[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DBD::Pg::st execute failed: ERROR: column "customer_id" does not exist



Hi,

LedgerSMB version 1.2.5

Clicking on any of the foll (+) results in an error message:

Purchases
  + Add Transaction
  + Creditor Invoice
    Reports
    + Transactions
    + Outstanding


Error message has the form:
-------------------------------------------------------------
DBD::Pg::st execute failed: ERROR: column "customer_id" does not exist
Error!

SELECT ct.name AS vendor, ct.curr AS currency, ct.id AS vendor_id,
current_date + ct.terms AS duedate, ct.notes, ct.curr AS currency
FROM vendor ct
WHERE ct.id = (select customer_id from ap where 1 = 1 AND vendor_id IS NOT 
NULL order by id DESC limit 1)
ERROR: column "customer_id" does not exist
-------------------------------------------------------------


Output from postgres:
-------------------------------------------------------------
ef-2005-6=> \d ap
                                Table "public.ap"
    Column     |         Type          |                Modifiers
---------------+-----------------------+------------------------------------------
 id            | integer               | not null default 
nextval('id'::regclass)
 invnumber     | text                  |
 transdate     | date                  | default ('now'::text)::date
 vendor_id     | integer               |
 taxincluded   | boolean               | default false
 amount        | numeric               |
 netamount     | numeric               |
 paid          | numeric               |
 datepaid      | date                  |
 duedate       | date                  |
 invoice       | boolean               | default false
 ordnumber     | text                  |
 curr          | character(3)          |
 notes         | text                  |
 employee_id   | integer               |
 till          | character varying(20) |
 quonumber     | text                  |
 intnotes      | text                  |
 department_id | integer               | default 0
 shipvia       | text                  |
 language_code | character varying(6)  |
 ponumber      | text                  |
 shippingpoint | text                  |
 terms         | smallint              | default 0
Indexes:
    "ap_pkey" PRIMARY KEY, btree (id)
    "ap_employee_id_key" btree (employee_id)
    "ap_id_key" btree (id)
    "ap_invnumber_key" btree (invnumber)
    "ap_ordnumber_key" btree (ordnumber)
    "ap_quonumber_key" btree (quonumber)
    "ap_transdate_key" btree (transdate)
    "ap_vendor_id_key" btree (vendor_id)
Rules:
    ap_id_track_i AS
    ON INSERT TO ap DO  INSERT INTO transactions (id, table_name)
  VALUES (new.id, 'ap'::text)
    ap_id_track_u AS
    ON UPDATE TO ap DO  UPDATE transactions SET id = new.id
  WHERE transactions.id = old.id
Triggers:
    check_department AFTER INSERT OR UPDATE ON ap FOR EACH ROW EXECUTE 
PROCEDURE check_department()
    del_department AFTER DELETE ON ap FOR EACH ROW EXECUTE PROCEDURE 
del_department()
    del_exchangerate BEFORE DELETE ON ap FOR EACH ROW EXECUTE PROCEDURE 
del_exchangerate()
    del_recurring AFTER DELETE ON ap FOR EACH ROW EXECUTE PROCEDURE 
del_recurring()
-------------------------------------------------------------