Hi guys!
I have the following situation:
1. For one specific service there can be more invoices issued;
2. Each of this invoices can be payed with partial payments (multiple payments/invoice)
I needed to make some calculations in a report for invoice value, payed amount/invoice, total amount due/service (filter done in masterpage services.php ) , and came up with this solution, which works ok:
Because one of the requirement is to filter data by customer name, which is present in invoices.php only, I should filter the data using invoices.php as masterpage and using as criteria both by my_search_str and page_id as custom_field. But I just think this is not possibe.
Is there any solution with this approach or should I look in another direction?
Any help is appreciated.
I have the following situation:
1. For one specific service there can be more invoices issued;
2. Each of this invoices can be payed with partial payments (multiple payments/invoice)
I needed to make some calculations in a report for invoice value, payed amount/invoice, total amount due/service (filter done in masterpage services.php ) , and came up with this solution, which works ok:
- Code: Select all
<cms:pages masterpage='members/services.php' custom_field=my_search_str order='asc'>
<cms:set totalinvoiced='0' scope='global' />
<cms:pages masterpage='members/invoices.php' custom_field="idfolder=id(<cms:show k_page_id />)" show_future_entries='1'>
<cms:set totalinvoiced="<cms:add totalinvoiced invoicevalue />" scope='global' />
</cms:pages>
<cms:set totalpayed='0' scope='global' />
<cms:pages masterpage='members/invoices.php' custom_field="idfolder=id(<cms:show k_page_id />)" show_future_entries='1'>
<cms:reverse_related_pages 'idinvoice' masterpage='members/payments.php' >
<cms:set totalpayed="<cms:add totalpayed payedamount />" scope='global' />
</cms:reverse_related_pages>
</cms:pages>
<cms:pages masterpage='members/invoices.php' custom_field="idfolder=id(<cms:show k_page_id />)" show_future_entries='1' order='asc'>
<tr>
<td><cms:show customername/></td>
<td><cms:show service /></td>
<td><cms:show invoicenr/></td>
<td><cms:date k_page_date format='d.m.Y' /></td>
<td><cms:show invoicevalue/></td>
<td>
<cms:set totalpayedfrominvoice='0' scope='global' />
<cms:reverse_related_pages 'idinvoice' masterpage='members/payments.php' >
<cms:set totalpayedfrominvoice="<cms:add totalpayedfrominvoice payedamount />" scope='global' />
</cms:reverse_related_pages>
<cms:show totalpayedfrominvoice/>
</td>
<td><cms:sub invoicevalue totalpayedfrominvoice /></td>
<td><cms:sub totalinvoiced totalpayed /></td>
</tr>
</cms:pages>
</cms:pages>
Because one of the requirement is to filter data by customer name, which is present in invoices.php only, I should filter the data using invoices.php as masterpage and using as criteria both by my_search_str and page_id as custom_field. But I just think this is not possibe.
Is there any solution with this approach or should I look in another direction?
Any help is appreciated.