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-2002
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 #======================================================================
30 # Inventory received module
32 #======================================================================
39 require "$form->{path}/io.pl";
40 require "$form->{path}/arap.pl";
48 $lxdebug->enter_sub();
50 $form->{title} = $locale->text('Add Vendor Invoice');
56 $lxdebug->leave_sub();
61 $lxdebug->enter_sub();
63 $form->{title} = $locale->text('Edit Vendor Invoice');
69 $lxdebug->leave_sub();
74 $lxdebug->enter_sub();
77 $form->{webdav} = $webdav;
80 $form->{jscalendar} = $jscalendar;
82 $form->create_links("AP", \%myconfig, "vendor");
84 if ($form->{all_vendor}) {
85 unless ($form->{vendor_id}) {
86 $form->{vendor_id} = $form->{all_vendor}->[0]->{id};
90 $cp_id = $form->{cp_id};
91 IR->get_vendor(\%myconfig, \%$form);
92 IR->retrieve_invoice(\%myconfig, \%$form);
93 $form->{cp_id} = $cp_id;
96 @curr = split /:/, $form->{currencies};
98 $form->{defaultcurrency} = $curr[0];
100 map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
102 $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
105 if ($form->{all_vendor}) {
106 $form->{vendor} = "$form->{vendor}--$form->{vendor_id}";
107 map { $form->{selectvendor} .= "<option>$_->{name}--$_->{id}\n" } (@{ $form->{all_vendor} });
111 if ($form->{all_departments}) {
112 $form->{selectdepartment} = "<option>\n";
113 $form->{department} = "$form->{department}--$form->{department_id}";
115 map { $form->{selectdepartment} .= "<option>$_->{description}--$_->{id}\n" } (@{ $form->{all_departments} });
119 $form->{forex} = $form->{exchangerate};
120 $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
122 foreach $key (keys %{ $form->{AP_links} }) {
124 foreach $ref (@{ $form->{AP_links}{$key} }) {
125 $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
128 if ($key eq "AP_paid") {
129 for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
130 $form->{"AP_paid_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
132 $form->{"paid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{amount};
133 $form->{"datepaid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{transdate};
134 $form->{"forex_$i"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i-1]->{exchangerate};
135 $form->{"source_$i"} = $form->{acc_trans}{$key}->[$i-1]->{source};
136 $form->{"memo_$i"} = $form->{acc_trans}{$key}->[$i-1]->{memo};
138 $form->{paidaccounts} = $i;
141 $form->{$key} = "$form->{acc_trans}{$key}->[0]->{accno}--$form->{acc_trans}{$key}->[0]->{description}";
146 $form->{paidaccounts} = 1 unless (exists $form->{paidaccounts});
148 $form->{AP} = $form->{AP_1} unless $form->{id};
150 $form->{locked} = ($form->datetonum($form->{invdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig));
152 $lxdebug->leave_sub();
157 sub prepare_invoice {
158 $lxdebug->enter_sub();
162 map { $form->{$_} =~ s/\"/"/g } qw(invnumber ordnumber quonumber);
164 foreach $ref (@{ $form->{invoice_details} }) {
166 map { $form->{"${_}_$i"} = $ref->{$_} } keys %{ $ref };
168 ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
170 $decimalplaces = ($dec > 2) ? $dec : 2;
172 $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
173 $form->{"qty_$i"} = $form->format_amount(\%myconfig, ($form->{"qty_$i"} * -1));
175 $form->{rowcount} = $i;
179 $lxdebug->leave_sub();
185 $lxdebug->enter_sub();
187 # set option selected
188 foreach $item (qw(AP vendor currency department contact)) {
189 $form->{"select$item"} =~ s/ selected//;
190 $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
193 $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
195 $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
196 $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
199 if ($form->{all_contacts}) {
201 $form->{selectcontact} = "";
202 foreach $item (@{$form->{all_contacts}}) {
203 if ($form->{cp_id} == $item->{cp_id})
205 $form->{selectcontact} .= "<option selected>$item->{cp_name}--$item->{cp_id}";
209 $form->{selectcontact} .= "<option>$item->{cp_name}--$item->{cp_id}";
215 if ($form->{currency} ne $form->{defaultcurrency}) {
216 if ($form->{forex}) {
218 <th align=right nowrap>|.$locale->text('Exchangerate').qq|</th>
219 <td>$form->{exchangerate}<input type=hidden name=exchangerate value=$form->{exchangerate}></td>
223 <th align=right nowrap>|.$locale->text('Exchangerate').qq|</th>
224 <td><input name=exchangerate size=10 value=$form->{exchangerate}></td>
229 <input type=hidden name=forex value=$form->{forex}>
232 $vendor = ($form->{selectvendor}) ? qq|<select name=vendor>$form->{selectvendor}</select>\n<input type=hidden name="selectvendor" value="$form->{selectvendor}">| : qq|<input name=vendor value="$form->{vendor}" size=35>|;
234 $contact = ($form->{selectcontact}) ? qq|<select name=contact>$form->{selectcontact}</select>\n<input type=hidden name="selectcontact" value="$form->{selectcontact}">| : qq|<input name=contact value="$form->{contact}" size=35>|;
238 <th align="right" nowrap>|.$locale->text('Department').qq|</th>
239 <td colspan=3><select name=department>$form->{selectdepartment}</select>
240 <input type=hidden name=selectdepartment value="$form->{selectdepartment}">
243 | if $form->{selectdepartment};
245 $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
247 # use JavaScript Calendar or not
248 $form->{jsscript} = $form->{jscalendar};
250 if ($form->{jsscript})
252 # with JavaScript Calendar
254 <td><input name=invdate id=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>
255 <td><input type=button name=invdate id="trigger1" value=|.$locale->text('button').qq|></td>
258 <td width="13"><input name=duedate id=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>
259 <td width="4"><input type=button name=duedate id="trigger2" value=|.$locale->text('button').qq|></td></td>
262 $jsscript = Form->write_trigger(\%myconfig,"2","invdate","BL","trigger1","duedate","BL","trigger2");
266 # without JavaScript Calendar
267 $button1 = qq|<td><input name=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>|;
268 $button2 = qq|<td width="13"><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>|;
276 <form method=post action=$form->{script}>
278 <input type=hidden name=id value=$form->{id}>
279 <input type=hidden name=title value="$form->{title}">
280 <input type=hidden name=vc value="vendor">
281 <input type=hidden name=type value=$form->{type}>
283 <input type=hidden name=creditlimit value=$form->{creditlimit}>
284 <input type=hidden name=creditremaining value=$form->{creditremaining}>
286 <input type=hidden name=closedto value=$form->{closedto}>
287 <input type=hidden name=locked value=$form->{locked}>
289 <input type=hidden name=shipped value=$form->{shipped}>
294 <th class=listtop>$form->{title}</th>
304 <th align=right nowrap>|.$locale->text('Vendor').qq|</th>
305 <td colspan=3>$vendor</td>
307 <th align=richt nowrap>|.$locale->text('Contact Person').qq|</th>
308 <td colspan=3>$contact</td>
310 <input type=hidden name=vendor_id value=$form->{vendor_id}>
311 <input type=hidden name=oldvendor value="$form->{oldvendor}">
319 <th nowrap>|.$locale->text('Credit Limit').qq|</th>
320 <td>$form->{creditlimit}</td>
322 <th nowrap>|.$locale->text('Remaining').qq|</th>
323 <td class="plus$n">$form->{creditremaining}</td>
328 <th align=right>|.$locale->text('Record in').qq|</th>
329 <td colspan=3><select name=AP>$form->{selectAP}</select></td>
330 <input type=hidden name=selectAP value="$form->{selectAP}">
334 <th align=right nowrap>|.$locale->text('Currency').qq|</th>
335 <td><select name=currency>$form->{selectcurrency}</select></td>
343 <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
344 <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
347 <th align=right nowrap>|.$locale->text('Invoice Date').qq|</th>
351 <th align=right nowrap>|.$locale->text('Due Date').qq|</th>
355 <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
356 <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
357 <input type=hidden name=quonumber value="$form->{quonumber}">
368 <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
369 <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
370 <input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
371 <input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
372 <input type=hidden name=webdav value=$webdav>
374 <input type=hidden name=taxpart value="$form->{taxpart}">
375 <input type=hidden name=taxservice value="$form->{taxservice}">
377 <input type=hidden name=taxaccounts value="$form->{taxaccounts}">
380 foreach $item (split / /, $form->{taxaccounts}) {
382 <input type=hidden name="${item}_rate" value=$form->{"${item}_rate"}>
383 <input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
387 $lxdebug->leave_sub();
393 $lxdebug->enter_sub();
395 $form->{invtotal} = $form->{invsubtotal};
397 if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
400 if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) {
403 $rows = ($rows > $introws) ? $rows : $introws;
404 $notes = qq|<textarea name=notes rows=$rows cols=25 wrap=soft>$form->{notes}</textarea>|;
405 $intnotes = qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</textarea>|;
407 $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
410 if ($form->{taxaccounts}) {
412 <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|.$locale->text('Tax Included').qq|</b>
416 if (!$form->{taxincluded}) {
418 foreach $item (split / /, $form->{taxaccounts}) {
419 if ($form->{"${item}_base"}) {
420 $form->{invtotal} += $form->{"${item}_total"} = $form->round_amount($form->{"${item}_base"} * $form->{"${item}_rate"}, 2);
421 $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
425 <th align=right>$form->{"${item}_description"}</th>
426 <td align=right>$form->{"${item}_total"}</td>
434 $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
438 <th align=right>|.$locale->text('Subtotal').qq|</th>
439 <td align=right>$form->{invsubtotal}</td>
445 if ($form->{taxincluded}) {
446 foreach $item (split / /, $form->{taxaccounts}) {
447 if ($form->{"${item}_base"}) {
448 $form->{"${item}_total"} = $form->round_amount(($form->{"${item}_base"} * $form->{"${item}_rate"} / (1 + $form->{"${item}_rate"})) , 2);
449 $form->{"${item}_base"} = $form->round_amount($form->{"${item}_base"}, 2);
450 $form->{"${item}_netto"} = $form->round_amount(($form->{"${item}_base"}-$form->{"${item}_total"}), 2);
451 $form->{"${item}_netto"} = $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2);
452 $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
456 <th align=right>Enthaltene $form->{"${item}_description"}</th>
457 <td align=right>$form->{"${item}_total"}</td>
460 <th align=right>Nettobetrag</th>
461 <td align=right>$form->{"${item}_netto"}</td>
470 $form->{oldinvtotal} = $form->{invtotal};
471 $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
475 <td colspan=$colspan>
476 <table cellspacing="0">
481 <th align=left>|.$locale->text('Notes').qq|</th>
482 <th align=left>|.$locale->text('Internal Notes').qq|</th>
490 <td colspan=2 align=right width=100%>
497 <th align=right>|.$locale->text('Total').qq|</th>
498 <td align=right>$form->{invtotal}</td>
510 <td><hr size=3 noshade></td>
513 <th class=listtop align=left>Dokumente im Webdav-Repository</th>
516 <td align=left width=30%><b>Dateiname</b></td>
517 <td align=left width=70%><b>Webdavlink</b></td>
519 foreach $file (keys %{ $form->{WEBDAV}}) {
522 <td align=left>$file</td>
523 <td align=left><a href="$form->{WEBDAV}{$file}">$form->{WEBDAV}{$file}</a></td>
535 <input type=hidden name=jscalendar value=$form->{jscalendar}>
539 <td colspan=$colspan>
542 <th colspan=6 class=listheading>|.$locale->text('Payments').qq|</th>
546 if ($form->{currency} eq $form->{defaultcurrency}) {
547 @column_index = qw(datepaid source memo paid AP_paid);
549 @column_index = qw(datepaid source memo paid exchangerate AP_paid);
552 $column_data{datepaid} = "<th>".$locale->text('Date')."</th>";
553 $column_data{paid} = "<th>".$locale->text('Amount')."</th>";
554 $column_data{exchangerate} = "<th>".$locale->text('Exch')."</th>";
555 $column_data{AP_paid} = "<th>".$locale->text('Account')."</th>";
556 $column_data{source} = "<th>".$locale->text('Source')."</th>";
557 $column_data{memo} = "<th>".$locale->text('Memo')."</th>";
562 map { print "$column_data{$_}\n" } @column_index;
567 $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
568 for $i (1 .. $form->{paidaccounts}) {
574 $form->{"selectAP_paid_$i"} = $form->{selectAP_paid};
575 $form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/;
578 $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
579 $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
581 $exchangerate = qq| |;
582 if ($form->{currency} ne $form->{defaultcurrency}) {
583 if ($form->{"forex_$i"}) {
584 $exchangerate = qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
586 $exchangerate = qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
590 <input type=hidden name="forex_$i" value=$form->{"forex_$i"}>
593 $column_data{"paid_$i"} = qq|<td align=center><input name="paid_$i" size=11 value=$form->{"paid_$i"}></td>|;
594 $column_data{"exchangerate_$i"} = qq|<td align=center>$exchangerate</td>|;
595 $column_data{"AP_paid_$i"} = qq|<td align=center><select name="AP_paid_$i">$form->{"selectAP_paid_$i"}</select></td>|;
596 $column_data{"datepaid_$i"} = qq|<td align=center><input name="datepaid_$i" size=11 title="$myconfig{dateformat}" value=$form->{"datepaid_$i"}></td>|;
597 $column_data{"source_$i"} = qq|<td align=center><input name="source_$i" size=11 value=$form->{"source_$i"}></td>|;
598 $column_data{"memo_$i"} = qq|<td align=center><input name="memo_$i" size=11 value=$form->{"memo_$i"}></td>|;
600 map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
608 <input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
609 <input type=hidden name=paidaccounts value=$form->{paidaccounts}>
610 <input type=hidden name=selectAP_paid value="$form->{selectAP_paid}">
615 <td><hr size=3 noshade></td>
621 $invdate = $form->datetonum($form->{invdate}, \%myconfig);
622 $closedto = $form->datetonum($form->{closedto}, \%myconfig);
625 print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
628 if (!$form->{revtrans}) {
629 if (!$form->{locked}) {
631 <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">
632 <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">
637 if ($invdate > $closedto) {
639 <input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">
640 <input class=submit type=submit name=action value="|.$locale->text('Order').qq|">
645 if ($invdate > $closedto) {
646 print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
647 <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">|;
651 if ($form->{menubar}) {
652 require "$form->{path}/menu.pl";
658 <input type=hidden name=rowcount value=$form->{rowcount}>
660 <input name=callback type=hidden value="$form->{callback}">
662 <input type=hidden name=path value=$form->{path}>
663 <input type=hidden name=login value=$form->{login}>
664 <input type=hidden name=password value=$form->{password}>
672 $lxdebug->leave_sub();
678 $lxdebug->enter_sub();
680 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining);
686 $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell')));
689 for $i (1 .. $form->{paidaccounts}) {
690 if ($form->{"paid_$i"}) {
691 map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
693 $form->{"exchangerate_$i"} = $exchangerate if ($form->{"forex_$i"} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell')));
697 $i = $form->{rowcount};
698 $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
700 if (($form->{"partnumber_$i"} eq "") && ($form->{"description_$i"} eq "") && ($form->{"partsgroup_$i"} eq "")) {
701 $form->{creditremaining} += ($form->{oldinvtotal} - $form->{oldtotalpaid});
706 IR->retrieve_item(\%myconfig, \%$form);
708 my $rows = scalar @{ $form->{item_list} };
711 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
719 # override sellprice if there is one entered
720 $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
722 map { $form->{item_list}[$i]{$_} =~ s/\"/"/g } qw(partnumber description unit);
724 map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
726 $s = ($sellprice) ? $sellprice : $form->{"sellprice_$i"};
728 ($dec) = ($s =~ /\.(\d+)/);
730 $decimalplaces = ($dec > 2) ? $dec : 2;
733 $form->{"sellprice_$i"} = $sellprice;
735 # if there is an exchange rate adjust sellprice
736 $form->{"sellprice_$i"} /= $exchangerate;
739 $amount = $form->{"sellprice_$i"} * $form->{"qty_$i"} * (1 - $form->{"discount_$i"} / 100);
740 $form->{creditremaining} -= $amount;
741 $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
742 $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
748 # ok, so this is a new part
749 # ask if it is a part or service item
751 if ($form->{"partsgroup_$i"} && ($form->{"partsnumber_$i"} eq "") && ($form->{"description_$i"} eq "")) {
753 $form->{"discount_$i"} = "";
757 $form->{"id_$i"} = 0;
758 $form->{"unit_$i"} = $locale->text('ea');
765 $lxdebug->leave_sub();
771 $lxdebug->enter_sub();
773 $form->isblank("invdate", $locale->text('Invoice Date missing!'));
774 $form->isblank("vendor", $locale->text('Vendor missing!'));
776 # if the vendor changed get new values
777 if (&check_name(vendor)) {
784 $closedto = $form->datetonum($form->{closedto}, \%myconfig);
785 $invdate = $form->datetonum($form->{invdate}, \%myconfig);
787 $form->error($locale->text('Cannot post invoice for a closed period!')) if ($invdate <= $closedto);
789 $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency});
791 for $i (1 .. $form->{paidaccounts}) {
792 if ($form->{"paid_$i"}) {
793 $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
795 $form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
797 $form->error($locale->text('Cannot post payment for a closed period!')) if ($datepaid <= $closedto);
799 if ($form->{currency} ne $form->{defaultcurrency}) {
800 $form->{"exchangerate_$i"} = $form->{exchangerate} if ($invdate == $datepaid);
801 $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!'));
807 ($form->{AP}) = split /--/, $form->{AP};
808 ($form->{AP_paid}) = split /--/, $form->{AP_paid};
810 $form->{id} = 0 if $form->{postasnew};
812 $form->redirect($locale->text('Invoice')." $form->{invnumber} ".$locale->text('posted!')) if (IR->post_invoice(\%myconfig, \%$form));
813 $form->error($locale->text('Cannot post invoice!'));
815 $lxdebug->leave_sub();
821 $lxdebug->enter_sub();
828 <form method=post action=$form->{script}>
831 # delete action variable
832 map { delete $form->{$_} } qw(action header);
834 foreach $key (keys %$form) {
835 $form->{$key} =~ s/\"/"/g;
836 print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
840 <h2 class=confirm>|.$locale->text('Confirm!').qq|</h2>
842 <h4>|.$locale->text('Are you sure you want to delete Invoice Number').qq| $form->{invnumber}</h4>
844 <input name=action class=submit type=submit value="|.$locale->text('Yes').qq|">
849 $lxdebug->leave_sub();
855 $lxdebug->enter_sub();
857 $form->redirect($locale->text('Invoice deleted!')) if (IR->delete_invoice(\%myconfig, \%$form));
858 $form->error($locale->text('Cannot delete invoice!'));
860 $lxdebug->leave_sub();