diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2015-10-15 21:07:34 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-10-15 21:07:34 -0500 |
commit | b6f16a22bd93ec66ffbb1da30e63f7e950b3b819 (patch) | |
tree | 88dc077ac63271cb2df290bbd20069acfdd71615 /httemplate/edit/process | |
parent | 2b2dd969f3c18751afc583ad1e836ab8e6f73b5d (diff) |
RT#34960: Quotations
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r-- | httemplate/edit/process/quotation_pkg_detail.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/httemplate/edit/process/quotation_pkg_detail.html b/httemplate/edit/process/quotation_pkg_detail.html new file mode 100644 index 000000000..2fc420280 --- /dev/null +++ b/httemplate/edit/process/quotation_pkg_detail.html @@ -0,0 +1,45 @@ +% if ( $error ) { +<% header('Error') %> +<FONT COLOR="#ff0000"><B><% $error |h %></B></FONT><BR><BR> +<CENTER><INPUT TYPE="BUTTON" VALUE="OK" onClick="parent.cClick()"></CENTER> +</BODY></HTML> +% } else { +<% header($action) %> + <SCRIPT TYPE="text/javascript"> + window.top.location.reload(); + </SCRIPT> + </BODY></HTML> +% } +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('Generate quotation'); + +$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'illegal pkgnum'; +my $pkgnum = $1; + +my $quotation_pkg = qsearchs({ + 'table' => 'quotation_pkg', + 'addl_from' => 'LEFT JOIN quotation USING ( quotationnum )'. + 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'quotationpkgnum' => $pkgnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, +}); + +my @orig_details = $quotation_pkg->details(); + +my $action = 'Quotation details'. + ( scalar(@orig_details) ? ' changed ' : ' added ' ); + +my $param = $cgi->Vars; +my @details = (); +for ( my $row = 0; exists($param->{"detail$row"}); $row++ ) { + push @details, $param->{"detail$row"} + if $param->{"detail$row"} =~ /\S/; +} + +my $error = $quotation_pkg->set_details(@details); + +</%init> |