When trying to print a saved Purchase Order to a PDF file, I receive the following error:
Error!
'
SELECT meta_number as vendornumber, e.name,
line_one as address1, line_two as address2, city, state,
mail_code as zipcode, c.name as country,
pay_to_name as contact,
phone as vendorphone, fax as vendorfax,
tax_id AS vendortaxnumber, sic_code AS sic, iban, bic, remark,
-- gifi_accno AS gifi,
startdate, enddate
FROM entity_credit_account eca
JOIN entity e ON eca.entity_id = e.id
JOIN company co ON co.entity_id = e.id
LEFT JOIN eca_to_location e2l ON eca.id = e2l.credit_id
and e2l.location_class = 1
LEFT JOIN entity_to_location el ON eca.entity_id = el.entity_id
and el.location_class = 1
LEFT JOIN location l ON l.id =
coalesce(e2l.location_id, el.location_id)
LEFT JOIN country c ON l.country_id = c.id
LEFT JOIN (select max(phone) as phone, max(fax) as fax, credit_id
FROM (SELECT CASE WHEN contact_class_id =1 THEN contact
END as phone,
CASE WHEN contact_class_id =9 THEN contact
END as fax,
credit_id
FROM eca_to_contact) ct_base
GROUP BY credit_id) ct ON ct.credit_id = eca.id
LEFT JOIN entity_bank_account ba ON ba.id = eca.bank_account
WHERE eca.id = ? and location_class = 1
ERROR: column reference "location_class" is ambiguous
LINE 29: WHERE eca.id = '4' and location_class = 1
^ at LedgerSMB/IR.pm line 1458.
'
dbversion: 1.4.11, company: Zoonicorn, LLC
Pull request/fix pending at https://github.com/ledgersmb/LedgerSMB/pull/660
Merged into 1.4.12.