Merge lp:~openbig/bigconsulting/statement_account into lp:bigconsulting

Proposed by gpa(OpenERP)
Status: Merged
Merged at revision: 105
Proposed branch: lp:~openbig/bigconsulting/statement_account
Merge into: lp:bigconsulting
Diff against target: 156 lines (+45/-69)
2 files modified
account_invoice_cash_discount/account_invoice_cash_discount.py (+44/-67)
account_invoice_cash_discount/wizard/invoice_statement_payment.py (+1/-2)
To merge this branch: bzr merge lp:~openbig/bigconsulting/statement_account
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+36139@code.launchpad.net

Description of the change

added changes for the account selection in the statement

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_invoice_cash_discount/account_invoice_cash_discount.py'
--- account_invoice_cash_discount/account_invoice_cash_discount.py 2010-09-21 10:45:28 +0000
+++ account_invoice_cash_discount/account_invoice_cash_discount.py 2010-09-21 12:26:27 +0000
@@ -704,6 +704,7 @@
704 st_base_code_id = False704 st_base_code_id = False
705 move_tax_amount = 0.0705 move_tax_amount = 0.0
706 tax_real_amt = 0.0706 tax_real_amt = 0.0
707 curr_diff_account_id = False
707 708
708 if move.type == 'general':709 if move.type == 'general':
709 if move.tax_type == 'tax_included':710 if move.tax_type == 'tax_included':
@@ -807,7 +808,6 @@
807 808
808 for line in move.reconcile_id.line_ids:809 for line in move.reconcile_id.line_ids:
809 move_line_data = self.pool.get('account.move.line').browse(cr, uid, line.id, context=context)810 move_line_data = self.pool.get('account.move.line').browse(cr, uid, line.id, context=context)
810
811 if st.currency.id <> move_line_data.currency_id.id:811 if st.currency.id <> move_line_data.currency_id.id:
812 amount_currency = move.amount812 amount_currency = move.amount
813 expense_acc = res_users_obj.browse(cr, uid, uid, context=context).company_id.expense_account_id.id813 expense_acc = res_users_obj.browse(cr, uid, uid, context=context).company_id.expense_account_id.id
@@ -832,72 +832,49 @@
832 if partner_acc_id:832 if partner_acc_id:
833 partner_acc_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, partner_acc_id)833 partner_acc_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, partner_acc_id)
834 ##############################################834 ##############################################
835 835
836 if balance < 0.00:836 ## Account selection############
837 account_move_line_obj.create(cr, uid, {837 if move_line_data.invoice.type in ['in_invoice','out_refund'] and balance < 0.00:
838 'name': move.name,838 curr_diff_account_id = revene_acc
839 'date': move.date,839 elif move_line_data.invoice.type in ['in_invoice','out_refund'] and balance > 0.00:
840 'ref': move.ref,840 curr_diff_account_id = expense_acc
841 'move_id': move_id,841 elif move_line_data.invoice.type in ['out_invoice','in_refund'] and balance < 0.00:
842 'partner_id': ((move.partner_id) and move.partner_id.id) or False,842 curr_diff_account_id = revene_acc
843 'account_id': expense_acc,843 elif move_line_data.invoice.type in ['out_invoice','in_refund'] and balance > 0.00:
844 'credit': abs(balance),844 curr_diff_account_id = expense_acc
845 'debit': 0.0,845 #######################################
846 'statement_id': st.id,846
847 'journal_id': st.journal_id.id,847 account_move_line_obj.create(cr, uid, {
848 'period_id': st.period_id.id,848 'name': move.name,
849 'amount_currency': 0.0,849 'date': move.date,
850 'currency_id': currency_id,850 'ref': move.ref,
851 }, context=context)851 'move_id': move_id,
852 852 'partner_id': ((move.partner_id) and move.partner_id.id) or False,
853 account_move_line_obj.create(cr, uid, {853 'account_id': expense_acc,
854 'name': move.name,854 'credit': abs(balance),
855 'date': move.date,855 'debit': 0.0,
856 'ref': move.ref,856 'statement_id': st.id,
857 'move_id': move_id,857 'journal_id': st.journal_id.id,
858 'partner_id': ((move.partner_id) and move.partner_id.id) or False,858 'period_id': st.period_id.id,
859 'account_id': partner_acc_id,859 'amount_currency': 0.0,
860 'credit': 0.0,860 'currency_id': currency_id,
861 'debit': abs(balance),861 }, context=context)
862 'statement_id': st.id,862
863 'journal_id': st.journal_id.id,863 account_move_line_obj.create(cr, uid, {
864 'period_id': st.period_id.id,864 'name': move.name,
865 'amount_currency': 0.0,865 'date': move.date,
866 'currency_id': currency_id,866 'ref': move.ref,
867 }, context=context)867 'move_id': move_id,
868 868 'partner_id': ((move.partner_id) and move.partner_id.id) or False,
869 elif balance > 0.00:869 'account_id': partner_acc_id,
870 account_move_line_obj.create(cr, uid, {870 'credit': 0.0,
871 'name': move.name,871 'debit': abs(balance),
872 'date': move.date,872 'statement_id': st.id,
873 'ref': move.ref,873 'journal_id': st.journal_id.id,
874 'move_id': move_id,874 'period_id': st.period_id.id,
875 'partner_id': ((move.partner_id) and move.partner_id.id) or False,875 'amount_currency': 0.0,
876 'account_id':revene_acc,876 'currency_id': currency_id,
877 'credit': abs(balance),877 }, context=context)
878 'debit': 0.0,
879 'statement_id': st.id,
880 'journal_id': st.journal_id.id,
881 'period_id': st.period_id.id,
882 'amount_currency': 0.0,
883 'currency_id': currency_id,
884 }, context=context)
885
886 account_move_line_obj.create(cr, uid, {
887 'name': move.name,
888 'date': move.date,
889 'ref': move.ref,
890 'move_id': move_id,
891 'partner_id': ((move.partner_id) and move.partner_id.id) or False,
892 'account_id': partner_acc_id,
893 'credit': 0.0,
894 'debit': abs(balance),
895 'statement_id': st.id,
896 'journal_id': st.journal_id.id,
897 'period_id': st.period_id.id,
898 'amount_currency': 0.0,
899 'currency_id': currency_id,
900 }, context=context)
901 878
902 new_end_value += amount+st_tax_amount-newline_sum879 new_end_value += amount+st_tax_amount-newline_sum
903880
904881
=== modified file 'account_invoice_cash_discount/wizard/invoice_statement_payment.py'
--- account_invoice_cash_discount/wizard/invoice_statement_payment.py 2010-09-21 10:45:28 +0000
+++ account_invoice_cash_discount/wizard/invoice_statement_payment.py 2010-09-21 12:26:27 +0000
@@ -126,7 +126,7 @@
126 # else:126 # else:
127 ctx['date'] = line_date127 ctx['date'] = line_date
128 invoice_amount = 0.0128 invoice_amount = 0.0
129 129 cal_invoice_amount = 0.0
130 if line.debit > 0:130 if line.debit > 0:
131 invoice_amount = line.debit131 invoice_amount = line.debit
132 elif line.credit > 0:132 elif line.credit > 0:
@@ -144,7 +144,6 @@
144 for invoice_line in invoice.invoice_line:144 for invoice_line in invoice.invoice_line:
145 line_tax_amount = 0.0145 line_tax_amount = 0.0
146 total_tax_amount = 0.0146 total_tax_amount = 0.0
147 cal_invoice_amount = 0.0
148 tax_account_id = False147 tax_account_id = False
149 tax_code_id = False148 tax_code_id = False
150 tax_base_id = False149 tax_base_id = False

Subscribers

People subscribed via source and target branches