Bug #3328
Ketika input Diskon masih ngaco rownya
0%
Description
Dear Shofwan,
Tadi ketika saya coba membuat transaksi di Purchase Order saya coba mengisikan diskonnya. Saya mengisikan field Disc% di row 1 tapi malah mempengaruhi field Discount dan Net Amount di row 2 (Foto 1). Lalu saya coba mengisi field Discount di row 1 tapi malah mempengaruhi Net Amount di row 2 (Foto 2).
Tolong diperbaiki ya Wan agar Discountnya mempengaruhi Net Amount di row yang sama.
Terimakasih.
Menu Path: Logistic & Service > Purchasing > Purchase Order
Port: http://remote.minovais.com:61138/
DB: MinovaES_KJL_Prod (di 1452)
Files
Subtasks
Related issues
Updated by shofwan shiddiq about 2 months ago
- File clipboard-202501070943-qqmpa.png clipboard-202501070943-qqmpa.png added
- File clipboard-202501070944-yalbg.png clipboard-202501070944-yalbg.png added
- Assignee changed from shofwan shiddiq to hans hans
Dear Hans, boleh tolong untuk di bantu case yg ini. untuk query perhitungan discount nya ada di
TableName = SDATATABLEFIELD, FieldName = Discount, nanti di kolom SelectFunction. nanti di ubah nya di script ini
Updated by hans hans about 2 months ago
- File clipboard-202501071459-zhclq.png clipboard-202501071459-zhclq.png added
- File clipboard-202501071500-tykub.png clipboard-202501071500-tykub.png added
- Assignee changed from hans hans to haykal haykal
Halo mas Haykal, untuk input diskon sudah diperbaiki
UPDATE:
port: 1452
DB: MinovaES_KJL_Prod
Table: SDATATABLEFIELD
Filter:
TableName: PTRPURCHITEM
FieldName: DiscountPercentage & Discount
Updated by haykal haykal about 1 month ago
- Status changed from Assigned to Revise
- Assignee changed from haykal haykal to hans hans
Dear Hans,
Untuk field-field yg memang wajib diisikan angka (dan berpengaruh di kalkulasi) tlg di disabled aja ya apabila usernya mengisi format selain angka.
Terimakasih.
Updated by hans hans about 1 month ago
- Assignee changed from hans hans to haykal haykal
Halo mas Haykal
Untuk disable setiap input yang bertipe selain number akan otomatis menjadi 0
UPDATE:
port: 1452
DB: MinovaES_KJL_Prod
Table: SDATATABLEFIELD
Filter:
TableName: PTRPURCHITEM
FieldName: Discount, DiscountPercentage, MaterialQuantity, PriceAmount
Updated by haykal haykal about 1 month ago
- Assignee changed from haykal haykal to hans hans
Hans, untuk perhitungan yang di Total Amount nya bener seperti yang lu bilang. Jadi setelah Total Amount itu terpotong nilai Discount, Pajak 11% nya hrs terhitung juga di Total Amount.
Note: Cek juga nilai yg di footer Tax Amount nya udh bener atau belom.
Terimakasih.
Updated by hans hans about 1 month ago
- Assignee changed from hans hans to haykal haykal
Halo mas Haykal
Untuk perhitungan sudah diperbaiki
UPDATE:
port: 1452
DB: MinovaES_KJL_Prod
Table: SDATATABLEFIELD
Filter:
TableName: PTRPURCHITEM
FieldName: Discount, DiscountPercentage, MaterialQuantity, PriceAmount
Backup:
// record discount
debugger;
var store = Ext.StoreMgr.lookup("storePTRPURCHITEM");
if (store !== undefined) {
var grid = Ext.getCmp(gridName);
var selection = grid.getView().getSelectionModel().getSelection()[0];
var idx = grid.store.indexOf(selection);
var discount = Number(val.value);
var rec = store.getAt(idx);
var priceAmount = rec.get('PriceAmount');
var materialQuantity = rec.get('MaterialQuantity');
var netAmount, totAmount;
if (!isNaN(discount)) {
netAmount = (materialQuantity * priceAmount) - discount;
totAmount = (materialQuantity * priceAmount) - discount;
} else {
netAmount = 0
totAmount = 0
}
rec.set({
"NetAmount": netAmount,
"TotAmount": totAmount
}); // upd 3
}
// record discountPercentage
debugger;
var store = Ext.StoreMgr.lookup("storePTRPURCHITEM");
if (store != undefined) {
var grid = Ext.getCmp(gridName);
var selection = grid.getView().getSelectionModel().getSelection()[0];
var idx = grid.store.indexOf(selection);
var discPercentage = Number(val.value);
var rec = store.getAt(idx);
var priceAmount = rec.get('PriceAmount');
var materialQuantity = rec.get('MaterialQuantity');
var totAmount, netAmount;
if (!isNaN(discPercentage)) {
var discount = (priceAmount * materialQuantity * discPercentage) / 100;
TotAmount = (materialQuantity * priceAmount) - discount;
netAmount = (materialQuantity * priceAmount) - discount;
} else {
TotAmount = 0;
netAmount = 0;
}
rec.set({
"NetAmount": netAmount,
"TotAmount": totAmount,
"Discount": discount
}); // upd 3
var taxtype;
if (taxtype != '') {
taxtype = rec.get('TaxType');
} else {
taxtype = '1';
}
var persenparam = '0';
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PCMEPGENPARAM',
param: 'Parameter[=]TAXPPNPERCENTAGE'
},
success: function (response) {
var results = Ext.decode(response.responseText);
persenparam = results.data[0].Value1;
console.log(persenparam);
}
});
var tax = "0";
var totAmount = 0;
if (taxtype === '2') {
tax = Math.round(netAmount * (parseFloat(persenparam) / 100));
totAmount = netAmount + tax;
} else if (taxtype === '1') {
var _tax = netAmount / ((100 + parseFloat(persenparam)) / 100);
tax = Math.round(netAmount - _tax);
totAmount = netAmount;
}
store.getAt(idx).set('TotAmount', totAmount);
store.getAt(idx).set('Tax', tax);
// store.getAt(idx).set('TaxType', '1');
}
// record materialQuantity
var store = Ext.StoreMgr.lookup("storePTRPURCHITEM");
if (store != undefined) {
// var idx = store.getCount() - 1;
var grid = Ext.getCmp(gridName);
var selection = grid.getView().getSelectionModel().getSelection()[0];
var idx = grid.store.indexOf(selection); // upd 1
var val = Number(val.value);
var materialQuantity = isNaN(val) ? 0 : val; // upd 1;
var priceAmount = store.getAt(idx).get('PriceAmount');
var discount = store.getAt(idx).get('Discount');
var discountpercentage = store.getAt(idx).get('DiscountPercentage');
if (discountpercentage > 0) {
discount = (materialQuantity * priceAmount) * (discountpercentage / 100)
} else {
discount = 0
}
var netAmount = (materialQuantity * priceAmount) - discount;
store.getAt(idx).set('NetAmount', netAmount);
var persenparam = '0';
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PCMEPGENPARAM',
param: 'Parameter[=]TAXPPNPERCENTAGE'
},
success: function(response) {
var results = Ext.decode(response.responseText);
persenparam = results.data[0].Value1;
console.log(persenparam);
}
});
var taxtype = undefined;
if (taxtype != '') {
taxtype = store.getAt(idx).get('TaxType');
} else {
taxtype = '1';
}
var totAmount = '0';
if (taxtype === '2') {
tax = Math.round(netAmount * (parseFloat(persenparam) / 100));
totAmount = (netAmount + tax);
} else if (taxtype === '1') {
var _tax = netAmount / ((100 + parseFloat(persenparam)) / 100);
tax = Math.round(netAmount - _tax);
totAmount = netAmount;
}
store.getAt(idx).set('TotAmount', totAmount);
store.getAt(idx).set('Tax', tax);
// store.getAt(idx).set('Discount', discount);
}
// record priceAmount
var store = Ext.StoreMgr.lookup("storePTRPURCHITEM");
if (store != undefined) {
// var idx = store.getCount() - 1;
var grid = Ext.getCmp(gridName);
var selection = grid.getView().getSelectionModel().getSelection()[0];
var idx = grid.store.indexOf(selection); // upd 1
var val = Number(val.value);
var priceAmount= isNaN(val) ? 0 : val; // upd 1;
var materialQuantity = store.getAt(idx).get('MaterialQuantity');
var discountPercentage = store.getAt(idx).get('DiscountPercentage');
var discount = Math.round((priceAmount * materialQuantity) * (discountPercentage / 100));
var netAmount = Math.round((materialQuantity * priceAmount) - discount);
store.getAt(idx).set('NetAmount', netAmount);
// store.getAt(idx).set('Discount', discount);
var taxtype;
if (taxtype != '') {
taxtype = store.getAt(idx).get('TaxType');
} else {
taxtype = '1';
}
var persenparam = '0';
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PCMEPGENPARAM',
param: 'Parameter[=]TAXPPNPERCENTAGE'
},
success: function(response) {
var results = Ext.decode(response.responseText);
persenparam = results.data[0].Value1;
console.log(persenparam);
}
});
var tax = "0";
var totAmount = 0;
if (taxtype === '2') {
tax = Math.round(netAmount * (parseFloat(persenparam) / 100));
totAmount = (netAmount + tax);
} else if (taxtype === '1') {
var _tax = netAmount / ((100 + parseFloat(persenparam)) / 100);
tax = Math.round(netAmount - _tax);
totAmount = netAmount;
}
store.getAt(idx).set('TotAmount', totAmount);
store.getAt(idx).set('Tax', tax);
}
Updated by haykal haykal 15 days ago
- Status changed from Revise to Deploy
- Assignee changed from haykal haykal to hans hans
Udh ok Hans. Minta tolong di-deploy ke KJL Prod ya...
Port: https://hris-kjl-prod.minovais.com/
DB: MinovaES_KJL_Prod (103.153.60.89)
Terimakasih.