summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLedgerSMB/IR.pm6
-rwxr-xr-xLedgerSMB/IS.pm1
2 files changed, 4 insertions, 3 deletions
diff --git a/LedgerSMB/IR.pm b/LedgerSMB/IR.pm
index 2f799975..7dd38c3e 100755
--- a/LedgerSMB/IR.pm
+++ b/LedgerSMB/IR.pm
@@ -333,7 +333,7 @@ sub post_invoice {
WHERE i.parts_id = ?
AND (i.qty + i.allocated) > 0
ORDER BY transdate|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute( $form->{"id_$i"} )
|| $form->dberror($query);
@@ -363,7 +363,7 @@ sub post_invoice {
VALUES (?, ?, ?, ?,
?, ?)|;
- $sth = $dbh->prepare($query);
+ my $sth = $dbh->prepare($query);
$sth->execute(
$ref->{trans_id}, $ref->{inventory_accno_id},
$linetotal, $ref->{transdate},
@@ -385,7 +385,7 @@ sub post_invoice {
$sth->execute(
$ref->{trans_id}, $ref->{expense_accno_id},
$linetotal * -1, $ref->{transdate},
- $ref->{project_id}, $invoice_id
+ $:ref->{project_id}, $invoice_id
) || $form->dberror($query);
}
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index 0a47cc9d..50931446 100755
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -1057,6 +1057,7 @@ sub post_invoice {
&cogs( $dbh, $form, $form->{"id_$i"},
$form->{"qty_$i"}, $project_id );
} else {
+ my $total_inventory = 0;
$query = qq|
SELECT i.id, i.qty, i.allocated, a.transdate
FROM invoice i