From: Moritz Bunkus Date: Mon, 9 Jan 2012 16:13:33 +0000 (+0100) Subject: Merge branch 'master' of vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-2.7.0beta1~82 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/7edc9f8c5eeec5fd24ccd709efa62f928ab66350?hp=bc88a0d19d2891ea36830ca2dae796975c369d7b Merge branch 'master' of vc.linet-services.de:public/lx-office-erp --- diff --git a/SL/DB/Customer.pm b/SL/DB/Customer.pm index f9f890167..2e3fa6856 100644 --- a/SL/DB/Customer.pm +++ b/SL/DB/Customer.pm @@ -26,11 +26,6 @@ __PACKAGE__->meta->add_relationship( column_map => { id => 'cp_cv_id' }, manager_args => { sort_by => 'lower(contacts.cp_name)' }, }, - business => { - type => 'one to one', - class => 'SL::DB::Business', - column_map => { business_id => 'id' }, - }, ); __PACKAGE__->meta->initialize; diff --git a/SL/DB/MetaSetup/Customer.pm b/SL/DB/MetaSetup/Customer.pm index 00bdb258f..181f6e658 100644 --- a/SL/DB/MetaSetup/Customer.pm +++ b/SL/DB/MetaSetup/Customer.pm @@ -51,14 +51,30 @@ __PACKAGE__->meta->setup( taxzone_id => { type => 'integer', default => '0', not_null => 1 }, greeting => { type => 'text' }, ustid => { type => 'text' }, + direct_debit => { type => 'boolean', default => 'false' }, iban => { type => 'varchar', length => 100 }, bic => { type => 'varchar', length => 100 }, - direct_debit => { type => 'boolean', default => 'false' }, + curr => { type => 'character', length => 3 }, ], primary_key_columns => [ 'id' ], - allow_inline_column_values => 1, + foreign_keys => [ + business => { + class => 'SL::DB::Business', + key_columns => { business_id => 'id' }, + }, + + language_obj => { + class => 'SL::DB::Language', + key_columns => { language_id => 'id' }, + }, + + payment => { + class => 'SL::DB::PaymentTerm', + key_columns => { payment_id => 'id' }, + }, + ], ); 1; diff --git a/SL/DB/MetaSetup/Part.pm b/SL/DB/MetaSetup/Part.pm index d6814e8d0..d4e142b74 100644 --- a/SL/DB/MetaSetup/Part.pm +++ b/SL/DB/MetaSetup/Part.pm @@ -59,6 +59,11 @@ __PACKAGE__->meta->setup( class => 'SL::DB::Buchungsgruppe', key_columns => { buchungsgruppen_id => 'id' }, }, + + unit_obj => { + class => 'SL::DB::Unit', + key_columns => { unit => 'name' }, + }, ], ); diff --git a/SL/DB/MetaSetup/Vendor.pm b/SL/DB/MetaSetup/Vendor.pm index ae71c6293..2fc47cc18 100644 --- a/SL/DB/MetaSetup/Vendor.pm +++ b/SL/DB/MetaSetup/Vendor.pm @@ -54,6 +54,7 @@ __PACKAGE__->meta->setup( direct_debit => { type => 'boolean', default => 'false' }, iban => { type => 'varchar', length => 100 }, bic => { type => 'varchar', length => 100 }, + curr => { type => 'character', length => 3 }, ], primary_key_columns => [ 'id' ], diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm index 22fbc1b4c..952bce278 100644 --- a/SL/DB/Part.pm +++ b/SL/DB/Part.pm @@ -16,11 +16,6 @@ use SL::DB::Helper::CustomVariables ( ); __PACKAGE__->meta->add_relationships( - unit_obj => { - type => 'one to one', - class => 'SL::DB::Unit', - column_map => { unit => 'name' }, - }, assemblies => { type => 'one to many', class => 'SL::DB::Assembly', diff --git a/SL/DO.pm b/SL/DO.pm index 0d2a5ec21..f241cdfb7 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -350,7 +350,7 @@ sub save { conv_i($form->{salesman_id}), conv_i($form->{cp_id}), $form->{transaction_description}, $form->{type} =~ /^sales/ ? 't' : 'f', - conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{curr}, + conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), substr($form->{currency}, 0, 3), conv_i($form->{id})); do_query($form, $dbh, $query, @values); @@ -601,7 +601,7 @@ sub retrieve { d.description AS department, dord.language_id, dord.shipto_id, dord.globalproject_id, dord.delivered, dord.transaction_description, - dord.taxzone_id, dord.taxincluded, dord.terms, dord.curr + dord.taxzone_id, dord.taxincluded, dord.terms, dord.curr AS currency FROM delivery_orders dord JOIN ${vc} cv ON (dord.${vc}_id = cv.id) LEFT JOIN employee e ON (dord.employee_id = e.id) @@ -623,6 +623,9 @@ sub retrieve { } $sth->finish(); + # remove any trailing whitespace + $form->{currency} =~ s/\s*$//; + $form->{donumber_array} =~ s/\s*$//g; $form->{saved_donumber} = $form->{donumber}; diff --git a/SL/Form.pm b/SL/Form.pm index f100b8c90..d0a4157b4 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2857,7 +2857,7 @@ sub create_links { if ($self->{"$self->{vc}_id"}) { # only setup currency - ($self->{currency}) = split(/:/, $self->{currencies}); + ($self->{currency}) = split(/:/, $self->{currencies}) if !$self->{currency}; } else { diff --git a/SL/VK.pm b/SL/VK.pm index 13c7d7f99..c3a2562fd 100644 --- a/SL/VK.pm +++ b/SL/VK.pm @@ -62,6 +62,9 @@ sub invoice_transactions { # Stornierte Rechnungen und Stornorechnungen in invoice rausfiltern $where .= " AND ar.storno is not true "; + # Bestandteile von Erzeugnissen herausfiltern + $where .= " AND i.assemblyitem is not true "; + my $sortorder = "cus.name,i.parts_id,ar.transdate"; if ($form->{sortby} eq 'artikelsort') { $sortorder = "i.parts_id,cus.name,ar.transdate"; diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index b550532ed..2ace9a7b4 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -116,7 +116,7 @@ sub invoice_links { } } - my ($payment_id, $language_id, $taxzone_id); + my ($payment_id, $language_id, $taxzone_id, $currency); if ($form->{payment_id}) { $payment_id = $form->{payment_id}; } @@ -126,6 +126,9 @@ sub invoice_links { if ($form->{taxzone_id}) { $taxzone_id = $form->{taxzone_id}; } + if ($form->{currency}) { + $currency = $form->{currency}; + } my $cp_id = $form->{cp_id}; IR->get_vendor(\%myconfig, \%$form); @@ -141,6 +144,9 @@ sub invoice_links { if ($taxzone_id) { $form->{taxzone_id} = $taxzone_id; } + if ($currency) { + $form->{currency} = $currency; + } my @curr = split(/:/, $form->{currencies}); #seems to be missing map { $form->{selectcurrency} .= "