T
This commit is contained in:
parent
96df197e2f
commit
5f1c975a55
|
@ -54,8 +54,14 @@ public static function get_stok_barang($id_barang,$jenis_barang = '')
|
|||
|
||||
}
|
||||
|
||||
public static function format_rupiah($angka)
|
||||
{
|
||||
|
||||
public function get_join_barang($id_barang,$table = '')
|
||||
$hasil_rupiah = "Rp " . number_format($angka,2,',','.');
|
||||
return $hasil_rupiah;
|
||||
}
|
||||
|
||||
public static function get_join_barang($id_barang,$table = '')
|
||||
{
|
||||
|
||||
$data = DB::table('tbl_barang')
|
||||
|
|
|
@ -56,7 +56,7 @@ public function store(Request $request)
|
|||
'harga'=>$request->harga_barang,
|
||||
'nup'=>$request->nup,
|
||||
'kategori_simak_id'=>$request->kategori_simak,
|
||||
'kode_barang'=>$request->kode_barang
|
||||
'kodebarang'=>$request->kode_barang
|
||||
);
|
||||
|
||||
$insert = DB::table('tbl_barang')->insert($data);
|
||||
|
@ -109,9 +109,9 @@ public function updates_barang(Request $request)
|
|||
'tanggal_masuk'=>$request->tanggal_masuk,
|
||||
'keterangan'=>$request->keterangan,
|
||||
'image'=>$fileName,
|
||||
'kode_barang'=>$request->kode_barang,
|
||||
'kodebarang'=>$request->kode_barang,
|
||||
'kategori_simak_id'=>$request->kategori_simak,
|
||||
'harga'=>$request->harga_barang,
|
||||
'harga'=>$request->harga,
|
||||
'nup'=>$request->nup,
|
||||
|
||||
);
|
||||
|
@ -135,9 +135,9 @@ public function updates_barang(Request $request)
|
|||
'lokasi'=>$request->lokasi,
|
||||
'tanggal_masuk'=>$request->tanggal_masuk,
|
||||
'keterangan'=>$request->keterangan,
|
||||
'kode_barang'=>$request->kode_barang,
|
||||
'kodebarang'=>$request->kode_barang,
|
||||
'kategori_simak_id'=>$request->kategori_simak,
|
||||
'harga'=>$request->harga_barang,
|
||||
'harga'=>$request->harga,
|
||||
'nup'=>$request->nup,
|
||||
|
||||
);
|
||||
|
|
|
@ -112,6 +112,22 @@
|
|||
<script src="{{ secure_asset('argon') }}/vendor/chart.js/dist/Chart.extension.js"></script>
|
||||
|
||||
<script>
|
||||
function formatRupiah(angka, prefix){
|
||||
var number_string = angka.toString().replace(/[^,\d]/g, ''),
|
||||
split = number_string.split(','),
|
||||
sisa = split[0].length % 3,
|
||||
rupiah = split[0].substr(0, sisa),
|
||||
ribuan = split[0].substr(sisa).match(/\d{3}/gi);
|
||||
|
||||
// tambahkan titik jika yang di input sudah menjadi angka ribuan
|
||||
if(ribuan){
|
||||
separator = sisa ? '.' : '';
|
||||
rupiah += separator + ribuan.join('.');
|
||||
}
|
||||
|
||||
rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah;
|
||||
return prefix == undefined ? rupiah : (rupiah ? 'Rp. ' + rupiah : '');
|
||||
}
|
||||
$("[name=jenis_keluar]").change(function(e){
|
||||
|
||||
e.preventDefault();
|
||||
|
@ -303,6 +319,9 @@
|
|||
$("[name=jumlah]").val(obj[0].jumlah_barang);
|
||||
$("[name=tanggal_masuk]").val(obj[0].tanggal_masuk);
|
||||
$("[name=kategori_simak]").val(obj[0].kategori_simak_id);
|
||||
$("[name=kode_barang]").val(obj[0].kodebarang);
|
||||
$("[name=nup]").val(obj[0].nup);
|
||||
$("[name=harga]").val(formatRupiah(obj[0].harga,'Rp'));
|
||||
$("[name=satuan_barang]").val(obj[0].satuan_id);
|
||||
$("[name=jenis_barang]").val(obj[0].jenis_barang_id);
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-money-check"></i></span>
|
||||
</div>
|
||||
<input class="form-control" required placeholder="Update Harga Barang ..." type="number" name="harga">
|
||||
<input class="form-control" required placeholder="Update Harga Barang ..." type="text" name="harga">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user