summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/DBObject/Company.pm2
-rw-r--r--scripts/vendor.pl3
-rw-r--r--sql/modules/Company.sql4
3 files changed, 5 insertions, 4 deletions
diff --git a/LedgerSMB/DBObject/Company.pm b/LedgerSMB/DBObject/Company.pm
index 2d538582..c2676de2 100644
--- a/LedgerSMB/DBObject/Company.pm
+++ b/LedgerSMB/DBObject/Company.pm
@@ -185,7 +185,7 @@ sub get {
my $self = shift @_;
$self->set_entity_class();
- my ($ref) = $self->exec_method(funcname => 'entity__retrieve_credit');
+ my ($ref) = $self->exec_method(funcname => 'company_retrieve');
$self->merge($ref);
$self->{threshold} = $self->format_amount(amount => $self->{threshold});
diff --git a/scripts/vendor.pl b/scripts/vendor.pl
index 321f76d4..2119d46c 100644
--- a/scripts/vendor.pl
+++ b/scripts/vendor.pl
@@ -149,7 +149,8 @@ sub get_results {
push @rows,
{legal_name => $ref->{legal_name},
meta_number => {text => $ref->{meta_number},
- href => "$get_url&entity_id=$ref->{entity_id}"},
+ href => "$get_url&entity_id=$ref->{entity_id}" . "&meta_number=$ref->{meta_number}"
+ },
business_type => $ref->{business_type},
curr => $ref->{curr},
};
diff --git a/sql/modules/Company.sql b/sql/modules/Company.sql
index b7f5e640..b5dd76cc 100644
--- a/sql/modules/Company.sql
+++ b/sql/modules/Company.sql
@@ -220,11 +220,11 @@ BEGIN
END;
$$ LANGUAGE PLPGSQL;
-CREATE OR REPLACE FUNCTION company_retrieve (in_id int) RETURNS company AS
+CREATE OR REPLACE FUNCTION company_retrieve (in_entity_id int) RETURNS company AS
$$
DECLARE t_company company;
BEGIN
- SELECT * INTO t_company FROM company WHERE id = in_id;
+ SELECT * INTO t_company FROM company WHERE entity_id = in_entity_id;
RETURN t_company;
END;
$$ language plpgsql;