summaryrefslogtreecommitdiff
path: root/LedgerSMB/OP.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-19 06:47:55 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-19 06:47:55 +0000
commit5c6cd055b1b83d8309332ab3ce1001137d0e8f42 (patch)
tree146f9d75f61823c8c15093f3940960a564bf4896 /LedgerSMB/OP.pm
parent6e13bacefd8e71242dec64a3185215980e749bcf (diff)
More voucher-related commits
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1285 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/OP.pm')
-rw-r--r--LedgerSMB/OP.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/LedgerSMB/OP.pm b/LedgerSMB/OP.pm
index 836ef92c..962011de 100644
--- a/LedgerSMB/OP.pm
+++ b/LedgerSMB/OP.pm
@@ -96,6 +96,16 @@ sub overpayment {
if (not defined $form->{approved}){
$form->{approved} = 1;
}
+ if (!$form->{approved}){
+ if (not defined $form->{batch_id}){
+ $form->error($locale->text('Batch ID Missing'));
+ }
+ $query = qq|
+ INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|;
+ $sth = $dbh->prepare($query);
+ $sth->execute($form->{batch_id}, $uid) ||
+ $form->dberror($query);
+ }
$sth = $dbh->prepare($query);
$sth->execute( $uid, $accno, $form->{datepaid}, $fxamount * $ml,
$form->{approved} )