From: Jan Büren Date: Wed, 6 May 2009 13:16:49 +0000 (+0000) Subject: Fehlerbehebung fuer Bug 736 - Der beim Lieferanten hinterlegte Rabatt wird in dem... X-Git-Tag: release-2.6.0beta2~17 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a325f1b7554914418f885c43211099baa0ce083c;p=kivitendo-erp.git Fehlerbehebung fuer Bug 736 - Der beim Lieferanten hinterlegte Rabatt wird in dem Feld Rabatt zu den jeweiligen Positionen vorbelegt (Einkauf -> Anfrage/Auftrag und Einkauf -> Einkaufsrechnung erfassen) - Ferner ist der Variablenname jetzt auf form->vendor_discount umbenannt --- diff --git a/SL/IR.pm b/SL/IR.pm index 5b0934221..4c57f856d 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -866,7 +866,8 @@ sub get_vendor { } my $query = qq|SELECT - v.id AS vendor_id, v.name AS vendor, v.creditlimit, v.terms, v.notes AS intnotes, + v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount, + v.creditlimit, v.terms, v.notes AS intnotes, v.email, v.cc, v.bcc, v.language_id, v.payment_id, v.street, v.zipcode, v.city, v.country, v.taxzone_id, $duedate + COALESCE(pt.terms_netto, 0) AS duedate, diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 4ad039569..850db5feb 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -137,7 +137,7 @@ sub display_row { { id => 'partnumber', width => 8, value => $locale->text('Number'), display => 1, }, { id => 'description', width => 30, value => $locale->text('Part Description'), display => 1, }, { id => 'ship', width => 5, value => $locale->text('Delivered'), display => $is_s_p_order, }, - { id => 'qty', width => 5, value => $locale->text('Qty'), display => 1, }, + { id => 'qty', width => 5, value => $locale->text('Wo bin ich'), display => 1, }, { id => 'price_factor', width => 5, value => $locale->text('Price Factor'), display => !$is_delivery_order, }, { id => 'unit', width => 5, value => $locale->text('Unit'), display => 1, }, { id => 'license', width => 10, value => $locale->text('License'), display => 0, }, @@ -145,7 +145,7 @@ sub display_row { { id => 'projectnr', width => 10, value => $locale->text('Project'), display => 0, }, { id => 'sellprice', width => 15, value => $locale->text('Price'), display => !$is_delivery_order, }, { id => 'sellprice_pg', width => 8, value => $locale->text('Pricegroup'), display => ($form->{type} =~ /^sales_/) && !$is_delivery_order, }, - { id => 'discount', width => 5, value => $locale->text('Discount'), display => ($form->{vc} eq 'customer') && !$is_delivery_order, }, + { id => 'discount', width => 5, value => $locale->text('Discount'), display => !$is_delivery_order, }, { id => 'linetotal', width => 10, value => $locale->text('Extended'), display => !$is_delivery_order, }, { id => 'bin', width => 10, value => $locale->text('Bin'), display => 0, }, { id => 'stock_in_out', width => 10, value => $stock_in_out_title, display => $is_delivery_order, }, diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 61c87cffc..342304d9b 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -857,7 +857,7 @@ sub form_footer { } print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers); - $form->hide_form(qw(rowcount callback draft_id draft_description)); + $form->hide_form(qw(rowcount callback draft_id draft_description vendor_discount)); # button for saving history if($form->{id} ne "") { @@ -876,7 +876,6 @@ sub form_footer { } # /mark_as_paid button print qq| - |; @@ -941,6 +940,9 @@ sub update { # override sellprice if there is one entered $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"}); + # ergaenzung fuer bug 736 Lieferanten-Rabatt auch in Einkaufsrechnungen vorbelegen jb + $form->{"discount_$i"} = $form->format_amount(\%myconfig, + $form->{vendor_discount} * 100 ); map { $form->{item_list}[$i]{$_} =~ s/\"/"/g } qw(partnumber description unit); map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] }; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index c14cc85ab..c86de3763 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -505,8 +505,12 @@ sub update { } my $rows = scalar @{ $form->{item_list} }; + # hier ist das problem fuer bug 817 $form->{discount} wird nicht durchgeschliffen - $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100); + # ferner fallunterscheidung fuer verkauf oder einkauf s.a. bug 736 jb 04.05.2009 + # select discount as vendor_discount from vendor || + # select discount as customer_discount from customer + $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"$form->{vc}_discount"} * 100); if ($rows) { $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"}); diff --git a/templates/webpages/oe/form_footer_de.html b/templates/webpages/oe/form_footer_de.html index 4891bfde0..641f5dcb7 100644 --- a/templates/webpages/oe/form_footer_de.html +++ b/templates/webpages/oe/form_footer_de.html @@ -155,11 +155,14 @@ [%- END %] [%- END %] [%- END %] - - +[% IF vc == 'customer' %] + +[% ELSE %] + +[% END %] diff --git a/templates/webpages/oe/form_footer_master.html b/templates/webpages/oe/form_footer_master.html index f21b3fd02..eac021573 100644 --- a/templates/webpages/oe/form_footer_master.html +++ b/templates/webpages/oe/form_footer_master.html @@ -155,11 +155,14 @@ [%- END %] [%- END %] [%- END %] - - +[% IF vc == 'customer' %] + +[% ELSE %] + +[% END %]