Commit a20dee7b authored by Rafael Monnerat's avatar Rafael Monnerat

[source|destination]_administation, [source|destination]_decision is copied on...

[source|destination]_administation, [source|destination]_decision is copied on invoice throw Simulation



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20936 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ce0cf823
...@@ -90,9 +90,13 @@ class InvoicingRule(Rule): ...@@ -90,9 +90,13 @@ class InvoicingRule(Rule):
invoice_line = { invoice_line = {
'source': context_movement.getSource(), 'source': context_movement.getSource(),
'source_section': context_movement.getSourceSection(), 'source_section': context_movement.getSourceSection(),
'destination': context_movement.getDestination(), 'source_decision': context_movement.getSourceDecision(),
'source_administration': context_movement.getSourceAdministration(),
'destination': context_movement.getDestination(),
'destination_section': context_movement.getDestinationSection(), 'destination_section': context_movement.getDestinationSection(),
'start_date': context_movement.getStartDate(), 'destination_decision': context_movement.getDestinationDecision(),
'destination_administration': context_movement.getDestinationAdministration(),
'start_date': context_movement.getStartDate(),
'stop_date': context_movement.getStopDate(), 'stop_date': context_movement.getStopDate(),
'resource': context_movement.getResource(), 'resource': context_movement.getResource(),
'variation_category_list': context_movement.getVariationCategoryList(), 'variation_category_list': context_movement.getVariationCategoryList(),
......
...@@ -532,6 +532,30 @@ class TestInvoice(TestPackingListMixin, ...@@ -532,6 +532,30 @@ class TestInvoice(TestPackingListMixin,
self.assertEquals(round(line.getQuantity(), resource_precision), self.assertEquals(round(line.getQuantity(), resource_precision),
round(expected_price * line_ratio, resource_precision)) round(expected_price * line_ratio, resource_precision))
def stepCheckPackingListInvoice(
self, sequence=None, sequence_list=None, **kw):
""" Checks if the delivery builder is working as expected,
coping the atributes from packing list to invoice."""
packing_list = sequence.get('packing_list')
related_invoice_list = packing_list.getCausalityRelatedValueList(
portal_type=self.sale_invoice_transaction_portal_type)
self.assertEquals(len(related_invoice_list), 1)
invoice = related_invoice_list[0]
self.assertEquals(packing_list.getSource(), invoice.getSource())
self.assertEquals(packing_list.getDestination(), invoice.getDestination())
self.assertEquals(packing_list.getDestinationSection(), \
invoice.getDestinationSection())
self.assertEquals(packing_list.getSourceSection(), \
invoice.getSourceSection())
self.assertEquals(packing_list.getSourceDecision(), \
invoice.getSourceDecision())
self.assertEquals(packing_list.getDestinationAdministration(), \
invoice.getDestinationAdministration())
self.assertEquals(packing_list.getSourceAdministration(), \
invoice.getSourceAdministration())
def stepCheckDeliveryRuleForDeferred( def stepCheckDeliveryRuleForDeferred(
self, sequence=None, sequence_list=None, **kw): self, sequence=None, sequence_list=None, **kw):
""" Checks that a delivery rule has been created when we took 'split """ Checks that a delivery rule has been created when we took 'split
...@@ -1914,6 +1938,29 @@ class TestInvoice(TestPackingListMixin, ...@@ -1914,6 +1938,29 @@ class TestInvoice(TestPackingListMixin,
""") """)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def test_18_compareInvoiceAndPackingList(self, quiet=quiet, run=RUN_ALL_TESTS):
"""
Checks that a Simple Invoice is created from a Packing List
"""
if not run: return
if not quiet:
self.logMessage('Simple Invoice')
sequence_list = SequenceList()
for base_sequence in (self.PACKING_LIST_DEFAULT_SEQUENCE, ) :
sequence_list.addSequenceString(
base_sequence +
"""
stepSetReadyPackingList
stepTic
stepStartPackingList
stepCheckInvoicingRule
stepTic
stepCheckInvoiceBuilding
stepCheckInvoicesConsistency
stepCheckPackingListInvoice
""")
sequence_list.play(self, quiet=quiet)
def test_invoice_transaction_line_resource(self): def test_invoice_transaction_line_resource(self):
# tests that simulation movements corresponding to accounting line have a # tests that simulation movements corresponding to accounting line have a
# good resource in the simulation # good resource in the simulation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment