summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_pkg_detail.html
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-03-11 00:10:13 -0600
committerJonathan Prykop <jonathan@freeside.biz>2016-03-11 00:10:13 -0600
commit9972d7caa7a3e1a29dc4201e0c7256ba093ea705 (patch)
tree6bf876a129869b777d593bf63963fce7fdd89575 /httemplate/edit/cust_pkg_detail.html
parentf5ba2c8127ef9fcbfda8c25e0eeb32d05e47fd30 (diff)
RT#40806: Enter invoice details from order package page
Diffstat (limited to 'httemplate/edit/cust_pkg_detail.html')
-rw-r--r--httemplate/edit/cust_pkg_detail.html66
1 files changed, 6 insertions, 60 deletions
diff --git a/httemplate/edit/cust_pkg_detail.html b/httemplate/edit/cust_pkg_detail.html
index b1e60dad5..a1a6db6d3 100644
--- a/httemplate/edit/cust_pkg_detail.html
+++ b/httemplate/edit/cust_pkg_detail.html
@@ -1,9 +1,4 @@
-<% include("/elements/header-popup.html", $title, '',
- ( $cgi->param('error') ? '' : 'onload="addRow()"' ),
- )
-%>
-
-%# <% include('/elements/error.html') %>
+<& /elements/header-popup.html, $title &>
<FORM ACTION="process/cust_pkg_detail.html" NAME="DetailForm" ID="DetailForm" METHOD="POST">
@@ -40,17 +35,10 @@
<TD COLSPAN=2><% ucfirst($name{$detailtype}) %>: </TD>
</TR>
-% my $row = 0;
-% for ( @details ) {
-
- <TR>
- <TD></TD>
- <TD>
- <INPUT TYPE="text" NAME="detail<% $row %>" SIZE="60" MAXLENGTH="65" VALUE="<% $_->detail |h %>" rownum="<% $row++ %>" onkeyup="possiblyAddRow" onchange="possiblyAddRow" >
- </TD>
- </TR>
-
-% }
+<& elements/detail-table.html,
+ id => 'DetailTable',
+ details => \@details,
+ &>
</TABLE>
@@ -59,48 +47,6 @@
</FORM>
-<SCRIPT TYPE="text/javascript">
-
- var rownum = <% $row %>;
-
- function possiblyAddRow() {
- if ( ( rownum - this.getAttribute('rownum') ) == 1 ) {
- addRow();
- }
- }
-
- function addRow() {
-
- var table = document.getElementById('DetailTable');
- var tablebody = table.getElementsByTagName('tbody').item(0);
-
- var row = document.createElement('TR');
-
- var empty_cell = document.createElement('TD');
- row.appendChild(empty_cell);
-
- var detail_cell = document.createElement('TD');
-
- var detail_input = document.createElement('INPUT');
- detail_input.setAttribute('name', 'detail'+rownum);
- detail_input.setAttribute('id', 'detail'+rownum);
- detail_input.setAttribute('size', 60);
- detail_input.setAttribute('maxLength', 65);
- detail_input.setAttribute('rownum', rownum);
- detail_input.onkeyup = possiblyAddRow;
- detail_input.onchange = possiblyAddRow;
- detail_cell.appendChild(detail_input);
-
- row.appendChild(detail_cell);
-
- tablebody.appendChild(row);
-
- rownum++;
-
- }
-
-</SCRIPT>
-
</BODY>
</HTML>
<%init>
@@ -136,7 +82,7 @@ my $cust_pkg = qsearchs({
my $part_pkg = $cust_pkg->part_pkg;
-my @details = $cust_pkg->cust_pkg_detail($detailtype);
+my @details = map { $_->detail } $cust_pkg->cust_pkg_detail($detailtype);
my $title = ( scalar(@details) ? 'Edit ' : 'Add ' ). $name{$detailtype};