default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / process / quotation_pkg_detail.html
index 2fc4202..c1f9b2b 100644 (file)
@@ -1,12 +1,12 @@
 % if ( $error ) {
-<% header('Error') %>
+<& /elements/header-popup.html, '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) %>
+<& /elements/header-popup.html, $action &>
   <SCRIPT TYPE="text/javascript">
-    window.top.location.reload();
+    topreload();
   </SCRIPT>
   </BODY></HTML>
 % }
@@ -26,8 +26,16 @@ 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 @orig_details = $quotation_pkg->details();
 
 my $action = 'Quotation details'.
@@ -40,6 +48,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' : ''
+            );
 
 </%init>