summaryrefslogtreecommitdiff
path: root/LedgerSMB/CP.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 02:58:58 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 02:58:58 +0000
commitd640e98a985b61ede4e7154908adfb8cd562350b (patch)
tree883aab3a6eacd34dc063b29b4fa6526c517adf37 /LedgerSMB/CP.pm
parent4371d3ac11fd01cf5c42d1e3cb938e857b7c7258 (diff)
Fixing all possibilities of bug-1607680-like errors in 1.2
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@715 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/CP.pm')
-rwxr-xr-xLedgerSMB/CP.pm22
1 files changed, 12 insertions, 10 deletions
diff --git a/LedgerSMB/CP.pm b/LedgerSMB/CP.pm
index 33d47bcf..edb474ed 100755
--- a/LedgerSMB/CP.pm
+++ b/LedgerSMB/CP.pm
@@ -419,10 +419,10 @@ sub post_payment {
amount)
VALUES (?, ?,
?,
- ? * ?)|;
+ ?)|;
$sth = $dbh->prepare($query);
$sth->execute($form->{"id_$i"}, $id,
- $form->{date_paid}, $amount, $ml)
+ $form->{date_paid}, $amount * $ml)
|| $form->dberror($query, 'CP.pm', 427);
# add payment
@@ -433,11 +433,12 @@ sub post_payment {
VALUES (?, (SELECT id
FROM chart
WHERE accno = ?),
- ?, ? * ? * -1, ?, ?)|;
+ ?, ?, ?, ?)|;
$sth = $dbh->prepare($query);
$sth->execute(
$form->{"id_$i"}, $paymentaccno,
- $form->{datepaid}, $form->{"paid_$i"}, $ml,
+ $form->{datepaid},
+ $form->{"paid_$i"} * $ml * -1,
$form->{source}, $form->{memo})
|| $form->dberror(
$query, 'CP.pm', 444);
@@ -458,12 +459,12 @@ sub post_payment {
VALUES (?, (SELECT id
FROM chart
WHERE accno = ?),
- ?, ? * ? * -1, '0', '1',
+ ?, ?, '0', '1',
?)|;
$sth = $dbh->prepare($query);
$sth->execute(
$form->{"id_$i"}, $paymentaccno,
- $form->{datepaid}, $amount, $ml,
+ $form->{datepaid}, $amount * $ml * -1,
$form->{source})
|| $form->dberror(
$query, 'CP.pm', 470);
@@ -693,12 +694,12 @@ sub post_payments {
INSERT INTO acc_trans
(trans_id, chart_id, transdate,
amount)
- VALUES (?, ?, ?, ? * ?)|;
+ VALUES (?, ?, ?, ?)|;
$sth = $dbh->prepare($query);
$sth->execute(
$form->{"id_$i"}, $id, $form->{datepaid},
- $amount, $ml)
+ $amount * $ml)
|| $form->dberror($query, 'CP.pm',
701);
@@ -715,12 +716,13 @@ sub post_payments {
INSERT INTO acc_trans
(trans_id, chart_id, transdate,
amount, source, memo)
- VALUES (?, ?, ?, ? * ? * -1, ?, ?)|;
+ VALUES (?, ?, ?, ?, ?, ?)|;
$sth = $dbh->prepare($query);
$sth->execute(
$form->{"id_$i"}, $accno_id, $form->{datepaid},
- $paid, $ml, $form->{source}, $form->{memo})
+ $paid * $ml * -1, $form->{source},
+ $form->{memo})
|| $form->dberror($query, 'CP.pm',
723);