From: Sven Schöling Date: Tue, 5 Aug 2014 11:18:34 +0000 (+0200) Subject: PriceSource: bei Rechnungen mitspeichern X-Git-Tag: release-3.2.0beta~165 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6d3c1977881e0de8857f57e64e66e80482e21f42;p=kivitendo-erp.git PriceSource: bei Rechnungen mitspeichern --- diff --git a/SL/IR.pm b/SL/IR.pm index 1dde56f74..6c5c5019b 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -382,13 +382,15 @@ sub post_invoice { qq|INSERT INTO invoice (id, trans_id, parts_id, description, longdescription, qty, base_qty, sellprice, fxsellprice, discount, allocated, unit, deliverydate, project_id, serialnumber, price_factor_id, price_factor, marge_price_factor) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, (SELECT factor FROM price_factors WHERE id = ?), ?)|; + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, (SELECT factor FROM price_factors WHERE id = ?), ?, ?)|; @values = ($invoice_id, conv_i($form->{id}), conv_i($form->{"id_$i"}), $form->{"description_$i"}, $restricter->process($form->{"longdescription_$i"}), $form->{"qty_$i"} * -1, $baseqty * -1, $form->{"sellprice_$i"}, $fxsellprice, $form->{"discount_$i"}, $allocated, $form->{"unit_$i"}, conv_date($form->{deliverydate}), conv_i($form->{"project_id_$i"}), $form->{"serialnumber_$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->{"price_factor_id_$i"}), conv_i($form->{"price_factor_id_$i"}), conv_i($form->{"marge_price_factor_$i"}), + conv_i($form->{"active_price_source_$i"}), + ); do_query($form, $dbh, $query, @values); CVar->save_custom_variables(module => 'IC', @@ -976,7 +978,7 @@ sub retrieve_invoice { i.id AS invoice_id, i.description, i.longdescription, i.qty, i.fxsellprice AS sellprice, i.parts_id AS id, i.unit, i.deliverydate, i.project_id, i.serialnumber, - i.price_factor_id, i.price_factor, i.marge_price_factor, i.discount, + i.price_factor_id, i.price_factor, i.marge_price_factor, i.discount, i.active_price_source, p.partnumber, p.inventory_accno_id AS part_inventory_accno_id, pr.projectnumber, pg.partsgroup FROM invoice i diff --git a/SL/IS.pm b/SL/IS.pm index 5c156a675..e7a437e41 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -761,9 +761,9 @@ sub post_invoice { sellprice, fxsellprice, discount, allocated, assemblyitem, unit, deliverydate, project_id, serialnumber, pricegroup_id, ordnumber, donumber, transdate, cusordnumber, base_qty, subtotal, - marge_percent, marge_total, lastcost, + marge_percent, marge_total, lastcost, active_price_source, price_factor_id, price_factor, marge_price_factor) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, (SELECT factor FROM price_factors WHERE id = ?), ?)|; @values = ($invoice_id, conv_i($form->{id}), conv_i($form->{"id_$i"}), @@ -776,6 +776,7 @@ sub post_invoice { $form->{"cusordnumber_$i"}, $baseqty, $form->{"subtotal_$i"} ? 't' : 'f', $form->{"marge_percent_$i"}, $form->{"marge_absolut_$i"}, $form->{"lastcost_$i"}, + $form->{"active_price_source_$i"}, conv_i($form->{"price_factor_id_$i"}), conv_i($form->{"price_factor_id_$i"}), conv_i($form->{"marge_price_factor_$i"})); do_query($form, $dbh, $query, @values); @@ -1677,7 +1678,7 @@ sub retrieve_invoice { i.id AS invoice_id, i.description, i.longdescription, i.qty, i.fxsellprice AS sellprice, i.discount, i.parts_id AS id, i.unit, i.deliverydate AS reqdate, i.project_id, i.serialnumber, i.id AS invoice_pos, i.pricegroup_id, i.ordnumber, i.donumber, i.transdate, i.cusordnumber, i.subtotal, i.lastcost, - i.price_factor_id, i.price_factor, i.marge_price_factor, + i.price_factor_id, i.price_factor, i.marge_price_factor, i.active_price_source, p.partnumber, p.assembly, p.notes AS partnotes, p.inventory_accno_id AS part_inventory_accno_id, p.formel, p.listprice, pr.projectnumber, pg.partsgroup, prg.pricegroup