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 @@ ...@@ -155,18 +155,18 @@
</div> </div>
</aside--> </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: {}"> item_dict python: {}">
<p class='line' tal:condition="python: aggregated_reference">&nbsp;</p> <tal:block tal:condition="python: invoice_line_aggregate_list">
<aside tal:condition="python: aggregated_reference"> <p class='line'>&nbsp;</p>
<aside>
<h1><span>Subscription Details</span></h1> <h1><span>Subscription Details</span></h1>
<tal:block tal:repeat="line python: context.portal_catalog( <tal:block tal:repeat="line python: invoice_line_aggregate_list">
portal_type='Sale Packing List Line', <tal:block tal:define="aggregate python: line.getAggregateValue(**filter_portal_type);
grouping_reference=aggregated_reference, item_uid python: aggregate.getUid();
default_resource_uid=context.service_module.slapos_instance_subscription.getUid(), item_title python: aggregate.getTitle();
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');
start_date python: line.getStartDate(); start_date python: line.getStartDate();
stop_date python: line.getStopDate(); stop_date python: line.getStopDate();
quantity python: line.getQuantity(); quantity python: line.getQuantity();
...@@ -196,6 +196,7 @@ ...@@ -196,6 +196,7 @@
</tbody> </tbody>
</table> </table>
</aside> </aside>
</tal:block>
<p class='line page-break'>&nbsp;</p> <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 tal:condition="python: invoice_resource_document is not None" tal:content="structure python: invoice_resource_document.getData()">
</tal:block> </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