From edf62911e889cf7a6189aafd49f66b2aa396a0c8 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 10 Jul 2007 19:27:48 +0000 Subject: Removing old menu.ini git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1370 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/IR.pm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/IR.pm b/LedgerSMB/IR.pm index f3008ef3..25b305a7 100644 --- a/LedgerSMB/IR.pm +++ b/LedgerSMB/IR.pm @@ -406,8 +406,6 @@ sub post_invoice { $form->update_balance( $dbh, "invoice", "allocated", qq|id = $ref->{id}|, $qty * -1 ); - $form->update_balance( $dbh, "invoice", "allocated", - qq|id =$invoice_id|,$qty); $allocated += $qty; @@ -432,6 +430,33 @@ sub post_invoice { }; } + $query = qq| + UPDATE invoice + SET trans_id = ?, + parts_id = ?, + description = ?, + qty = ?, + sellprice = ?, + fxsellprice = ?, + discount = ?, + allocated = ?, + unit = ?, + deliverydate = ?, + project_id = ?, + serialnumber = ?, + notes = ? + WHERE id = ?|; + $sth = $dbh->prepare($query); + $sth->execute( + $form->{id}, $form->{"id_$i"}, + $form->{"description_$i"}, $form->{"qty_$i"} * -1, + $form->{"sellprice_$i"}, $fxsellprice, + $form->{"discount_$i"}, $allocated, + $form->{"unit_$i"}, $form->{"deliverydate_$i"}, + $project_id, $form->{"serialnumber_$i"}, + $form->{"notes_$i"}, $invoice_id + ) || $form->dberror($query); + } } -- cgit v1.2.3