Commit 983b4d31 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Use getMovementList to rather them contentValues

   Use getMovementList to get Invoice Cell/Invoice Lines, it allows to get the
    aggregate properly.

   It makes list more consistent.
parent a1053ad9
......@@ -2,6 +2,8 @@
<html tal:define="quantity_renderer nocall:here/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_quantity/render_pdf;
price_renderer nocall:here/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_total_price/render_pdf;
total_not_tax_price_list python: [];
movement_list python: context.getMovementList(portal_type=context.getPortalInvoiceMovementTypeList(),
sort_on=[('int_index', 'ascending'), ('reference', 'ascending')]);
invoice_resource_document python: context.portal_catalog.getResultValue(
portal_type='User Consumption HTML File',
validation_state='shared',
......@@ -104,8 +106,7 @@
</tr>
</thead>
<tbody>
<tal:block tal:repeat="line python: context.contentValues(portal_type=context.getPortalInvoiceMovementTypeList(),
sort_on=[('int_index', 'ascending'), ('reference', 'ascending')])">
<tal:block tal:repeat="line movement_list">
<tr tal:condition="python: line.getUse('') != 'trade/tax'">
<td><span tal:content="python: line.getReference() or line.getIntIndex()"></span></td>
<td><span tal:content="python: line.getResourceReference('')"></span></td>
......@@ -124,8 +125,7 @@
<th><span>Total Excluding Tax</span></th>
<td><span tal:content="python: price_renderer(sum(total_not_tax_price_list))"></span></td>
</tr>
<tal:block tal:repeat="line python: context.contentValues(portal_type=context.getPortalInvoiceMovementTypeList(),
sort_on=[('int_index', 'ascending'), ('reference', 'ascending')])">
<tal:block tal:repeat="line movement_list">
<tal:block tal:condition="python: line.getUse('') == 'trade/tax'">
<tr>
<th><span>Tax Rate</span></th>
......@@ -150,9 +150,8 @@
</div>
</aside-->
<tal:block tal:define="invoice_line_list python: context.contentValues(portal_type='Invoice Line');
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='Hosting Subscription') and i.getAggregate(**filter_portal_type)];
<tal:block tal:define="filter_portal_type python: {'portal_type': ['Instance Tree', 'Compute Node', 'Project']};
invoice_line_aggregate_list python: [i for i in movement_list if i.getAggregate(portal_type='Hosting Subscription') and i.getAggregate(**filter_portal_type)];
item_dict python: {}">
<tal:block tal:condition="python: invoice_line_aggregate_list">
<aside>
......
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