diff options
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/IR.pm | 29 |
1 files changed, 27 insertions, 2 deletions
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); + } } |