summaryrefslogtreecommitdiff
path: root/LedgerSMB/IS.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-06 05:29:30 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-06 05:29:30 +0000
commit787fc5c243b456ac441d745f72ffc52040dd72a3 (patch)
tree8a3649db227ce2fdf91400c5759ca177a1ba068b /LedgerSMB/IS.pm
parentbc2449155f59bf20b74f5772cd0e05d0294b8679 (diff)
Sales order printing seems to kinda work
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1518 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/IS.pm')
-rw-r--r--LedgerSMB/IS.pm24
1 files changed, 16 insertions, 8 deletions
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index 489f16d4..67c62bac 100644
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -785,13 +785,20 @@ sub customer_details {
# get rest for the customer
my $query = qq|
- SELECT customernumber, name, address1, address2, city,
- state, zipcode, country,
- contact, phone as customerphone, fax as customerfax,
- taxnumber AS customertaxnumber, sic_code AS sic, iban,
+ SELECT c.customernumber, e.name, l.line_one as address1,
+ l.line_two as address2, l.city_province AS city,
+ '' as state, l.mail_code AS zipcode,
+ country.name as country,
+ '' as contact, '' as customerphone, '' as customerfax,
+ '' AS customertaxnumber, sic_code AS sic, iban,
bic, startdate, enddate
- FROM customer
- WHERE id = ?|;
+ FROM customer c
+ JOIN company cm ON c.entity_id = cm.entity_id
+ JOIN entity e ON (c.entity_id = e.id)
+ JOIN company_to_location cl ON cm.id = cl.company_id
+ JOIN location l ON cl.location_id = l.id
+ JOIN country ON l.country_id = country.id
+ WHERE e.id = ?|;
my $sth = $dbh->prepare($query);
$sth->execute( $form->{customer_id} ) || $form->dberror($query);
@@ -1858,11 +1865,12 @@ sub retrieve_invoice {
a.intnotes,
a.duedate, a.taxincluded, a.curr AS currency,
a.person_id, e.name AS employee, a.till,
- a.entity_id, a.reverse
+ a.entity_id, a.reverse,
a.language_code, a.ponumber,
a.on_hold
FROM ar a
- LEFT JOIN employee e ON (e.entity_id = a.person_id)
+ LEFT JOIN employee em ON (em.entity_id = a.person_id)
+ INNER JOIN entity e ON e.id = em.entity_id
WHERE a.id = ?|;
$sth = $dbh->prepare($query);