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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
ab137095
Commit
ab137095
authored
Jan 12, 2023
by
Jérome Perrin
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
b5a6ec60
Changes
3
Show 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 @
ab137095
...
@@ -11,7 +11,7 @@ if ptg.getSourcePayment() == context.getSourcePayment():
...
@@ -11,7 +11,7 @@ if ptg.getSourcePayment() == context.getSourcePayment():
else
:
else
:
third_party
=
context
.
getSourceSectionValue
()
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
(
return
"{invoice_reference} {third_party_name}"
.
format
(
invoice_reference
=
context
.
getParentValue
().
getCausalityReference
()
or
''
,
invoice_reference
=
context
.
getParentValue
().
getCausalityReference
()
or
''
,
...
...
bt5/erp5_payment_mean_sepa/SkinTemplateItem/portal_skins/erp5_payment_mean_sepa/PaymentTransactionGroup_getSEPACreditTransferDataDict.py
View file @
ab137095
...
@@ -78,7 +78,7 @@ for brain in context.PaymentTransactionGroup_getAccountingTransactionLineList():
...
@@ -78,7 +78,7 @@ for brain in context.PaymentTransactionGroup_getAccountingTransactionLineList():
'Ustrd'
:
transaction_line
.
AccountingTransactionLine_getSEPACreditTransferRemittanceInformation
(),
'Ustrd'
:
transaction_line
.
AccountingTransactionLine_getSEPACreditTransferRemittanceInformation
(),
},
},
'Cdtr'
:
{
'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
(),
'PstlAdr'
:
(
creditor_entity
.
getDefaultAddressText
()
or
''
).
splitlines
(),
'Ctry'
:
creditor_entity
.
getDefaultAddressRegion
()
and
creditor_entity
.
getDefaultAddressValue
().
getRegionReference
(),
'Ctry'
:
creditor_entity
.
getDefaultAddressRegion
()
and
creditor_entity
.
getDefaultAddressValue
().
getRegionReference
(),
},
},
...
...
bt5/erp5_payment_mean_sepa/TestTemplateItem/portal_components/test.erp5.testPaymentTransactionGroupSEPA.py
View file @
ab137095
...
@@ -198,6 +198,54 @@ class TestPaymentTransactionGroupPaymentSEPA(AccountingTestCase):
...
@@ -198,6 +198,54 @@ class TestPaymentTransactionGroupPaymentSEPA(AccountingTestCase):
[
'PT-1'
,
'PT-2'
],
[
'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
):
def
test_generate_sepa_credit_transfer_action
(
self
):
ptg
=
self
.
_createPTG
()
ptg
=
self
.
_createPTG
()
ret
=
ptg
.
PaymentTransactionGroup_generateSEPACreditTransferFile
(
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