view_invoice_header.sql 496 B

123456789101112131415161718
  1. CREATE VIEW `view_invoice_header` AS
  2. select
  3. `a`.`invoice_number` AS `invoice_number`,
  4. `a`.`project_id` AS `project_id`,
  5. `a`.`pos_id` AS `pos_id`,
  6. `a`.`invoice_date` AS `invoice_date`,
  7. `a`.`cashier` AS `cashier`,
  8. `a`.`paid` AS `paid`,
  9. `a`.`printed` AS `printed`,
  10. `b`.`line_count` AS `line_count`,
  11. `b`.`total` AS `total`,
  12. `a`.`mdate` AS `mdate`,
  13. `a`.`cdate` AS `cdate`
  14. from (
  15. `invoice_header` `a`
  16. left join `view_totals` as `b` on (`a`.`invoice_number` = `b`.`invoice_number`)
  17. );