summaryrefslogtreecommitdiff
path: root/LedgerSMB/IS.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-24 06:22:23 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-24 06:22:23 +0000
commit0303f21d687059f314eaeef17e40eba99d22001f (patch)
tree5bff8e21de4eac7fd7fed585aa6041e325f5c49a /LedgerSMB/IS.pm
parent7598b08d170810570ff60d77fdb991673601e6b6 (diff)
Added support for custom fields to IS, OE, and corrected API bugs in Form.
Also AA now partially supports the custom fields. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@139 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/IS.pm')
-rwxr-xr-xLedgerSMB/IS.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index bda4d5b6..1e4714fa 100755
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -633,6 +633,15 @@ sub post_invoice {
($form->{id}) = $sth->fetchrow_array;
$sth->finish;
+
+ @queries = $form->get_custom_queries('ar', 'INSERT');
+ for (@queries){
+ $query = shift (@{$_});
+ $sth = $dbh->prepare($query) || $form->db_error($query);
+ $sth->execute(@{$_}, $form->{id})|| $form->dberror($query);;
+ $sth->finish;
+ $did_insert = 1;
+ }
}
@@ -1421,6 +1430,17 @@ sub retrieve_invoice {
my $rc = $dbh->commit;
$dbh->disconnect;
+ @queries = $form->get_custom_queries('ar', 'SELECT');
+ for (@queries){
+ $query = shift @{$_};
+ $sth = $form->{dbh}->prepare($query);
+ $sth->execute($form->{id});
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ for (keys %{$ref}){
+ $form->{$_} = $ref->{$_};
+ }
+ }
+ $form->{dbh}->commit;
$rc;
}