<?php
$sql['get_data_barang_usulan'] = "
	SELECT
	  usulanBrgDetId       AS brgId,
	  CONCAT(LPAD(golbrgKode, 1, '0'), '.', LPAD(bidangbrgKode, 2, '0'), '.', LPAD(kelbrgKode, 2, '0'), '.', LPAD(subkelbrgKode, 2, '0'), '.', LPAD(barangKode, 3, '0')) AS `brgKode`,
	  barangNama           AS brgNama,
	  usulanBrgNilaiHps    AS brgHps,
	  usulanBrgDetJml      AS jmlDO,
	  usulanBrgNilaiUsulan AS brgNilai
	FROM aset_pb_usulan_brg
	  LEFT JOIN aset_pb_usulan_brg_det
		 ON usulanBrgDetUsulanBrgId = usulanBrgId
	  LEFT JOIN barang_ref
		 ON barangId = usulanBrgDetBrgId
	  JOIN sub_kelompok_barang_ref
		 ON subkelbrgId = barangSubkelbrgId
	  JOIN kelompok_barang_ref
		 ON kelbrgId = subkelbrgKelbrgId
	  JOIN bidang_barang_ref
		 ON bidangbrgId = kelbrgBidangbrgId
	  JOIN golongan_barang_ref
		 ON golbrgId = bidangbrgGolbrgId
	WHERE usulanBrgStatusId = 3 AND usulanBrgDetId NOT IN(SELECT
                              pengadaanBrgDetUsulanBrgDetId
                            FROM aset_pb_pengadaan_brg_detil)
";
?>