From 0303f21d687059f314eaeef17e40eba99d22001f Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sun, 24 Sep 2006 06:22:23 +0000 Subject: 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 --- LedgerSMB/IS.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'LedgerSMB/IS.pm') 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; } -- cgit v1.2.3