[Erp5-report] r18903 - in /erp5/trunk/bt5/erp5_accounting: WorkflowTemplateItem/portal_work...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 29 15:08:09 CET 2008


Author: jerome
Date: Tue Jan 29 15:08:09 2008
New Revision: 18903

URL: http://svn.erp5.org?rev=18903&view=rev
Log:
generate differents transaction references based on the year.

Modified:
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml?rev=18903&r1=18902&r2=18903&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml Tue Jan 29 15:08:09 2008
@@ -84,15 +84,18 @@
 \n
 # Generate new values for Source Reference and Destination Reference.\n
 if not transaction.getSourceReference():\n
-  source_id_group = (\'accounting\', \'section\', source_section)\n
+  year = transaction.getStartDate().year()\n
+  source_id_group = (\'accounting\', \'section\', source_section, year)\n
   source_reference = transaction.generateNewId(id_group=source_id_group,\n
                                                default=1)\n
-  transaction.setSourceReference(source_reference)\n
+  transaction.setSourceReference(\'%s-%s\' % (year, source_reference))\n
+\n
 if not transaction.getDestinationReference():\n
-  destination_id_group = (\'accounting\', \'section\', destination_section)\n
+  year = transaction.getStopDate().year()\n
+  destination_id_group = (\'accounting\', \'section\', destination_section, year)\n
   destination_reference = transaction.generateNewId(\n
                               id_group=destination_id_group, default=1)\n
-  transaction.setDestinationReference(destination_reference)\n
+  transaction.setDestinationReference(\'%s-%s\' % (year, destination_reference))\n
 </string> </value>
         </item>
         <item>
@@ -149,6 +152,7 @@
                             <string>destination_section</string>
                             <string>invoice_id_group</string>
                             <string>invoice_reference</string>
+                            <string>year</string>
                             <string>source_id_group</string>
                             <string>source_reference</string>
                             <string>destination_id_group</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=18903&r1=18902&r2=18903&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Tue Jan 29 15:08:09 2008
@@ -1,1 +1,1 @@
-557
+558




More information about the Erp5-report mailing list