text: DROP VIEW IF EXISTS view_persediaan_barang2_bppakb;
  
  CREATE VIEW view_persediaan_barang2_bppakb AS
  
  SELECT
  *,
  sum(jumlah) OVER (PARTITION BY kode_barang ORDER BY serial, tanggal, id_persediaan) as pra_saldo
  
  
  FROM
  view_persediaan_barang_bppakb
  
  WHERE
  1 = 1  AND
  id_skpd = 11;
  
  
  
  GRANT ALL PRIVILEGES ON view_persediaan_barang2_bppakb TO lap_bppakb;
  REVOKE INSERT, UPDATE, DELETE ON view_persediaan_barang2_bppakb FROM lap_bppakb;
  