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
Xavier Thompson
slapos.core
Commits
3c87cc4a
Commit
3c87cc4a
authored
Nov 23, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Order Builder for Payment (with test).
parent
604f6553
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1074 additions
and
1 deletion
+1074
-1
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction.xml
...m/accounting_module/template_sale_invoice_transaction.xml
+205
-0
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction/2.xml
...accounting_module/template_sale_invoice_transaction/2.xml
+56
-0
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction/3.xml
...accounting_module/template_sale_invoice_transaction/3.xml
+56
-0
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction/5.xml
...accounting_module/template_sale_invoice_transaction/5.xml
+56
-0
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder.xml
...Item/portal_orders/slapos_payment_transaction_builder.xml
+121
-0
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder/category_movement_group_on_delivery.xml
...ansaction_builder/category_movement_group_on_delivery.xml
+63
-0
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder/category_movement_group_on_line.xml
...t_transaction_builder/category_movement_group_on_line.xml
+57
-0
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder/property_movement_group_on_delivery.xml
...ansaction_builder/property_movement_group_on_delivery.xml
+57
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/OrderBuilder_generateUnrelatedInvoiceList.xml
..._accounting/OrderBuilder_generateUnrelatedInvoiceList.xml
+122
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_postOrderBuild.xml
...s/slapos_accounting/PaymentTransaction_postOrderBuild.xml
+71
-0
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingBuilder.py
...ccounting/TestTemplateItem/testSlapOSAccountingBuilder.py
+205
-0
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
master/bt5/slapos_accounting/bt/template_path_list
master/bt5/slapos_accounting/bt/template_path_list
+4
-0
No files found.
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Sale Invoice Transaction"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
source/organisation_module/slapos
</string>
<string>
source_section/organisation_module/slapos
</string>
<string>
price_currency/currency_module/EUR
</string>
<string>
resource/currency_module/EUR
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_destination_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
template_sale_invoice_transaction
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Sale Invoice Transaction
</string>
</value>
</item>
<item>
<key>
<string>
start_date
</string>
</key>
<value>
<object>
<klass>
<global
id=
"1.1"
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1325372400.0
</float>
<string>
GMT+1
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
stop_date
</string>
</key>
<value>
<object>
<klass>
<reference
id=
"1.1"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1326582000.0
</float>
<string>
GMT+1
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction/2.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Sale Invoice Transaction Line"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
resource/currency_module/EUR
</string>
<string>
destination/account_module/payable
</string>
<string>
source/account_module/receivable
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
destination_total_asset_price
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
grouping_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
2
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Sale Invoice Transaction Line
</string>
</value>
</item>
<item>
<key>
<string>
price
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
quantity
</string>
</key>
<value>
<float>
-1.0
</float>
</value>
</item>
<item>
<key>
<string>
source_total_asset_price
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction/3.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Sale Invoice Transaction Line"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
resource/currency_module/EUR
</string>
<string>
destination/account_module/purchase
</string>
<string>
source/account_module/sales
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
destination_total_asset_price
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
grouping_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
3
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Sale Invoice Transaction Line
</string>
</value>
</item>
<item>
<key>
<string>
price
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
quantity
</string>
</key>
<value>
<float>
0.84
</float>
</value>
</item>
<item>
<key>
<string>
source_total_asset_price
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PathTemplateItem/accounting_module/template_sale_invoice_transaction/5.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Sale Invoice Transaction Line"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
resource/currency_module/EUR
</string>
<string>
destination/account_module/refundable_vat
</string>
<string>
source/account_module/coll_vat
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
destination_total_asset_price
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
grouping_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
5
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Sale Invoice Transaction Line
</string>
</value>
</item>
<item>
<key>
<string>
price
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
quantity
</string>
</key>
<value>
<float>
0.16
</float>
</value>
</item>
<item>
<key>
<string>
source_total_asset_price
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Order Builder"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
destination/organisation_module/slapos
</string>
<string>
destination_section/organisation_module/slapos
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
delivery_after_generation_script_id
</string>
</key>
<value>
<string>
PaymentTransaction_postOrderBuild
</string>
</value>
</item>
<item>
<key>
<string>
delivery_cell_portal_type
</string>
</key>
<value>
<string>
Delivery Cell
</string>
</value>
</item>
<item>
<key>
<string>
delivery_cell_separate_order
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
delivery_line_portal_type
</string>
</key>
<value>
<string>
Accounting Transaction Line
</string>
</value>
</item>
<item>
<key>
<string>
delivery_module
</string>
</key>
<value>
<string>
accounting_module
</string>
</value>
</item>
<item>
<key>
<string>
delivery_portal_type
</string>
</key>
<value>
<string>
Payment Transaction
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_payment_transaction_builder
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Order Builder
</string>
</value>
</item>
<item>
<key>
<string>
simulation_select_method_id
</string>
</key>
<value>
<string>
OrderBuilder_generateUnrelatedInvoiceList
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Payment Builder
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder/category_movement_group_on_delivery.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category Movement Group"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
collect_order_group/delivery
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
category_movement_group_on_delivery
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category Movement Group
</string>
</value>
</item>
<item>
<key>
<string>
tested_property
</string>
</key>
<value>
<tuple>
<string>
causality
</string>
<string>
destination_payment
</string>
<string>
destination_section
</string>
<string>
price_currency
</string>
<string>
resource
</string>
<string>
source_payment
</string>
<string>
source_section
</string>
<string>
specialise
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
update_always
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder/category_movement_group_on_line.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category Movement Group"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
collect_order_group/line
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
category_movement_group_on_line
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category Movement Group
</string>
</value>
</item>
<item>
<key>
<string>
tested_property
</string>
</key>
<value>
<tuple>
<string>
destination
</string>
<string>
source
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
update_always
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PathTemplateItem/portal_orders/slapos_payment_transaction_builder/property_movement_group_on_delivery.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Movement Group"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
collect_order_group/delivery
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
property_movement_group_on_delivery
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Movement Group
</string>
</value>
</item>
<item>
<key>
<string>
tested_property
</string>
</key>
<value>
<tuple>
<string>
start_date
</string>
<string>
stop_date
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
update_always
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/OrderBuilder_generateUnrelatedInvoiceList.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.ERP5Type.Document import newTempSimulationMovement\n
\n
portal = context.getPortalObject()\n
select_dict = {\'causality_related_uid\': None}\n
\n
select_kw = kwargs.copy()\n
select_kw.pop(\'portal_type\', None)\n
select_kw.pop(\'delivery_relative_url_list\', None)\n
select_kw.update(\n
portal_type=\'Sale Invoice Transaction\',\n
simulation_state=\'stopped\',\n
limit=10, # do only some in one shot\n
select_dict=select_dict,\n
left_join_list=select_dict.keys(),\n
causality_related_uid=None\n
)\n
\n
default_source_uid=portal.restrictedTraverse(\'account_module/receivable\').getUid()\n
movement_list = []\n
id = 1\n
for invoice in portal.portal_catalog(**select_kw):\n
invoice.getObject().serialize() # in order to avoid selection in same transaction\n
quantity = 0.\n
for movement in invoice.searchFolder(portal_type=\'Sale Invoice Transaction Line\',\n
default_source_uid=default_source_uid):\n
quantity += movement.getQuantity()\n
temp_movement_kw = dict(\n
causality=invoice.getRelativeUrl(),\n
source_section=invoice.getSourceSection(),\n
destination_section=invoice.getDestinationSection(),\n
resource=invoice.getResource(),\n
price_currency=invoice.getResource(),\n
start_date=invoice.getStartDate(),\n
stop_date=invoice.getStopDate(),\n
specialise=invoice.getSpecialise(),\n
source_payment=\'organisation_module/slapos/bank_account\', # the other place defnied: business process\n
)\n
temp_movement_rec = newTempSimulationMovement(\n
portal, str(id),\n
quantity=-1 * quantity,\n
source=\'account_module/receivable\',\n
destination=\'account_module/payable\',\n
**temp_movement_kw\n
)\n
id += 1\n
temp_movement_bank = newTempSimulationMovement(\n
portal, str(id),\n
quantity=1 * quantity,\n
source=\'account_module/bank\',\n
destination=\'account_module/bank\',\n
**temp_movement_kw\n
)\n
id += 1\n
movement_list.extend([temp_movement_rec, temp_movement_bank])\n
\n
return movement_list\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
*args, **kwargs
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
OrderBuilder_generateUnrelatedInvoiceList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_postOrderBuild.xml
0 → 100644
View file @
3c87cc4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.ERP5Type.Message import translateString\n
payment_transaction = context\n
payment_transaction.immediateReindexObject() # in order to avoid selection in OrderBuilder_getAccountingTransactionLineListSlapOS\n
comment = translateString("Initialised by Order Builder.")\n
payment_transaction.autoPlan(comment=comment)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
related_simulation_movement_path_list=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PaymentTransaction_postOrderBuild
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingBuilder.py
View file @
3c87cc4a
...
...
@@ -8,6 +8,7 @@
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
from
DateTime
import
DateTime
import
transaction
def
convertCategoryList
(
base
,
l
):
return
[
'%s/%s'
%
(
base
,
q
)
for
q
in
l
]
...
...
@@ -1408,3 +1409,207 @@ class TestSlapOSPaymentTransactionBuilder(TestSlapOSSalePackingListBuilder):
checkPayment
(
payment_movement_1_rec_bank
,
transaction_line_1_rec_bank
.
getParentValue
())
checkPayment
(
payment_movement_2_rec_bank
,
transaction_line_2_rec_bank
.
getParentValue
())
class
TestSlapOSPaymentTransactionOrderBuilder
(
testSlapOSMixin
):
def
sumReceivable
(
self
,
transaction
):
quantity
=
.
0
default_source_uid
=
self
.
portal
.
restrictedTraverse
(
'account_module/receivable'
).
getUid
()
for
line
in
transaction
.
searchFolder
(
portal_type
=
self
.
portal
.
getPortalAccountingMovementTypeList
(),
default_source_uid
=
default_source_uid
):
quantity
+=
line
.
getQuantity
()
return
quantity
def
assertPayment
(
self
,
payment
,
invoice
):
self
.
assertEqual
(
self
.
sumReceivable
(
invoice
),
payment
\
.
PaymentTransaction_getTotalPayablePrice
())
self
.
assertEqual
(
'auto_planned'
,
payment
.
getSimulationState
())
self
.
assertSameSet
([],
payment
.
checkConsistency
())
self
.
assertSameSet
([
invoice
],
payment
.
getCausalityValueList
())
self
.
assertSameSet
([],
payment
.
getCausalityRelatedValueList
(
portal_type
=
'Applied Rule'
))
expected_set
=
[
'causality/%s'
%
invoice
.
getRelativeUrl
(),
'destination_section/%s'
%
invoice
.
getDestinationSection
(),
'price_currency/%s'
%
invoice
.
getPriceCurrency
(),
'resource/%s'
%
invoice
.
getResource
(),
'source_payment/organisation_module/slapos/bank_account'
,
'source_section/%s'
%
invoice
.
getSourceSection
(),
]
self
.
assertSameSet
(
expected_set
,
payment
.
getCategoryList
())
self
.
assertEqual
(
invoice
.
getStartDate
(),
payment
.
getStartDate
())
self
.
assertEqual
(
invoice
.
getStopDate
(),
payment
.
getStopDate
())
movement_list
=
payment
.
getMovementList
()
self
.
assertEqual
(
2
,
len
(
movement_list
))
bank_list
=
[
q
for
q
in
movement_list
if
q
.
getSource
()
==
'account_module/bank'
]
rec_list
=
[
q
for
q
in
movement_list
if
q
.
getSource
()
==
'account_module/receivable'
]
self
.
assertEqual
(
1
,
len
(
bank_list
))
self
.
assertEqual
(
1
,
len
(
rec_list
))
def
assertLine
(
line
,
quantity
,
category_list
):
self
.
assertFalse
(
line
.
hasStartDate
())
self
.
assertFalse
(
line
.
hasStopDate
())
self
.
assertEqual
(
quantity
,
line
.
getQuantity
())
self
.
assertSameSet
(
category_list
,
line
.
getCategoryList
())
invoice_amount
=
self
.
sumReceivable
(
invoice
)
assertLine
(
bank_list
[
0
],
invoice_amount
,
[
'destination/account_module/bank'
,
'source/account_module/bank'
])
assertLine
(
rec_list
[
0
],
-
1
*
invoice_amount
,
[
'destination/account_module/payable'
,
'source/account_module/receivable'
])
def
emptyBuild
(
self
,
**
kw
):
delivery_list
=
self
.
_build
(
**
kw
)
self
.
assertSameSet
([],
delivery_list
)
return
delivery_list
def
fullBuild
(
self
,
**
kw
):
delivery_list
=
self
.
_build
(
**
kw
)
self
.
assertNotEqual
([],
delivery_list
)
return
delivery_list
def
_build
(
self
,
**
kw
):
return
self
.
portal
.
portal_orders
.
slapos_payment_transaction_builder
.
build
(
**
kw
)
def
test
(
self
):
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
=
person
.
getRelativeUrl
())
invoice
.
confirm
()
invoice
.
stop
()
self
.
tic
()
payment_list
=
self
.
fullBuild
(
uid
=
invoice
.
getUid
())
self
.
tic
()
self
.
assertEqual
(
1
,
len
(
payment_list
))
payment
=
payment_list
[
0
].
getObject
()
self
.
assertPayment
(
payment
,
invoice
)
def
test_twice
(
self
):
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
=
person
.
getRelativeUrl
())
invoice
.
confirm
()
invoice
.
stop
()
self
.
tic
()
payment_list
=
self
.
fullBuild
(
uid
=
invoice
.
getUid
())
self
.
tic
()
self
.
emptyBuild
(
uid
=
invoice
.
getUid
())
self
.
assertEqual
(
1
,
len
(
payment_list
))
payment
=
payment_list
[
0
].
getObject
()
self
.
assertPayment
(
payment
,
invoice
)
def
test_twice_transaction
(
self
):
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
=
person
.
getRelativeUrl
())
invoice
.
confirm
()
invoice
.
stop
()
self
.
tic
()
payment_list
=
self
.
fullBuild
(
uid
=
invoice
.
getUid
())
self
.
emptyBuild
(
uid
=
invoice
.
getUid
())
self
.
tic
()
self
.
assertEqual
(
1
,
len
(
payment_list
))
payment
=
payment_list
[
0
].
getObject
()
self
.
assertPayment
(
payment
,
invoice
)
def
test_twice_indexation
(
self
):
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
=
person
.
getRelativeUrl
())
invoice
.
confirm
()
invoice
.
stop
()
self
.
tic
()
payment_list
=
self
.
fullBuild
(
uid
=
invoice
.
getUid
())
transaction
.
commit
()
# the payment transaction is immediately indexed
self
.
assertEqual
(
1
,
len
(
payment_list
))
self
.
emptyBuild
(
uid
=
invoice
.
getUid
())
self
.
tic
()
payment
=
payment_list
[
0
].
getObject
()
self
.
assertPayment
(
payment
,
invoice
)
def
test_two_invoices
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
invoice_1
=
self
.
portal
.
accounting_module
.
template_sale_invoice_transaction
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
invoice_1
.
edit
(
destination_section
=
person
.
getRelativeUrl
())
invoice_1
.
confirm
()
invoice_1
.
stop
()
invoice_2
=
self
.
portal
.
accounting_module
.
template_sale_invoice_transaction
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
invoice_2
.
edit
(
destination_section
=
person
.
getRelativeUrl
())
invoice_2
.
confirm
()
invoice_2
.
stop
()
self
.
tic
()
payment_list
=
self
.
fullBuild
(
uid
=
[
invoice_1
.
getUid
(),
invoice_2
.
getUid
()])
self
.
tic
()
self
.
assertEqual
(
2
,
len
(
payment_list
))
payment_1_list
=
[
q
for
q
in
payment_list
if
q
.
getCausalityValue
()
==
invoice_1
]
payment_2_list
=
[
q
for
q
in
payment_list
if
q
.
getCausalityValue
()
==
invoice_2
]
self
.
assertEqual
(
1
,
len
(
payment_1_list
))
self
.
assertEqual
(
1
,
len
(
payment_2_list
))
payment_1
=
payment_1_list
[
0
]
payment_2
=
payment_2_list
[
0
]
self
.
assertPayment
(
payment_1
,
invoice_1
)
self
.
assertPayment
(
payment_2
,
invoice_2
)
def
test_two_lines
(
self
):
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
=
person
.
getRelativeUrl
())
self
.
tic
()
default_source_uid
=
self
.
portal
.
restrictedTraverse
(
'account_module/receivable'
).
getUid
()
modified
=
False
for
line
in
invoice
.
searchFolder
(
portal_type
=
self
.
portal
.
getPortalAccountingMovementTypeList
(),
default_source_uid
=
default_source_uid
):
quantity
=
line
.
getQuantity
()
/
2
line
.
edit
(
quantity
=
quantity
)
line
.
getObject
().
Base_createCloneDocument
(
batch_mode
=
1
).
edit
(
quantity
=
quantity
)
modified
=
True
break
self
.
assertTrue
(
modified
)
invoice
.
confirm
()
invoice
.
stop
()
self
.
tic
()
payment_list
=
self
.
fullBuild
(
uid
=
[
invoice
.
getUid
()])
self
.
tic
()
self
.
assertEqual
(
1
,
len
(
payment_list
))
payment
=
payment_list
[
0
].
getObject
()
self
.
assertPayment
(
payment
,
invoice
)
master/bt5/slapos_accounting/bt/revision
View file @
3c87cc4a
138
\ No newline at end of file
139
\ No newline at end of file
master/bt5/slapos_accounting/bt/template_path_list
View file @
3c87cc4a
...
...
@@ -9,6 +9,8 @@ account_module/purchase
account_module/receivable
account_module/refundable_vat
account_module/sales
accounting_module/template_sale_invoice_transaction
accounting_module/template_sale_invoice_transaction/**
business_process_module/slapos_sale_business_process
business_process_module/slapos_sale_business_process/**
currency_module/EUR
...
...
@@ -36,6 +38,8 @@ portal_deliveries/slapos_sale_invoice_transaction_trade_model_builder
portal_deliveries/slapos_sale_invoice_transaction_trade_model_builder/**
portal_deliveries/slapos_sale_packing_list_builder
portal_deliveries/slapos_sale_packing_list_builder/**
portal_orders/slapos_payment_transaction_builder
portal_orders/slapos_payment_transaction_builder/**
portal_rules/slapos_delivery_root_simulation_rule
portal_rules/slapos_delivery_root_simulation_rule/**
portal_rules/slapos_invoice_simulation_rule
...
...
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