Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Iliya Manolov
erp5
Commits
5cbea03a
Commit
5cbea03a
authored
Jul 01, 2013
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore draft accounting periods (and fix a typo)
parent
cde0394c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
...kflow/accounting_workflow/scripts/validateTransaction.xml
+5
-5
bt5/erp5_accounting/bt/revision
bt5/erp5_accounting/bt/revision
+1
-1
No files found.
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
View file @
5cbea03a
...
@@ -96,18 +96,18 @@ transaction_line_list = transaction.getMovementList(\n
...
@@ -96,18 +96,18 @@ transaction_line_list = transaction.getMovementList(\n
portal_type=transaction.getPortalAccountingMovementTypeList())\n
portal_type=transaction.getPortalAccountingMovementTypeList())\n
\n
\n
\n
\n
def checkAccountingPeriodRecusivly(accounting_period, transaction_date):\n
def checkAccountingPeriodRecu
r
sivly(accounting_period, transaction_date):\n
valid = accounting_period.getSimulationState() in (\'planned\', \'started\')\n
valid = accounting_period.getSimulationState() in (\'planned\', \'started\')\n
if not valid:\n
if not valid:\n
return False\n
return False\n
for sub_accounting_period in accounting_period.contentValues():\n
for sub_accounting_period in accounting_period.contentValues():\n
if sub_accounting_period.getSimulationState() in (\n
if sub_accounting_period.getSimulationState() in (\n
\'deleted\', \'cancelled\'):\n
\'deleted\', \'cancelled\'
, \'draft\'
):\n
continue\n
continue\n
if sub_accounting_period.getStartDate().earliestTime() <= \\\n
if sub_accounting_period.getStartDate().earliestTime() <= \\\n
transaction_date <= \\\n
transaction_date <= \\\n
sub_accounting_period.getStopDate().latestTime():\n
sub_accounting_period.getStopDate().latestTime():\n
if not checkAccountingPeriodRecusivly(sub_accounting_period,\n
if not checkAccountingPeriodRecu
r
sivly(sub_accounting_period,\n
transaction_date):\n
transaction_date):\n
return False\n
return False\n
return True\n
return True\n
...
@@ -136,7 +136,7 @@ if not skip_period_validation :\n
...
@@ -136,7 +136,7 @@ if not skip_period_validation :\n
transaction_date = transaction.getStartDate().earliestTime()\n
transaction_date = transaction.getStartDate().earliestTime()\n
valid_date = False\n
valid_date = False\n
if accounting_period is not None:\n
if accounting_period is not None:\n
valid_date = checkAccountingPeriodRecusivly(accounting_period,\n
valid_date = checkAccountingPeriodRecu
r
sivly(accounting_period,\n
transaction_date)\n
transaction_date)\n
\n
\n
if not valid_date:\n
if not valid_date:\n
...
@@ -166,7 +166,7 @@ if not skip_period_validation :\n
...
@@ -166,7 +166,7 @@ if not skip_period_validation :\n
transaction_date = transaction.getStopDate().earliestTime()\n
transaction_date = transaction.getStopDate().earliestTime()\n
valid_date = False\n
valid_date = False\n
if accounting_period is not None:\n
if accounting_period is not None:\n
valid_date = checkAccountingPeriodRecusivly(accounting_period,\n
valid_date = checkAccountingPeriodRecu
r
sivly(accounting_period,\n
transaction_date)\n
transaction_date)\n
\n
\n
if not valid_date:\n
if not valid_date:\n
...
...
bt5/erp5_accounting/bt/revision
View file @
5cbea03a
1535
1537
\ No newline at end of file
\ No newline at end of file
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