From e6b2f50939b78d5f181070b3aedcd528f5393833 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Fri, 12 Sep 2008 22:57:58 +0000 Subject: Added description field to customer/vendor generation. Corrected entity credit account autogenerated number sequences. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2321 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/DBObject/Company.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/DBObject/Company.pm b/LedgerSMB/DBObject/Company.pm index b2eed72c..a0cce914 100644 --- a/LedgerSMB/DBObject/Company.pm +++ b/LedgerSMB/DBObject/Company.pm @@ -71,7 +71,8 @@ sub save_credit { my $self = shift @_; $self->set_entity_class(); $self->{threshold} = $self->parse_amount(amount => $self->{threshold}); - $self->exec_method(funcname => 'entity_credit_save'); + my ($ref) = $self->exec_method(funcname => 'entity_credit_save'); + $self->{credit_id} = (values %$ref)[0]; $self->{threshold} = $self->format_amount(amount => $self->{threshold}); $self->{dbh}->commit; } @@ -218,7 +219,8 @@ sub get { for (@{$self->{credit_list}}){ print STDERR "credit_id: $_->{credit_id}\n"; if (($_->{credit_id} eq $self->{credit_id}) - or ($_->{meta_number} eq $self->{meta_number})){ + or ($_->{meta_number} eq $self->{meta_number}) + or ($_->{id} eq $self->{credit_id})){ $self->merge($_); last; } -- cgit v1.2.3