UOM check on Client first, then check from System
--HG-- branch : EDII
This commit is contained in:
parent
8780c6a14a
commit
9fdda9e70a
|
|
@ -177,25 +177,31 @@ public class MID_UploadTPB extends SvrProcess{
|
||||||
BigDecimal PriceActual = Env.ZERO;
|
BigDecimal PriceActual = Env.ZERO;
|
||||||
if(AJU_DocType_Value.equals("23") || AJU_DocType_Value.equals("40") || AJU_DocType_Value.equals("41")){
|
if(AJU_DocType_Value.equals("23") || AJU_DocType_Value.equals("40") || AJU_DocType_Value.equals("41")){
|
||||||
M_Product_ID = DB.getSQLValue(get_TrxName(), "SELECT M_Product_ID FROM M_Product WHERE Value =? AND AD_Client_ID =?", new Object[] { rowBarang.getCell(20).getStringCellValue(), getAD_Client_ID() });
|
M_Product_ID = DB.getSQLValue(get_TrxName(), "SELECT M_Product_ID FROM M_Product WHERE Value =? AND AD_Client_ID =?", new Object[] { rowBarang.getCell(20).getStringCellValue(), getAD_Client_ID() });
|
||||||
C_UOM_ID = DB.getSQLValue(get_TrxName(), " SELECT C_UOM_ID FROM C_UOM WHERE UOMSymbol =?", new Object[] { rowBarang.getCell(27).getStringCellValue()});
|
C_UOM_ID = DB.getSQLValue(get_TrxName(), " SELECT C_UOM_ID FROM C_UOM WHERE UOMSymbol =? AND AD_Client_ID =?", new Object[] { rowBarang.getCell(27).getStringCellValue(), getAD_Client_ID()});
|
||||||
|
|
||||||
if(M_Product_ID <=0)
|
if(M_Product_ID <=0)
|
||||||
throw new AdempiereException("Product Not Found "+rowBarang.getCell(20).getStringCellValue()+" !!!");
|
throw new AdempiereException("Product Not Found "+rowBarang.getCell(20).getStringCellValue()+" !!!");
|
||||||
|
|
||||||
|
|
||||||
|
if(C_UOM_ID <=0)
|
||||||
|
C_UOM_ID = DB.getSQLValue(get_TrxName(), " SELECT C_UOM_ID FROM C_UOM WHERE UOMSymbol =? AND AD_Client_ID =?", new Object[] { rowBarang.getCell(27).getStringCellValue(), 0});
|
||||||
|
|
||||||
if(C_UOM_ID <=0)
|
if(C_UOM_ID <=0)
|
||||||
throw new AdempiereException("UOM Not Found "+rowBarang.getCell(27).getStringCellValue()+" !!!");
|
throw new AdempiereException("UOM Not Found "+rowBarang.getCell(27).getStringCellValue()+" !!!");
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
M_Product_ID = DB.getSQLValue(get_TrxName(), "SELECT M_Product_ID FROM M_Product WHERE Value =? AND AD_Client_ID =?", new Object[] { rowBarang.getCell(10).getStringCellValue(), getAD_Client_ID() });
|
M_Product_ID = DB.getSQLValue(get_TrxName(), "SELECT M_Product_ID FROM M_Product WHERE Value =? AND AD_Client_ID =?", new Object[] { rowBarang.getCell(10).getStringCellValue(), getAD_Client_ID() });
|
||||||
C_UOM_ID = DB.getSQLValue(get_TrxName(), " SELECT C_UOM_ID FROM C_UOM WHERE UOMSymbol =?", new Object[] { rowBarang.getCell(7).getStringCellValue()});
|
C_UOM_ID = DB.getSQLValue(get_TrxName(), " SELECT C_UOM_ID FROM C_UOM WHERE UOMSymbol =? AND AD_Client_ID =?", new Object[] { rowBarang.getCell(7).getStringCellValue(), getAD_Client_ID()});
|
||||||
|
|
||||||
if(M_Product_ID <=0)
|
if(M_Product_ID <=0)
|
||||||
throw new AdempiereException("Product Not Found "+rowBarang.getCell(10).getStringCellValue()+" !!!");
|
throw new AdempiereException("Product Not Found "+rowBarang.getCell(10).getStringCellValue()+" !!!");
|
||||||
|
|
||||||
|
if(C_UOM_ID <=0)
|
||||||
|
C_UOM_ID = DB.getSQLValue(get_TrxName(), " SELECT C_UOM_ID FROM C_UOM WHERE UOMSymbol =?", new Object[] { rowBarang.getCell(7).getStringCellValue(), 0});
|
||||||
|
|
||||||
if(C_UOM_ID <=0)
|
if(C_UOM_ID <=0)
|
||||||
throw new AdempiereException("UOM Not Found "+rowBarang.getCell(7).getStringCellValue()+" !!!");
|
throw new AdempiereException("UOM Not Found "+rowBarang.getCell(7).getStringCellValue()+" !!!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(AJU_DocType_Value.equals("23")){
|
if(AJU_DocType_Value.equals("23")){
|
||||||
Qty = new BigDecimal(rowBarang.getCell(16).getStringCellValue());
|
Qty = new BigDecimal(rowBarang.getCell(16).getStringCellValue());
|
||||||
PriceList = new BigDecimal(rowBarang.getCell(12).getStringCellValue());
|
PriceList = new BigDecimal(rowBarang.getCell(12).getStringCellValue());
|
||||||
|
|
@ -222,18 +228,15 @@ public class MID_UploadTPB extends SvrProcess{
|
||||||
else
|
else
|
||||||
PriceList = PriceActual;
|
PriceList = PriceActual;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AJU_DocType_Value.equals("27")){
|
if(AJU_DocType_Value.equals("27")){
|
||||||
Discount = new BigDecimal(rowBarang.getCell(22).getStringCellValue());
|
Discount = new BigDecimal(rowBarang.getCell(22).getStringCellValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
tpbDetail.setM_Product_ID(M_Product_ID);
|
tpbDetail.setM_Product_ID(M_Product_ID);
|
||||||
tpbDetail.setC_UOM_ID(C_UOM_ID);
|
tpbDetail.setC_UOM_ID(C_UOM_ID);
|
||||||
tpbDetail.setQty(Qty);
|
tpbDetail.setQty(Qty);
|
||||||
tpbDetail.setPriceList(PriceList);
|
tpbDetail.setPriceList(PriceList);
|
||||||
tpbDetail.setDiscount(Discount);
|
tpbDetail.setDiscount(Discount);
|
||||||
tpbDetail.setPriceActual(PriceActual);
|
tpbDetail.setPriceActual(PriceActual);
|
||||||
|
|
||||||
tpbDetail.saveEx();
|
tpbDetail.saveEx();
|
||||||
return tpbDetail;
|
return tpbDetail;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue