drop view if exists view_kinerja_penjualan;

--gopg:split

CREATE VIEW view_kinerja_penjualan AS
SELECT
  inventory_barangs.id,
  inventory_barangs.toko_id,
  tokos.nama_toko,
  inventory_barangs.nama_barang,
  inventory_barangs.kode_barang,
  inventory_barangs.jenis_barang_id,
  jenis_barangs.nama AS jenis_barang_nama,
  inventory_barangs.status_ketersediaan,
  inventory_barangs.status_label,
  inventory_barangs.berat,
  inventory_barangs.created_at,
  inventory_barangs.deleted_by
FROM
  inventory_barangs
  LEFT JOIN jenis_barangs ON jenis_barangs.id = inventory_barangs.jenis_barang_id
  LEFT JOIN tokos ON tokos.id = inventory_barangs.toko_id;