[Erp5-report] r16922 - in /erp5/trunk/bt5/erp5_banking_core: SkinTemplateItem/portal_skins/...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 10 09:36:32 CEST 2007


Author: aurel
Date: Wed Oct 10 09:36:32 2007
New Revision: 16922

URL: http://svn.erp5.org?rev=16922&view=rev
Log:
add script to check date on check

Added:
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Check_checkIntervalBetweenDate.xml
Modified:
    erp5/trunk/bt5/erp5_banking_core/bt/revision

Added: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Check_checkIntervalBetweenDate.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Check_checkIntervalBetweenDate.xml?rev=16922&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Check_checkIntervalBetweenDate.xml (added)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Check_checkIntervalBetweenDate.xml Wed Oct 10 09:36:32 2007
@@ -1,0 +1,201 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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 encoding="cdata"><![CDATA[
+
+from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+from Products.ERP5Type.Message import Message\n
+from Products.ERP5Type.DateUtils import getIntervalBetweenDates\n
+\n
+if stop_date is None:\n
+  from DateTime import DateTime\n
+  stop_date = DateTime().Date()\n
+\n
+resource_title = resource.getTitle()\n
+context.log("date %s %s" %(start_date, stop_date), "title = %s" %resource_title)\n
+\n
+if \'compte\' in resource_title:\n
+  interval = getIntervalBetweenDates(start_date,stop_date)\n
+  context.log("interval", interval)\n
+  if interval[\'year\'] == 3:\n
+    if interval[\'month\'] > 0 or interval["day"] > 0:\n
+      msg = Message(domain=\'ui\', message="Check $check is more than 3 years old.",\n
+                    mapping={"check" : check_nb})\n
+      raise ValidationFailed, (msg,)\n
+  elif interval[\'year\'] > 3:\n
+    msg = Message(domain=\'ui\', message="Check $check is more than 3 years old.",\n
+                  mapping={"check" : check_nb})\n
+    raise ValidationFailed, (msg,)\n
+\n
+elif \'virement\' in resource_title:\n
+  interval = getIntervalBetweenDates(start_date, stop_date)\n
+  context.log("interval", interval)\n
+  if interval[\'month\'] == 3:\n
+    if interval["day"] > 0:\n
+      msg = Message(domain=\'ui\', message="Check $check is more than 3 month old.",\n
+                    mapping={"check" : check_nb})\n
+      raise ValidationFailed, (msg,)\n
+  elif interval[\'month\'] > 3 or interval[\'year\'] > 0:\n
+    msg = Message(domain=\'ui\', message="Check $check is more than 3 month old.",\n
+                  mapping={"check" : check_nb})\n
+    raise ValidationFailed, (msg,)\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>resource, start_date, stop_date, check_nb</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>4</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>resource</string>
+                            <string>start_date</string>
+                            <string>stop_date</string>
+                            <string>check_nb</string>
+                            <string>Products.DCWorkflow.DCWorkflow</string>
+                            <string>ValidationFailed</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>Message</string>
+                            <string>Products.ERP5Type.DateUtils</string>
+                            <string>getIntervalBetweenDates</string>
+                            <string>None</string>
+                            <string>DateTime</string>
+                            <string>_getattr_</string>
+                            <string>resource_title</string>
+                            <string>context</string>
+                            <string>interval</string>
+                            <string>_getitem_</string>
+                            <string>msg</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Check_checkIntervalBetweenDate</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_banking_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/bt/revision?rev=16922&r1=16921&r2=16922&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_core/bt/revision Wed Oct 10 09:36:32 2007
@@ -1,1 +1,1 @@
-364
+365




More information about the Erp5-report mailing list