X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7148aad6ec1cb80332c9fba6232e3fc825807307..53593baa211863fbf66540cf1bcc36c8fb37257f:/bin/mozilla/arap.pl diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl deleted file mode 100644 index 1ed40a7f9..000000000 --- a/bin/mozilla/arap.pl +++ /dev/null @@ -1,462 +0,0 @@ -#===================================================================== -# LX-Office ERP -# Copyright (C) 2004 -# Based on SQL-Ledger Version 2.1.9 -# Web http://www.lx-office.org -# -#===================================================================== -# SQL-Ledger Accounting -# Copyright (c) 2002 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.sql-ledger.org -# -# -# 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. -#====================================================================== -# -# common routines for gl, ar, ap, is, ir, oe -# - -use SL::Projects; - -# any custom scripts for this one -if (-f "bin/mozilla/custom_arap.pl") { - eval { require "bin/mozilla/custom_arap.pl"; }; -} -if (-f "bin/mozilla/$form->{login}_arap.pl") { - eval { require "bin/mozilla/$form->{login}_arap.pl"; }; -} - -1; - -require "bin/mozilla/common.pl"; - -# end of main - -sub check_name { - $lxdebug->enter_sub(); - - $auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . - 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash |' . - 'purchase_delivery_order_edit | sales_delivery_order_edit'); - - my ($name) = @_; - - $name = $name eq "customer" ? "customer" : "vendor"; - - my ($new_name, $new_id) = split /--/, $form->{$name}; - my $i = 0; - # if we use a selection - if ($form->{"select$name"}) { - if ($form->{"old$name"} ne $form->{$name}) { - - # this is needed for is, ir and oe - $form->{update} = 0; - # for credit calculations - $form->{oldinvtotal} = 0; - $form->{oldtotalpaid} = 0; - $form->{calctax} = 1; - - $form->{"${name}_id"} = $new_id; - - IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer'); - IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor'); - - $form->{$name} = $form->{"old$name"} = "$new_name--$new_id"; - - $i = 1; - } - } else { - - # check name, combine name and id - if ($form->{"old$name"} ne qq|$form->{$name}--$form->{"${name}_id"}|) { - - # this is needed for is, ir and oe - $form->{update} = 0; - - # for credit calculations - $form->{oldinvtotal} = 0; - $form->{oldtotalpaid} = 0; - $form->{calctax} = 1; - - # return one name or a list of names in $form->{name_list} - if (($i = $form->get_name(\%myconfig, $name)) > 1) { - &select_name($name); - exit; - } - - if ($i == 1) { - - # we got one name - $form->{"${name}_id"} = $form->{name_list}[0]->{id}; - $form->{$name} = $form->{name_list}[0]->{name}; - $form->{"old$name"} = qq|$form->{$name}--$form->{"${name}_id"}|; - - IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer'); - IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor'); - - } else { - - # name is not on file - # $locale->text('Customer not on file or locked!') - # $locale->text('Vendor not on file or locked!') - $msg = ucfirst $name . " not on file or locked!"; - $form->error($locale->text($msg)); - } - } - } - $form->language_payment(\%myconfig); - - $lxdebug->leave_sub(); - - return $i; -} - -# $locale->text('Customer not on file!') -# $locale->text('Vendor not on file!') - -sub select_name { - $lxdebug->enter_sub(); - - $auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . - 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash'); - - my ($table) = @_; - - @column_index = qw(ndx name address); - - $label = ucfirst $table; - $column_data{ndx} = qq|