From: Moritz Bunkus Date: Mon, 24 Feb 2014 10:18:41 +0000 (+0100) Subject: Lieferscheine -> Rechnungen wandeln: Lieferscheinnummer in jeder Rechnungsposition... X-Git-Tag: release-3.2.0beta~491^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=bb7e2e85d50544c6b72eb40d57f513eeacf578d5;p=kivitendo-erp.git Lieferscheine -> Rechnungen wandeln: Lieferscheinnummer in jeder Rechnungsposition speichern Dies geschieht analog zu invoice.ordnumber als invoice.donumber. In Druckvorlagen steht sie als Variable donumber_do zur Verfügung (auch dies angelehnt an invoice.ordnumber, die als ordnumber_oe zur Verfügung steht). --- diff --git a/SL/DB/MetaSetup/InvoiceItem.pm b/SL/DB/MetaSetup/InvoiceItem.pm index 86e0a9d5d..1d73b7357 100644 --- a/SL/DB/MetaSetup/InvoiceItem.pm +++ b/SL/DB/MetaSetup/InvoiceItem.pm @@ -17,6 +17,7 @@ __PACKAGE__->meta->columns( description => { type => 'text' }, discount => { type => 'float', precision => 4 }, fxsellprice => { type => 'numeric', precision => 5, scale => 15 }, + donumber => { type => 'text' }, id => { type => 'integer', not_null => 1, sequence => 'invoiceid' }, itime => { type => 'timestamp', default => 'now()' }, lastcost => { type => 'numeric', precision => 5, scale => 15 }, diff --git a/SL/DO.pm b/SL/DO.pm index 31b01c424..a0087dee0 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -680,7 +680,7 @@ sub retrieve { 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.pricegroup_id, - pr.projectnumber, dord.transdate AS dord_transdate, + pr.projectnumber, dord.transdate AS dord_transdate, dord.donumber, pg.partsgroup FROM delivery_order_items doi JOIN parts p ON (doi.parts_id = p.id) diff --git a/SL/IS.pm b/SL/IS.pm index 9470f1a9a..c5fd8821f 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -149,7 +149,7 @@ sub invoice_details { my @arrays = qw(runningnumber number description longdescription qty ship unit bin - deliverydate_oe ordnumber_oe transdate_oe validuntil + deliverydate_oe ordnumber_oe donumber_do transdate_oe validuntil partnotes serialnumber reqdate sellprice listprice netprice discount p_discount discount_sub nodiscount_sub linetotal nodiscount_linetotal tax_rate projectnumber projectdescription @@ -210,6 +210,7 @@ sub invoice_details { push @{ $form->{TEMPLATE_ARRAYS}->{sellprice} }, $form->{"sellprice_$i"}; push @{ $form->{TEMPLATE_ARRAYS}->{sellprice_nofmt} }, $form->parse_amount($myconfig, $form->{"sellprice_$i"}); push @{ $form->{TEMPLATE_ARRAYS}->{ordnumber_oe} }, $form->{"ordnumber_$i"}; + push @{ $form->{TEMPLATE_ARRAYS}->{donumber_do} }, $form->{"donumber_$i"}; push @{ $form->{TEMPLATE_ARRAYS}->{transdate_oe} }, $form->{"transdate_$i"}; push @{ $form->{TEMPLATE_ARRAYS}->{invnumber} }, $form->{"invnumber"}; push @{ $form->{TEMPLATE_ARRAYS}->{invdate} }, $form->{"invdate"}; @@ -741,10 +742,10 @@ sub post_invoice { qq|INSERT INTO invoice (id, trans_id, parts_id, description, longdescription, qty, sellprice, fxsellprice, discount, allocated, assemblyitem, unit, deliverydate, project_id, serialnumber, pricegroup_id, - ordnumber, transdate, cusordnumber, base_qty, subtotal, + ordnumber, donumber, transdate, cusordnumber, base_qty, subtotal, marge_percent, marge_total, lastcost, 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"}), @@ -753,7 +754,7 @@ sub post_invoice { $form->{"discount_$i"}, $allocated, 'f', $form->{"unit_$i"}, conv_date($form->{"reqdate_$i"}), conv_i($form->{"project_id_$i"}), $form->{"serialnumber_$i"}, $pricegroup_id, - $form->{"ordnumber_$i"}, conv_date($form->{"transdate_$i"}), + $form->{"ordnumber_$i"}, $form->{"donumber_$i"}, conv_date($form->{"transdate_$i"}), $form->{"cusordnumber_$i"}, $baseqty, $form->{"subtotal_$i"} ? 't' : 'f', $form->{"marge_percent_$i"}, $form->{"marge_absolut_$i"}, $form->{"lastcost_$i"}, @@ -1652,7 +1653,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.transdate, i.cusordnumber, i.subtotal, i.lastcost, + 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, 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 diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index e946e4e4b..06b8f6552 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -775,6 +775,7 @@ sub invoice { } } map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor); + $form->{"donumber_$i"} = $form->{donumber}; } $form->{type} = "invoice"; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index c9f14870b..d47168bc4 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -437,7 +437,7 @@ sub display_row { $cgi->hidden("-name" => "price_new_$i", "-value" => $form->format_amount(\%myconfig, $form->{"price_new_$i"})), map { ($cgi->hidden("-name" => $_, "-id" => $_, "-value" => $form->{$_})); } map { $_."_$i" } (qw(orderitems_id bo pricegroup_old price_old id inventory_accno bin partsgroup partnotes - income_accno expense_accno listprice assembly taxaccounts ordnumber transdate cusordnumber + income_accno expense_accno listprice assembly taxaccounts ordnumber donumber transdate cusordnumber longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars) ); @@ -750,7 +750,7 @@ sub remove_emptied_rows { taxaccounts bin assembly weight projectnumber project_id oldprojectnumber runningnumber serialnumber partsgroup payment_id not_discountable shop ve gv buchungsgruppen_id language_values - sellprice_pg pricegroup_old price_old price_new unit_old ordnumber + sellprice_pg pricegroup_old price_old price_new unit_old ordnumber donumber transdate longdescription basefactor marge_total marge_percent marge_price_factor lastcost price_factor_id partnotes stock_out stock_in has_sernumber reqdate); diff --git a/doc/dokumentation.xml b/doc/dokumentation.xml index 834987090..96a8de2d3 100644 --- a/doc/dokumentation.xml +++ b/doc/dokumentation.xml @@ -3773,6 +3773,15 @@ ln -s $(pwd)/kivitendo-task-server.service /etc/systemd/system/ + + donumber_do + + + Lieferscheinnummer desjenigen Lieferscheins, aus dem die Position stammt, sofern die Rechnung aus einem oder + mehreren Lieferscheinen erstellt wurde + + + p_discount diff --git a/sql/Pg-upgrade2/invoice_add_donumber.sql b/sql/Pg-upgrade2/invoice_add_donumber.sql new file mode 100644 index 000000000..4b3aa722a --- /dev/null +++ b/sql/Pg-upgrade2/invoice_add_donumber.sql @@ -0,0 +1,4 @@ +-- @tag: invoice_add_donumber +-- @description: invoice_add_donumber +-- @depends: release_3_0_0 +ALTER TABLE invoice ADD COLUMN donumber TEXT;