Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
ccaa011b
Commit
ccaa011b
authored
Jan 12, 2023
by
Jérome Perrin
Committed by
Kazuhiko Shiozaki
Jul 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
payment_mean_sepa: prevent error with payment transaction for persons
This was working only with Organisations
parent
1a1ee4d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
bt5/erp5_payment_mean_sepa/SkinTemplateItem/portal_skins/erp5_payment_mean_sepa/AccountingTransactionLine_getSEPACreditTransferRemittanceInformation.py
...sactionLine_getSEPACreditTransferRemittanceInformation.py
+1
-1
bt5/erp5_payment_mean_sepa/SkinTemplateItem/portal_skins/erp5_payment_mean_sepa/PaymentTransactionGroup_getSEPACreditTransferDataDict.py
.../PaymentTransactionGroup_getSEPACreditTransferDataDict.py
+1
-1
bt5/erp5_payment_mean_sepa/TestTemplateItem/portal_components/test.erp5.testPaymentTransactionGroupSEPA.py
...l_components/test.erp5.testPaymentTransactionGroupSEPA.py
+48
-0
No files found.
bt5/erp5_payment_mean_sepa/SkinTemplateItem/portal_skins/erp5_payment_mean_sepa/AccountingTransactionLine_getSEPACreditTransferRemittanceInformation.py
View file @
ccaa011b
...
...
@@ -11,7 +11,7 @@ if ptg.getSourcePayment() == context.getSourcePayment():
else
:
third_party
=
context
.
getSourceSectionValue
()
third_party_name
=
third_party
.
get
CorporateName
(
)
or
third_party
.
getTitle
()
third_party_name
=
third_party
.
get
Property
(
'corporate_name'
)
or
third_party
.
getTitle
()
return
"{invoice_reference} {third_party_name}"
.
format
(
invoice_reference
=
context
.
getParentValue
().
getCausalityReference
()
or
''
,
...
...
bt5/erp5_payment_mean_sepa/SkinTemplateItem/portal_skins/erp5_payment_mean_sepa/PaymentTransactionGroup_getSEPACreditTransferDataDict.py
View file @
ccaa011b
...
...
@@ -78,7 +78,7 @@ for brain in context.PaymentTransactionGroup_getAccountingTransactionLineList():
'Ustrd'
:
transaction_line
.
AccountingTransactionLine_getSEPACreditTransferRemittanceInformation
(),
},
'Cdtr'
:
{
'Nm'
:
creditor_entity
.
get
CorporateName
(
)
or
creditor_entity
.
getTitle
(),
'Nm'
:
creditor_entity
.
get
Property
(
'corporate_name'
)
or
creditor_entity
.
getTitle
(),
'PstlAdr'
:
(
creditor_entity
.
getDefaultAddressText
()
or
''
).
splitlines
(),
'Ctry'
:
creditor_entity
.
getDefaultAddressRegion
()
and
creditor_entity
.
getDefaultAddressValue
().
getRegionReference
(),
},
...
...
bt5/erp5_payment_mean_sepa/TestTemplateItem/portal_components/test.erp5.testPaymentTransactionGroupSEPA.py
View file @
ccaa011b
...
...
@@ -198,6 +198,54 @@ class TestPaymentTransactionGroupPaymentSEPA(AccountingTestCase):
[
'PT-1'
,
'PT-2'
],
)
def
test_PaymentTransactionGroup_viewAsSEPACreditTransferPain_001_001_02_with_person
(
self
):
ptg
=
self
.
_createPTG
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
)
bank_account_person
=
person
.
newContent
(
portal_type
=
'Bank Account'
,
iban
=
'FR4610096000306768831487U66'
,
bic_code
=
'TESTXXXX'
)
bank_account_person
.
validate
()
self
.
_makeOne
(
portal_type
=
'Payment Transaction'
,
simulation_state
=
'delivered'
,
title
=
'three'
,
reference
=
'PT-3'
,
destination_section_value
=
self
.
section
,
destination_payment_value
=
self
.
bank_account
,
source_section_value
=
person
,
source_payment_value
=
bank_account_person
,
start_date
=
DateTime
(
2021
,
1
,
2
),
lines
=
(
dict
(
destination_value
=
self
.
portal
.
account_module
.
payable
,
destination_debit
=
300
),
dict
(
destination_value
=
self
.
portal
.
account_module
.
bank
,
destination_credit
=
300
,
aggregate_value
=
ptg
)))
self
.
tic
()
pain
=
lxml
.
etree
.
fromstring
(
getattr
(
ptg
,
'PaymentTransactionGroup_viewAsSEPACreditTransferPain.001.001.02'
)().
encode
(
'utf-8'
))
xmlschema
=
lxml
.
etree
.
XMLSchema
(
lxml
.
etree
.
fromstring
(
str
(
getattr
(
self
.
portal
,
'pain.001.001.02.xsd'
).
data
)))
xmlschema
.
assertValid
(
pain
)
self
.
assertEqual
(
sorted
([
node
.
text
for
node
in
pain
.
findall
(
'.//{*}CdtTrfTxInf/{*}Cdtr/{*}Nm'
)]),
[
'John Doe'
,
'Supplier1'
,
'Supplier2'
],
)
self
.
assertEqual
(
sorted
([
node
.
text
for
node
in
pain
.
findall
(
'.//{*}CdtTrfTxInf/{*}RmtInf/{*}Ustrd'
)]),
[
'INVOICE1 Supplier1'
,
'John Doe'
,
'Supplier2'
],
)
def
test_generate_sepa_credit_transfer_action
(
self
):
ptg
=
self
.
_createPTG
()
ret
=
ptg
.
PaymentTransactionGroup_generateSEPACreditTransferFile
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment