X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=d75766a3fcb1da47b2f4ebe319ab90f4aefc6b7b;hb=435a5be586488ee4700b0a4fed0c91b5a5e1abfb;hp=b41b0ec9927034a13f40834c928a2aa1bbf8b69b;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index b41b0ec99..d75766a3f 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -31,50 +31,43 @@ # #====================================================================== - use SL::AM; use SL::CA; use SL::Form; use SL::User; - 1; -# end of main - - - -sub add { &{ "add_$form->{type}" } }; -sub edit { &{ "edit_$form->{type}" } }; -sub save { &{ "save_$form->{type}" } }; -sub delete { &{ "delete_$form->{type}" } }; - +# end of main +sub add { &{"add_$form->{type}"} } +sub edit { &{"edit_$form->{type}"} } +sub save { &{"save_$form->{type}"} } +sub delete { &{"delete_$form->{type}"} } sub add_account { $lxdebug->enter_sub(); - - $form->{title} = "Add"; + $form->{title} = "Add"; $form->{charttype} = "A"; AM->get_account(\%myconfig, \%$form); - - $form->{callback} = "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; + + $form->{callback} = + "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}" + unless $form->{callback}; &account_header; &form_footer; - + $lxdebug->leave_sub(); } - sub edit_account { $lxdebug->enter_sub(); - $form->{title} = "Edit"; AM->get_account(\%myconfig, \%$form); - + foreach my $item (split(/:/, $form->{link})) { $form->{$item} = "checked"; } @@ -85,122 +78,171 @@ sub edit_account { $lxdebug->leave_sub(); } - sub account_header { $lxdebug->enter_sub(); - $form->{title} = $locale->text("$form->{title} Account"); - - $checked{$form->{charttype}} = "checked"; + + $checked{ $form->{charttype} } = "checked"; $checked{"$form->{category}_"} = "checked"; $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked"; - + $form->{description} =~ s/\"/"/g; - - if (@{ $form->{TAXKEY} }) { - $form->{selecttaxkey} = "Keine Steuer 0%\n"; - foreach $item (@{ $form->{TAXKEY} }) { - if ($item->{taxkey}==$form->{taxkey_id}) { - $form->{selecttaxkey} .= "{taxkey} selected>$item->{taxdescription}\n";} - else { - $form->{selecttaxkey} .= "{taxkey}>$item->{taxdescription}\n"; - } + if (@{ $form->{TAXKEY} }) { + $form->{selecttaxkey} = "Keine Steuer 0%\n"; + foreach $item (@{ $form->{TAXKEY} }) { + if ($item->{taxkey} == $form->{taxkey_id}) { + $form->{selecttaxkey} .= + "{taxkey} selected>$item->{taxdescription}\n"; + } else { + $form->{selecttaxkey} .= + "{taxkey}>$item->{taxdescription}\n"; + } + } } - } - + $taxkey = qq| - |.$locale->text('Steuersatz').qq| + | . $locale->text('Steuersatz') . qq| $form->{selecttaxkey} |; - $form->{selectustva} = "\n"; - %ustva = ( 48 => "Steuerfrei, Zeile 48", 51 => "Steuerpflichtig 16%, Zeile 51", 86 => "Steuerpflichtig 7%, Zeile 86", 91 => "Steuerfrei, Zeile 91", 97 => "Steuerpflichtig 16%, Zeile 97", 93 => "Steuerpflichtig 7%, Zeile 93", 94 => "Steuerpflichtig 16%, Zeile 94", 66 => "Vorsteuer, Zeile 66"); - foreach $item (sort({ $a <=> $b }keys %ustva)) { - if ($item==$form->{pos_ustva}) { + %ustva = (48 => "Steuerfrei, Zeile 48", + 51 => "Steuerpflichtig 16%, Zeile 51", + 86 => "Steuerpflichtig 7%, Zeile 86", + 91 => "Steuerfrei, Zeile 91", + 97 => "Steuerpflichtig 16%, Zeile 97", + 93 => "Steuerpflichtig 7%, Zeile 93", + 94 => "Steuerpflichtig 16%, Zeile 94", + 66 => "Vorsteuer, Zeile 66"); + foreach $item (sort({ $a <=> $b } keys %ustva)) { + if ($item == $form->{pos_ustva}) { $form->{selectustva} .= "$ustva{$item}\n"; - } else { - $form->{selectustva} .= "$ustva{$item}\n"; + } else { + $form->{selectustva} .= "$ustva{$item}\n"; } - } - - + $ustva = qq| - |.$locale->text('Umsatzsteuervoranmeldung').qq| + | . $locale->text('Umsatzsteuervoranmeldung') . qq| $form->{selectustva} |; $form->{selecteur} = "\n"; - %eur = ( 1 => "Umsatzerlöse", 2 => "sonstige Erlöse", 3 => "Privatanteile", 4 => "Zinserträge", 5 => "Ausserordentliche Erträge", 6 => "Vereinnahmte Umsatzst.", 7 => "Umsatzsteuererstattungen", 8 => "Wareneingänge", 9 => "Löhne und Gehälter", 10 => "Gesetzl. sozialer Aufw.", 11 => "Mieten", 12 => "Gas, Strom, Wasser", 13 => "Instandhaltung", 14 => "Steuern, Versich., Beiträge", 15 => "Kfz-Steuern", 16 => "Kfz-Versicherungen", 17 => "Sonst. Fahrtkosten", 18 => "Werbe- und Reisekosten", 19 => "Instandhaltung u. Werkzeuge", 20 => "Fachzeitschriften, Bücher", 21 => "Miete für Einrichtungen", 22 => "Rechts- und Beratungskosten", 23 => "Bürobedarf, Porto, Telefon", 24 => "Sonstige Aufwendungen", 25 => "Abschreibungen auf Anlagever.", 26 => "Abschreibungen auf GWG", 27 => "Vorsteuer", 28 => "Umsatzsteuerzahlungen", 29 => "Zinsaufwand", 30 => "Ausserordentlicher Aufwand", 31 => "Betriebliche Steuern"); + %eur = (1 => "Umsatzerlöse", + 2 => "sonstige Erlöse", + 3 => "Privatanteile", + 4 => "Zinserträge", + 5 => "Ausserordentliche Erträge", + 6 => "Vereinnahmte Umsatzst.", + 7 => "Umsatzsteuererstattungen", + 8 => "Wareneingänge", + 9 => "Löhne und Gehälter", + 10 => "Gesetzl. sozialer Aufw.", + 11 => "Mieten", + 12 => "Gas, Strom, Wasser", + 13 => "Instandhaltung", + 14 => "Steuern, Versich., Beiträge", + 15 => "Kfz-Steuern", + 16 => "Kfz-Versicherungen", + 17 => "Sonst. Fahrtkosten", + 18 => "Werbe- und Reisekosten", + 19 => "Instandhaltung u. Werkzeuge", + 20 => "Fachzeitschriften, Bücher", + 21 => "Miete für Einrichtungen", + 22 => "Rechts- und Beratungskosten", + 23 => "Bürobedarf, Porto, Telefon", + 24 => "Sonstige Aufwendungen", + 25 => "Abschreibungen auf Anlagever.", + 26 => "Abschreibungen auf GWG", + 27 => "Vorsteuer", + 28 => "Umsatzsteuerzahlungen", + 29 => "Zinsaufwand", + 30 => "Ausserordentlicher Aufwand", + 31 => "Betriebliche Steuern"); foreach $item (sort({ $a <=> $b } keys(%eur))) { - if ($item==$form->{pos_eur}) { + if ($item == $form->{pos_eur}) { $form->{selecteur} .= "$eur{$item}\n"; - } else { - $form->{selecteur} .= "$eur{$item}\n"; + } else { + $form->{selecteur} .= "$eur{$item}\n"; } - } - - + $eur = qq| - |.$locale->text('EÜR').qq| + | . $locale->text('EÜR') . qq| $form->{selecteur} |; $form->{selectbwa} = "\n"; - - %bwapos = (1 => 'Umsatzerlöse', 2 => 'Best.Verdg.FE/UE', 3 => 'Aktiv.Eigenleistung', 4 => 'Mat./Wareneinkauf', 5 => 'So.betr.Erlöse', 10 => 'Personalkosten', 11 => 'Raumkosten', 12 => 'Betriebl.Steuern', 13 => 'Vers./Beiträge', 14 => 'Kfz.Kosten o.St.', 15 => 'Werbe-Reisek.', 16 => 'Kosten Warenabgabe', 17 => 'Abschreibungen', 18 => 'Rep./instandhlt.', 19 => 'Übrige Steuern', 20 => 'Sonst.Kosten', 30 => 'Zinsauwand', 31 => 'Sonst.neutr.Aufw.', 32 => 'Zinserträge', 33 => 'Sonst.neutr.Ertrag', 34 => 'Verr.kalk.Kosten', 35 => 'Steuern Eink.u.Ertr.'); + + %bwapos = (1 => 'Umsatzerlöse', + 2 => 'Best.Verdg.FE/UE', + 3 => 'Aktiv.Eigenleistung', + 4 => 'Mat./Wareneinkauf', + 5 => 'So.betr.Erlöse', + 10 => 'Personalkosten', + 11 => 'Raumkosten', + 12 => 'Betriebl.Steuern', + 13 => 'Vers./Beiträge', + 14 => 'Kfz.Kosten o.St.', + 15 => 'Werbe-Reisek.', + 16 => 'Kosten Warenabgabe', + 17 => 'Abschreibungen', + 18 => 'Rep./instandhlt.', + 19 => 'Übrige Steuern', + 20 => 'Sonst.Kosten', + 30 => 'Zinsauwand', + 31 => 'Sonst.neutr.Aufw.', + 32 => 'Zinserträge', + 33 => 'Sonst.neutr.Ertrag', + 34 => 'Verr.kalk.Kosten', + 35 => 'Steuern Eink.u.Ertr.'); foreach $item (sort({ $a <=> $b } keys %bwapos)) { - if ($item==$form->{pos_bwa}) { + if ($item == $form->{pos_bwa}) { $form->{selectbwa} .= "$bwapos{$item}\n"; } else { $form->{selectbwa} .= "$bwapos{$item}\n"; } - } - - + $bwa = qq| - |.$locale->text('BWA').qq| + | . $locale->text('BWA') . qq| $form->{selectbwa} |; $form->{selectbilanz} = "\n"; foreach $item ((1, 2, 3, 4)) { - if ($item==$form->{pos_bilanz}) { + if ($item == $form->{pos_bilanz}) { $form->{selectbilanz} .= "$item\n"; } else { $form->{selectbilanz} .= "$item\n"; } - } - - + $bilanz = qq| - |.$locale->text('Bilanz').qq| + | . $locale->text('Bilanz') . qq| $form->{selectbilanz} |; -# this is for our parser only! -# type=submit $locale->text('Add Account') -# type=submit $locale->text('Edit Account') + + # this is for our parser only! + # type=submit $locale->text('Add Account') + # type=submit $locale->text('Edit Account') $form->header; @@ -227,97 +269,113 @@ sub account_header { - |.$locale->text('Account Number').qq| + | . $locale->text('Account Number') . qq| {accno}> - |.$locale->text('Description').qq| + | . $locale->text('Description') . qq| - |.$locale->text('Account Type').qq| + | . $locale->text('Account Type') . qq| - |.$locale->text('Asset').qq|\n - |.$locale->text('Liability').qq|\n - |.$locale->text('Equity').qq|\n - |.$locale->text('Revenue').qq|\n - |.$locale->text('Expense') - .qq| + | + . $locale->text('Asset') . qq|\n + | + . $locale->text('Liability') . qq|\n + | + . $locale->text('Equity') . qq|\n + | + . $locale->text('Revenue') . qq|\n + | + . $locale->text('Expense') . qq| - |.$locale->text('Heading').qq| - |.$locale->text('Account') - .qq| + | + . $locale->text('Heading') . qq| + | + . $locale->text('Account') . qq| |; - -if ($form->{charttype} eq "A") { - print qq| + if ($form->{charttype} eq "A") { + print qq| - |.$locale->text('Is this a summary account to record').qq| + | + . $locale->text('Is this a summary account to record') . qq| - {AR}> |.$locale->text('AR') - .qq| {AP}> |.$locale->text('AP') - .qq| {IC}> |.$locale->text('Inventory') - .qq| + {AR}> | + . $locale->text('AR') + . qq| {AP}> | + . $locale->text('AP') + . qq| {IC}> | + . $locale->text('Inventory') + . qq| - |.$locale->text('Include in drop-down menus').qq| + | . $locale->text('Include in drop-down menus') . qq| - |.$locale->text('Receivables').qq| - |.$locale->text('Payables').qq| - |.$locale->text('Parts Inventory').qq| - |.$locale->text('Service Items').qq| + | . $locale->text('Receivables') . qq| + | . $locale->text('Payables') . qq| + | . $locale->text('Parts Inventory') . qq| + | . $locale->text('Service Items') . qq| - {AR_amount}> |.$locale->text('Revenue').qq|\n - {AR_paid}> |.$locale->text('Receipt').qq|\n - {AR_tax}> |.$locale->text('Tax') - .qq| + {AR_amount}> | + . $locale->text('Revenue') . qq|\n + {AR_paid}> | + . $locale->text('Receipt') . qq|\n + {AR_tax}> | + . $locale->text('Tax') . qq| - {AP_amount}> |.$locale->text('Expense/Asset').qq|\n - {AP_paid}> |.$locale->text('Payment').qq|\n - {AP_tax}> |.$locale->text('Tax') - .qq| + {AP_amount}> | + . $locale->text('Expense/Asset') . qq|\n + {AP_paid}> | + . $locale->text('Payment') . qq|\n + {AP_tax}> | + . $locale->text('Tax') . qq| - {IC_sale}> |.$locale->text('Revenue').qq|\n - {IC_cogs}> |.$locale->text('COGS').qq|\n - {IC_taxpart}> |.$locale->text('Tax') - .qq| + {IC_sale}> | + . $locale->text('Revenue') . qq|\n + {IC_cogs}> | + . $locale->text('COGS') . qq|\n + {IC_taxpart}> | + . $locale->text('Tax') . qq| - {IC_income}> |.$locale->text('Revenue').qq|\n - {IC_expense}> |.$locale->text('Expense').qq|\n - {IC_taxservice}> |.$locale->text('Tax') - .qq| + {IC_income}> | + . $locale->text('Revenue') . qq|\n + {IC_expense}> | + . $locale->text('Expense') . qq|\n + {IC_taxservice}> | + . $locale->text('Tax') . qq| - - + + |; -} + } -print qq| + print qq| $taxkey $ustva $eur @@ -335,11 +393,9 @@ print qq| $lxdebug->leave_sub(); } - sub form_footer { $lxdebug->enter_sub(); - print qq| @@ -349,18 +405,20 @@ sub form_footer { {password}> - + |; if ($form->{id} && $form->{orphaned}) { - print qq||; + print qq||; } if ($form->{menubar}) { require "$form->{path}/menu.pl"; &menubar; } - + print qq| @@ -371,41 +429,40 @@ sub form_footer { $lxdebug->leave_sub(); } - sub save_account { $lxdebug->enter_sub(); - - $form->isblank("accno", $locale->text('Account Number missing!')); + $form->isblank("accno", $locale->text('Account Number missing!')); $form->isblank("category", $locale->text('Account Type missing!')); - - $form->redirect($locale->text('Account saved!')) if (AM->save_account(\%myconfig, \%$form)); + + $form->redirect($locale->text('Account saved!')) + if (AM->save_account(\%myconfig, \%$form)); $form->error($locale->text('Cannot save account!')); $lxdebug->leave_sub(); } - sub list_account { $lxdebug->enter_sub(); - CA->all_accounts(\%myconfig, \%$form); $form->{title} = $locale->text('Chart of Accounts'); - + # construct callback - $callback = "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}"; + $callback = + "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}"; @column_index = qw(accno gifi_accno description debit credit link); - $column_header{accno} = qq||.$locale->text('Account').qq||; - $column_header{gifi_accno} = qq||.$locale->text('GIFI').qq||; - $column_header{description} = qq||.$locale->text('Description').qq||; - $column_header{debit} = qq||.$locale->text('Debit').qq||; - $column_header{credit} = qq||.$locale->text('Credit').qq||; - $column_header{link} = qq||.$locale->text('Link').qq||; - + $column_header{accno} = qq|| . $locale->text('Account') . qq||; + $column_header{gifi_accno} = + qq|| . $locale->text('GIFI') . qq||; + $column_header{description} = + qq|| . $locale->text('Description') . qq||; + $column_header{debit} = qq|| . $locale->text('Debit') . qq||; + $column_header{credit} = qq|| . $locale->text('Credit') . qq||; + $column_header{link} = qq|| . $locale->text('Link') . qq||; $form->header; $colspan = $#column_index + 1; @@ -422,24 +479,26 @@ sub list_account { |; map { print "$column_header{$_}\n" } @column_index; - + print qq| |; # escape callback $callback = $form->escape($callback); - + foreach $ca (@{ $form->{CA} }) { - - $ca->{debit} = " "; + + $ca->{debit} = " "; $ca->{credit} = " "; if ($ca->{amount} > 0) { - $ca->{credit} = $form->format_amount(\%myconfig, $ca->{amount}, 2, " "); + $ca->{credit} = + $form->format_amount(\%myconfig, $ca->{amount}, 2, " "); } if ($ca->{amount} < 0) { - $ca->{debit} = $form->format_amount(\%myconfig, -$ca->{amount}, 2, " "); + $ca->{debit} = + $form->format_amount(\%myconfig, -$ca->{amount}, 2, " "); } $ca->{link} =~ s/://og; @@ -447,31 +506,36 @@ sub list_account { if ($ca->{charttype} eq "H") { print qq||; - $column_data{accno} = qq|{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}|; - $column_data{gifi_accno} = qq|{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno} |; + $column_data{accno} = + qq|{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}|; + $column_data{gifi_accno} = + qq|{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno} |; $column_data{description} = qq|$ca->{description} |; - $column_data{debit} = qq| |; - $column_data{credit} = qq| |; - $column_data{link} = qq| |; + $column_data{debit} = qq| |; + $column_data{credit} = qq| |; + $column_data{link} = qq| |; } else { - $i++; $i %= 2; + $i++; + $i %= 2; print qq| |; - $column_data{accno} = qq|{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}|; - $column_data{gifi_accno} = qq|{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno} |; + $column_data{accno} = + qq|{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}|; + $column_data{gifi_accno} = + qq|{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno} |; $column_data{description} = qq|$ca->{description} |; - $column_data{debit} = qq|$ca->{debit}|; - $column_data{credit} = qq|$ca->{credit}|; - $column_data{link} = qq|$ca->{link} |; - + $column_data{debit} = qq|$ca->{debit}|; + $column_data{credit} = qq|$ca->{credit}|; + $column_data{link} = qq|$ca->{link} |; + } map { print "$column_data{$_}\n" } @column_index; - + print "\n"; } - + print qq| @@ -483,46 +547,46 @@ sub list_account { $lxdebug->leave_sub(); } - sub delete_account { $lxdebug->enter_sub(); - $form->{title} = $locale->text('Delete Account'); - foreach $id (qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)) { + foreach $id ( + qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id) + ) { if ($form->{id} == $form->{$id}) { $form->error($locale->text('Cannot delete default account!')); } } - $form->redirect($locale->text('Account deleted!')) if (AM->delete_account(\%myconfig, \%$form)); + $form->redirect($locale->text('Account deleted!')) + if (AM->delete_account(\%myconfig, \%$form)); $form->error($locale->text('Cannot delete account!')); $lxdebug->leave_sub(); } - sub list_gifi { $lxdebug->enter_sub(); - @{ $form->{fields} } = (accno, description); - $form->{table} = "gifi"; + $form->{table} = "gifi"; $form->{sortorder} = "accno"; - + AM->gifi_accounts(\%myconfig, \%$form); $form->{title} = $locale->text('GIFI'); - + # construct callback - $callback = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}"; + $callback = + "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}"; @column_index = qw(accno description); - $column_header{accno} = qq||.$locale->text('GIFI').qq||; - $column_header{description} = qq||.$locale->text('Description').qq||; - + $column_header{accno} = qq|| . $locale->text('GIFI') . qq||; + $column_header{description} = + qq|| . $locale->text('Description') . qq||; $form->header; $colspan = $#column_index + 1; @@ -539,29 +603,31 @@ sub list_gifi { |; map { print "$column_header{$_}\n" } @column_index; - + print qq| |; # escape callback $callback = $form->escape($callback); - + foreach $ca (@{ $form->{ALL} }) { - - $i++; $i %= 2; - + + $i++; + $i %= 2; + print qq| |; - - $column_data{accno} = qq|{script}?action=edit_gifi&coa=1&accno=$ca->{accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}|; + + $column_data{accno} = + qq|{script}?action=edit_gifi&coa=1&accno=$ca->{accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}|; $column_data{description} = qq|$ca->{description} |; - + map { print "$column_data{$_}\n" } @column_index; - + print "\n"; } - + print qq| @@ -575,47 +641,43 @@ sub list_gifi { $lxdebug->leave_sub(); } - sub add_gifi { $lxdebug->enter_sub(); $form->{title} = "Add"; - + # construct callback - $form->{callback} = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}"; + $form->{callback} = + "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}"; $form->{coa} = 1; - + &gifi_header; &gifi_footer; - + $lxdebug->leave_sub(); } - sub edit_gifi { $lxdebug->enter_sub(); - $form->{title} = "Edit"; AM->get_gifi(\%myconfig, \%$form); - + &gifi_header; &gifi_footer; - + $lxdebug->leave_sub(); } - sub gifi_header { $lxdebug->enter_sub(); - $form->{title} = $locale->text("$form->{title} GIFI"); - -# $locale->text('Add GIFI') -# $locale->text('Edit GIFI') + + # $locale->text('Add GIFI') + # $locale->text('Edit GIFI') $form->{description} =~ s/\"/"/g; @@ -638,11 +700,11 @@ sub gifi_header { - |.$locale->text('GIFI').qq| + | . $locale->text('GIFI') . qq| {accno}> - |.$locale->text('Description').qq| + | . $locale->text('Description') . qq| @@ -657,11 +719,9 @@ sub gifi_header { $lxdebug->leave_sub(); } - sub gifi_footer { $lxdebug->enter_sub(); - print qq| @@ -670,15 +730,18 @@ sub gifi_footer { {login}> {password}> -|; +|; if ($form->{coa}) { print qq| - + |; if ($form->{accno} && $form->{orphaned}) { - print qq||; + print qq||; } } @@ -697,11 +760,9 @@ sub gifi_footer { $lxdebug->leave_sub(); } - sub save_gifi { $lxdebug->enter_sub(); - $form->isblank("accno", $locale->text('GIFI missing!')); AM->save_gifi(\%myconfig, \%$form); $form->redirect($locale->text('GIFI saved!')); @@ -709,46 +770,42 @@ sub save_gifi { $lxdebug->leave_sub(); } - sub copy_to_coa { $lxdebug->enter_sub(); - $form->isblank("accno", $locale->text('GIFI missing!')); AM->save_gifi(\%myconfig, \%$form); delete $form->{id}; $form->{gifi_accno} = $form->{accno}; - $form->{title} = "Add"; - $form->{charttype} = "A"; - + $form->{title} = "Add"; + $form->{charttype} = "A"; + &account_header; &form_footer; - + $lxdebug->leave_sub(); } - sub delete_gifi { $lxdebug->enter_sub(); - AM->delete_gifi(\%myconfig, \%$form); $form->redirect($locale->text('GIFI deleted!')); $lxdebug->leave_sub(); } - sub add_department { $lxdebug->enter_sub(); - $form->{title} = "Add"; - $form->{role} = "P"; - - $form->{callback} = "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; + $form->{role} = "P"; + + $form->{callback} = + "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}" + unless $form->{callback}; &department_header; &form_footer; @@ -756,11 +813,9 @@ sub add_department { $lxdebug->leave_sub(); } - sub edit_department { $lxdebug->enter_sub(); - $form->{title} = "Edit"; AM->get_department(\%myconfig, \%$form); @@ -771,24 +826,32 @@ sub edit_department { $lxdebug->leave_sub(); } - sub list_department { $lxdebug->enter_sub(); - AM->departments(\%myconfig, \%$form); - $form->{callback} = "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"; + $form->{callback} = + "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"; $callback = $form->escape($form->{callback}); - + $form->{title} = $locale->text('Departments'); @column_index = qw(description cost profit); - $column_header{description} = qq||.$locale->text('Description').qq||; - $column_header{cost} = qq||.$locale->text('Cost Center').qq||; - $column_header{profit} = qq||.$locale->text('Profit Center').qq||; + $column_header{description} = + qq|| + . $locale->text('Description') + . qq||; + $column_header{cost} = + qq|| + . $locale->text('Cost Center') + . qq||; + $column_header{profit} = + qq|| + . $locale->text('Profit Center') + . qq||; $form->header; @@ -813,23 +876,25 @@ sub list_department { |; foreach $ref (@{ $form->{ALL} }) { - - $i++; $i %= 2; - + + $i++; + $i %= 2; + print qq| |; - $costcenter = ($ref->{role} eq "C") ? "X" : ""; - $profitcenter = ($ref->{role} eq "P") ? "X" : ""; - - $column_data{description} = qq|{script}?action=edit_department&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}|; - $column_data{cost} = qq|$costcenter|; - $column_data{profit} = qq|$profitcenter|; + $costcenter = ($ref->{role} eq "C") ? "X" : ""; + $profitcenter = ($ref->{role} eq "P") ? "X" : ""; + + $column_data{description} = + qq|{script}?action=edit_department&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}|; + $column_data{cost} = qq|$costcenter|; + $column_data{profit} = qq|$profitcenter|; - map { print "$column_data{$_}\n" } @column_index; + map { print "$column_data{$_}\n" } @column_index; - print qq| + print qq| |; } @@ -854,7 +919,8 @@ sub list_department { {login}> {password}> -|; +|; if ($form->{menubar}) { require "$form->{path}/menu.pl"; @@ -863,35 +929,35 @@ sub list_department { print qq| - +