Feature #2820
Field Posisi Stock di Purchase Requisition ingin otomatis
Description
Dear Shofwan,
Setelah user memilih Nama Barang, ingin agar field Posisi Stock otomatis terisi dengan quantity stock barang tersebut pada saat itu (Mengambil dari Tabel PMDMAT0004).
Terimakasih.
Menu Path: Logistic & Service > Purchasing > Purchase Requisition
Port: http://remote.minovais.com:61138/
DB: MinovaES_KJL_Prod
Files
Subtasks
Related issues
Updated by Kezia Pawitra Yulianti 5 months ago
- Due date set to 07/01/2024
- Status changed from New to Assigned
Updated by shofwan shiddiq 5 months ago
- File clipboard-202406261647-hqrsg.png clipboard-202406261647-hqrsg.png added
- Status changed from Assigned to QA Test
- Assignee changed from shofwan shiddiq to haykal haykal
Sudah autoload ya Posisi Stock nya
UPDATE
Table = SDATATABLEFIELD > TableName = PTRPURCHITEM > FieldName = Material
Update SelectFunction
var store = Ext.StoreMgr.lookup("storePTRPURCHITEM");
if (store != undefined) {
var idx = store.getCount() - 1;
var materialID = val.value;
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PMDMAT0003',
param: 'MaterialID[=]' + materialID
},
success: function (response) {
var results = Ext.decode(response.responseText);
dtgrid = results.data;
}
});
var max;
for (var i = 0; i < dtgrid.length; i++) {
if (!max || parseInt(dtgrid[i]["SeqID"]) > parseInt(max["SeqID"]))
max = dtgrid[i];
}
if (max != undefined) {
store.getAt(idx).set('PriceAmount', max.PurchasePrice);
store.getAt(idx).set('Discount', max.Discount);
} else {
store.getAt(idx).set('PriceAmount', map);
store.getAt(idx).set('Discount', 0);
}
// Set Unit Transaction
var map;
var unitmasurement;
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PMDMAT0001',
param: 'MaterialID[=]' + materialID
},
success: function (response) {
var results = Ext.decode(response.responseText);
dtgrid1 = results.data;
}
});
var unitM;
try {
unitM = dtgrid1[0].UnitMeasurement;
}
catch(err){
store.getAt(idx).set('UnitTransaction', '1');
}
store.getAt(idx).set('UnitTransaction', unitM);
// Set Supplier
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PMDVEN0002',
param: 'MaterialID[=]' + materialID
},
success: function (response) {
var results2 = Ext.decode(response.responseText);
dtgrid2 = results2.data;
}
});
var supplier;
try {
supplier = dtgrid2[0].VendorID;
}
catch(err){
store.getAt(idx).set('Supplier', '');
}
store.getAt(idx).set('Supplier', supplier);
// Set Posisi Stock
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PMDMAT0004',
param: 'MaterialID[=]' + materialID
},
success: function (response) {
var results3 = Ext.decode(response.responseText);
dtgrid3 = results3.data;
}
});
var posisiStock;
try {
posisiStock = dtgrid3[0].Qty;
}
catch(err){
store.getAt(idx).set('StockPosition', '');
}
store.getAt(idx).set('StockPosition', posisiStock);
}