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 #======================================================================
32 #======================================================================
43 sub add { &{"add_$form->{type}"} }
44 sub edit { &{"edit_$form->{type}"} }
45 sub save { &{"save_$form->{type}"} }
46 sub delete { &{"delete_$form->{type}"} }
49 $lxdebug->enter_sub();
51 $form->{title} = "Add";
52 $form->{charttype} = "A";
53 AM->get_account(\%myconfig, \%$form);
56 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}"
57 unless $form->{callback};
62 $lxdebug->leave_sub();
66 $lxdebug->enter_sub();
68 $form->{title} = "Edit";
69 AM->get_account(\%myconfig, \%$form);
71 foreach my $item (split(/:/, $form->{link})) {
72 $form->{$item} = "checked";
78 $lxdebug->leave_sub();
82 $lxdebug->enter_sub();
84 $form->{title} = $locale->text("$form->{title} Account");
86 $checked{ $form->{charttype} } = "checked";
87 $checked{"$form->{category}_"} = "checked";
88 $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked";
90 $form->{description} =~ s/\"/"/g;
92 if (@{ $form->{TAXKEY} }) {
93 $form->{selecttaxkey} = "<option value=0>Keine Steuer 0%\n";
94 foreach $item (@{ $form->{TAXKEY} }) {
95 if ($item->{taxkey} == $form->{taxkey_id}) {
96 $form->{selecttaxkey} .=
97 "<option value=$item->{taxkey} selected>$item->{taxdescription}\n";
99 $form->{selecttaxkey} .=
100 "<option value=$item->{taxkey}>$item->{taxdescription}\n";
108 <th align=right>| . $locale->text('Steuersatz') . qq|</th>
109 <td><select name=taxkey_id>$form->{selecttaxkey}</select></td>
110 <input type=hidden name=selecttaxkey value="$form->{selecttaxkey}">
113 $form->{selectustva} = "<option>\n";
114 %ustva = (41 => "Steuerfrei IGL a. Abnehmer m. UStID (§4 Nr. 1b UStG), Nr. 41",
115 44 => "Steuerfrei IGL n. Fahrz. o. UStID (§4 Nr. 1b UStG), Nr. 44",
116 49 => "Steuerfrei IGL n. Fahrz. a. Unternehmen (§2a UStG), Nr. 49",
117 43 => "Weit Steuerfreie Umsätze m. VSt Abzug (Ausfuhr, Umsätze §4 Nr.2-7 UStG), Nr. 43",
118 48 => "Steuerfreie Umsätze ohne VSt.abzug (§4 Nr.8-28 UStG), Nr. 48",
119 51 => "Steuerpflichtige Umsätze 16%, Nr. 51",
120 511 => "Steuerpflichtige Umsätze 16%, Nr. 51 rechts",
121 86 => "Steuerpflichtige Umsätze 7%, Nr. 86",
122 861 => "Steuerpflichtige Umsätze 7%, Nr. 86 rechts",
127 91 => "Steuerfrei, Nr. 91",
128 97 => "Steuerpflichtig 16%, Nr. 97",
129 971 => "Steuerpflichtig 16%, Nr. 97 rechts",
130 93 => "Steuerpflichtig 7%, Nr. 93",
131 931 => "Steuerpflichtig 7%, Nr. 93 rechts",
133 94 => "Steuerpflichtig 16%, Nr. 94",
145 66 => "Abziehbare Vorsteuerbeträge, Nr. 66",
154 foreach $item (sort({ $a <=> $b } keys %ustva)) {
155 if ($item == $form->{pos_ustva}) {
156 $form->{selectustva} .= "<option value=$item selected>$ustva{$item}\n";
158 $form->{selectustva} .= "<option value=$item>$ustva{$item}\n";
165 <th align=right>| . $locale->text('Umsatzsteuervoranmeldung') . qq|</th>
166 <td><select name=pos_ustva>$form->{selectustva}</select></td>
167 <input type=hidden name=selectustva value="$form->{selectustva}">
170 $form->{selecteur} = "<option>\n";
171 %eur = (1 => "Umsatzerlöse",
172 2 => "sonstige Erlöse",
173 3 => "Privatanteile",
175 5 => "Ausserordentliche Erträge",
176 6 => "Vereinnahmte Umsatzst.",
177 7 => "Umsatzsteuererstattungen",
178 8 => "Wareneingänge",
179 9 => "Löhne und Gehälter",
180 10 => "Gesetzl. sozialer Aufw.",
182 12 => "Gas, Strom, Wasser",
183 13 => "Instandhaltung",
184 14 => "Steuern, Versich., Beiträge",
186 16 => "Kfz-Versicherungen",
187 17 => "Sonst. Fahrtkosten",
188 18 => "Werbe- und Reisekosten",
189 19 => "Instandhaltung u. Werkzeuge",
190 20 => "Fachzeitschriften, Bücher",
191 21 => "Miete für Einrichtungen",
192 22 => "Rechts- und Beratungskosten",
193 23 => "Bürobedarf, Porto, Telefon",
194 24 => "Sonstige Aufwendungen",
195 25 => "Abschreibungen auf Anlagever.",
196 26 => "Abschreibungen auf GWG",
198 28 => "Umsatzsteuerzahlungen",
200 30 => "Ausserordentlicher Aufwand",
201 31 => "Betriebliche Steuern");
202 foreach $item (sort({ $a <=> $b } keys(%eur))) {
203 if ($item == $form->{pos_eur}) {
204 $form->{selecteur} .= "<option value=$item selected>$eur{$item}\n";
206 $form->{selecteur} .= "<option value=$item>$eur{$item}\n";
213 <th align=right>| . $locale->text('EÜR') . qq|</th>
214 <td><select name=pos_eur>$form->{selecteur}</select></td>
215 <input type=hidden name=selecteur value="$form->{selecteur}">
218 $form->{selectbwa} = "<option>\n";
220 %bwapos = (1 => 'Umsatzerlöse',
221 2 => 'Best.Verdg.FE/UE',
222 3 => 'Aktiv.Eigenleistung',
223 4 => 'Mat./Wareneinkauf',
224 5 => 'So.betr.Erlöse',
225 10 => 'Personalkosten',
227 12 => 'Betriebl.Steuern',
228 13 => 'Vers./Beiträge',
229 14 => 'Kfz.Kosten o.St.',
230 15 => 'Werbe-Reisek.',
231 16 => 'Kosten Warenabgabe',
232 17 => 'Abschreibungen',
233 18 => 'Rep./instandhlt.',
234 19 => 'Übrige Steuern',
235 20 => 'Sonst.Kosten',
237 31 => 'Sonst.neutr.Aufw.',
239 33 => 'Sonst.neutr.Ertrag',
240 34 => 'Verr.kalk.Kosten',
241 35 => 'Steuern Eink.u.Ertr.');
242 foreach $item (sort({ $a <=> $b } keys %bwapos)) {
243 if ($item == $form->{pos_bwa}) {
244 $form->{selectbwa} .= "<option value=$item selected>$bwapos{$item}\n";
246 $form->{selectbwa} .= "<option value=$item>$bwapos{$item}\n";
253 <th align=right>| . $locale->text('BWA') . qq|</th>
254 <td><select name=pos_bwa>$form->{selectbwa}</select></td>
255 <input type=hidden name=selectbwa value="$form->{selectbwa}">
258 $form->{selectbilanz} = "<option>\n";
259 foreach $item ((1, 2, 3, 4)) {
260 if ($item == $form->{pos_bilanz}) {
261 $form->{selectbilanz} .= "<option value=$item selected>$item\n";
263 $form->{selectbilanz} .= "<option value=$item>$item\n";
270 <th align=right>| . $locale->text('Bilanz') . qq|</th>
271 <td><select name=pos_bilanz>$form->{selectbilanz}</select></td>
272 <input type=hidden name=selectbilanz value="$form->{selectbilanz}">
275 # this is for our parser only!
276 # type=submit $locale->text('Add Account')
277 # type=submit $locale->text('Edit Account')
284 <form method=post action=$form->{script}>
286 <input type=hidden name=id value=$form->{id}>
287 <input type=hidden name=type value=account>
289 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
290 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
291 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
292 <input type=hidden name=fxgain_accno_id values=$form->{fxgain_accno_id}>
293 <input type=hidden name=fxloss_accno_id values=$form->{fxloss_accno_id}>
295 <table border=0 width=100%>
297 <th class=listtop>$form->{title}</th>
304 <th align=right>| . $locale->text('Account Number') . qq|</th>
305 <td><input name=accno size=20 value=$form->{accno}></td>
308 <th align=right>| . $locale->text('Description') . qq|</th>
309 <td><input name=description size=40 value="$form->{description}"></td>
312 <th align=right>| . $locale->text('Account Type') . qq|</th>
316 <td><input name=category type=radio class=radio value=A $checked{A_}> |
317 . $locale->text('Asset') . qq|\n<br>
318 <input name=category type=radio class=radio value=L $checked{L_}> |
319 . $locale->text('Liability') . qq|\n<br>
320 <input name=category type=radio class=radio value=I $checked{I_}> |
321 . $locale->text('Revenue') . qq|\n<br>
322 <input name=category type=radio class=radio value=E $checked{E_}> |
323 . $locale->text('Expense') . qq|</td>
324 <td width=50> </td>
326 <input name=charttype type=radio class=radio value="H" $checked{H}> |
327 . $locale->text('Heading') . qq|<br>
328 <input name=charttype type=radio class=radio value="A" $checked{A}> |
329 . $locale->text('Account') . qq|</td>
336 if ($form->{charttype} eq "A") {
343 . $locale->text('Is this a summary account to record') . qq|</th>
345 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |
346 . $locale->text('AR')
347 . qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |
348 . $locale->text('AP')
349 . qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |
350 . $locale->text('Inventory')
357 <th colspan=2>| . $locale->text('Include in drop-down menus') . qq|</th>
363 <th align=left>| . $locale->text('Receivables') . qq|</th>
364 <th align=left>| . $locale->text('Payables') . qq|</th>
365 <th align=left>| . $locale->text('Parts Inventory') . qq|</th>
366 <th align=left>| . $locale->text('Service Items') . qq|</th>
370 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |
371 . $locale->text('Revenue') . qq|\n<br>
372 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |
373 . $locale->text('Receipt') . qq|\n<br>
374 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |
375 . $locale->text('Tax') . qq|
378 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |
379 . $locale->text('Expense/Asset') . qq|\n<br>
380 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |
381 . $locale->text('Payment') . qq|\n<br>
382 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |
383 . $locale->text('Tax') . qq|
386 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |
387 . $locale->text('Revenue') . qq|\n<br>
388 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |
389 . $locale->text('COGS') . qq|\n<br>
390 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |
391 . $locale->text('Tax') . qq|
394 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |
395 . $locale->text('Revenue') . qq|\n<br>
396 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |
397 . $locale->text('Expense') . qq|\n<br>
398 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |
399 . $locale->text('Tax') . qq|
418 <td><hr size=3 noshade></td>
423 $lxdebug->leave_sub();
427 $lxdebug->enter_sub();
431 <input name=callback type=hidden value="$form->{callback}">
433 <input type=hidden name=path value=$form->{path}>
434 <input type=hidden name=login value=$form->{login}>
435 <input type=hidden name=password value=$form->{password}>
438 <input type=submit class=submit name=action value="|
439 . $locale->text('Save') . qq|">
442 if ($form->{id} && $form->{orphaned}) {
443 print qq|<input type=submit class=submit name=action value="|
444 . $locale->text('Delete') . qq|">|;
447 if ($form->{menubar}) {
448 require "$form->{path}/menu.pl";
459 $lxdebug->leave_sub();
463 $lxdebug->enter_sub();
465 $form->isblank("accno", $locale->text('Account Number missing!'));
466 $form->isblank("category", $locale->text('Account Type missing!'));
468 $form->redirect($locale->text('Account saved!'))
469 if (AM->save_account(\%myconfig, \%$form));
470 $form->error($locale->text('Cannot save account!'));
472 $lxdebug->leave_sub();
476 $lxdebug->enter_sub();
478 CA->all_accounts(\%myconfig, \%$form);
480 $form->{title} = $locale->text('Chart of Accounts');
484 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
486 @column_index = qw(accno gifi_accno description debit credit link);
488 $column_header{accno} = qq|<th>| . $locale->text('Account') . qq|</a></th>|;
489 $column_header{gifi_accno} =
490 qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
491 $column_header{description} =
492 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
493 $column_header{debit} = qq|<th>| . $locale->text('Debit') . qq|</a></th>|;
494 $column_header{credit} = qq|<th>| . $locale->text('Credit') . qq|</a></th>|;
495 $column_header{link} = qq|<th>| . $locale->text('Link') . qq|</a></th>|;
498 $colspan = $#column_index + 1;
505 <th class=listtop colspan=$colspan>$form->{title}</th>
508 <tr class=listheading>
511 map { print "$column_header{$_}\n" } @column_index;
518 $callback = $form->escape($callback);
520 foreach $ca (@{ $form->{CA} }) {
522 $ca->{debit} = " ";
523 $ca->{credit} = " ";
525 if ($ca->{amount} > 0) {
527 $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
529 if ($ca->{amount} < 0) {
531 $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
534 $ca->{link} =~ s/:/<br>/og;
536 if ($ca->{charttype} eq "H") {
537 print qq|<tr class=listheading>|;
539 $column_data{accno} =
540 qq|<th><a href=$form->{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</a></th>|;
541 $column_data{gifi_accno} =
542 qq|<th><a href=$form->{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno}</a> </th>|;
543 $column_data{description} = qq|<th>$ca->{description} </th>|;
544 $column_data{debit} = qq|<th> </th>|;
545 $column_data{credit} = qq| <th> </th>|;
546 $column_data{link} = qq|<th> </th>|;
552 <tr valign=top class=listrow$i>|;
553 $column_data{accno} =
554 qq|<td><a href=$form->{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</a></td>|;
555 $column_data{gifi_accno} =
556 qq|<td><a href=$form->{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno}</a> </td>|;
557 $column_data{description} = qq|<td>$ca->{description} </td>|;
558 $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
559 $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
560 $column_data{link} = qq|<td>$ca->{link} </td>|;
564 map { print "$column_data{$_}\n" } @column_index;
570 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
577 $lxdebug->leave_sub();
581 $lxdebug->enter_sub();
583 $form->{title} = $locale->text('Delete Account');
586 qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)
588 if ($form->{id} == $form->{$id}) {
589 $form->error($locale->text('Cannot delete default account!'));
593 $form->redirect($locale->text('Account deleted!'))
594 if (AM->delete_account(\%myconfig, \%$form));
595 $form->error($locale->text('Cannot delete account!'));
597 $lxdebug->leave_sub();
601 $lxdebug->enter_sub();
603 @{ $form->{fields} } = (accno, description);
604 $form->{table} = "gifi";
605 $form->{sortorder} = "accno";
607 AM->gifi_accounts(\%myconfig, \%$form);
609 $form->{title} = $locale->text('GIFI');
613 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
615 @column_index = qw(accno description);
617 $column_header{accno} = qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
618 $column_header{description} =
619 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
622 $colspan = $#column_index + 1;
629 <th class=listtop colspan=$colspan>$form->{title}</th>
632 <tr class=listheading>
635 map { print "$column_header{$_}\n" } @column_index;
642 $callback = $form->escape($callback);
644 foreach $ca (@{ $form->{ALL} }) {
650 <tr valign=top class=listrow$i>|;
652 $column_data{accno} =
653 qq|<td><a href=$form->{script}?action=edit_gifi&coa=1&accno=$ca->{accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</td>|;
654 $column_data{description} = qq|<td>$ca->{description} </td>|;
656 map { print "$column_data{$_}\n" } @column_index;
663 <td colspan=$colspan><hr size=3 noshade></td>
671 $lxdebug->leave_sub();
675 $lxdebug->enter_sub();
677 $form->{title} = "Add";
681 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
688 $lxdebug->leave_sub();
692 $lxdebug->enter_sub();
694 $form->{title} = "Edit";
696 AM->get_gifi(\%myconfig, \%$form);
701 $lxdebug->leave_sub();
705 $lxdebug->enter_sub();
707 $form->{title} = $locale->text("$form->{title} GIFI");
709 # $locale->text('Add GIFI')
710 # $locale->text('Edit GIFI')
712 $form->{description} =~ s/\"/"/g;
719 <form method=post action=$form->{script}>
721 <input type=hidden name=id value=$form->{accno}>
722 <input type=hidden name=type value=gifi>
726 <th class=listtop>$form->{title}</th>
733 <th align=right>| . $locale->text('GIFI') . qq|</th>
734 <td><input name=accno size=20 value=$form->{accno}></td>
737 <th align=right>| . $locale->text('Description') . qq|</th>
738 <td><input name=description size=60 value="$form->{description}"></td>
744 <td colspan=2><hr size=3 noshade></td>
749 $lxdebug->leave_sub();
753 $lxdebug->enter_sub();
757 <input name=callback type=hidden value="$form->{callback}">
759 <input type=hidden name=path value=$form->{path}>
760 <input type=hidden name=login value=$form->{login}>
761 <input type=hidden name=password value=$form->{password}>
763 <br><input type=submit class=submit name=action value="|
764 . $locale->text('Save') . qq|">|;
768 <input type=submit class=submit name=action value="|
769 . $locale->text('Copy to COA') . qq|">
772 if ($form->{accno} && $form->{orphaned}) {
773 print qq|<input type=submit class=submit name=action value="|
774 . $locale->text('Delete') . qq|">|;
778 if ($form->{menubar}) {
779 require "$form->{path}/menu.pl";
790 $lxdebug->leave_sub();
794 $lxdebug->enter_sub();
796 $form->isblank("accno", $locale->text('GIFI missing!'));
797 AM->save_gifi(\%myconfig, \%$form);
798 $form->redirect($locale->text('GIFI saved!'));
800 $lxdebug->leave_sub();
804 $lxdebug->enter_sub();
806 $form->isblank("accno", $locale->text('GIFI missing!'));
808 AM->save_gifi(\%myconfig, \%$form);
811 $form->{gifi_accno} = $form->{accno};
812 $form->{title} = "Add";
813 $form->{charttype} = "A";
818 $lxdebug->leave_sub();
822 $lxdebug->enter_sub();
824 AM->delete_gifi(\%myconfig, \%$form);
825 $form->redirect($locale->text('GIFI deleted!'));
827 $lxdebug->leave_sub();
831 $lxdebug->enter_sub();
833 $form->{title} = "Add";
837 "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"
838 unless $form->{callback};
843 $lxdebug->leave_sub();
846 sub edit_department {
847 $lxdebug->enter_sub();
849 $form->{title} = "Edit";
851 AM->get_department(\%myconfig, \%$form);
856 $lxdebug->leave_sub();
859 sub list_department {
860 $lxdebug->enter_sub();
862 AM->departments(\%myconfig, \%$form);
865 "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}";
867 $callback = $form->escape($form->{callback});
869 $form->{title} = $locale->text('Departments');
871 @column_index = qw(description cost profit);
873 $column_header{description} =
874 qq|<th class=listheading width=90%>|
875 . $locale->text('Description')
877 $column_header{cost} =
878 qq|<th class=listheading nowrap>|
879 . $locale->text('Cost Center')
881 $column_header{profit} =
882 qq|<th class=listheading nowrap>|
883 . $locale->text('Profit Center')
893 <th class=listtop>$form->{title}</th>
899 <tr class=listheading>
902 map { print "$column_header{$_}\n" } @column_index;
908 foreach $ref (@{ $form->{ALL} }) {
914 <tr valign=top class=listrow$i>
917 $costcenter = ($ref->{role} eq "C") ? "X" : "";
918 $profitcenter = ($ref->{role} eq "P") ? "X" : "";
920 $column_data{description} =
921 qq|<td><a href=$form->{script}?action=edit_department&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
922 $column_data{cost} = qq|<td align=center>$costcenter</td>|;
923 $column_data{profit} = qq|<td align=center>$profitcenter</td>|;
925 map { print "$column_data{$_}\n" } @column_index;
937 <td><hr size=3 noshade></td>
942 <form method=post action=$form->{script}>
944 <input name=callback type=hidden value="$form->{callback}">
946 <input type=hidden name=type value=department>
948 <input type=hidden name=path value=$form->{path}>
949 <input type=hidden name=login value=$form->{login}>
950 <input type=hidden name=password value=$form->{password}>
952 <input class=submit type=submit name=action value="|
953 . $locale->text('Add') . qq|">|;
955 if ($form->{menubar}) {
956 require "$form->{path}/menu.pl";
967 $lxdebug->leave_sub();
970 sub department_header {
971 $lxdebug->enter_sub();
973 $form->{title} = $locale->text("$form->{title} Department");
975 # $locale->text('Add Department')
976 # $locale->text('Edit Department')
978 $form->{description} =~ s/\"/"/g;
980 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
982 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
985 qq|<input name=description size=60 value="$form->{description}">|;
988 $costcenter = "checked" if $form->{role} eq "C";
989 $profitcenter = "checked" if $form->{role} eq "P";
996 <form method=post action=$form->{script}>
998 <input type=hidden name=id value=$form->{id}>
999 <input type=hidden name=type value=department>
1003 <th class=listtop colspan=2>$form->{title}</th>
1005 <tr height="5"></tr>
1007 <th align=right>| . $locale->text('Description') . qq|</th>
1008 <td>$description</td>
1012 <td><input type=radio style=radio name=role value="C" $costcenter> |
1013 . $locale->text('Cost Center') . qq|
1014 <input type=radio style=radio name=role value="P" $profitcenter> |
1015 . $locale->text('Profit Center') . qq|
1018 <td colspan=2><hr size=3 noshade></td>
1023 $lxdebug->leave_sub();
1026 sub save_department {
1027 $lxdebug->enter_sub();
1029 $form->isblank("description", $locale->text('Description missing!'));
1030 AM->save_department(\%myconfig, \%$form);
1031 $form->redirect($locale->text('Department saved!'));
1033 $lxdebug->leave_sub();
1036 sub delete_department {
1037 $lxdebug->enter_sub();
1039 AM->delete_department(\%myconfig, \%$form);
1040 $form->redirect($locale->text('Department deleted!'));
1042 $lxdebug->leave_sub();
1046 $lxdebug->enter_sub();
1048 $form->{title} = "Add";
1051 "$form->{script}?action=add_business&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1052 unless $form->{callback};
1057 $lxdebug->leave_sub();
1061 $lxdebug->enter_sub();
1063 $form->{title} = "Edit";
1065 AM->get_business(\%myconfig, \%$form);
1069 $form->{orphaned} = 1;
1072 $lxdebug->leave_sub();
1076 $lxdebug->enter_sub();
1078 AM->business(\%myconfig, \%$form);
1081 "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1083 $callback = $form->escape($form->{callback});
1085 $form->{title} = $locale->text('Type of Business');
1087 @column_index = qw(description discount customernumberinit);
1089 $column_header{description} =
1090 qq|<th class=listheading width=60%>|
1091 . $locale->text('Description')
1093 $column_header{discount} =
1094 qq|<th class=listheading width=10%>|
1095 . $locale->text('Discount')
1097 $column_header{customernumberinit} =
1098 qq|<th class=listheading>|
1099 . $locale->text('Customernumberinit')
1109 <th class=listtop>$form->{title}</th>
1111 <tr height="5"></tr>
1115 <tr class=listheading>
1118 map { print "$column_header{$_}\n" } @column_index;
1124 foreach $ref (@{ $form->{ALL} }) {
1130 <tr valign=top class=listrow$i>
1134 $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
1137 ? "<b>$ref->{description}</b>"
1138 : "$ref->{description}";
1139 $column_data{description} =
1140 qq|<td><a href=$form->{script}?action=edit_business&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$description</td>|;
1141 $column_data{discount} = qq|<td align=right>$discount</td>|;
1142 $column_data{customernumberinit} =
1143 qq|<td align=right>$ref->{customernumberinit}</td>|;
1145 map { print "$column_data{$_}\n" } @column_index;
1157 <td><hr size=3 noshade></td>
1162 <form method=post action=$form->{script}>
1164 <input name=callback type=hidden value="$form->{callback}">
1166 <input type=hidden name=type value=business>
1168 <input type=hidden name=path value=$form->{path}>
1169 <input type=hidden name=login value=$form->{login}>
1170 <input type=hidden name=password value=$form->{password}>
1172 <input class=submit type=submit name=action value="|
1173 . $locale->text('Add') . qq|">|;
1175 if ($form->{menubar}) {
1176 require "$form->{path}/menu.pl";
1188 $lxdebug->leave_sub();
1191 sub business_header {
1192 $lxdebug->enter_sub();
1194 $form->{title} = $locale->text("$form->{title} Business");
1195 $form->{salesman} = "checked" if $form->{salesman};
1197 # $locale->text('Add Business')
1198 # $locale->text('Edit Business')
1200 $form->{description} =~ s/\"/"/g;
1202 $form->format_amount(\%myconfig, $form->{discount} * 100);
1209 <form method=post action=$form->{script}>
1211 <input type=hidden name=id value=$form->{id}>
1212 <input type=hidden name=type value=business>
1216 <th class=listtop colspan=2>$form->{title}</th>
1218 <tr height="5"></tr>
1220 <th align=right>| . $locale->text('Type of Business') . qq|</th>
1221 <td><input name=description size=30 value="$form->{description}"></td>
1224 <th align=right>| . $locale->text('Discount') . qq| %</th>
1225 <td><input name=discount size=5 value=$form->{discount}></td>
1228 <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
1229 <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1232 <td align=right>| . $locale->text('Salesman') . qq|</td>
1233 <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
1235 <td colspan=2><hr size=3 noshade></td>
1240 $lxdebug->leave_sub();
1244 $lxdebug->enter_sub();
1246 $form->isblank("description", $locale->text('Description missing!'));
1247 AM->save_business(\%myconfig, \%$form);
1248 $form->redirect($locale->text('Business saved!'));
1250 $lxdebug->leave_sub();
1253 sub delete_business {
1254 $lxdebug->enter_sub();
1256 AM->delete_business(\%myconfig, \%$form);
1257 $form->redirect($locale->text('Business deleted!'));
1259 $lxdebug->leave_sub();
1263 $lxdebug->enter_sub();
1265 $form->{title} = "Add";
1268 "$form->{script}?action=add_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1269 unless $form->{callback};
1274 $lxdebug->leave_sub();
1278 $lxdebug->enter_sub();
1280 $form->{title} = "Edit";
1282 AM->get_sic(\%myconfig, \%$form);
1286 $form->{orphaned} = 1;
1289 $lxdebug->leave_sub();
1293 $lxdebug->enter_sub();
1295 AM->sic(\%myconfig, \%$form);
1298 "$form->{script}?action=list_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1300 $callback = $form->escape($form->{callback});
1302 $form->{title} = $locale->text('Standard Industrial Codes');
1304 @column_index = qw(code description);
1306 $column_header{code} =
1307 qq|<th class=listheading>| . $locale->text('Code') . qq|</th>|;
1308 $column_header{description} =
1309 qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|;
1318 <th class=listtop>$form->{title}</th>
1320 <tr height="5"></tr>
1324 <tr class=listheading>
1327 map { print "$column_header{$_}\n" } @column_index;
1333 foreach $ref (@{ $form->{ALL} }) {
1338 if ($ref->{sictype} eq 'H') {
1340 <tr valign=top class=listheading>
1342 $column_data{code} =
1343 qq|<th><a href=$form->{script}?action=edit_sic&code=$ref->{code}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{code}</th>|;
1344 $column_data{description} = qq|<th>$ref->{description}</th>|;
1348 <tr valign=top class=listrow$i>
1351 $column_data{code} =
1352 qq|<td><a href=$form->{script}?action=edit_sic&code=$ref->{code}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{code}</td>|;
1353 $column_data{description} = qq|<td>$ref->{description}</td>|;
1357 map { print "$column_data{$_}\n" } @column_index;
1369 <td><hr size=3 noshade></td>
1374 <form method=post action=$form->{script}>
1376 <input name=callback type=hidden value="$form->{callback}">
1378 <input type=hidden name=type value=sic>
1380 <input type=hidden name=path value=$form->{path}>
1381 <input type=hidden name=login value=$form->{login}>
1382 <input type=hidden name=password value=$form->{password}>
1384 <input class=submit type=submit name=action value="|
1385 . $locale->text('Add') . qq|">|;
1387 if ($form->{menubar}) {
1388 require "$form->{path}/menu.pl";
1399 $lxdebug->leave_sub();
1403 $lxdebug->enter_sub();
1405 $form->{title} = $locale->text("$form->{title} SIC");
1407 # $locale->text('Add SIC')
1408 # $locale->text('Edit SIC')
1410 $form->{code} =~ s/\"/"/g;
1411 $form->{description} =~ s/\"/"/g;
1413 $checked = ($form->{sictype} eq 'H') ? "checked" : "";
1420 <form method=post action=$form->{script}>
1422 <input type=hidden name=type value=sic>
1423 <input type=hidden name=id value=$form->{code}>
1427 <th class=listtop colspan=2>$form->{title}</th>
1429 <tr height="5"></tr>
1431 <th align=right>| . $locale->text('Code') . qq|</th>
1432 <td><input name=code size=10 value=$form->{code}></td>
1436 <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |
1437 . $locale->text('Heading') . qq|</th>
1440 <th align=right>| . $locale->text('Description') . qq|</th>
1441 <td><input name=description size=60 value="$form->{description}"></td>
1443 <td colspan=2><hr size=3 noshade></td>
1448 $lxdebug->leave_sub();
1452 $lxdebug->enter_sub();
1454 $form->isblank("code", $locale->text('Code missing!'));
1455 $form->isblank("description", $locale->text('Description missing!'));
1456 AM->save_sic(\%myconfig, \%$form);
1457 $form->redirect($locale->text('SIC saved!'));
1459 $lxdebug->leave_sub();
1463 $lxdebug->enter_sub();
1465 AM->delete_sic(\%myconfig, \%$form);
1466 $form->redirect($locale->text('SIC deleted!'));
1468 $lxdebug->leave_sub();
1471 sub display_stylesheet {
1472 $lxdebug->enter_sub();
1474 $form->{file} = "css/$myconfig{stylesheet}";
1477 $lxdebug->leave_sub();
1481 $lxdebug->enter_sub();
1483 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
1484 $form->{file} =~ s/^\/*//g;
1485 $form->{file} =~ s/$userspath//;
1487 $form->error("$!: $form->{file}") unless -f $form->{file};
1489 AM->load_template(\%$form);
1491 $form->{title} = $form->{file};
1493 # if it is anything but html
1494 if ($form->{file} !~ /\.html$/) {
1495 $form->{body} = "<pre>\n$form->{body}\n</pre>";
1505 <form method=post action=$form->{script}>
1507 <input name=file type=hidden value=$form->{file}>
1508 <input name=type type=hidden value=template>
1510 <input type=hidden name=path value=$form->{path}>
1511 <input type=hidden name=login value=$form->{login}>
1512 <input type=hidden name=password value=$form->{password}>
1514 <input name=action type=submit class=submit value="|
1515 . $locale->text('Edit') . qq|">|;
1517 if ($form->{menubar}) {
1518 require "$form->{path}/menu.pl";
1529 $lxdebug->leave_sub();
1533 $lxdebug->enter_sub();
1535 AM->load_template(\%$form);
1537 $form->{title} = $locale->text('Edit Template');
1539 # convert   to &nbsp;
1540 $form->{body} =~ s/ /&nbsp;/gi;
1547 <form method=post action=$form->{script}>
1549 <input name=file type=hidden value=$form->{file}>
1550 <input name=type type=hidden value=template>
1552 <input type=hidden name=path value=$form->{path}>
1553 <input type=hidden name=login value=$form->{login}>
1554 <input type=hidden name=password value=$form->{password}>
1556 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
1558 <textarea name=body rows=25 cols=70>
1563 <input type=submit class=submit name=action value="|
1564 . $locale->text('Save') . qq|">|;
1566 if ($form->{menubar}) {
1567 require "$form->{path}/menu.pl";
1579 $lxdebug->leave_sub();
1583 $lxdebug->enter_sub();
1585 AM->save_template(\%$form);
1586 $form->redirect($locale->text('Template saved!'));
1588 $lxdebug->leave_sub();
1592 $lxdebug->enter_sub();
1594 # get defaults for account numbers and last numbers
1595 AM->defaultaccounts(\%myconfig, \%$form);
1597 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
1599 ($item eq $myconfig{dateformat})
1600 ? "<option selected>$item\n"
1601 : "<option>$item\n";
1604 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
1606 ($item eq $myconfig{numberformat})
1607 ? "<option selected>$item\n"
1608 : "<option>$item\n";
1611 foreach $item (qw(name company address signature)) {
1612 $myconfig{$item} =~ s/\"/"/g;
1615 foreach $item (qw(address signature)) {
1616 $myconfig{$item} =~ s/\\n/\r\n/g;
1619 %countrycodes = User->country_codes;
1621 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
1625 ($myconfig{countrycode} eq $key)
1626 ? "<option selected value=$key>$countrycodes{$key}\n"
1627 : "<option value=$key>$countrycodes{$key}\n";
1629 $countrycodes = "<option>American English\n$countrycodes";
1631 foreach $key (keys %{ $form->{IC} }) {
1632 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
1634 ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key})
1635 ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n"
1636 : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
1640 opendir CSS, "css/.";
1641 @all = grep /.*\.css$/, readdir CSS;
1644 foreach $item (@all) {
1645 if ($item eq $myconfig{stylesheet}) {
1646 $selectstylesheet .= qq|<option selected>$item\n|;
1648 $selectstylesheet .= qq|<option>$item\n|;
1651 $selectstylesheet .= "<option>\n";
1653 $form->{title} = $locale->text('Edit Preferences for') . qq| $form->{login}|;
1657 if ($myconfig{menustyle} eq "old") { $oldS = "checked"; }
1658 else { $newS = "checked"; }
1663 <form method=post action=$form->{script}>
1665 <input type=hidden name=old_password value=$myconfig{password}>
1666 <input type=hidden name=type value=preferences>
1667 <input type=hidden name=role value=$myconfig{role}>
1670 <tr><th class=listtop>$form->{title}</th></tr>
1675 <th align=right>| . $locale->text('Name') . qq|</th>
1676 <td><input name=name size=15 value="$myconfig{name}"></td>
1679 <th align=right>| . $locale->text('Password') . qq|</th>
1680 <td><input type=password name=new_password size=10 value=$myconfig{password}></td>
1683 <th align=right>| . $locale->text('E-mail') . qq|</th>
1684 <td><input name=email size=30 value="$myconfig{email}"></td>
1687 <th align=right>| . $locale->text('Signature') . qq|</th>
1688 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
1691 <th align=right>| . $locale->text('Phone') . qq|</th>
1692 <td><input name=tel size=14 value="$myconfig{tel}"></td>
1695 <th align=right>| . $locale->text('Fax') . qq|</th>
1696 <td><input name=fax size=14 value="$myconfig{fax}"></td>
1699 <th align=right>| . $locale->text('Company') . qq|</th>
1700 <td><input name=company size=30 value="$myconfig{company}"></td>
1703 <th align=right>| . $locale->text('Address') . qq|</th>
1704 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
1707 <th align=right>| . $locale->text('Date Format') . qq|</th>
1708 <td><select name=dateformat>$dateformat</select></td>
1711 <th align=right>| . $locale->text('Number Format') . qq|</th>
1712 <td><select name=numberformat>$numberformat</select></td>
1715 <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>
1716 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
1719 <th align=right>| . $locale->text('Language') . qq|</th>
1720 <td><select name=countrycode>$countrycodes</select></td>
1723 <th align=right>| . $locale->text('Character Set') . qq|</th>
1724 <td><input name=charset size=20 value="$myconfig{charset}"></td>
1727 <th align=right>| . $locale->text('Stylesheet') . qq|</th>
1728 <td><select name=usestylesheet>$selectstylesheet</select></td>
1731 <th align=right>| . $locale->text('Setup Menu') . qq|</th>
1732 <td><input name=menustyle type=radio class=radio value=neu $newS> New
1733 <input name=menustyle type=radio class=radio value=old $oldS> Old</td>
1735 <input name=printer type=hidden value="$myconfig{printer}">
1736 <tr class=listheading>
1737 <th colspan=2> </th>
1740 <th align=right>| . $locale->text('Business Number') . qq|</th>
1741 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
1747 <th align=right>| . $locale->text('Year End') . qq| (mm/dd)</th>
1748 <td><input name=yearend size=5 value=$form->{defaults}{yearend}></td>
1749 <th align=right>| . $locale->text('Weight Unit') . qq|</th>
1750 <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
1755 <tr class=listheading>
1757 . $locale->text('Last Numbers & Default Accounts') . qq|</th>
1763 <th align=right nowrap>| . $locale->text('Inventory Account') . qq|</th>
1764 <td><select name=inventory_accno>$myconfig{IC}</select></td>
1767 <th align=right nowrap>| . $locale->text('Revenue Account') . qq|</th>
1768 <td><select name=income_accno>$myconfig{IC_income}</select></td>
1771 <th align=right nowrap>| . $locale->text('Expense Account') . qq|</th>
1772 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
1775 <th align=right nowrap>| . $locale->text('Foreign Exchange Gain') . qq|</th>
1776 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
1779 <th align=right nowrap>| . $locale->text('Foreign Exchange Loss') . qq|</th>
1780 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
1785 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies'
1787 . qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
1796 <th align=right nowrap>| . $locale->text('Last Invoice Number') . qq|</th>
1797 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
1798 <th align=right nowrap>|
1799 . $locale->text('Last Customer Number') . qq|</th>
1800 <td><input name=customernumber size=10 value=$form->{defaults}{customernumber}></td>
1803 <th align=right nowrap>|
1804 . $locale->text('Last Sales Order Number') . qq|</th>
1805 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
1806 <th align=right nowrap>|
1807 . $locale->text('Last Vendor Number') . qq|</th>
1808 <td><input name=vendornumber size=10 value=$form->{defaults}{vendornumber}></td>
1811 <th align=right nowrap>|
1812 . $locale->text('Last Purchase Order Number') . qq|</th>
1813 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
1814 <th align=right nowrap>|
1815 . $locale->text('Last Article Number') . qq|</th>
1816 <td><input name=articlenumber size=10 value=$form->{defaults}{articlenumber}></td>
1819 <th align=right nowrap>|
1820 . $locale->text('Last Sales Quotation Number') . qq|</th>
1821 <td><input name=sqnumber size=10 value=$form->{defaults}{sqnumber}></td>
1822 <th align=right nowrap>|
1823 . $locale->text('Last Service Number') . qq|</th>
1824 <td><input name=servicenumber size=10 value=$form->{defaults}{servicenumber}></td>
1827 <th align=right nowrap>| . $locale->text('Last RFQ Number') . qq|</th>
1828 <td><input name=rfqnumber size=10 value=$form->{defaults}{rfqnumber}></td>
1829 <th align=right nowrap></th>
1835 <tr class=listheading>
1836 <th colspan=2>| . $locale->text('Tax Accounts') . qq|</th>
1843 <th>| . $locale->text('Rate') . qq| (%)</th>
1844 <th>| . $locale->text('Number') . qq|</th>
1848 foreach $accno (sort keys %{ $form->{taxrates} }) {
1851 <th align=right>$form->{taxrates}{$accno}{description}</th>
1852 <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
1853 <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
1856 $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
1859 chop $form->{taxaccounts};
1862 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
1871 <td><hr size=3 noshade></td>
1875 <input type=hidden name=path value=$form->{path}>
1876 <input type=hidden name=login value=$form->{login}>
1877 <input type=hidden name=password value=$form->{password}>
1880 <input type=submit class=submit name=action value="|
1881 . $locale->text('Save') . qq|">|;
1883 if ($form->{menubar}) {
1884 require "$form->{path}/menu.pl";
1895 $lxdebug->leave_sub();
1898 sub save_preferences {
1899 $lxdebug->enter_sub();
1901 $form->{stylesheet} = $form->{usestylesheet};
1903 $form->redirect($locale->text('Preferences saved!'))
1905 AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath, $webdav
1907 $form->error($locale->text('Cannot save preferences!'));
1909 $lxdebug->leave_sub();
1913 $lxdebug->enter_sub();
1915 if ($form->{media} eq 'email') {
1916 $form->error($locale->text('No email address for') . " $myconfig{name}")
1917 unless ($myconfig{email});
1919 $form->{OUT} = "$sendmail";
1923 AM->backup(\%myconfig, \%$form, $userspath);
1925 if ($form->{media} eq 'email') {
1926 $form->redirect($locale->text('Backup sent to') . qq| $myconfig{email}|);
1929 $lxdebug->leave_sub();
1933 $lxdebug->enter_sub();
1935 $form->{title} = $locale->text('Audit Control');
1937 AM->closedto(\%myconfig, \%$form);
1939 if ($form->{revtrans}) {
1940 $checked{Y} = "checked";
1942 $checked{N} = "checked";
1950 <form method=post action=$form->{script}>
1952 <input type=hidden name=path value=$form->{path}>
1953 <input type=hidden name=login value=$form->{login}>
1954 <input type=hidden name=password value=$form->{password}>
1957 <tr><th class=listtop>$form->{title}</th></tr>
1958 <tr height="5"></tr>
1964 . $locale->text('Enforce transaction reversal for all dates') . qq|</th>
1965 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |
1966 . $locale->text('Yes')
1967 . qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |
1968 . $locale->text('No')
1972 <th>| . $locale->text('Close Books up to') . qq|</th>
1973 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
1983 <input type=hidden name=nextsub value=doclose>
1985 <input type=submit class=submit name=action value="|
1986 . $locale->text('Continue') . qq|">
1994 $lxdebug->leave_sub();
1998 $lxdebug->enter_sub();
2000 AM->closebooks(\%myconfig, \%$form);
2002 if ($form->{revtrans}) {
2004 $locale->text('Transaction reversal enforced for all dates'));
2006 if ($form->{closedto}) {
2008 $locale->text('Transaction reversal enforced up to') . " "
2009 . $locale->date(\%myconfig, $form->{closedto}, 1));
2011 $form->redirect($locale->text('Books are open'));
2015 $lxdebug->leave_sub();
2019 $lxdebug->enter_sub();
2021 $form->{title} = "Add";
2024 "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2025 unless $form->{callback};
2030 $lxdebug->leave_sub();
2033 sub edit_warehouse {
2034 $lxdebug->enter_sub();
2036 $form->{title} = "Edit";
2038 AM->get_warehouse(\%myconfig, \%$form);
2043 $lxdebug->leave_sub();
2046 sub list_warehouse {
2047 $lxdebug->enter_sub();
2049 AM->warehouses(\%myconfig, \%$form);
2052 "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2054 $callback = $form->escape($form->{callback});
2056 $form->{title} = $locale->text('Warehouses');
2058 @column_index = qw(description);
2060 $column_header{description} =
2061 qq|<th class=listheading width=100%>|
2062 . $locale->text('Description')
2072 <th class=listtop>$form->{title}</th>
2074 <tr height="5"></tr>
2078 <tr class=listheading>
2081 map { print "$column_header{$_}\n" } @column_index;
2087 foreach $ref (@{ $form->{ALL} }) {
2093 <tr valign=top class=listrow$i>
2096 $column_data{description} =
2097 qq|<td><a href=$form->{script}?action=edit_warehouse&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
2099 map { print "$column_data{$_}\n" } @column_index;
2111 <td><hr size=3 noshade></td>
2116 <form method=post action=$form->{script}>
2118 <input name=callback type=hidden value="$form->{callback}">
2120 <input type=hidden name=type value=warehouse>
2122 <input type=hidden name=path value=$form->{path}>
2123 <input type=hidden name=login value=$form->{login}>
2124 <input type=hidden name=password value=$form->{password}>
2126 <input class=submit type=submit name=action value="|
2127 . $locale->text('Add') . qq|">|;
2129 if ($form->{menubar}) {
2130 require "$form->{path}/menu.pl";
2141 $lxdebug->leave_sub();
2144 sub warehouse_header {
2145 $lxdebug->enter_sub();
2147 $form->{title} = $locale->text("$form->{title} Warehouse");
2149 # $locale->text('Add Warehouse')
2150 # $locale->text('Edit Warehouse')
2152 $form->{description} =~ s/\"/"/g;
2154 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
2156 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
2159 qq|<input name=description size=60 value="$form->{description}">|;
2167 <form method=post action=$form->{script}>
2169 <input type=hidden name=id value=$form->{id}>
2170 <input type=hidden name=type value=warehouse>
2174 <th class=listtop colspan=2>$form->{title}</th>
2176 <tr height="5"></tr>
2178 <th align=right>| . $locale->text('Description') . qq|</th>
2179 <td>$description</td>
2182 <td colspan=2><hr size=3 noshade></td>
2187 $lxdebug->leave_sub();
2190 sub save_warehouse {
2191 $lxdebug->enter_sub();
2193 $form->isblank("description", $locale->text('Description missing!'));
2194 AM->save_warehouse(\%myconfig, \%$form);
2195 $form->redirect($locale->text('Warehouse saved!'));
2197 $lxdebug->leave_sub();
2200 sub delete_warehouse {
2201 $lxdebug->enter_sub();
2203 AM->delete_warehouse(\%myconfig, \%$form);
2204 $form->redirect($locale->text('Warehouse deleted!'));
2206 $lxdebug->leave_sub();
2210 $lxdebug->enter_sub();
2212 &{ $form->{nextsub} };
2214 $lxdebug->leave_sub();