opname stok: koreksi sisa stok per satuan; laporan stok akhir: tampil sisa stok dg nama satuan

This commit is contained in:
2026-04-10 08:47:52 +07:00
parent cb7ccf46d2
commit 04b752b11f
3 changed files with 27 additions and 24 deletions
+11 -10
View File
@@ -5,9 +5,9 @@
Desc. : JS - Transaksi Opname Stok Barang
Created By : Siau Pheng ([email protected]).
Created Date : May 24th, 2010.
Last Modified : September 29th, 2025.
Last Modified : April 10th, 2026.
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
(c) 2010 - 2026, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
@@ -146,23 +146,23 @@ var OpnameJS = {
new Request.JSON({
url: this.PHP,
sendParam: ['data=detail-produk','mode','mode_detail='+mode,'No_Opname','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'HPP='+HPP],
onSuccess: function(a){
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
onSuccess: (a) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Opname','Tgl_Opname','CabID'], {'selectFunc': OpnameJS.Produk_Comp});
$('#winDetail')
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
.find('#Qty').keyup(function(e){
.find('#butWSimpan').click(() => this.detail_simpan()).end()
.find('#Qty').keyup((e) => {
if (parseFloat(e.target.value) == 0) return false;
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
}.bind(this));
});
if (mode == 'insert' && InvID == 0) {
FoniaJS.setFocus('#Nama_Produk');
} else {
FoniaJS.setFocus('#Qty');
}
this.update_stok();
}.bind(this), null, false);
}.bind(this)
}, null, false);
}
}).send();
},
@@ -175,7 +175,7 @@ var OpnameJS = {
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
this.detail_produk('update', acell[0], 0, 0, 0);
},
detail_hapus: function(acell){
@@ -272,6 +272,7 @@ var OpnameJS = {
$('#Kode_Barang').val(adata[0]);
$('#Nama_Satuan').val(adata[2]);
$('#Harga_Beli').val(adata[4]);
$('#Kali').val(adata[5]);
OpnameJS.update_stok();
FoniaJS.setFocus('#Qty');
},