1 # #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 #=====================================================================
8 # SQL-Ledger, Accounting
9 # Copyright (c) 1998-2003
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #======================================================================
32 #======================================================================
40 require "bin/mozilla/io.pl";
41 require "bin/mozilla/arap.pl";
48 # $locale->text('Edit the purchase_order');
49 # $locale->text('Edit the sales_order');
50 # $locale->text('Edit the request_quotation');
51 # $locale->text('Edit the sales_quotation');
53 # $locale->text('Workflow purchase_order');
54 # $locale->text('Workflow sales_order');
55 # $locale->text('Workflow request_quotation');
56 # $locale->text('Workflow sales_quotation');
59 $lxdebug->enter_sub();
63 if ($form->{type} eq 'purchase_order') {
64 $form->{title} = $action eq "edit" ?
65 $locale->text('Edit Purchase Order') :
66 $locale->text('Add Purchase Order');
67 $form->{heading} = $locale->text('Purchase Order');
68 $form->{vc} = 'vendor';
70 if ($form->{type} eq 'sales_order') {
71 $form->{title} = $action eq "edit" ?
72 $locale->text('Edit Sales Order') :
73 $locale->text('Add Sales Order');
74 $form->{heading} = $locale->text('Sales Order');
75 $form->{vc} = 'customer';
77 if ($form->{type} eq 'request_quotation') {
78 $form->{title} = $action eq "edit" ?
79 $locale->text('Edit Request for Quotation') :
80 $locale->text('Add Request for Quotation');
81 $form->{heading} = $locale->text('Request for Quotation');
82 $form->{vc} = 'vendor';
84 if ($form->{type} eq 'sales_quotation') {
85 $form->{title} = $action eq "edit" ?
86 $locale->text('Edit Quotation') :
87 $locale->text('Add Quotation');
88 $form->{heading} = $locale->text('Quotation');
89 $form->{vc} = 'customer';
92 $lxdebug->leave_sub();
96 $lxdebug->enter_sub();
101 "$form->{script}?action=add&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}"
102 unless $form->{callback};
108 $lxdebug->leave_sub();
112 $lxdebug->enter_sub();
113 # show history button
114 $form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|;
115 #/show hhistory button
117 $form->{simple_save} = 0;
119 set_headings("edit");
121 # editing without stuff to edit? try adding it first
122 if ($form->{rowcount}) {
123 map { $id++ if $form->{"multi_id_$_"} } (1 .. $form->{rowcount});
127 undef $form->{rowcount};
129 $lxdebug->leave_sub();
132 } elsif (!$form->{id}) {
134 $lxdebug->leave_sub();
138 if ($form->{print_and_save}) {
139 $form->{action} = "print";
140 $form->{resubmit} = 1;
141 $language_id = $form->{language_id};
142 $printer_id = $form->{printer_id};
145 set_headings("edit");
149 if ($form->{print_and_save}) {
150 $form->{language_id} = $language_id;
151 $form->{printer_id} = $printer_id;
155 $lxdebug->leave_sub();
159 $lxdebug->enter_sub();
161 # get customer/vendor
162 $form->all_vc(\%myconfig, $form->{vc},
163 ($form->{vc} eq 'customer') ? "AR" : "AP");
165 # retrieve order/quotation
166 $form->{webdav} = $webdav;
168 $form->{jscalendar} = $jscalendar;
170 my $editing = $form->{id};
172 OE->retrieve(\%myconfig, \%$form);
174 if ($form->{payment_id}) {
175 $payment_id = $form->{payment_id};
177 if ($form->{language_id}) {
178 $language_id = $form->{language_id};
180 if ($form->{taxzone_id}) {
181 $taxzone_id = $form->{taxzone_id};
184 $salesman_id = $form->{salesman_id} if ($editing);
187 # if multiple rowcounts (== collective order) then check if the
188 # there were more than one customer (in that case OE::retrieve removes
189 # the content from the field)
190 if ( $form->{rowcount}
191 && $form->{type} eq 'sales_order'
192 && defined $form->{customer}
193 && $form->{customer} eq '') {
195 # $main::lxdebug->message(0, "Detected Edit order with concurrent customers");
198 'Collective Orders only work for orders from one customer!')
202 $taxincluded = $form->{taxincluded};
203 $form->{shipto} = 1 if $form->{id};
205 if ($form->{"all_$form->{vc}"}) {
206 unless ($form->{"$form->{vc}_id"}) {
207 $form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id};
211 $cp_id = $form->{cp_id};
212 $intnotes = $form->{intnotes};
214 # get customer / vendor
215 if ($form->{type} =~ /(purchase_order|request_quotation)/) {
216 IR->get_vendor(\%myconfig, \%$form);
218 #quote all_vendor Bug 133
219 foreach $ref (@{ $form->{all_vendor} }) {
220 $ref->{name} = $form->quote($ref->{name});
224 if ($form->{type} =~ /sales_(order|quotation)/) {
225 IS->get_customer(\%myconfig, \%$form);
227 #quote all_vendor Bug 133
228 foreach $ref (@{ $form->{all_customer} }) {
229 $ref->{name} = $form->quote($ref->{name});
233 $form->{cp_id} = $cp_id;
235 $form->{payment_id} = $payment_id;
238 $form->{language_id} = $language_id;
241 $form->{taxzone_id} = $taxzone_id;
243 $form->{intnotes} = $intnotes if $intnotes;
244 ($form->{ $form->{vc} }) = split /--/, $form->{ $form->{vc} };
245 $form->{"old$form->{vc}"} =
246 qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
248 # build the popup menus
249 if (@{ $form->{"all_$form->{vc}"} }) {
250 $form->{ $form->{vc} } =
251 qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
252 map { $form->{"select$form->{vc}"} .=
253 "<option>$_->{name}--$_->{id}</option>\n" }
254 (@{ $form->{"all_$form->{vc}"} });
257 $form->{taxincluded} = $taxincluded if ($form->{id});
260 if (@{ $form->{all_departments} }) {
261 $form->{selectdepartment} = "<option>\n";
262 $form->{department} = "$form->{department}--$form->{department_id}";
265 $form->{selectdepartment} .=
266 "<option>$_->{description}--$_->{id}</option>\n"
267 } (@{ $form->{all_departments} });
270 $form->{employee} = "$form->{employee}--$form->{employee_id}";
273 $form->{forex} = $form->{exchangerate};
275 $form->{salesman_id} = $salesman_id if ($editing);
277 $lxdebug->leave_sub();
281 $lxdebug->enter_sub();
282 $form->{formname} = $form->{type} unless $form->{formname};
285 foreach $ref (@{ $form->{form_details} }) {
286 $form->{rowcount} = ++$i;
288 map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
290 for my $i (1 .. $form->{rowcount}) {
292 $form->{"discount_$i"} =
293 $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
295 $form->{"discount_$i"} =
296 $form->format_amount(\%myconfig, $form->{"discount_$i"});
298 ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
300 $decimalplaces = ($dec > 2) ? $dec : 2;
302 # copy reqdate from deliverydate for invoice -> order conversion
303 $form->{"reqdate_$i"} = $form->{"deliverydate_$i"}
304 unless $form->{"reqdate_$i"};
306 $form->{"sellprice_$i"} =
307 $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
310 (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
311 $dec_qty = length $dec_qty;
313 $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
315 map { $form->{"${_}_$i"} =~ s/\"/"/g }
316 qw(partnumber description unit);
319 $lxdebug->leave_sub();
323 $lxdebug->enter_sub();
325 my $checkedclosed = $form->{"closed"} ? "checked" : "";
326 my $checkeddelivered = $form->{"delivered"} ? "checked" : "";
328 map { $form->{$_} =~ s/\"/"/g }
329 qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname
330 shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact
331 shiptophone shiptofax shiptodepartment_1 shiptodepartment_2);
333 # use JavaScript Calendar or not
334 $form->{jsscript} = $form->{jscalendar};
337 $payment = qq|<option value=""></option>|;
338 foreach $item (@{ $form->{payment_terms} }) {
339 if ($form->{payment_id} eq $item->{id}) {
340 $payment .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
342 $payment .= qq|<option value="$item->{id}">$item->{description}</option>|;
345 if ($form->{jsscript}) {
347 # with JavaScript Calendar
349 <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value="$form->{transdate}" onBlur=\"check_right_date_format(this)\"></td>
350 <td><input type=button name=transdate id="trigger1" value=|
351 . $locale->text('button') . qq|></td>
354 <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value="$form->{reqdate}" onBlur=\"check_right_date_format(this)\"></td>
355 <td width="4"><input type=button name=reqdate name=reqdate id="trigger2" value=|
356 . $locale->text('button') . qq|></td>
361 Form->write_trigger(\%myconfig, "2", "transdate", "BL", "trigger1",
362 "reqdate", "BL", "trigger2");
366 # without JavaScript Calendar
368 <td><input name="transdate" id="transdate" size="11" title="$myconfig{dateformat}" value="$form->{transdate}" onBlur=\"check_right_date_format(this)\"></td>|;
370 <td width="13"><input name="reqdate" id="reqdate" size="11" title="$myconfig{dateformat}" value="$form->{reqdate}" onBlur=\"check_right_date_format(this)\"></td>|;
375 if (($form->{"type"} eq "sales_order") ||
376 ($form->{"type"} eq "purchase_order")) {
378 <input name="delivered" id="delivered" type="checkbox" class="checkbox" value="1" $checkeddelivered>
379 <label for="delivered">| . $locale->text('Delivered') . qq|</label>|);
384 <input name="closed" id="closed" type="checkbox" class="checkbox" value="1" $checkedclosed>
385 <label for="closed">| . $locale->text('Closed') . qq|</label>|);
391 <td colspan=| . (2 * scalar(@tmp)) . qq| align=center>| . join("\n", @tmp) . qq|
397 # set option selected
398 foreach $item ($form->{vc}, currency, department, employee, ($form->{vc} eq "customer" ? customer : vendor)) {
399 $form->{"select$item"} =~ s/ selected//;
400 $form->{"select$item"} =~
401 s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
404 #quote select[customer|vendor] Bug 133
405 $form->{"select$form->{vc}"} = $form->quote($form->{"select$form->{vc}"});
407 #substitute \n and \r to \s (bug 543)
408 $form->{"select$form->{vc}"} =~ s/[\n\r]/ /g;
410 my @old_project_ids = ($form->{"globalproject_id"});
411 map({ push(@old_project_ids, $form->{"project_id_$_"})
412 if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
414 $form->get_lists("contacts" => "ALL_CONTACTS",
415 "shipto" => "ALL_SHIPTO",
416 "projects" => { "key" => "ALL_PROJECTS",
418 "old_id" => \@old_project_ids },
419 "employees" => "ALL_SALESMEN",
420 "taxzones" => "ALL_TAXZONES",
421 "currencies" => "ALL_CURRENCIES");
422 ($form->{vc} eq "customer"
423 ? $form->get_lists("customers" => "ALL_CUSTOMERS")
424 : $form->get_lists("vendors" => "ALL_VENDORS"));
427 my @values = (undef);
428 foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
429 push(@values, $item->{"cp_id"});
430 $labels{$item->{"cp_id"}} = $item->{"cp_name"} .
431 ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
434 NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
435 '-labels' => \%labels, '-default' => $form->{"cp_id"}));
440 foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) {
441 push(@values, $item->{name}.qq|--|.$item->{"id"});
442 $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
446 <th align="right">| . $locale->text(ucfirst($form->{vc})) . qq|</th>
448 (($myconfig{vclimit} == 1 )
449 ? qq|<input type="text" value="$form->{old$form->{vc}}" name="$form->{vc}">|
450 : (NTI($cgi->popup_menu('-name' => "$form->{vc}", '-default' => $form->{"old$form->{vc}"},
451 '-onChange' => 'document.getElementById(\'update_button\').click();',
452 '-values' => \@values, '-labels' => \%labels)))) . qq|
453 </td><input type=hidden name="select$form->{vc}" value="| .
454 Q($form->{"select$form->{vc}"}) . qq|">|;
458 foreach my $item (@{ $form->{"ALL_SHIPTO"} }) {
459 push(@values, $item->{"shipto_id"});
460 $labels{$item->{"shipto_id"}} =
461 $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"};
465 <th align=right>| . $locale->text('Shipping Address') . qq|</th>
467 NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
468 '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
473 foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
474 push(@values, $item->{"id"});
475 $labels{$item->{"id"}} = $item->{"projectnumber"};
477 my $globalprojectnumber =
478 NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
479 '-labels' => \%labels,
480 '-default' => $form->{"globalproject_id"}));
483 if ($form->{type} =~ /^sales_/) {
486 foreach my $item (@{ $form->{ALL_SALESMEN} }) {
487 push(@values, $item->{id});
488 $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
493 <th align="right">| . $locale->text('Salesman') . qq|</th>
495 NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id},
496 '-values' => \@values, '-labels' => \%labels))
503 foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
504 push(@values, $item->{"id"});
505 $labels{$item->{"id"}} = $item->{"name"};
510 <th align="right">| . $locale->text('Employee') . qq|</th>
512 NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee"},
513 '-values' => \@values, '-labels' => \%labels)) . qq|
519 foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
520 push(@values, $item->{"id"});
521 $labels{$item->{"id"}} = $item->{"description"};
526 <th align="right">| . $locale->text('Steuersatz') . qq|</th>
528 NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
529 '-values' => \@values, '-labels' => \%labels)) . qq|
536 foreach my $item (@{ $form->{"ALL_CURRENCIES"} }) {
537 push(@values, $item);
538 $labels{$item} = $item;
541 $form->{currency} = $form->{defaultcurrency} unless $form->{currency};
544 <th align="right">| . $locale->text('Currency') . qq|</th>
546 NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
547 '-values' => \@values, '-labels' => \%labels)) . qq|
552 $form->{exchangerate} =
553 $form->format_amount(\%myconfig, $form->{exchangerate});
555 if (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) {
561 $form->{creditlimit} =
562 $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
563 $form->{creditremaining} =
564 $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
567 <input type=hidden name=forex value=$form->{forex}>
570 if ($form->{currency} ne $form->{defaultcurrency}) {
571 if ($form->{forex}) {
574 . $locale->text('Exchangerate')
575 . qq|</th><td>$form->{exchangerate}</td>
576 <input type=hidden name=exchangerate value=$form->{exchangerate}>
581 . $locale->text('Exchangerate')
582 . qq|</th><td><input name=exchangerate size=10 value=$form->{exchangerate}></td>|;
586 if ($form->{business}) {
589 <th align=right>| . $locale->text('Business') . qq|</th>
590 <td>$form->{business}</td>
591 <th align=right>| . $locale->text('Trade Discount') . qq|</th>
593 . $form->format_amount(\%myconfig, $form->{tradediscount} * 100)
599 if ($form->{max_dunning_level}) {
605 <th align=right>| . $locale->text('Max. Dunning Level') . qq|:</th>
606 <td><b>$form->{max_dunning_level}</b></td>
607 <th align=right>| . $locale->text('Dunning Amount') . qq|:</th>
609 . $form->format_amount(\%myconfig, $form->{dunning_amount},2)
618 if ($form->{type} !~ /_quotation$/) {
621 <th width=70% align=right nowrap>| . $locale->text('Order Number') . qq|</th>
622 <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
625 <th width=70% align=right nowrap>|
626 . $locale->text('Quotation Number') . qq|</th>
627 <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
630 <th width=70% align=right nowrap>|
631 . $locale->text('Customer Order Number') . qq|</th>
632 <td><input name=cusordnumber size=11 value="$form->{cusordnumber}"></td>
635 <th align=right nowrap>| . $locale->text('Order Date') . qq|</th>
640 <th align=right nowrap=true>| . $locale->text('Required by') . qq|</th>
645 $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
647 $creditremaining = qq|
653 <th nowrap>| . $locale->text('Credit Limit') . qq|</th>
654 <td>$form->{creditlimit}</td>
656 <th nowrap>| . $locale->text('Remaining') . qq|</th>
657 <td class="plus$n" nowrap>$form->{creditremaining}</td>
666 ($form->{type} eq 'sales_quotation')
667 ? $locale->text('Valid until')
668 : $locale->text('Required by');
669 if ($form->{type} eq 'sales_quotation') {
672 <th width=70% align=right nowrap>|
673 . $locale->text('Quotation Number') . qq|</th>
674 <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
675 <input type=hidden name=ordnumber value="$form->{ordnumber}">
681 <th width=70% align=right nowrap>| . $locale->text('RFQ Number') . qq|</th>
682 <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
683 <input type=hidden name=ordnumber value="$form->{ordnumber}">
691 <th align=right nowrap>| . $locale->text('Quotation Date') . qq|</th>
695 <th align=right nowrap=true>$reqlabel</th>
699 $creditremaining = qq| <tr>
707 <th align="right" nowrap>| . $locale->text('Department') . qq|</th>
708 <td colspan=3><select name=department>$form->{selectdepartment}</select>
709 <input type=hidden name=selectdepartment value="$form->{selectdepartment}">
711 </tr> | if $form->{selectdepartment};
713 if ($form->{type} eq 'sales_order') {
714 if ($form->{selectemployee}) {
716 <input type=hidden name=customer_klass value=$form->{customer_klass}>
722 <input type=hidden name=customer_klass value=$form->{customer_klass}>
726 if ($form->{resubmit} && ($form->{format} eq "html")) {
728 qq|window.open('about:blank','Beleg'); document.oe.target = 'Beleg';document.oe.submit()|;
729 } elsif ($form->{resubmit}) {
730 $onload = qq|document.oe.submit()|;
735 $credittext = $locale->text('Credit Limit exceeded!!!');
736 if ($creditwarning) {
737 $onload = qq|alert('$credittext')|;
740 $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
741 $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
743 $form->{"javascript"} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|;
744 # show history button js
745 $form->{javascript} .= qq|<script type="text/javascript" src="js/show_history.js"></script>|;
746 #/show history button js
750 <body onLoad="$onload">
752 <form method=post name=oe action=$form->{script}>
753 <script type="text/javascript" src="js/common.js"></script>
754 <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
755 <script type="text/javascript" src="js/vendor_selection.js"></script>
756 <script type="text/javascript" src="js/calculate_qty.js"></script>
758 <input type=hidden name=id value=$form->{id}>
759 <input type=hidden name=action value=$form->{action}>
761 <input type=hidden name=type value=$form->{type}>
762 <input type=hidden name=formname value=$form->{formname}>
763 <input type=hidden name=media value=$form->{media}>
764 <input type=hidden name=format value=$form->{format}>
765 <input type=hidden name=proforma value=$form->{proforma}>
767 <input type=hidden name=queued value="$form->{queued}">
768 <input type=hidden name=printed value="$form->{printed}">
769 <input type=hidden name=emailed value="$form->{emailed}">
771 <input type=hidden name=vc value=$form->{vc}>
773 <input type=hidden name=title value="$form->{title}">
775 <input type=hidden name=discount value=$form->{discount}>
776 <input type=hidden name=creditlimit value=$form->{creditlimit}>
777 <input type=hidden name=creditremaining value=$form->{creditremaining}>
779 <input type=hidden name=tradediscount value=$form->{tradediscount}>
780 <input type=hidden name=business value=$form->{business}>
781 <input type=hidden name=webdav value=$webdav>
785 <th class=listtop>$form->{title}</th>
796 <th align=richt nowrap>|
797 . $locale->text('Contact Person') . qq|</th>
798 <td colspan=3>$contact</td>
810 <th align=right>| . $locale->text('Shipping Point') . qq|</th>
811 <td colspan=3><input name=shippingpoint size=35 value="$form->{shippingpoint}"></td>
814 <th align=right>| . $locale->text('Ship via') . qq|</th>
815 <td colspan=3><input name=shipvia size=35 value="$form->{shipvia}"></td>
818 <th align="right">| . $locale->text('Transaction description') . qq|</th>
819 <td colspan="3"><input name="transaction_description" size="35" value="| . H($form->{transaction_description}) . qq|"></td>
826 # <button type="button" onclick="delivery_customer_selection_window('delivery_customer_string','delivery_customer_id')">| . $locale->text('Choose Customer') . qq|</button>
828 # <td colspan=2><input type=hidden name=delivery_customer_id value="$form->{delivery_customer_id}">
829 # <input size=45 id=delivery_customer_string name=delivery_customer_string value="$form->{delivery_customer_string}"></td>
833 # <button type="button" onclick="vendor_selection_window('delivery_vendor_string','delivery_vendor_id')">| . $locale->text('Choose Vendor') . qq|</button>
835 # <td colspan=2><input type=hidden name=delivery_vendor_id value="$form->{delivery_vendor_id}">
836 # <input size=45 id=vendor_string name=delivery_vendor_string value="$form->{delivery_vendor_string}"></td>
850 <th width="70%" align="right" nowrap>| . $locale->text('Project Number') . qq|</th>
851 <td>$globalprojectnumber</td>
862 <!-- shipto are in hidden variables -->
864 <input type=hidden name=shiptoname value="$form->{shiptoname}">
865 <input type=hidden name=shiptostreet value="$form->{shiptostreet}">
866 <input type=hidden name=shiptozipcode value="$form->{shiptozipcode}">
867 <input type=hidden name=shiptocity value="$form->{shiptocity}">
868 <input type=hidden name=shiptocountry value="$form->{shiptocountry}">
869 <input type=hidden name=shiptocontact value="$form->{shiptocontact}">
870 <input type=hidden name=shiptophone value="$form->{shiptophone}">
871 <input type=hidden name=shiptofax value="$form->{shiptofax}">
872 <input type=hidden name=shiptodepartment_1 value="$form->{shiptodepartment_1}">
873 <input type=hidden name=shiptodepartment_2 value="$form->{shiptodepartment_2}">
874 <input type=hidden name=shiptoemail value="$form->{shiptoemail}">
876 <!-- email variables -->
877 <input type=hidden name=message value="$form->{message}">
878 <input type=hidden name=email value="$form->{email}">
879 <input type=hidden name=subject value="$form->{subject}">
880 <input type=hidden name=cc value="$form->{cc}">
881 <input type=hidden name=bcc value="$form->{bcc}">
883 <input type=hidden name=taxpart value="$form->{taxpart}">
884 <input type=hidden name=taxservice value="$form->{taxservice}">
886 <input type=hidden name=taxaccounts value="$form->{taxaccounts}">
889 foreach $item (split / /, $form->{taxaccounts}) {
891 <input type=hidden name="${item}_rate" value=$form->{"${item}_rate"}>
892 <input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
895 $lxdebug->leave_sub();
899 $lxdebug->enter_sub();
901 $form->{invtotal} = $form->{invsubtotal};
903 if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
906 if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) {
909 $rows = ($rows > $introws) ? $rows : $introws;
911 qq|<textarea name=notes rows=$rows cols=25 wrap=soft>$form->{notes}</textarea>|;
913 qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</textarea>|;
915 $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
918 if ($form->{taxaccounts}) {
920 <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|
921 . $locale->text('Tax Included') . qq|</b><br><br>
925 if (!$form->{taxincluded}) {
927 foreach $item (split / /, $form->{taxaccounts}) {
928 if ($form->{"${item}_base"}) {
929 $form->{invtotal} += $form->{"${item}_total"} =
931 $form->{"${item}_base"} * $form->{"${item}_rate"},
933 $form->{"${item}_total"} =
934 $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
938 <th align=right>$form->{"${item}_description"} |
939 . $form->{"${item}_rate"} * 100 .qq|%</th>
940 <td align=right>$form->{"${item}_total"}</td>
946 $form->{invsubtotal} =
947 $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
951 <th align=right>| . $locale->text('Subtotal') . qq|</th>
952 <td align=right>$form->{invsubtotal}</td>
958 if ($form->{taxincluded}) {
959 foreach $item (split / /, $form->{taxaccounts}) {
960 if ($form->{"${item}_base"}) {
961 $form->{"${item}_total"} =
963 ($form->{"${item}_base"} * $form->{"${item}_rate"} /
964 (1 + $form->{"${item}_rate"})
967 $form->{"${item}_netto"} =
969 ($form->{"${item}_base"} - $form->{"${item}_total"}),
971 $form->{"${item}_total"} =
972 $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
973 $form->{"${item}_netto"} =
974 $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2);
978 <th align=right>Enthaltene $form->{"${item}_description"} |
979 . $form->{"${item}_rate"} * 100 .qq|%</th>
980 <td align=right>$form->{"${item}_total"}</td>
983 <th align=right>Nettobetrag</th>
984 <td align=right>$form->{"${item}_netto"}</td>
992 $form->{oldinvtotal} = $form->{invtotal};
994 $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
1004 <th align=left>| . $locale->text('Notes') . qq|</th>
1005 <th align=left>| . $locale->text('Internal Notes') . qq|</th>
1011 <th align=right>| . $locale->text('Payment Terms') . qq|</th>
1012 <td><select name=payment_id>$payment
1016 <td align=right width=100%>
1022 <th align=right>| . $locale->text('Total') . qq|</th>
1023 <td align=right>$form->{invtotal}</td>
1031 <input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
1032 <input type=hidden name=oldtotalpaid value=$totalpaid>
1034 <td><hr size=3 noshade></td>
1042 <th class=listtop align=left>Dokumente im Webdav-Repository</th>
1045 <td align=left width=30%><b>Dateiname</b></td>
1046 <td align=left width=70%><b>Webdavlink</b></td>
1048 foreach $file (keys %{ $form->{WEBDAV} }) {
1051 <td align=left>$file</td>
1052 <td align=left><a href="$form->{WEBDAV}{$file}">$form->{WEBDAV}{$file}</a></td>
1060 <td><hr size=3 noshade></td>
1067 <input type=hidden name=jscalendar value=$form->{jscalendar}>
1080 | . $locale->text("Edit the $form->{type}") . qq|<br>
1081 <input class=submit type=submit name=action id=update_button value="|
1082 . $locale->text('Update') . qq|">
1083 <input class=submit type=submit name=action value="|
1084 . $locale->text('Ship to') . qq|">
1085 <input class=submit type=submit name=action value="|
1086 . $locale->text('Print') . qq|">
1087 <input class=submit type=submit name=action value="|
1088 . $locale->text('E-mail') . qq|">
1089 <input class=submit type=submit name=action value="|
1090 . $locale->text('Save') . qq|">
1091 <input class=submit type=submit name=action value="|
1092 . $locale->text('Save and Close') . qq|">
1095 if (($form->{id})) {
1097 <input type="button" class="submit" onclick="set_history_window(|
1099 . qq|);" name="history" id="history" value="|
1100 . $locale->text('history')
1103 <br>| . $locale->text("Workflow $form->{type}") . qq|<br>
1104 <input class=submit type=submit name=action value="|
1105 . $locale->text('Save as new') . qq|">
1106 <input class=submit type=submit name=action value="|
1107 . $locale->text('Delete') . qq|">|;
1108 if (($form->{type} =~ /sales_quotation$/)) {
1110 <input class=submit type=submit name=action value="|
1111 . $locale->text('Sales Order') . qq|">|;
1113 if ($form->{type} =~ /request_quotation$/) {
1115 <input class=submit type=submit name=action value="|
1116 . $locale->text('Purchase Order') . qq|">|;
1120 <input class=submit type=submit name=action value="|
1121 . $locale->text('Invoice') . qq|">
1125 if ($form->{type} =~ /sales_order$/) {
1127 <br>$form->{heading} als neue Vorlage verwenden für<br>
1128 <input class=submit type=submit name=action value="|
1129 . $locale->text('Purchase Order') . qq|">
1130 <input class=submit type=submit name=action value="|
1131 . $locale->text('Quotation') . qq|">
1134 } elsif ($form->{type} =~ /purchase_order$/) {
1136 <br>$form->{heading} als neue Vorlage verwenden für<br>
1137 <input class=submit type=submit name=action value="|
1138 . $locale->text('Sales Order') . qq|">
1139 <input class=submit type=submit name=action value="|
1140 . $locale->text('Request for Quotation') . qq|">
1145 <br>$form->{heading} als neue Vorlage verwenden für<br>
1146 <input class=submit type=submit name=action value="|
1147 . $locale->text('Order') . qq|">
1150 } elsif ($form->{type} =~ /sales_order$/ && $form->{rowcount} && !$form->{proforma}) {
1152 <br>Workflow $form->{heading}<br>
1153 <input class=submit type=submit name=action value="|
1154 . $locale->text('Save as new') . qq|">
1155 <input class=submit type=submit name=action value="|
1156 . $locale->text('Invoice') . qq|">
1160 $form->hide_form("saved_xyznumber");
1164 <input type=hidden name=rowcount value=$form->{rowcount}>
1166 <input name=callback type=hidden value="$form->{callback}">
1168 <input type=hidden name=login value=$form->{login}>
1169 <input type=hidden name=password value=$form->{password}>
1176 $lxdebug->leave_sub();
1180 $lxdebug->enter_sub();
1182 set_headings($form->{"id"} ? "edit" : "add");
1184 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
1185 qw(exchangerate creditlimit creditremaining);
1186 $form->{update} = 1;
1188 &check_name($form->{vc});
1191 $buysell = 'sell' if ($form->{vc} eq 'vendor');
1192 $form->{exchangerate} = $exchangerate
1196 $form->check_exchangerate(
1197 \%myconfig, $form->{currency}, $form->{transdate}, $buysell
1201 $i = $form->{rowcount};
1203 $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
1205 if ( ($form->{"partnumber_$i"} eq "")
1206 && ($form->{"description_$i"} eq "")
1207 && ($form->{"partsgroup_$i"} eq "")) {
1209 $form->{creditremaining} += ($form->{oldinvtotal} - $form->{oldtotalpaid});
1214 if ( $form->{type} eq 'purchase_order'
1215 || $form->{type} eq 'request_quotation') {
1216 IR->retrieve_item(\%myconfig, \%$form);
1218 if ($form->{type} eq 'sales_order' || $form->{type} eq 'sales_quotation') {
1219 IS->retrieve_item(\%myconfig, \%$form);
1222 my $rows = scalar @{ $form->{item_list} };
1224 $form->{"discount_$i"} =
1225 $form->format_amount(\%myconfig, $form->{discount} * 100);
1228 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
1237 $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
1238 if ($form->{"not_discountable_$i"}) {
1239 $form->{"discount_$i"} = 0;
1241 map { $form->{item_list}[$i]{$_} =~ s/\"/"/g }
1242 qw(partnumber description unit);
1243 map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} }
1244 keys %{ $form->{item_list}[0] };
1245 if ($form->{"part_payment_id_$i"} ne "") {
1246 $form->{payment_id} = $form->{"part_payment_id_$i"};
1249 $s = ($sellprice) ? $sellprice : $form->{"sellprice_$i"};
1251 ($dec) = ($s =~ /\.(\d+)/);
1253 $decimalplaces = ($dec > 2) ? $dec : 2;
1256 $form->{"sellprice_$i"} = $sellprice;
1259 $form->{"sellprice_$i"} *= (1 - $form->{tradediscount});
1261 # if there is an exchange rate adjust sellprice
1262 $form->{"sellprice_$i"} /= $exchangerate;
1266 $form->{"sellprice_$i"} * $form->{"qty_$i"} *
1267 (1 - $form->{"discount_$i"} / 100);
1268 map { $form->{"${_}_base"} = 0 } (split / /, $form->{taxaccounts});
1269 map { $form->{"${_}_base"} += $amount }
1270 (split / /, $form->{"taxaccounts_$i"});
1271 map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) }
1272 split / /, $form->{taxaccounts}
1273 if !$form->{taxincluded};
1275 $form->{creditremaining} -= $amount;
1277 $form->{"sellprice_$i"} =
1278 $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
1281 $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
1283 # get pricegroups for parts
1284 IS->get_pricegroups_for_parts(\%myconfig, \%$form);
1286 # build up html code for prices_$i
1287 &set_pricegroup($i);
1294 # ok, so this is a new part
1295 # ask if it is a part or service item
1297 if ( $form->{"partsgroup_$i"}
1298 && ($form->{"partsnumber_$i"} eq "")
1299 && ($form->{"description_$i"} eq "")) {
1300 $form->{rowcount}--;
1301 $form->{"discount_$i"} = "";
1305 $form->{"id_$i"} = 0;
1306 $form->{"unit_$i"} = $locale->text('ea');
1314 $lxdebug->leave_sub();
1318 $lxdebug->enter_sub();
1320 if ($form->{type} eq 'purchase_order') {
1321 $form->{title} = $locale->text('Purchase Orders');
1322 $form->{vc} = 'vendor';
1323 $ordlabel = $locale->text('Order Number');
1324 $ordnumber = 'ordnumber';
1325 $employee = $locale->text('Employee');
1328 if ($form->{type} eq 'request_quotation') {
1329 $form->{title} = $locale->text('Request for Quotations');
1330 $form->{vc} = 'vendor';
1331 $ordlabel = $locale->text('RFQ Number');
1332 $ordnumber = 'quonumber';
1333 $employee = $locale->text('Employee');
1336 if ($form->{type} eq 'sales_order') {
1337 $form->{title} = $locale->text('Sales Orders');
1338 $form->{vc} = 'customer';
1339 $ordlabel = $locale->text('Order Number');
1340 $ordnumber = 'ordnumber';
1341 $employee = $locale->text('Employee');
1344 if ($form->{type} eq 'sales_quotation') {
1345 $form->{title} = $locale->text('Quotations');
1346 $form->{vc} = 'customer';
1347 $ordlabel = $locale->text('Quotation Number');
1348 $ordnumber = 'quonumber';
1349 $employee = $locale->text('Employee');
1352 # setup vendor / customer selection
1353 $form->all_vc(\%myconfig, $form->{vc},
1354 ($form->{vc} eq 'customer') ? "AR" : "AP");
1357 if (@{ $form->{all_departments} }) {
1358 $form->{selectdepartment} = "<option>\n";
1361 $form->{selectdepartment} .=
1362 "<option>$_->{description}--$_->{id}</option>\n"
1363 } (@{ $form->{all_departments} });
1368 <th align=right nowrap>| . $locale->text('Department') . qq|</th>
1369 <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
1371 | if $form->{selectdepartment};
1374 if (($form->{"type"} eq "sales_order") ||
1375 ($form->{"type"} eq "purchase_order")) {
1378 <td><input name="notdelivered" id="notdelivered" class="checkbox" type="checkbox" value="1" checked>
1379 <label for="notdelivered">|. $locale->text('Not delivered') . qq|</label></td>
1380 <td><input name="delivered" id="delivered" class="checkbox" type="checkbox" value="1" checked>
1381 <label for="delivered">| . $locale->text('Delivered') . qq|</label></td>
1386 # use JavaScript Calendar or not
1387 $form->{jsscript} = $jscalendar;
1389 if ($form->{jsscript}) {
1391 # with JavaScript Calendar
1393 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
1394 <input type=button name=transdatefrom id="trigger3" value=|
1395 . $locale->text('button') . qq|></td>
1398 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
1399 <input type=button name=transdateto name=transdateto id="trigger4" value=|
1400 . $locale->text('button') . qq|></td>
1405 Form->write_trigger(\%myconfig, "2", "transdatefrom", "BR", "trigger3",
1406 "transdateto", "BL", "trigger4");
1409 # without JavaScript Calendar
1411 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
1413 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\></td>|;
1416 $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
1421 foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
1422 push(@values, $item->{"id"});
1423 $labels{$item->{"id"}} = $item->{"projectnumber"};
1426 NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
1427 '-labels' => \%labels));
1434 <form method=post action=$form->{script}>
1438 <th class=listtop>$form->{title}</th>
1440 <tr height="5"></tr>
1449 <th align=right>$ordlabel</th>
1450 <td colspan=3><input name="$ordnumber" size=20></td>
1453 <th align="right">| . $locale->text('Transaction description') . qq|</th>
1454 <td colspan="3"><input name="transaction_description" size=20></td>
1457 <th align="right">| . $locale->text("Project Number") . qq|</th>
1458 <td colspan="3">$projectnumber</td>
1461 <th align=right>| . $locale->text('From') . qq|</th>
1463 <th align=right>| . $locale->text('Bis') . qq|</th>
1466 <input type=hidden name=sort value=transdate>
1468 <th align=right>| . $locale->text('Include in Report') . qq|</th>
1472 <td><input type="checkbox" name="open" value="1" id="open" checked>
1473 <label for="open">| . $locale->text("Open") . qq|</td>
1474 <td><input type="checkbox" name="closed" value="1" id="closed">
1475 <label for="closed">| . $locale->text("Closed") . qq|</td>
1479 <td><input name="l_id" class=checkbox type=checkbox value=Y>
1480 | . $locale->text('ID') . qq|</td>
1481 <td><input name="l_$ordnumber" class=checkbox type=checkbox value=Y checked> $ordlabel</td>
1482 <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked> |
1483 . $locale->text('Date') . qq|</td>
1484 <td><input name="l_reqdate" class=checkbox type=checkbox value=Y checked> |
1485 . $locale->text('Required by') . qq|</td>
1488 <td><input name="l_name" class=checkbox type=checkbox value=Y checked> ucfirst($form->{vc})</td>
1489 <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
1490 <td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
1491 . $locale->text('Ship via') . qq|</td>
1492 <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
1495 <td><input name="l_netamount" class=checkbox type=checkbox value=Y> |
1496 . $locale->text('Amount') . qq|</td>
1497 <td><input name="l_tax" class=checkbox type=checkbox value=Y> |
1498 . $locale->text('Tax') . qq|</td>
1499 <td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |
1500 . $locale->text('Total') . qq|</td>
1503 <td><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y> |
1504 . $locale->text('Project Number') . qq|</td>
1505 <td><input name="l_transaction_description" class=checkbox type=checkbox value=Y> |
1506 . $locale->text('Transaction description') . qq|</td>
1509 <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |
1510 . $locale->text('Subtotal') . qq|</td>
1518 <tr><td colspan=4><hr size=3 noshade></td></tr>
1524 <input type=hidden name=nextsub value=orders>
1525 <input type=hidden name=login value=$form->{login}>
1526 <input type=hidden name=password value=$form->{password}>
1527 <input type=hidden name=vc value=$form->{vc}>
1528 <input type=hidden name=type value=$form->{type}>
1530 <input class=submit type=submit name=action value="|
1531 . $locale->text('Continue') . qq|">
1538 $lxdebug->leave_sub();
1542 $lxdebug->enter_sub();
1544 # split vendor / customer
1545 ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) =
1546 split(/--/, $form->{ $form->{vc} });
1548 OE->transactions(\%myconfig, \%$form);
1550 $ordnumber = ($form->{type} =~ /_order$/) ? "ordnumber" : "quonumber";
1554 qw(type vc login password transdatefrom transdateto
1555 open closed notdelivered delivered department
1556 transaction_description);
1557 $href = "$form->{script}?action=orders&"
1558 . join("&", map { "${_}=" . E($form->{$_}) } @fields)
1559 . "&${ordnumber}=" . E($form->{$ordnumber});
1563 "transdate", "reqdate",
1565 "name", "netamount",
1568 "shipvia", "globalprojectnumber",
1569 "transaction_description", "open",
1570 "closed", "delivered"
1573 $form->{l_open} = $form->{l_closed} = "Y"
1574 if ($form->{open} && $form->{closed});
1576 $form->{"l_delivered"} = "Y"
1577 if ($form->{"delivered"} && $form->{"notdelivered"});
1579 foreach $item (@columns) {
1580 if ($form->{"l_$item"} eq "Y") {
1581 push @column_index, $item;
1583 # add column to href and callback
1584 $callback .= "&l_$item=Y";
1585 $href .= "&l_$item=Y";
1589 # only show checkboxes if gotten here via sales_order form.
1590 if ($form->{type} =~ /sales_order/) {
1591 unshift @column_index, "ids";
1594 if ($form->{l_subtotal} eq 'Y') {
1595 $callback .= "&l_subtotal=Y";
1596 $href .= "&l_subtotal=Y";
1599 if ($form->{vc} eq 'vendor') {
1600 if ($form->{type} eq 'purchase_order') {
1601 $form->{title} = $locale->text('Purchase Orders');
1603 $form->{title} = $locale->text('Request for Quotations');
1605 $name = $locale->text('Vendor');
1606 $employee = $locale->text('Employee');
1608 if ($form->{vc} eq 'customer') {
1609 if ($form->{type} eq 'sales_order') {
1610 $form->{title} = $locale->text('Sales Orders');
1612 $form->{title} = $locale->text('Quotations');
1614 $employee = $locale->text('Employee');
1615 $name = $locale->text('Customer');
1618 $column_header{id} =
1619 qq|<th><a class=listheading href=$href&sort=id>|
1620 . $locale->text('ID')
1622 $column_header{transdate} =
1623 qq|<th><a class=listheading href=$href&sort=transdate>|
1624 . $locale->text('Date')
1626 $column_header{reqdate} =
1627 qq|<th><a class=listheading href=$href&sort=reqdate>|
1628 . $locale->text('Required by')
1630 $column_header{ordnumber} =
1631 qq|<th><a class=listheading href=$href&sort=ordnumber>|
1632 . $locale->text('Order')
1634 $column_header{quonumber} =
1635 qq|<th><a class=listheading href=$href&sort=quonumber>|
1636 . ($form->{"type"} eq "request_quotation" ?
1637 $locale->text('RFQ') :
1638 $locale->text('Quotation'))
1640 $column_header{name} =
1641 qq|<th><a class=listheading href=$href&sort=name>$name</a></th>|;
1642 $column_header{netamount} =
1643 qq|<th class=listheading>| . $locale->text('Amount') . qq|</th>|;
1644 $column_header{tax} =
1645 qq|<th class=listheading>| . $locale->text('Tax') . qq|</th>|;
1646 $column_header{amount} =
1647 qq|<th class=listheading>| . $locale->text('Total') . qq|</th>|;
1648 $column_header{curr} =
1649 qq|<th class=listheading>| . $locale->text('Curr') . qq|</th>|;
1650 $column_header{shipvia} =
1651 qq|<th><a class=listheading href=$href&sort=shipvia>|
1652 . $locale->text('Ship via')
1654 $column_header{globalprojectnumber} =
1655 qq|<th class="listheading">| . $locale->text('Project Number') . qq|</th>|;
1656 $column_header{open} =
1657 qq|<th class=listheading>| . $locale->text('O') . qq|</th>|;
1658 $column_header{closed} =
1659 qq|<th class=listheading>| . $locale->text('C') . qq|</th>|;
1660 $column_header{"delivered"} =
1661 qq|<th class="listheading">| . $locale->text("Delivered") . qq|</th>|;
1663 $column_header{employee} =
1664 qq|<th><a class=listheading href=$href&sort=employee>$employee</a></th>|;
1665 $column_header{transaction_description} =
1666 qq|<th><a class=listheading href="$href&sort=transaction_description">|
1667 . $locale->text("Transaction description") . qq|</a></th>|;
1669 $column_header{ids} = qq|<th></th>|;
1671 if ($form->{ $form->{vc} }) {
1672 $option = $locale->text(ucfirst $form->{vc});
1673 $option .= " : $form->{$form->{vc}}";
1675 if ($form->{department}) {
1676 $option .= "\n<br>" if ($option);
1677 ($department) = split /--/, $form->{department};
1678 $option .= $locale->text('Department') . " : $department";
1680 if ($form->{transdatefrom}) {
1682 . $locale->text('From') . " "
1683 . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
1685 if ($form->{transdateto}) {
1687 . $locale->text('Bis') . " "
1688 . $locale->date(\%myconfig, $form->{transdateto}, 1);
1690 if ($form->{open}) {
1691 $option .= "\n<br>" if ($option);
1692 $option .= $locale->text('Open');
1694 if ($form->{closed}) {
1695 $option .= "\n<br>" if ($option);
1696 $option .= $locale->text('Closed');
1704 <form method="post" action="oe.pl">
1707 <th class=listtop>$form->{title}</th>
1709 <tr height="5"></tr>
1716 <tr class=listheading>|;
1718 map { print "\n$column_header{$_}" } @column_index;
1724 # add sort and escape callback
1725 $callback_escaped = $form->escape($callback . "&sort=$form->{sort}");
1727 if (@{ $form->{OE} }) {
1728 $sameitem = $form->{OE}->[0]->{ $form->{sort} };
1733 foreach $oe (@{ $form->{OE} }) {
1734 $form->{rowcount} = ++$j;
1736 if ($form->{l_subtotal} eq 'Y') {
1737 if ($sameitem ne $oe->{ $form->{sort} }) {
1739 $sameitem = $oe->{ $form->{sort} };
1743 map { $oe->{$_} *= $oe->{exchangerate} } (qw(netamount amount));
1745 $column_data{netamount} =
1747 . $form->format_amount(\%myconfig, $oe->{netamount}, 2, " ")
1749 $column_data{tax} = "<td align=right>"
1750 . $form->format_amount(\%myconfig, $oe->{amount} - $oe->{netamount},
1753 $column_data{amount} =
1755 . $form->format_amount(\%myconfig, $oe->{amount}, 2, " ") . "</td>";
1757 $totalnetamount += $oe->{netamount};
1758 $totalamount += $oe->{amount};
1760 $subtotalnetamount += $oe->{netamount};
1761 $subtotalamount += $oe->{amount};
1764 qq|<td><input name="multi_id_$j" class=checkbox type=checkbox><input type="hidden" name="trans_id_$j" value="$oe->{id}"></td>|;
1765 $column_data{id} = "<td>$oe->{id}</td>";
1766 $column_data{transdate} = "<td>$oe->{transdate} </td>";
1767 $column_data{reqdate} = "<td>$oe->{reqdate} </td>";
1769 $column_data{$ordnumber} =
1770 "<td><a href=oe.pl?action=$action&type=$form->{type}&id=$oe->{id}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}</a></td>";
1771 $column_data{name} = "<td>$oe->{name}</td>";
1773 $column_data{employee} = "<td>$oe->{employee} </td>";
1774 $column_data{shipvia} = "<td>$oe->{shipvia} </td>";
1775 $column_data{globalprojectnumber} = "<td>" . H($oe->{globalprojectnumber}) . "</td>";
1777 if ($oe->{closed}) {
1778 $column_data{closed} = "<td align=center>X</td>";
1779 $column_data{open} = "<td> </td>";
1781 $column_data{closed} = "<td> </td>";
1782 $column_data{open} = "<td align=center>X</td>";
1784 $column_data{"delivered"} = "<td>" .
1785 ($oe->{"delivered"} ? $locale->text("Yes") : $locale->text("No")) .
1787 $column_data{transaction_description} = "<td>" . H($oe->{transaction_description}) . "</td>";
1792 <tr class=listrow$i>";
1794 map { print "\n$column_data{$_}" } @column_index;
1802 if ($form->{l_subtotal} eq 'Y') {
1808 <tr class=listtotal>|;
1810 map { $column_data{$_} = "<td> </td>" } @column_index;
1812 $column_data{netamount} =
1813 "<th class=listtotal align=right>"
1814 . $form->format_amount(\%myconfig, $totalnetamount, 2, " ") . "</th>";
1815 $column_data{tax} = "<th class=listtotal align=right>"
1816 . $form->format_amount(\%myconfig, $totalamount - $totalnetamount,
1819 $column_data{amount} =
1820 "<th class=listtotal align=right>"
1821 . $form->format_amount(\%myconfig, $totalamount, 2, " ") . "</th>";
1823 map { print "\n$column_data{$_}" } @column_index;
1831 <td><hr size=3 noshade></td>
1835 # multiple invoice edit button only if gotten there via sales_order form.
1837 if ($form->{type} =~ /sales_order/) {
1839 <input class"submit" type="submit" name="action" value="|
1840 . $locale->text('Continue') . qq|">
1841 <input type="hidden" name="nextsub" value="edit">
1842 <input type="hidden" name="type" value="$form->{type}">
1843 <input type="hidden" name="vc" value="$form->{vc}">
1844 <input type="hidden" name="login" value="$form->{login}">
1845 <input type="hidden" name="password" value="$form->{password}">
1846 <input type="hidden" name="callback" value="$callback">
1847 <input type="hidden" name="rowcount" value="$form->{rowcount}">|;
1854 <form method=post action=$form->{script}>
1856 <input name=callback type=hidden value="$form->{callback}">
1858 <input type=hidden name=type value=$form->{type}>
1859 <input type=hidden name=vc value=$form->{vc}>
1861 <input type=hidden name=login value=$form->{login}>
1862 <input type=hidden name=password value=$form->{password}>
1870 $lxdebug->leave_sub();
1874 $lxdebug->enter_sub();
1876 map { $column_data{$_} = "<td> </td>" } @column_index;
1878 $column_data{netamount} =
1879 "<th class=listsubtotal align=right>"
1880 . $form->format_amount(\%myconfig, $subtotalnetamount, 2, " ")
1882 $column_data{tax} = "<td class=listsubtotal align=right>"
1883 . $form->format_amount(\%myconfig, $subtotalamount - $subtotalnetamount,
1886 $column_data{amount} =
1887 "<th class=listsubtotal align=right>"
1888 . $form->format_amount(\%myconfig, $subtotalamount, 2, " ") . "</th>";
1890 $subtotalnetamount = 0;
1891 $subtotalamount = 0;
1894 <tr class=listsubtotal>
1897 map { print "\n$column_data{$_}" } @column_index;
1903 $lxdebug->leave_sub();
1906 sub save_and_close {
1907 $lxdebug->enter_sub();
1909 if ($form->{type} =~ /_order$/) {
1910 $form->isblank("transdate", $locale->text('Order Date missing!'));
1912 $form->isblank("transdate", $locale->text('Quotation Date missing!'));
1915 $msg = ucfirst $form->{vc};
1916 $form->isblank($form->{vc}, $locale->text($msg . " missing!"));
1918 # $locale->text('Customer missing!');
1919 # $locale->text('Vendor missing!');
1921 $form->isblank("exchangerate", $locale->text('Exchangerate missing!'))
1922 if ($form->{currency} ne $form->{defaultcurrency});
1926 # if the name changed get new values
1927 if (&check_name($form->{vc})) {
1932 $form->{id} = 0 if $form->{saveasnew};
1934 # this is for the internal notes section for the [email] Subject
1935 if ($form->{type} =~ /_order$/) {
1936 if ($form->{type} eq 'sales_order') {
1937 $form->{label} = $locale->text('Sales Order');
1939 $numberfld = "sonumber";
1940 $ordnumber = "ordnumber";
1942 $form->{label} = $locale->text('Purchase Order');
1944 $numberfld = "ponumber";
1945 $ordnumber = "ordnumber";
1948 $err = $locale->text('Cannot save order!');
1951 if ($form->{type} eq 'sales_quotation') {
1952 $form->{label} = $locale->text('Quotation');
1954 $numberfld = "sqnumber";
1955 $ordnumber = "quonumber";
1957 $form->{label} = $locale->text('Request for Quotation');
1959 $numberfld = "rfqnumber";
1960 $ordnumber = "quonumber";
1963 $err = $locale->text('Cannot save quotation!');
1967 # get new number in sequence if no number is given or if saveasnew was requested
1968 if (!$form->{$ordnumber} || $form->{saveasnew}) {
1969 $form->{$ordnumber} = $form->update_defaults(\%myconfig, $numberfld);
1974 $form->error($err) if (!OE->save(\%myconfig, \%$form));
1976 # saving the history
1977 if(!exists $form->{addition}) {
1978 $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
1979 $form->{addition} = "SAVED";
1980 $form->save_history($form->dbconnect(\%myconfig));
1982 # /saving the history
1984 $form->redirect($form->{label} . " $form->{$ordnumber} " .
1985 $locale->text('saved!'));
1987 $lxdebug->leave_sub();
1991 $lxdebug->enter_sub();
1993 if ($form->{type} =~ /_order$/) {
1994 $form->isblank("transdate", $locale->text('Order Date missing!'));
1996 $form->isblank("transdate", $locale->text('Quotation Date missing!'));
1999 $msg = ucfirst $form->{vc};
2000 $form->isblank($form->{vc}, $locale->text($msg . " missing!"));
2002 # $locale->text('Customer missing!');
2003 # $locale->text('Vendor missing!');
2005 $form->isblank("exchangerate", $locale->text('Exchangerate missing!'))
2006 if ($form->{currency} ne $form->{defaultcurrency});
2010 # if the name changed get new values
2011 if (&check_name($form->{vc})) {
2016 $form->{id} = 0 if $form->{saveasnew};
2018 # this is for the internal notes section for the [email] Subject
2019 if ($form->{type} =~ /_order$/) {
2020 if ($form->{type} eq 'sales_order') {
2021 $form->{label} = $locale->text('Sales Order');
2023 $numberfld = "sonumber";
2024 $ordnumber = "ordnumber";
2026 $form->{label} = $locale->text('Purchase Order');
2028 $numberfld = "ponumber";
2029 $ordnumber = "ordnumber";
2032 $err = $locale->text('Cannot save order!');
2035 if ($form->{type} eq 'sales_quotation') {
2036 $form->{label} = $locale->text('Quotation');
2038 $numberfld = "sqnumber";
2039 $ordnumber = "quonumber";
2041 $form->{label} = $locale->text('Request for Quotation');
2043 $numberfld = "rfqnumber";
2044 $ordnumber = "quonumber";
2047 $err = $locale->text('Cannot save quotation!');
2051 $form->{$ordnumber} = $form->update_defaults(\%myconfig, $numberfld)
2052 unless $form->{$ordnumber};
2056 OE->save(\%myconfig, \%$form);
2058 # saving the history
2059 if(!exists $form->{addition}) {
2060 $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
2061 $form->{addition} = "SAVED";
2062 $form->save_history($form->dbconnect(\%myconfig));
2064 # /saving the history
2066 $form->{simple_save} = 1;
2067 if(!$form->{print_and_save}) {
2068 set_headings("edit");
2072 $lxdebug->leave_sub();
2076 $lxdebug->enter_sub();
2080 if ($form->{type} =~ /_order$/) {
2081 $msg = $locale->text('Are you sure you want to delete Order Number');
2082 $ordnumber = 'ordnumber';
2084 $msg = $locale->text('Are you sure you want to delete Quotation Number');
2085 $ordnumber = 'quonumber';
2091 <form method=post action=$form->{script}>
2094 # delete action variable
2095 map { delete $form->{$_} } qw(action header);
2097 foreach $key (keys %$form) {
2098 $form->{$key} =~ s/\"/"/g;
2099 print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
2103 <h2 class=confirm>| . $locale->text('Confirm!') . qq|</h2>
2105 <h4>$msg $form->{$ordnumber}</h4>
2107 <input name=action class=submit type=submit value="|
2108 . $locale->text('Yes') . qq|">
2115 $lxdebug->leave_sub();
2119 $lxdebug->enter_sub();
2121 if ($form->{type} =~ /_order$/) {
2122 $msg = $locale->text('Order deleted!');
2123 $err = $locale->text('Cannot delete order!');
2125 $msg = $locale->text('Quotation deleted!');
2126 $err = $locale->text('Cannot delete quotation!');
2128 if (OE->delete(\%myconfig, \%$form, $spool)){
2129 $form->redirect($msg);
2130 # saving the history
2131 if(!exists $form->{addition}) {
2132 $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
2133 $form->{addition} = "DELETED";
2134 $form->save_history($form->dbconnect(\%myconfig));
2136 # /saving the history
2140 $lxdebug->leave_sub();
2144 $lxdebug->enter_sub();
2146 if ($form->{type} =~ /_order$/) {
2148 # these checks only apply if the items don't bring their own ordnumbers/transdates.
2149 # The if clause ensures that by searching for empty ordnumber_#/transdate_# fields.
2150 $form->isblank("ordnumber", $locale->text('Order Number missing!'))
2151 if (+{ map { $form->{"ordnumber_$_"}, 1 } (1 .. $form->{rowcount} - 1) }->{''});
2152 $form->isblank("transdate", $locale->text('Order Date missing!'))
2153 if (+{ map { $form->{"transdate_$_"}, 1 } (1 .. $form->{rowcount} - 1) }->{''});
2155 # also copy deliverydate from the order
2156 $form->{deliverydate} = $form->{reqdate} if $form->{reqdate};
2157 $form->{orddate} = $form->{transdate};
2159 $form->isblank("quonumber", $locale->text('Quotation Number missing!'));
2160 $form->isblank("transdate", $locale->text('Quotation Date missing!'));
2161 $form->{ordnumber} = "";
2162 $form->{quodate} = $form->{transdate};
2165 # if the name changed get new values
2166 if (&check_name($form->{vc})) {
2171 $form->{cp_id} *= 1;
2173 for $i (1 .. $form->{rowcount}) {
2174 map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig,
2175 $form->{"${_}_${i}"})
2176 if ($form->{"${_}_${i}"}) }
2177 qw(ship qty sellprice listprice basefactor));
2180 if ( $form->{type} =~ /_order/
2181 && $form->{currency} ne $form->{defaultcurrency}) {
2183 # check if we need a new exchangerate
2184 $buysell = ($form->{type} eq 'sales_order') ? "buy" : "sell";
2186 $orddate = $form->current_date(\%myconfig);
2188 $form->check_exchangerate(\%myconfig, $form->{currency}, $orddate,
2191 if (!$exchangerate) {
2192 &backorder_exchangerate($orddate, $buysell);
2197 # close orders/quotations
2198 $form->{closed} = 1;
2200 # save order if one ordnumber has been given
2201 # if not it's most likely a collective order, which can't be saved back
2202 # so they just have to be closed
2203 if (($form->{ordnumber} ne '') || ($form->{quonumber} ne '')) {
2204 OE->close_order(\%myconfig, \%$form);
2206 OE->close_orders(\%myconfig, \%$form);
2209 $form->{transdate} = $form->{invdate} = $form->current_date(\%myconfig);
2211 $form->current_date(\%myconfig, $form->{invdate}, $form->{terms} * 1);
2214 $form->{closed} = 0;
2215 $form->{rowcount}--;
2216 $form->{shipto} = 1;
2218 if ($form->{type} =~ /_order$/) {
2219 $form->{exchangerate} = $exchangerate;
2223 if ( $form->{type} eq 'purchase_order'
2224 || $form->{type} eq 'request_quotation') {
2225 $form->{title} = $locale->text('Add Vendor Invoice');
2226 $form->{script} = 'ir.pl';
2230 if ($form->{type} eq 'sales_order' || $form->{type} eq 'sales_quotation') {
2231 $form->{title} = $locale->text('Add Sales Invoice');
2232 $form->{script} = 'is.pl';
2237 # bo creates the id, reset it
2238 map { delete $form->{$_} }
2239 qw(id subject message cc bcc printed emailed queued);
2240 $form->{ $form->{vc} } =~ s/--.*//g;
2241 $form->{type} = "invoice";
2244 $locale = new Locale "$myconfig{countrycode}", "$script";
2246 require "bin/mozilla/$form->{script}";
2248 map { $form->{"select$_"} = "" } ($form->{vc}, currency);
2250 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
2251 qw(creditlimit creditremaining);
2253 $currency = $form->{currency};
2256 $form->{currency} = $currency;
2257 $form->{exchangerate} = "";
2258 $form->{forex} = "";
2259 $form->{exchangerate} = $exchangerate
2263 $form->check_exchangerate(
2264 \%myconfig, $form->{currency}, $form->{invdate}, $buysell
2267 $form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
2272 for $i (1 .. $form->{rowcount}) {
2273 $form->{"discount_$i"} =
2274 $form->format_amount(\%myconfig, $form->{"discount_$i"});
2276 ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
2278 $decimalplaces = ($dec > 2) ? $dec : 2;
2280 # copy delivery date from reqdate for order -> invoice conversion
2281 $form->{"deliverydate_$i"} = $form->{"reqdate_$i"}
2282 unless $form->{"deliverydate_$i"};
2284 $form->{"sellprice_$i"} =
2285 $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
2288 (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
2289 $dec_qty = length $dec_qty;
2291 $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
2293 map { $form->{"${_}_$i"} =~ s/\"/"/g }
2294 qw(partnumber description unit);
2300 $lxdebug->leave_sub();
2303 sub backorder_exchangerate {
2304 $lxdebug->enter_sub();
2305 my ($orddate, $buysell) = @_;
2312 <form method=post action=$form->{script}>
2315 # delete action variable
2316 map { delete $form->{$_} } qw(action header exchangerate);
2318 foreach $key (keys %$form) {
2319 $form->{$key} =~ s/\"/"/g;
2320 print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
2323 $form->{title} = $locale->text('Add Exchangerate');
2327 <input type=hidden name=login value=$form->{login}>
2328 <input type=hidden name=password value=$form->{password}>
2330 <input type=hidden name=exchangeratedate value=$orddate>
2331 <input type=hidden name=buysell value=$buysell>
2334 <tr><th class=listtop>$form->{title}</th></tr>
2335 <tr height="5"></tr>
2340 <th align=right>| . $locale->text('Currency') . qq|</th>
2341 <td>$form->{currency}</td>
2344 <th align=right>| . $locale->text('Date') . qq|</th>
2348 <th align=right>| . $locale->text('Exchangerate') . qq|</th>
2349 <td><input name=exchangerate size=11></td>
2359 <input type=hidden name=nextsub value=save_exchangerate>
2361 <input name=action class=submit type=submit value="|
2362 . $locale->text('Continue') . qq|">
2370 $lxdebug->leave_sub();
2373 sub save_exchangerate {
2374 $lxdebug->enter_sub();
2376 $form->isblank("exchangerate", $locale->text('Exchangerate missing!'));
2377 $form->{exchangerate} =
2378 $form->parse_amount(\%myconfig, $form->{exchangerate});
2379 $form->save_exchangerate(\%myconfig, $form->{currency},
2380 $form->{exchangeratedate},
2381 $form->{exchangerate}, $form->{buysell});
2385 $lxdebug->leave_sub();
2388 sub create_backorder {
2389 $lxdebug->enter_sub();
2391 $form->{shipped} = 1;
2393 # figure out if we need to create a backorder
2394 # items aren't saved if qty != 0
2396 for $i (1 .. $form->{rowcount}) {
2397 $totalqty += $qty = $form->{"qty_$i"};
2398 $totalship += $ship = $form->{"ship_$i"};
2400 $form->{"qty_$i"} = $qty - $ship;
2403 if ($totalship == 0) {
2404 map { $form->{"ship_$_"} = $form->{"qty_$_"} } (1 .. $form->{rowcount});
2405 $form->{ordtotal} = 0;
2406 $form->{shipped} = 0;
2410 if ($totalqty == $totalship) {
2411 map { $form->{"qty_$_"} = $form->{"ship_$_"} } (1 .. $form->{rowcount});
2412 $form->{ordtotal} = 0;
2417 qw(partnumber description qty ship unit sellprice discount id inventory_accno bin income_accno expense_accno listprice assembly taxaccounts partsgroup)
2420 for $i (1 .. $form->{rowcount}) {
2422 $form->{"${_}_$i"} =
2423 $form->format_amount(\%myconfig, $form->{"${_}_$i"})
2424 } qw(sellprice discount);
2429 OE->save(\%myconfig, \%$form);
2431 # rebuild rows for invoice
2435 for $i (1 .. $form->{rowcount}) {
2436 $form->{"qty_$i"} = $form->{"ship_$i"};
2438 if ($form->{"qty_$i"}) {
2441 map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
2446 $form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
2447 $form->{rowcount} = $count;
2449 $lxdebug->leave_sub();
2453 $lxdebug->enter_sub();
2455 $form->{saveasnew} = 1;
2456 $form->{closed} = 0;
2457 map { delete $form->{$_} } qw(printed emailed queued);
2459 # Let Lx-Office assign a new order number if the user hasn't changed the
2460 # previous one. If it has been changed manually then use it as-is.
2461 my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber";
2462 if ($form->{saved_xyznumber} &&
2463 ($form->{saved_xyznumber} eq $form->{$idx})) {
2464 delete($form->{$idx});
2469 $lxdebug->leave_sub();
2472 sub purchase_order {
2473 $lxdebug->enter_sub();
2475 if ( $form->{type} eq 'sales_quotation'
2476 || $form->{type} eq 'request_quotation') {
2477 OE->close_order(\%myconfig, \%$form);
2480 if ($form->{type} =~ /^sales_/) {
2481 delete($form->{ordnumber});
2484 $form->{cp_id} *= 1;
2486 $form->{title} = $locale->text('Add Purchase Order');
2487 $form->{vc} = "vendor";
2488 $form->{type} = "purchase_order";
2492 $lxdebug->leave_sub();
2496 $lxdebug->enter_sub();
2498 if ( $form->{type} eq 'sales_quotation'
2499 || $form->{type} eq 'request_quotation') {
2500 OE->close_order(\%myconfig, $form);
2503 if ($form->{type} eq "purchase_order") {
2504 delete($form->{ordnumber});
2507 $form->{cp_id} *= 1;
2509 $form->{title} = $locale->text('Add Sales Order');
2510 $form->{vc} = "customer";
2511 $form->{type} = "sales_order";
2515 $lxdebug->leave_sub();
2519 $lxdebug->enter_sub();
2521 $form->{transdate} = $form->current_date(\%myconfig);
2522 delete $form->{duedate};
2524 $form->{closed} = 0;
2527 map { delete $form->{$_} }
2528 qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal);
2530 for $i (1 .. $form->{rowcount}) {
2531 map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig,
2532 $form->{"${_}_${i}"})
2533 if ($form->{"${_}_${i}"}) }
2534 qw(ship qty sellprice listprice basefactor));
2542 for $i (1 .. $form->{rowcount} - 1) {
2543 map { $form->{"${_}_$i"} =~ s/\"/"/g }
2544 qw(partnumber description unit);
2547 map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, 0, "0") }
2548 qw(creditlimit creditremaining);
2552 $lxdebug->leave_sub();
2556 $lxdebug->enter_sub();
2558 $form->{print_and_save} = 1;
2563 my $saved_form = save_form();
2568 map({ $saved_vars{$_} = $form->{$_}; } qw(id ordnumber quonumber));
2569 restore_form($saved_form);
2570 map({ $form->{$_} = $saved_vars{$_}; } qw(id ordnumber quonumber));
2575 $lxdebug->leave_sub();