diff options
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> | 
