From 430d18b5829416a186ce554846ba68cde4ad6750 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Tue, 16 Jun 2015 01:25:51 -0500 Subject: [PATCH] RT#33484: Delete lines from quick payment entry [removed prefix, documented, added color handling] --- httemplate/elements/customer-table.html | 153 +++++++++++++++++++------------- httemplate/misc/batch-cust_pay.html | 21 ++--- 2 files changed, 101 insertions(+), 73 deletions(-) diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html index 090623ff9..76a7f12f6 100644 --- a/httemplate/elements/customer-table.html +++ b/httemplate/elements/customer-table.html @@ -37,6 +37,34 @@ Example: ) +Some incomplete notes for javascript programmers: + +On page load, existing rows are initialized by passing values to addRow +based on existing cgi values. An empty row (marked with the 'emptyrow' +attribute) is created by invoking addRow without values. After that, +to keep the non-empty row count (totalrows) accurate, use newEmptyRow to +create the next row. There should only be one empty row at a time. + +Global vars: +total_el - element for displaying total number of rows +totalrows - total number of non-empty rows +rownum - really more of a "next row" value, used by addRow +allrows - array of tr elements, one for each row + +Don't confuse the global rownum with the element attribute rownum +that is set as a reference point on some of the elements generated +by this script. They have different values. + +Some of the functions: +updateTotalRow() - updates total_el based on value of totalrows +addDeleteButton(searchrow) - adds delete button to searchrow +newEmptyRow() - replaces old empty row +deleteRow() - removes the row specified by this.rownum +addRow(values) - adds a new row (marked as empty if values aren't specified) + +This mason element is currently only used by misc/batch-cust_pay.html, +and probably should be cleaned up more before being used by anything else. + - +
@@ -680,7 +711,7 @@ Example: % my @rownums = sort { $a <=> $b } map /^custnum(\d+)$/, keys %$param; - @@ -702,17 +733,17 @@ Example:
Inv #
+ Total <% @rownums || 0 %> <% PL($opt{name_singular} || 'customer', ( @rownums || 0 ) ) %>