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