[% BLOCK format_money %][% number %][% END # block %] [% PROCESS elements.html # Include form elements helper. %] [% contact_type = (payment.account_class == 1) ? text('Vendor') : text('Customer') %] [% payment_type = (payment.account_class == 1) ? text('Payments') : text('Receipts') %]
[% payment.payment_type %]
[% INCLUDE input element_data = { type = "hidden" name = "project_id" value = payment.project_id } %] [% INCLUDE input element_data = { type = "hidden" name = "form_id" value = request.form_id } %] [% INCLUDE input element_data = { type = "hidden" name = "account_class" value = payment.account_class } %] [% INCLUDE input element_data = { type = "hidden" name = "payment_type_id" value = payment.payment_type_id } %] [% INCLUDE input element_data = { type = "hidden" name = "department_id" value = payment.department_id } %] [% INCLUDE input element_data = { type = "hidden" name = "meta_number" value = payment.meta_number } %] [% INCLUDE input element_data = { type = "hidden" name = "source_start" value = payment.source_start } %] [% INCLUDE input element_data = { type = "hidden" name = "approved" value = payment.approved } %] [% INCLUDE input element_data = { type = "hidden" name = "currency" value = payment.currency } %] [% INCLUDE input element_data = { type = "hidden" name = "ar_ap_accno" value = payment.ar_ap_accno } %] [% INCLUDE input element_data = { type = "hidden" name = "date_from" value = payment.date_from } %] [% INCLUDE input element_data = { type = "hidden" name = "date_to" value = payment.date_to } %] [% INCLUDE input element_data = { type = "hidden" name = "business_id" value = payment.business_id } %] [% INCLUDE input element_data = { type = "hidden" name = "batch_id" value = payment.batch_id } %]
[% text('Posting Date') %] [% IF payment.batch_id %] [% IF ! payment.datepaid %][% payment.datepaid = payment.batch_date %][% END %] [% payment.datepaid %] [% END %] [% INCLUDE input element_data= { value = payment.datepaid name = "datepaid" size = 20 class = (payment.batch_id) ? "hidden" : "date" type = (payment.batch_id) ? "hidden" : "text" } %]
[% IF payment.date_from %]
[% text('Filtering From') %] [% payment.date_from %]
[% END %] [% IF payment.date_to %]
[% text('To') %] [% payment.date_to %]
[% END %] [% IF payment.department.value %]
[% text('Department') %] [% payment.department %]
[% END %]
[% text('Account') %] [% FOREACH a = payment.debt_accounts %] [% IF a.accno == payment.ar_ap_accno %] [% a.accno %] -- [% a.description %] [% END # If a.accno... %] [% END # FOREACH a %]
[% IF payment.default_currency != payment.currency %]
[% IF payment.fx_from_db %] [% text('Exchange Rate') %] [% payment.exchangerate %] [% PROCESS input element_data = { name = 'exchangerate' value = payment.exchangerate type = 'hidden' }; ELSE; PROCESS input element_data= { label = text('Exchange Rate') #' type = 'text' class = "numeric" name = 'exchangerate' id = 'exchangerate' value = payment.exchangerate size = 20 }; END %]
[% END %] [% IF payment.business %]
[% text('Business') %] [% FOREACH b = payment.businesses %] [% IF b.id == payment.business %] [% b.id %] -- [% b.description %] [% END # if b.id... %] [% END # foreach b %]
[% END # if business %] [% IF payment.payment_type %]
[% text('Payment Type') %] [% payment_type_return_label %]
[% END %]
[% INCLUDE input element_data = { type = "hidden" name = "cash_accno" value = payment.cash_accno } %] [% text('Pay From') %] [% FOR c = payment.cash_accounts -%] [% IF c.accno == payment.cash_accno -%] [% c.accno %] -- [% c.description %] [% END # if c.accno -%] [% END # for c -%]

[% INCLUDE input element_data = { id = 'checkbox-selectall' name = 'selectall' class = 'selectall' value = 0 type = 'checkbox' "data-dojo-type" = "lsmb/PublishCheckBox" "data-dojo-props" = "topic:'ui/pay/bulk/all-accounts'" } %] [% text('Account') %] | [% text('Name') %] | [% text('Invoice Total') %] | [% text('Payment') %] | [% text('Details') %]
--- | --- | --- | --- | ---
[% rc = 1 %][% count = 0 %] [% FOREACH r = payment.contact_invoices %] [% rc = (rc + 1) % 2; count = count + 1 %]
[% INCLUDE input element_data = { type = "hidden" name = "contact_$count" value = r.contact_id } %] [% INCLUDE input element_data = { type = "hidden" name = "contact_label_" _ r.contact_id value = r.econtrol_code _ "--" _ r.account_number _ "--" _ r.contact_name } %] [% # IF payment.action == "update_payments" -%] [% IF payment.${"id_$r.contact_id"} -%] [% r.selected = 1 -%] [% END # IF payment.${"id_$r.contact_id"} -%] [% # END # IF action ... -%] [% INCLUDE input element_data = { type = "checkbox" id = "id_" _ r.contact_id name = "id_" _ r.contact_id value = r.contact_id checked = (r.selected) ? "checked" : undef class = 'contactcb' "data-dojo-type" = "lsmb/SubscribeCheckBox" "data-dojo-props" = "topic:'ui/pay/bulk/all-accounts'" } %] [% r.econtrol_code %] -- [% r.account_number %] -- [% r.eca_description %] | [% r.contact_name %] | [% r.to_pay %] [% payment.currency %] | [% INCLUDE input element_data = { name = "paid_" _ r.contact_id value = "some" class = "paid_some" id = "paid-some-" _ r.contact_id label = text('Some') type = "radio" checked = (payment.${"paid_$r.contact_id"} == 'some') ? "checked" : "" "data-dojo-type" = "lsmb/PublishRadioButton" "data-dojo-props" = "topic:'ui/pay/bulk/invoice-data-table-" _ r.contact_id _ "'" } %] [% INCLUDE input element_data = { name = "paid_" _ r.contact_id value = "all" class = "paid_all" id = "paid-all-" _ r.contact_id label = text('All') type = "radio" checked = (payment.${"paid_$r.contact_id"} != 'some') ? "checked" : "" "data-dojo-type" = "lsmb/PublishRadioButton" "data-dojo-props" = "topic:'ui/pay/bulk/invoice-data-table-" _ r.contact_id _ "'" } %] | [% INCLUDE input element_data = { name = "source_$r.contact_id" id = "source_$r.contact_id" value = r.source type = "text" size = "20" label = text('Source') } %]
[% text('Date') %] | [% text('Invoice Number') %] | [% text('Total') %] | [% text('Paid') %] | [% text('Discount') %] | [% text('Net Due') %] | [% text('To Pay') %]
--- | --- | --- | --- | --- | --- | ---
[% FOREACH i = r.invoices %] [% # NEXT IF nothing to pay %] [% IF i.to_pay %]
[% i.transdate %] [% PROCESS input element_data = { type = "hidden" name = "invoice_date_" _ r.contact_id _ "_" _ i.id value = i.transdate } %] | [% i.invnumber %] [% PROCESS input element_data = { type = "hidden" name = "invnumber_" _ r.contact_id _ "_" _ i.id value = i.invnumber } %] | [% i.amount %] [% PROCESS input element_data = { type = "hidden" name = "due_" _ r.contact_id _ "_" _ i.id value = i.due } %] | [% i.paid %] | [% i.net %] | [% i.due %] [% currency %] | [% fld = "payment_" _ r.contact_id _ "_" _ i.id ; PROCESS input element_data = { name = fld id = "payment_$i.id" value = payment.${fld} size = 20 type = "text" class = "monetary" } %] [% PROCESS input element_data = { type = "hidden" name = "invoice_" _ r.contact_id _ "_" _ i.id value = i.id } %] [% PROCESS input element_data = { type = "hidden" name = "net_" _ r.contact_id _ "_" _ i.id value = i.to_pay } %]
[% ELSE #not $i.to_pay %]
[% i.transdate %] | [% i.invnumber %] | [% i.amount %] | [% i.paid %] | [% i.due %] [% currency %] | [% text("Locked by [_1]", i.8) %]
[% END # if i.8 %] [% END # foreach i %] [% INCLUDE input element_data = { type = "hidden" name = "invoice_count_" _ r.contact_id value = i.size() } %]
[% text('Contact Total (if paying "some")') %] | [% r.contact_total %] [% payment.currency %]
[% END # foreach r %]
| [% text('Grand Total') %] | [% payment.grand_total %] [% payment.currency %]

[% INCLUDE input element_data = { type = "hidden" name = "contact_count" value = payment.contact_invoices.size } %] [% PROCESS input element_data = { name = "multiple" type = "hidden" value = '1' } %] [% INCLUDE button element_data = { text = text('Update'), value = 'update_payments' class = "submit" name = '__action' } %] [% INCLUDE button element_data = { text = text((batch_id) ? 'Save' : 'Post'), # value = 'pre_bulk_post_report' value = 'pre_bulk_post_report' class = "submit" name = '__action' 'data-lsmb-doing' = text('Saving...') 'data-lsmb-done' = text('Saved') } %] [% IF payment.can_print %] [% INCLUDE select element_data = { name = "media" class = "select" options = payment.media_options value = payment.media } %] [% INCLUDE select element_data = { name = "format" class = "select" options = payment.format_options value = payment.format } %] [% INCLUDE button element_data = { text = text('Print') value = 'print' class = 'submit' name = '__action' 'data-dojo-type' = 'lsmb/PrintButton' 'data-dojo-props' = "minimalGET: false" } %] [% END # IF can_print %]