From: Moritz Bunkus Date: Mon, 28 Nov 2011 15:46:37 +0000 (+0100) Subject: Merge branch 'master' of vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-2.7.0beta1~157^2 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/1167841707ec8fe4ac5964830cd292f129e9f98d?hp=5be5cfeb26291109510e1bd4a88e370d74d05138 Merge branch 'master' of vc.linet-services.de:public/lx-office-erp --- diff --git a/SL/Form.pm b/SL/Form.pm index 15d66cec9..37e4a21b6 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -40,7 +40,6 @@ package Form; use Data::Dumper; use CGI; -use CGI::Ajax; use Cwd; use Encode; use File::Copy; diff --git a/SL/IR.pm b/SL/IR.pm index 2bb56a720..2c46e8f61 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -1464,38 +1464,26 @@ sub post_payment { } sub get_duedate { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; - my $self = shift; - my %params = @_; + my ($self, %params) = @_; if (!$params{vendor_id} || !$params{invdate}) { - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; return $params{default}; } - my $myconfig = \%main::myconfig; - my $form = $main::form; - - my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); - + my $dbh = $::form->get_standard_dbh; my $query = qq|SELECT ?::date + pt.terms_netto FROM vendor v LEFT JOIN payment_terms pt ON (pt.id = v.payment_id) WHERE v.id = ?|; - my ($sth, $duedate); - - if (($sth = $dbh->prepare($query)) && $sth->execute($params{invdate}, conv_i($params{vendor_id}))) { - ($duedate) = $sth->fetchrow_array(); - $sth->finish(); - } else { - $dbh->rollback(); - } + my ($duedate) = selectfirst_array_query($::form, $dbh, $query, $params{invdate}, $params{vendor_id}); $duedate ||= $params{default}; - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; return $duedate; } diff --git a/SL/InstallationCheck.pm b/SL/InstallationCheck.pm index 6311d2b0c..ef1baba5a 100644 --- a/SL/InstallationCheck.pm +++ b/SL/InstallationCheck.pm @@ -11,9 +11,7 @@ BEGIN { @required_modules = ( { name => "parent", url => "http://search.cpan.org/~corion/", debian => 'libparent-perl' }, { name => "Archive::Zip", version => '1.16', url => "http://search.cpan.org/~adamk/", debian => 'libarchive-zip-perl' }, - { name => "Class::Accessor", version => '0.30', url => "http://search.cpan.org/~kasei/", debian => 'libclass-accessor-perl' }, { name => "Config::Std", url => "http://search.cpan.org/~dconway/", debian => 'libconfig-std-perl' }, - { name => "CGI::Ajax", version => '0.697', url => "http://search.cpan.org/~bct/" }, # no debian package, ours contains bugfixes { name => "DateTime", url => "http://search.cpan.org/~drolsky/", debian => 'libdatetime-perl' }, { name => "DBI", version => '1.50', url => "http://search.cpan.org/~timb/", debian => 'libdbi-perl' }, { name => "DBD::Pg", version => '1.49', url => "http://search.cpan.org/~dbdpg/", debian => 'libdbd-pg' }, diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index b6996d169..04b0e9adc 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -43,7 +43,6 @@ use SL::USTVA; use SL::Iconv; use SL::TODO; use SL::Printer; -use CGI::Ajax; use CGI; require "bin/mozilla/common.pl"; @@ -495,15 +494,6 @@ sub list_account { $ca->{link_edit_account} = $link_edit_account . '&id=' . E($ca->{id}); } - # Ajax - my $pjx = new CGI::Ajax('list_account_details' => build_std_url('action=list_account_details')); - - # Eneable AJAX debuging - #$pjx->DEBUG(1); - #$pjx->JSDEBUG(1); - - push(@ { $form->{AJAX} }, $pjx); - $form->use_stylesheet("list_accounts.css"); $form->{title} = $locale->text('Chart of Accounts'); @@ -586,9 +576,8 @@ sub list_account_details { } $form->{title} = $locale->text('Chart of Accounts'); - $form->header(); - print $form->parse_html_template('am/list_account_details'); + print $form->ajax_response_header, $form->parse_html_template('am/list_account_details'); $main::lxdebug->leave_sub(); diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl index d35225204..8915d2f8b 100644 --- a/bin/mozilla/datev.pl +++ b/bin/mozilla/datev.pl @@ -42,303 +42,46 @@ require "bin/mozilla/common.pl"; sub continue { call_sub($main::form->{"nextsub"}); } sub export { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; + DATEV->get_datev_stamm(\%::myconfig, $::form); + $::form->header; + print $::form->parse_html_template('datev/export'); - $main::auth->assert('datev_export'); - - $form->{title} = $locale->text("DATEX - Export Assistent"); - - DATEV->get_datev_stamm(\%myconfig, \%$form); - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text("DATEV Angaben") . qq|
- - - - - - - - - - - - - - - - - - - - - - - - | . # OBE-Export noch nicht implementiert! - qq| - - - - - - - - - - - - - -
| . $locale->text("Beraternummer") . qq|| . $locale->text("DFV-Kennzeichen") . qq|
| . $locale->text("Beratername") . qq|| . $locale->text("Password") . qq|
| . $locale->text("Mandantennummer") . qq|| . $locale->text("Medium Number") . qq|
| . $locale->text("Kontonummernerweiterung (KNE)") . qq|| . $locale->text("Abrechnungsnummer") . qq|
| - . $locale->text("Export Buchungsdaten") . qq| | - . $locale->text("Export Stammdaten") . qq|
-

- - - -
- -
- - - -|; - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export2 { - $main::lxdebug->enter_sub(); - - my $form = $main::form; + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - $main::auth->assert('datev_export'); - - if ($form->{exporttype} == 0) { - &export_bewegungsdaten(); + if ($::form->{exporttype} == 0) { + export_bewegungsdaten(); } else { - &export_stammdaten(); + export_stammdaten(); } - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export_bewegungsdaten { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; + $::form->header; + print $::form->parse_html_template('datev/export_bewegungsdaten'); - $main::auth->assert('datev_export'); - - $form->{title} = $locale->text("DATEX - Export Assistent"); - - $form->{allemonate} = - qq| - - - - - - - - - - - |; - - $form->{allequartale} = - qq| - - - |; - $form->{"jsscript"} = 1; - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text("Zeitraum") . qq|
- - - - - - - - - - - - - - - - - - - -
 | - . $locale->text('Monat') . qq|
 | - . $locale->text('Quartal') . qq|
 | - . $locale->text('Datum von') . qq| - | . $locale->text('bis') . qq| -
-

- -| . $form->write_trigger(\%myconfig, 2, - "transdatefrom", "BL", "trigger_transdatefrom", - "transdateto", "BL", "trigger_transdateto") . qq| - - - - - - - - - - - - - - -
- -
- - - -|; - - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export_stammdaten { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - my $form = $main::form; - my $locale = $main::locale; + $::form->header; + print $::form->parse_html_template('datev/export_stammdaten'); - $main::auth->assert('datev_export'); - - $form->{title} = $locale->text("DATEX - Export Assistent"); - - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text("Konten") . qq|
- - - - - - - - - -
| . $locale->text('Von Konto: ') . qq|
| . $locale->text('Bis Konto: ') . qq|
-

- - - - - - - - - - - - - -
- -
- - - -|; - - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export3 { diff --git a/bin/mozilla/installationcheck.pl b/bin/mozilla/installationcheck.pl index ca8c7895a..4741443df 100644 --- a/bin/mozilla/installationcheck.pl +++ b/bin/mozilla/installationcheck.pl @@ -76,7 +76,7 @@ sub verify_installation { " " . $locale->text("Here's an example command line:") . qq|

-

perl -MCPAN -e "install CGI::Ajax"

+

perl -MCPAN -e "install Config::Std"

| . $locale->text("The third way is to download the module from the " . "above mentioned URL and to install the module " . diff --git a/bin/mozilla/invoice_io.pl b/bin/mozilla/invoice_io.pl index c8097e325..42e402ec8 100644 --- a/bin/mozilla/invoice_io.pl +++ b/bin/mozilla/invoice_io.pl @@ -34,7 +34,6 @@ ####################################################################### use CGI; -use CGI::Ajax; use List::Util qw(max); use SL::Common; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index c569ef8a5..59b594aac 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -38,7 +38,6 @@ use Carp; use CGI; -use CGI::Ajax; use List::Util qw(min max first); use SL::CVar; diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 353b44453..cb3d3a5ad 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -274,10 +274,6 @@ sub form_header { $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - my $set_duedate_url = "$form->{script}?action=set_duedate"; - - push @ { $form->{AJAX} }, new CGI::Ajax( 'set_duedate' => $set_duedate_url ); - my @old_project_ids = ($form->{"globalproject_id"}); map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"}; @@ -820,14 +816,15 @@ sub yes { $main::lxdebug->leave_sub(); } -sub set_duedate_vendor { - $main::lxdebug->enter_sub(); - - my $form = $main::form; +sub get_duedate_vendor { + $::lxdebug->enter_sub; - print $form->ajax_response_header(), IR->get_duedate('vendor_id' => $form->{vendor_id}, - 'invdate' => $form->{invdate}, - 'default' => $form->{old_duedate}); + my $result = IR->get_duedate( + vendor_id => $::form->{vendor_id}, + invdate => $::form->{invdate}, + default => $::form->{old_duedate}, + ); - $main::lxdebug->leave_sub(); + print $::form->ajax_response_header, $result; + $::lxdebug->leave_sub; } diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 686de618b..beb6093f3 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -297,10 +297,6 @@ sub form_header { $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - my $set_duedate_url = "$form->{script}?action=set_duedate"; - - push @ { $form->{AJAX} }, new CGI::Ajax( 'set_duedate' => $set_duedate_url ); - my @old_project_ids = ($form->{"globalproject_id"}); map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"}; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index c9ddfa5be..addf693c5 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1766,9 +1766,11 @@ sub poso { map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal delivered ordnumber); # if purchase_order was generated from sales_order, use lastcost_$i as sellprice_$i + # also reset discounts if ( $form->{sales_order_to_purchase_order} ) { for my $i (1 .. $form->{rowcount}) { $form->{"sellprice_${i}"} = $form->format_amount(\%myconfig,$form->{"lastcost_${i}"}); + $form->{"discount_${i}"} = 0; }; }; diff --git a/doc/INSTALL.html b/doc/INSTALL.html index a6a05f129..95cd087d1 100644 --- a/doc/INSTALL.html +++ b/doc/INSTALL.html @@ -214,13 +214,12 @@ einer Standard-Perl-Installation sind: