From: Bernd Blessmann Date: Tue, 10 Jan 2012 10:50:59 +0000 (+0100) Subject: Bugfix für Bug 1770 (zweiter Teil): X-Git-Tag: release-2.7.0beta1~69^2~5^2~2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=34f5531fd67d118fcdeaf385d4077eabd328f00c;p=kivitendo-erp.git Bugfix für Bug 1770 (zweiter Teil): Preisgruppen überleben jetzt Workflow über Lieferschein. --- diff --git a/SL/DO.pm b/SL/DO.pm index f241cdfb7..8e4136172 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -252,9 +252,9 @@ sub save { id, delivery_order_id, parts_id, description, longdescription, qty, base_qty, sellprice, discount, unit, reqdate, project_id, serialnumber, ordnumber, transdate, cusordnumber, - lastcost, price_factor_id, price_factor, marge_price_factor) + lastcost, price_factor_id, price_factor, marge_price_factor, pricegroup_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, - (SELECT factor FROM price_factors WHERE id = ?), ?)|; + (SELECT factor FROM price_factors WHERE id = ?), ?, ?)|; my $h_item = prepare_query($form, $dbh, $q_item); my $q_item_stock = @@ -301,7 +301,8 @@ sub save { $form->{"cusordnumber_$i"}, $form->{"lastcost_$i"}, conv_i($form->{"price_factor_id_$i"}), conv_i($form->{"price_factor_id_$i"}), - conv_i($form->{"marge_price_factor_$i"})); + conv_i($form->{"marge_price_factor_$i"}), + conv_i($form->{"pricegroup_id_$i"})); do_statement($form, $h_item, $q_item, @values); my $stock_info = DO->unpack_stock_information('packed' => $form->{"stock_${in_out}_$i"}); @@ -670,7 +671,7 @@ sub retrieve { doi.sellprice, doi.parts_id AS id, doi.unit, doi.discount, p.bin, p.notes AS partnotes, doi.reqdate, doi.project_id, doi.serialnumber, doi.lastcost, doi.ordnumber, doi.transdate, doi.cusordnumber, doi.longdescription, - doi.price_factor_id, doi.price_factor, doi.marge_price_factor, + doi.price_factor_id, doi.price_factor, doi.marge_price_factor, doi.pricegroup_id, pr.projectnumber, dord.transdate AS dord_transdate, pg.partsgroup FROM delivery_order_items doi diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index cc04f5789..2079533a1 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -818,6 +818,13 @@ sub invoice { } + # show pricegroup in newly loaded invoice when creating invoice from delivery order + for my $i (1 .. $form->{rowcount}) { + $form->{"sellprice_pg_$i"} = join /--/, $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"}; + } + IS->get_pricegroups_for_parts(\%myconfig, \%$form); + set_pricegroup($_) for 1 .. $form->{rowcount}; + display_form(); $main::lxdebug->leave_sub(); @@ -916,6 +923,14 @@ sub invoice_multi { invoice_links(); prepare_invoice(); + + # show pricegroup in newly loaded invoice when creating invoice from delivery order + for my $i (1 .. $form->{rowcount}) { + $form->{"sellprice_pg_$i"} = join /--/, $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"}; + } + IS->get_pricegroups_for_parts(\%myconfig, \%$form); + set_pricegroup($_) for 1 .. $form->{rowcount}; + display_form(); $main::lxdebug->leave_sub(); diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 18058437f..1e380cdba 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -400,7 +400,7 @@ sub display_row { if ($is_delivery_order) { map { $form->{"${_}_${i}"} = $form->format_amount(\%myconfig, $form->{"${_}_${i}"}) } qw(sellprice discount lastcost); - push @hidden_vars, qw(sellprice discount not_discountable price_factor_id lastcost); + push @hidden_vars, qw(sellprice discount not_discountable price_factor_id lastcost pricegroup_id); push @hidden_vars, "stock_${stock_in_out}_sum_qty", "stock_${stock_in_out}"; } diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 59479931f..139b6f9f4 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1849,6 +1849,9 @@ sub delivery_order { map { $form->{$_} = $old_values{$_} if ($old_values{$_}) } keys %old_values; + for my $i (1 .. $form->{rowcount}) { + (my $dummy, $form->{"pricegroup_id_$i"}) = split /--/, $form->{"sellprice_pg_$i"}; + } update(); $main::lxdebug->leave_sub(); diff --git a/doc/changelog b/doc/changelog index 78df107cc..479c59eda 100644 --- a/doc/changelog +++ b/doc/changelog @@ -76,6 +76,7 @@ - Bugfix 1738: Entwürfe können nicht gelöscht werden - Bugfix 1759: Währung bei Kunden / Lieferanten vorbelegen - Bugfix 1770: Währung / currency überlebt Workflow über Lieferschein nicht + - Bugfix 1770: (zweiter Teil) Preisgruppen überleben Workflow nicht - Bugfix 1773: SQL Fehler bei Anzeige von Angeboten - Bugfix 1725: In Mahnungen steht currency nicht als Variable zur Verfügung? - Bugfix 1771: Zahlungsausgang: Lieferant wird nicht ausgewählt, wenn Name 2 Leerzeichen hintereinander enthält diff --git a/sql/Pg-upgrade2/delivery_order_items_add_pricegroup_id.sql b/sql/Pg-upgrade2/delivery_order_items_add_pricegroup_id.sql new file mode 100644 index 000000000..4d896d11a --- /dev/null +++ b/sql/Pg-upgrade2/delivery_order_items_add_pricegroup_id.sql @@ -0,0 +1,5 @@ +-- @tag: delivery_order_items_add_pricegroup_id +-- @description: Spalten für Preisgruppen-Id für Lieferscheine +-- @depends: release_2_6_3 +-- @charset: utf-8 +ALTER TABLE delivery_order_items ADD COLUMN pricegroup_id integer;