summaryrefslogtreecommitdiff
path: root/LedgerSMB/Form.pm
diff options
context:
space:
mode:
authoraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-10 21:16:16 +0000
committeraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-10 21:16:16 +0000
commit601652599b9a439c3bf3c4b2b25534ca88f9ca59 (patch)
tree4a25bf2dbb94747ff1ad561c386ea8f08a46d01d /LedgerSMB/Form.pm
parent47025e9f26cf3f037841dcae5b281fc38f5051ba (diff)
Fixes Add Vendor, to correctly work with the new entity_credit_account table, in place of the customer/vendor tables.
Removes the Vendor and Customer tables, replacing them with entity_credit_account (previously entity_metadata) and Vendor and Customer as a view, mimicking the original Vendor and Customer tables. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1373 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Form.pm')
-rw-r--r--LedgerSMB/Form.pm13
1 files changed, 6 insertions, 7 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 7d263fdd..0633ced5 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1197,9 +1197,11 @@ sub get_name {
@queryargs = ( $transdate, $transdate );
}
-
+
+ # Company name is stored in $self->{vendor} or $self->{customer}
my $name = $self->like( lc $self->{$table} );
-
+
+ # Vendor and Customer are now views into entity_credit_account.
my $query = qq|
SELECT * FROM $table t
JOIN entity e ON t.entity_id = e.id
@@ -1207,23 +1209,20 @@ sub get_name {
$where
ORDER BY e.name|;
- unshift( @queryargs, $name, $name );
+ unshift( @queryargs, $name, $name, $table );
my $sth = $self->{dbh}->prepare($query);
$sth->execute(@queryargs) || $self->dberror($query);
my $i = 0;
@{ $self->{name_list} } = ();
-
while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) {
push( @{ $self->{name_list} }, $ref );
$i++;
}
-
$sth->finish;
- $i;
-
+ return $i;
}
sub all_vc {