[Erp5-report] r9595 - in /erp5/trunk/bt5/erp5_banking_check: SkinTemplateItem/portal_skins/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Aug 31 15:26:11 CEST 2006
Author: seb
Date: Thu Aug 31 15:26:00 2006
New Revision: 9595
URL: http://svn.erp5.org?rev=9595&view=rev
Log:
create the right number of check inside the checkbook + small fixes
Added:
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/worklists/draft.xml
Modified:
erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookReception_view/listbox.xml
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/updateBankingOperation.xml
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml
Modified: erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookReception_view/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookReception_view/listbox.xml?rev=9595&r1=9594&r2=9595&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookReception_view/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookReception_view/listbox.xml Thu Aug 31 15:26:00 2006
@@ -340,6 +340,14 @@
<tuple>
<string>reference_range_max</string>
<string>Stop Number</string>
+ </tuple>
+ <tuple>
+ <string>check_amount_title</string>
+ <string>Number of checks</string>
+ </tuple>
+ <tuple>
+ <string>check_type_title</string>
+ <string>Value of check</string>
</tuple>
<tuple>
<string>destination_section</string>
Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/updateBankingOperation.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/updateBankingOperation.xml?rev=9595&r1=9594&r2=9595&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/updateBankingOperation.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/updateBankingOperation.xml Thu Aug 31 15:26:00 2006
@@ -74,6 +74,12 @@
transaction = state_change[\'object\']\n
bank_account = transaction.getDestinationPaymentValue()\n
check_number = transaction.getAggregateFreeText()\n
+message_tag = \'check_%s\' % (check_number, )\n
+\n
+# XXX: no need to handle this cleanly for now, so just raise an error.\n
+if context.portal_activities.countMessageWithTag(message_tag) != 0:\n
+ msg = Message(domain=\'ui\', message="This check number is already being indexed.")\n
+ raise ValidationFailed, (msg,)\n
\n
result = context.portal_catalog(portal_type = \'Check\', reference = check_number)\n
if len(result) == 0:\n
@@ -81,7 +87,7 @@
\n
# Get a checkbook for this bank account.\n
checkbook = None\n
- generic_model = context.portal_catalog(portal_type = \'Checkbook Model\', id = \'generic_checkbook\')[0].getObject()\n
+ generic_model = context.portal_catalog(portal_type = \'Checkbook Model\', title = \'Generic\')[0].getObject()\n
# XXX it would be better to use a related key for this, but z_related_resource is too specific to\n
# movement at the moment.\n
for brain in context.portal_catalog(portal_type = \'Checkbook\',\n
@@ -99,9 +105,7 @@
destination_payment_value = bank_account,\n
immediate_reindex = 1)\n
# Create a check.\n
- # To prevent duplicated checks for a single check number, index this new check immediately.\n
- # This has a performance penalty, but this part of the script will rarely be called (once per check number).\n
- check = checkbook.newContent(portal_type = \'Check\', reference = check_number, immediate_reindex = 1)\n
+ check = checkbook.newContent(portal_type = \'Check\', reference = check_number, activate_kw={\'tag\': message_tag})\n
# Automatically issue this check.\n
check.confirm()\n
else:\n
@@ -179,7 +183,11 @@
<string>_getattr_</string>
<string>bank_account</string>
<string>check_number</string>
+ <string>message_tag</string>
<string>context</string>
+ <string>Message</string>
+ <string>msg</string>
+ <string>ValidationFailed</string>
<string>result</string>
<string>len</string>
<string>None</string>
Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml?rev=9595&r1=9594&r2=9595&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_payment_workflow/scripts/validatePositionAccounting.xml Thu Aug 31 15:26:00 2006
@@ -94,15 +94,21 @@
\n
line = transaction.movement\n
bank_account = transaction.getDestinationPaymentValue()\n
-price = transaction.getSourceTotalAssetPrice() \n
-\n
-# immediate reindex is required to make this operation atomic.\n
-line.immediateReindexObject()\n
+price = transaction.getSourceTotalAssetPrice()\n
+\n
# this prevents multiple transactions from being committed at the same time for this bank account.\n
bank_account.serialize()\n
\n
-# Check if the banking operation is correct.\n
-if - price != transaction.getTotalPrice(portal_type = \'Banking Operation Line\'):\n
+# Make sure there are no other operations pending for this account\n
+if context.BankAccount_isMessagePending(bank_account):\n
+ msg = Message(domain=\'ui\', message="There are operations pending for this account that prevent form calculating its position. Please try again later.")\n
+ raise ValidationFailed, (msg,)\n
+\n
+# Index the banking operation line so it impacts account position\n
+context.BankingOperationLine_index(line)\n
+\n
+# Check if the banking operation is correct. Do not depend on catalog because line might not be indexed immediatelly.\n
+if - price != (line.getPrice() * line.getQuantity()):\n
msg = Message(domain=\'ui\', message=\'Banking operation and check payment price do not match.\')\n
raise ValidationFailed, (msg,)\n
\n
Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml?rev=9595&r1=9594&r2=9595&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/scripts/CheckbookReception_generateItemList.xml Thu Aug 31 15:26:00 2006
@@ -104,7 +104,7 @@
item = module.newContent()\n
if checkbook:\n
item.setReferenceRangeMin(reference_range_min)\n
- reference_range_max = str(int(float(reference_range_min)) + int(check_quantity))\n
+ reference_range_max = str(int(float(reference_range_min)) + int(check_quantity)-1)\n
item.setReferenceRangeMax(reference_range_max)\n
item.setTitle(\'%s - %s\' % (reference_range_min, reference_range_max))\n
reference_range_min = reference_range_max\n
Added: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/worklists/draft.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/worklists/draft.xml?rev=9595&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/worklists/draft.xml (added)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_reception_workflow/worklists/draft.xml Thu Aug 31 15:26:00 2006
@@ -1,0 +1,128 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <tuple>
+ <string>Products.DCWorkflow.Worklists</string>
+ <string>WorklistDefinition</string>
+ </tuple>
+ <none/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>actbox_category</string> </key>
+ <value> <string>global</string> </value>
+ </item>
+ <item>
+ <key> <string>actbox_name</string> </key>
+ <value> <string>Drafts to Validate (%(count)s)</string> </value>
+ </item>
+ <item>
+ <key> <string>actbox_url</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+Base_viewWorklist?simulation_state=draft&reset=1&portal_type=Checkbook Reception
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string>Drafts to Validate</string> </value>
+ </item>
+ <item>
+ <key> <string>guard</string> </key>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>draft</string> </value>
+ </item>
+ <item>
+ <key> <string>var_matches</string> </key>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="2" aka="AAAAAAAAAAI=">
+ <pickle>
+ <tuple>
+ <tuple>
+ <string>Products.DCWorkflow.Guard</string>
+ <string>Guard</string>
+ </tuple>
+ <none/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>roles</string> </key>
+ <value>
+ <tuple>
+ <string>Assignor</string>
+ <string>Manager</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="3" aka="AAAAAAAAAAM=">
+ <pickle>
+ <tuple>
+ <tuple>
+ <string>Persistence</string>
+ <string>PersistentMapping</string>
+ </tuple>
+ <none/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_container</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>portal_type</string> </key>
+ <value>
+ <tuple>
+ <string>Checkbook Reception</string>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>simulation_state</string> </key>
+ <value>
+ <tuple>
+ <string>draft</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
More information about the Erp5-report
mailing list