From 0ef2dee417147582084f925bc5d62cf13d41801d Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Fri, 29 Jan 2016 20:24:46 -0600 Subject: RT#39831 Quotation extra information for line items --- httemplate/edit/process/quotation_pkg_detail.html | 5 +++- httemplate/edit/quotation_pkg_detail.html | 29 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'httemplate') diff --git a/httemplate/edit/process/quotation_pkg_detail.html b/httemplate/edit/process/quotation_pkg_detail.html index 2fc420280..9e4ac3222 100644 --- a/httemplate/edit/process/quotation_pkg_detail.html +++ b/httemplate/edit/process/quotation_pkg_detail.html @@ -40,6 +40,9 @@ for ( my $row = 0; exists($param->{"detail$row"}); $row++ ) { if $param->{"detail$row"} =~ /\S/; } -my $error = $quotation_pkg->set_details(@details); +my $error = $quotation_pkg->set_details( + details => \@details, + copy_on_order => scalar($cgi->param('copy_on_order')) ? 'Y' : '' + ); diff --git a/httemplate/edit/quotation_pkg_detail.html b/httemplate/edit/quotation_pkg_detail.html index 80a904420..ae09b9c6a 100644 --- a/httemplate/edit/quotation_pkg_detail.html +++ b/httemplate/edit/quotation_pkg_detail.html @@ -21,6 +21,20 @@ <% $part_pkg->comment |h %> + + + + + + + % my $row = 0; % for ( @details ) { @@ -111,6 +125,21 @@ 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'; -- cgit v1.2.1