Commit 785b90b1 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Update Printout details

   Bare minimal update to display details, and extend to support Compute Node/Project/Instance Tree Subscriptions.
   Don't display details if the lines don't aggregate subscription requests
parent 4b389d34
......@@ -155,18 +155,18 @@
</div>
</aside-->
<tal:block tal:define="aggregated_reference python: context.getCausalityReferenceList(portal_type='Sale Packing List', checked_permission='View');
<tal:block tal:define="invoice_line_list python: context.contentValues(portal_type='Invoice Line', checked_permission='View');
filter_portal_type python: {'portal_type': ['Instance Tree', 'Compute Node', 'Project']};
invoice_line_aggregate_list python: [i for i in invoice_line_list if i.getAggregate(portal_type='Subscription Request') and i.getAggregate(**filter_portal_type)];
item_dict python: {}">
<p class='line' tal:condition="python: aggregated_reference">&nbsp;</p>
<aside tal:condition="python: aggregated_reference">
<tal:block tal:condition="python: invoice_line_aggregate_list">
<p class='line'>&nbsp;</p>
<aside>
<h1><span>Subscription Details</span></h1>
<tal:block tal:repeat="line python: context.portal_catalog(
portal_type='Sale Packing List Line',
grouping_reference=aggregated_reference,
default_resource_uid=context.service_module.slapos_instance_subscription.getUid(),
sort_on=[('default_aggregate_uid', 'ASC'), ('movement.start_date', 'ASC')])">
<tal:block tal:define="item_uid python: line.getAggregateUid(portal_type='Instance Tree');
item_title python: line.getAggregateTitle(portal_type='Instance Tree');
<tal:block tal:repeat="line python: invoice_line_aggregate_list">
<tal:block tal:define="aggregate python: line.getAggregateValue(**filter_portal_type);
item_uid python: aggregate.getUid();
item_title python: aggregate.getTitle();
start_date python: line.getStartDate();
stop_date python: line.getStopDate();
quantity python: line.getQuantity();
......@@ -196,6 +196,7 @@
</tbody>
</table>
</aside>
</tal:block>
<p class='line page-break'>&nbsp;</p>
<tal:block tal:condition="python: invoice_resource_document is not None" tal:content="structure python: invoice_resource_document.getData()">
</tal:block>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment