Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Titouan Soulard
slapos.core
Commits
4b8e2be9
Commit
4b8e2be9
authored
Feb 27, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: testSlapOSEntityCreatePayment: stop using invoice template
parent
cf0118af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSEntityCreatePayment.py
...tal_components/test.erp5.testSlapOSEntityCreatePayment.py
+41
-7
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSEntityCreatePayment.py
View file @
4b8e2be9
...
...
@@ -20,20 +20,54 @@
##############################################################################
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
from
DateTime
import
DateTime
class
TestSlapOSEntityCreatePaymentMixin
(
SlapOSTestCaseMixin
):
def
makeSaleInvoiceTransaction
(
self
,
person
=
None
):
project
=
self
.
addProject
()
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
"Organisation"
)
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
"Currency"
)
if
person
is
None
:
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
invoice
=
self
.
portal
.
accounting_module
.
template_sale_invoice_transaction
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
invoice
.
edit
(
destination_section_value
=
person
,
invoice
=
self
.
createSaleInvoiceTransaction
(
source_value
=
organisation
,
source_section_value
=
organisation
,
destination_section_value
=
person
,
destination_project_value
=
project
,
resource_value
=
currency
,
price_currency_value
=
currency
,
ledger
=
'automated'
,
payment_mode
=
self
.
payment_mode
)
payment_mode
=
self
.
payment_mode
,
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/01/15'
),
created_by_builder
=
1
# to prevent init script to create lines
)
for
line_kw
in
[{
'destination'
:
'account_module/payable'
,
'source'
:
'account_module/receivable'
,
'quantity'
:
-
1.0
},
{
'destination'
:
'account_module/purchase'
,
'source'
:
'account_module/sales'
,
'quantity'
:
0.84
},
{
'destination'
:
'account_module/refundable_vat'
,
'source'
:
'account_module/coll_vat'
,
'quantity'
:
0.16
}]:
invoice
.
newContent
(
portal_type
=
"Sale Invoice Transaction Line"
,
resource_value
=
currency
,
price
=
1.0
,
**
line_kw
)
return
person
,
invoice
def
sumReceivable
(
self
,
payment_transaction
):
...
...
@@ -60,7 +94,7 @@ class TestSlapOSEntityCreatePaymentMixin(SlapOSTestCaseMixin):
'destination_project/%s'
%
invoice
.
getDestinationProject
(),
'price_currency/%s'
%
invoice
.
getPriceCurrency
(),
'resource/%s'
%
invoice
.
getResource
(),
'source_payment/
organisation_module/slapos/bank_account'
,
'source_payment/
%s/bank_account'
%
invoice
.
getSourceSection
()
,
'payment_mode/%s'
%
self
.
payment_mode
,
'source_section/%s'
%
invoice
.
getSourceSection
(),
#'source_project/%s' % invoice.getSourceProject(),
...
...
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