Merge lp:~therp-nl/banking-addons/ba61-lp1102619_use_invoice_number_as_debit_order_line_reference into lp:banking-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 157
Proposed branch: lp:~therp-nl/banking-addons/ba61-lp1102619_use_invoice_number_as_debit_order_line_reference
Merge into: lp:banking-addons/6.1
Diff against target: 29 lines (+13/-5)
1 file modified
account_banking/wizard/account_payment_order.py (+13/-5)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/ba61-lp1102619_use_invoice_number_as_debit_order_line_reference
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Review via email: mp+144180@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking/wizard/account_payment_order.py'
2--- account_banking/wizard/account_payment_order.py 2013-01-10 13:38:19 +0000
3+++ account_banking/wizard/account_payment_order.py 2013-01-21 20:34:23 +0000
4@@ -85,12 +85,20 @@
5 state = communication2 = False
6 communication = line.ref or '/'
7 if line.invoice:
8- if line.invoice.reference_type == 'structured':
9+ if line.invoice.type in ('in_invoice', 'in_refund'):
10+ if line.invoice.reference_type == 'structured':
11+ state = 'structured'
12+ communication = line.invoice.reference
13+ else:
14+ state = 'normal'
15+ communication2 = line.invoice.reference
16+ else:
17+ # Make sure that the communication includes the
18+ # customer invoice number (in the case of debit order)
19+ communication = line.invoice.number.replace('/', '')
20 state = 'structured'
21- communication = line.invoice.reference
22- else:
23- state = 'normal'
24- communication2 = line.invoice.reference
25+ if communication != line.ref:
26+ communication2 = line.ref
27 # support debit orders when enabled
28 if (payment.payment_order_type == 'debit' and
29 'amount_to_receive' in line):

Subscribers

People subscribed via source and target branches