[% PROCESS 'elements.html'; PROCESS 'attachments.html'; -%]
[% IF check.unapproved_transactions %]
[% text('There are [_1] unapproved transactions before the end date of this report.',check.unapproved_transactions) %]
[% END; IF check.unapproved_reports %]
[% text('There are [_1] unapproved reconciliations before the end date of this report.',check.unapproved_reports) %]
[% END %] [% IF ! defined(b_cleared_table); b_cleared_table = 'checked'; END %] [% IF ! defined(b_cleared_table) or ! defined(b_cleared_table); b_mismatch_table = ""; b_outstanding_table = ""; IF !approved and !submitted; FOREACH row = report_lines; IF row.err == 'mismatch'; b_mismatch_table = 'checked'; END; IF row.cleared != 'checked' and row.err != 'mismatch'; b_outstanding_table = 'checked'; END; END; END; END %]
[% text('Reconciliation Report') %]

[% text('Account:') %] | [% account_info.accno %] [% account_info.description %]
[% text('Statement Date') %]: | [% end_date %]
[% text('Beginning Statement Balance:') %] | [% beginning_balance %]
[% text('Ending Statement Balance:') %] [% IF submitted %] | [% their_total %] [% ELSE %] | [% INCLUDE input element_data = { name = "their_total", type = "text", class = "money", size = "15", value = their_total } %] [% END %]
[% IF ! approved %] [% text('Variance:') %] | [% variance %] [% END %]
[% IF ! approved %]
[% text('Less Outstanding Checks:') %] | [% outstanding_total %]
[% text('Ending GL Balance:') %] | [% statement_gl_calc %]
[% END %]
[% text('Report Generated By:') %] | [% entered_username %]

[% IF ! approved and !submitted%]
[% text('Bank transactions upload:') %] [% PROCESS input element_data = { type="file" name="csv_file" id="file_upload" } %]
[% text('Upload file format') %] [% PROCESS select element_data = { name="trx_format" options=upload_formats text_attr="name" value_attr="name" default_blank=1 } %]
[% END %] [% IF error %]
[% error %]
[% END %] [% i = 1 %]

[% INCLUDE input element_data = { type = "toggle" name = "b_cleared_table" label = text('Cleared Transactions') checked = b_cleared_table "data-dojo-type" = "lsmb/PublishToggleButton" "data-dojo-props" = "topic:'ui/reconciliation/report/b_cleared_table'" } %]
| [% text('Transaction Type') %] | [% text('Cleared') %] [% INCLUDE tooltip element_data = { id => 'cleared_header_column', position => ["above", "below", "after", "before"], msg => text("Date when the transaction was cleared at your bank") }; %] | [% text('Source') %] | [% text('Posted') %] [% INCLUDE tooltip element_data = { id => 'posted_header_column', position => ["above", "below", "after", "before"], msg => text("Date when the transaction was posted in the ledger") }; %] | [% text('Description') %] | [% text('Books') %] [% INCLUDE tooltip element_data = { id => 'books_header_column', position => ["above", "below", "after", "before"], msg => text("Data from your ledger") }; %] | [% text('Bank') %] [% INCLUDE tooltip element_data = { id => 'bank_header_column', position => ["above", "below", "after", "before"], msg => text("Data from your bank statement") }; %]
--- | --- | --- | --- | --- | --- | --- | ---
[% text('Debits') %] | [% text('Credits') %] | [% text('Debits') %] | [% text('Credits') %]
[% FOREACH row = report_lines %] [% IF row.cleared -%] [% row.cleared = 'checked' -%] [% ELSE %] [% row.cleared = undef -%] [% END -%] [% IF row.cleared == 'checked' %] [% INCLUDE input element_data = { type = "hidden", name = "id_$i", value = row.id } %]
[% IF !approved and !submitted; INCLUDE input element_data = { type = "checkbox" name = "cleared_$row.id" value = row.id checked = row.cleared }; END %] | [% row.trans_type %] [% id=''; class=''; element_data = {}; IF row.days; id="cleared_time_$row.id"; IF row.days < 0; class='cleared-future'; element_data = { id = id msg = text('Clear date is [*,_1,day] in the future of after posting',0-row.days) }; ELSIF row.days > 150; class='cleared-past'; element_data = { id = id msg = text('Clear date over [*,_1,day]',row.days) }; END; END; %] | [% INCLUDE tooltip element_data; %] [% row.clear_time %] | [% row.scn %] | [% row.post_date %] | [% row.payee %] | [% reverse ? row.our_credits : row.our_debits %] | [% reverse ? row.our_debits : row.our_credits %] | [% reverse ? row.their_credits : row.their_debits %] | [% reverse ? row.their_debits : row.their_credits %]
[% i = i + 1 -%] [% END %] [% END -%]
[% text('Total') %] | [% total_cleared_debits %] | [% total_cleared_credits %]

[% have_mismatches = 0; FOREACH row = report_lines ; IF row.err == 'mismatch' ; have_mismatches = 1; LAST; END; END; IF have_mismatches ; -%]

[% INCLUDE input element_data = { type = "toggle" name = "b_mismatch_table" label = text('Mismatched Transactions (from upload)') checked = b_mismatch_table "data-dojo-type" = "lsmb/PublishToggleButton" "data-dojo-props" = "topic:'ui/reconciliation/report/b_mismatch_table'" } %]
| [% text('Transaction Type') %] | [% text('Cleared') %] | [% text('Source') %] | [% text('Posted') %] | [% text('Description') %] | [% text('Our Debits') %] | [% text('Our Credits') %] | [% text('Their Debits') %] | [% text('Their Credits') %]
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
[% FOREACH row = report_lines %] [% IF row.err == 'mismatch' %] [% INCLUDE input element_data = { type = "hidden", name = "id_$i", value = row.id } %]
[% IF !approved and !submitted; INCLUDE input element_data = { type = "checkbox" name = "cleared_$row.id" value = row.id checked = row.cleared }; END %] | [% row.trans_type %] | [% row.clear_time %] | [% row.scn %] | [% row.post_date %] | [% row.payee %] | [% reverse ? row.our_credits : row.our_debits %] | [% reverse ? row.our_debits : row.our_credits %] | [% reverse ? row.their_credits : row.their_debits %] | [% reverse ? row.their_debits : row.their_credits %]
[% i = i + 1 -%] [% END -%] [% END -%]
[% text('Total') %] | [% mismatch_our_debits %] | [% mismatch_our_credits %] | [% mismatch_their_debits %] | [% mismatch_their_credits %]

[% END; # have_mismatches have_outstanding = 0; FOREACH row = report_lines ; IF row.cleared != 'checked' and row.err != 'mismatch'; have_outstanding = 1; LAST; END; END; IF have_outstanding ; -%]

[% INCLUDE input element_data = { type = "toggle" name = "b_outstanding_table" label = text('Outstanding Transactions') checked = b_outstanding_table "data-dojo-type" = "lsmb/PublishToggleButton" "data-dojo-props" = "topic:'ui/reconciliation/report/b_outstanding_table'" } %]
[% text('Cleared') %] | [% text('Source') %] | [% text('Posted') %] | [% text('Description') %] | [% text('Our Debits') %] | [% text('Our Credits') %]
--- | --- | --- | --- | --- | ---
[% FOREACH row = report_lines; IF row.cleared != 'checked' and row.err != 'mismatch'; INCLUDE input element_data = { type = "hidden", name = "id_$i", value = row.id } %]
[% IF !approved and !submitted; INCLUDE input element_data = { type = "checkbox" name = "cleared_$row.id" value = row.id checked = row.cleared "data-dojo-type" = "lsmb/PublishCheckBox" "data-dojo-props" = "topic:'ui/reconciliation/report/cleared_" _ row.id _ "'" }; END %] | [% row.scn %] | [% row.post_date %] | [% row.payee %] | [% reverse ? row.our_credits : row.our_debits %] | [% reverse ? row.our_debits : row.our_credits %]
[% i = i + 1; END; END -%]
[% text('Total') %] | [% total_uncleared_debits %] | [% total_uncleared_credits %]

[% END; # have_outstanding %] [% INCLUDE input element_data = { name = "end_date", type = "hidden", value = end_date, } %] [% INCLUDE input element_data = { name = "form_id", type = "hidden", value = form_id, } %] [% INCLUDE input element_data = { name = "report_id", type = "hidden", value = report_id, } %] [% INCLUDE input element_data = { name = "workflow_id", type = "hidden", value = workflow_id, } %] [% IF NOT submitted %] [% INCLUDE select element_data = { name = "line_order", label = text('Order By'), #' options = sort_options, text_attr = 'label', value_attr = 'id', default_values = [line_order] class = 'sort' } %] [% INCLUDE button element_data = { name = "__action", text = text('Update'), value = 'update_recon_set', class = "submit" } %] [% INCLUDE button element_data = { name = "__action" text = text('Select All') #' value = 'select_all_recons' class = 'submit' } %] [% INCLUDE button element_data = { name = "__action", text = text('Save'), value = 'save_recon_set', class = "submit" 'data-lsmb-doing' = text('Saving...') 'data-lsmb-done' = text('Saved') } %] [% INCLUDE button element_data = { name = "__action", text = text('Submit'), value = 'submit_recon_set', disabled = submit_enabled && !check.unapproved_reports ? 'false' : 'true', class = "submit" } %] [% END %] [% IF submitted AND NOT approved AND can_approve %] [% INCLUDE button element_data = { name = "__action", text = text('Approve'), value = 'approve', disabled = submit_enabled ? 'false' : 'true', class = "submit" 'data-lsmb-doing' = text('Approving...') 'data-lsmb-done' = text('Approved') }; INCLUDE button element_data = { name = "__action", text = text('Reject'), value = 'reject', class = "submit" 'data-lsmb-doing' = text('Rejecting...') 'data-lsmb-done' = text('Rejected') } %] [% END %] [% IF NOT approved %] [% INCLUDE button element_data = { name = "__action" text = text('Delete') value = 'delete_report' type = 'submit' class = 'submit' 'data-lsmb-doing' = text('Deleting...') 'data-lsmb-done' = text('Deleted') } %] [% END %] [% PROCESS attachments attachments={ ref_key=report_id file_class=9 files=files file_links=file_links callback='recon.pl?__action=display_report&report_id=' _ report_id }; -%]