summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-09-12 22:57:58 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-09-12 22:57:58 +0000
commite6b2f50939b78d5f181070b3aedcd528f5393833 (patch)
tree6a5095dd448bad8d2ab1ee5969ac17443bb91f96 /LedgerSMB/DBObject
parentaeb8fa97fcadab8e48b014f66650dac8ac4d32c4 (diff)
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
Diffstat (limited to 'LedgerSMB/DBObject')
-rw-r--r--LedgerSMB/DBObject/Company.pm6
1 files changed, 4 insertions, 2 deletions
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;
}