#=====================================================================
# LedgerSMB Small Medium Business Accounting
# Copyright (c) 2002
#
# Author: DWS Systems Inc.
# Web: http://sourceforge.net/projects/ledger-smb/
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#======================================================================
#
# project/job administration
# partsgroup administration
# translation maintainance
#
#======================================================================
use SL::PE;
use SL::AA;
use SL::OE;
1;
# end of main
sub add {
# construct callback
$form->{callback} = "$form->{script}?action=add&type=$form->{type}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}" unless $form->{callback};
&{ "prepare_$form->{type}" };
$form->{orphaned} = 1;
&display_form;
}
sub edit {
&{ "prepare_$form->{type}" };
&display_form;
}
sub prepare_partsgroup { PE->get_partsgroup(\%myconfig, \%$form) if $form->{id} }
sub prepare_pricegroup { PE->get_pricegroup(\%myconfig, \%$form) if $form->{id} }
sub prepare_job {
# $locale->text('Add Job')
# $locale->text('Edit Job')
$form->{vc} = 'customer';
PE->get_job(\%myconfig, \%$form);
$form->{taxaccounts} = "";
for (keys %{ $form->{IC_links} }) {
$form->{"select$_"} = "";
foreach $ref (@{ $form->{IC_links}{$_} }) {
if (/IC_tax/) {
if (/taxpart/) {
$form->{taxaccounts} .= "$ref->{accno} ";
$form->{"IC_tax_$ref->{accno}_description"} = "$ref->{accno}--$ref->{description}";
if ($form->{id}) {
if ($form->{amount}{$ref->{accno}}) {
$form->{"IC_tax_$ref->{accno}"} = "checked";
}
} else {
$form->{"IC_tax_$ref->{accno}"} = "checked";
}
}
} else {
$form->{"select$_"} .= "