Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
slapos.core
Commits
713c3e2e
Commit
713c3e2e
authored
Dec 14, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simply data structure.
parent
25a90384
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
25 deletions
+22
-25
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_getOpenSaleOrderDifference.xml
...s/slapos_accounting/Person_getOpenSaleOrderDifference.xml
+15
-15
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_storeOpenSaleOrderJournal.xml
...ns/slapos_accounting/Person_storeOpenSaleOrderJournal.xml
+6
-9
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_getOpenSaleOrderDifference.xml
View file @
713c3e2e
...
@@ -80,32 +80,32 @@ if previous_open_sale_order is not None:\n
...
@@ -80,32 +80,32 @@ if previous_open_sale_order is not None:\n
now = DateTime()\n
now = DateTime()\n
\n
\n
add_kw_kw = {}\n
add_kw_kw = {}\n
for (add_kw, explanation) in add_kw_list:\n
for add_kw in add_kw_list:\n
hosting_url = add_kw[\'aggregate\']\n
existing = portal.portal_catalog.countResults(\n
existing = portal.portal_catalog.countResults(\n
portal_type=\'Open Sale Order Line\',\n
portal_type=\'Open Sale Order Line\',\n
default_aggregate_uid=portal.restrictedTraverse(
add_kw[\'aggregate\']
).getUid()\n
default_aggregate_uid=portal.restrictedTraverse(
hosting_url
).getUid()\n
)[0][0] >
0\n
)[0][0] >
0\n
if
add_kw[\'aggregate\']
not in hosting_subscription_mapping and not existing:\n
if
hosting_url
not in hosting_subscription_mapping and not existing:\n
add_kw_kw[
add_kw[\'aggregate\']
] = add_kw.copy()\n
add_kw_kw[
hosting_url
] = add_kw.copy()\n
add_kw_kw[
add_kw[\'aggregate\']][\'explanation\'] = [\'Added because of %s \' % explanation
]\n
add_kw_kw[
hosting_url][\'explanation\'] = [\'Added because of %s \' % hosting_url
]\n
\n
\n
modify_kw_kw = {}\n
modify_kw_kw = {}\n
for start_date_tuple in start_date_tuple_list:\n
for hosting_url, start_date in start_date_tuple_list:\n
start_date_tuple, explanation = start_date_tuple[0:2], start_date_tuple[2]\n
start_date = getClosestDate(target_date=start_date, precision=\'day\')\n
start_date = getClosestDate(target_date=start_date_tuple[1], precision=\'day\')\n
while start_date.day() >= 29:\n
while start_date.day() >= 29:\n
start_date = addToDate(start_date, to_add={\'day\': -1})\n
start_date = addToDate(start_date, to_add={\'day\': -1})\n
start_date_modified = False\n
start_date_modified = False\n
if
start_date_tuple[0]
in hosting_subscription_mapping:\n
if
hosting_url
in hosting_subscription_mapping:\n
line_id = hosting_subscription_mapping[
start_date_tuple[0]
]\n
line_id = hosting_subscription_mapping[
hosting_url
]\n
line = previous_open_sale_order[line_id]\n
line = previous_open_sale_order[line_id]\n
if line.getStartDate() is None:\n
if line.getStartDate() is None:\n
modify_kw_kw[line.getAggregate(portal_type=\'Hosting Subscription\')] = {\'start_date\': start_date}\n
modify_kw_kw[line.getAggregate(portal_type=\'Hosting Subscription\')] = {\'start_date\': start_date}\n
modify_kw_kw[line.getAggregate(portal_type=\'Hosting Subscription\')][\'explanation\'] = [\'Set start date because of %s\' %
explanation
]\n
modify_kw_kw[line.getAggregate(portal_type=\'Hosting Subscription\')][\'explanation\'] = [\'Set start date because of %s\' %
hosting_url
]\n
start_date_modified = True\n
start_date_modified = True\n
elif
start_date_tuple[0]
in add_kw_kw:\n
elif
hosting_url
in add_kw_kw:\n
add_kw_kw[
start_date_tuple[0]
][\'start_date\'] = start_date\n
add_kw_kw[
hosting_url
][\'start_date\'] = start_date\n
add_kw_kw[
start_date_tuple[0]][\'explanation\'].append(\'Added start date beacuse of %s\' % explanation
)\n
add_kw_kw[
hosting_url][\'explanation\'].append(\'Added start date because of %s\' % hosting_url
)\n
start_date_modified = True\n
start_date_modified = True\n
\n
\n
if previous_open_sale_order is not None:\n
if previous_open_sale_order is not None:\n
...
@@ -155,7 +155,7 @@ for (key, value) in modify_kw_kw.copy().iteritems():\n
...
@@ -155,7 +155,7 @@ for (key, value) in modify_kw_kw.copy().iteritems():\n
\n
\n
remove_id_list =
set()\n
remove_id_list =
set()\n
if
previous_open_sale_order
is
not
None:\n
if
previous_open_sale_order
is
not
None:\n
for
(remove_hosting,
explanation)
in
remove_hosting_list:\n
for
remove_hosting
in
remove_hosting_list:\n
if
remove_hosting
in
add_kw_kw:\n
if
remove_hosting
in
add_kw_kw:\n
add_kw_kw[remove_hosting][\'explanation\'].append(\'Not
removed
because
just
added\')\n
add_kw_kw[remove_hosting][\'explanation\'].append(\'Not
removed
because
just
added\')\n
continue\n
continue\n
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_storeOpenSaleOrderJournal.xml
View file @
713c3e2e
...
@@ -72,21 +72,18 @@ for hosting_subscription in portal.portal_catalog(\n
...
@@ -72,21 +72,18 @@ for hosting_subscription in portal.portal_catalog(\n
default_destination_section_uid=context.getUid(),\n
default_destination_section_uid=context.getUid(),\n
):\n
):\n
hosting_subscription = hosting_subscription.getObject()\n
hosting_subscription = hosting_subscription.getObject()\n
add_kw = dict(\n
add_kw_list.append({\n
title=hosting_subscription.getTitle(),\n
\'title\': hosting_subscription.getTitle(),\n
aggregate=hosting_subscription.getRelativeUrl()\n
\'aggregate\': hosting_subscription.getRelativeUrl(),\n
)\n
})\n
add_kw_list.append((add_kw, hosting_subscription.getPath()))\n
if hosting_subscription.getSlapState() == \'destroy_requested\':\n
if hosting_subscription.getSlapState() == \'destroy_requested\':\n
remove_hosting_list.append((hosting_subscription.getRelativeUrl(),\n
remove_hosting_list.append(hosting_subscription.getRelativeUrl())\n
hosting_subscription.getPath()))\n
try:\n
try:\n
start_date = getWorkflowDate(hosting_subscription, \'request_instance\')\n
start_date = getWorkflowDate(hosting_subscription, \'request_instance\')\n
except ValueError:\n
except ValueError:\n
start_date = hosting_subscription.getCreationDate()\n
start_date = hosting_subscription.getCreationDate()\n
start_date_tuple_list.append((hosting_subscription.getRelativeUrl(),\n
start_date_tuple_list.append((hosting_subscription.getRelativeUrl(),\n
start_date,\n
start_date))\n
hosting_subscription.getPath()))\n
\n
\n
\n
\n
result = context.Person_updateOpenSaleOrder(\n
result = context.Person_updateOpenSaleOrder(\n
...
...
master/bt5/slapos_accounting/bt/revision
View file @
713c3e2e
220
221
\ 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