diff options
Diffstat (limited to 'LedgerSMB/IS.pm')
-rwxr-xr-x | LedgerSMB/IS.pm | 20 |
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; } |