X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquotation_pkg_detail.html;h=9aa50ec388ae57af031fe4bb44dde0991f1d02bf;hb=9d5f61a78f7cddeb65f6943f3e58326f47cc0c0b;hp=b8f589a9a764458fe96c31f773acce2f4fbda321;hpb=b6f16a22bd93ec66ffbb1da30e63f7e950b3b819;p=freeside.git diff --git a/httemplate/edit/quotation_pkg_detail.html b/httemplate/edit/quotation_pkg_detail.html index b8f589a9a..9aa50ec38 100644 --- a/httemplate/edit/quotation_pkg_detail.html +++ b/httemplate/edit/quotation_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 &>
@@ -22,20 +17,24 @@ - Detail: + + + + -% my $row = 0; -% for ( @details ) { - - - - - - - - -% } +<& elements/detail-table.html, + id => 'DetailTable', + details => \@details, + label => 'Details', + &> @@ -44,49 +43,6 @@
- - <%init> @@ -105,12 +61,34 @@ my $quotation_pkg = qsearchs({ 'LEFT JOIN cust_main USING ( custnum )', 'hashref' => { 'quotationpkgnum' => $pkgnum }, 'extra_sql' => ' AND '. $curuser->agentnums_sql, +}) +|| qsearchs({ + 'table' => 'quotation_pkg', + 'addl_from' => 'LEFT JOIN quotation USING ( quotationnum )'. + 'LEFT JOIN prospect_main USING ( prospectnum )', + 'hashref' => { 'quotationpkgnum' => $pkgnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, }); my $part_pkg = $quotation_pkg->part_pkg; my @details = $quotation_pkg->details; +my $copy_on_order = 0; +if (@details) { + + # currently, they should either all have this flag, or none + # but just in case, erring on the side of not copying to invoice + # unless every existing detail has copy_on_order + # (anyway, user has to submit change, this is just for autofill) + + my @quotation_pkg_detail = $quotation_pkg->quotation_pkg_detail; + my @copy_on_order = grep { $_->copy_on_order } @quotation_pkg_detail; + $copy_on_order = 1 if @copy_on_order; + my @no_copy_on_order = grep { !$_->copy_on_order } @quotation_pkg_detail; + $copy_on_order = 0 if @no_copy_on_order; +} + my $title = ( scalar(@details) ? 'Edit ' : 'Add ' ). 'Quotation Details';