Change Registered Attribute Set Instance
--HG-- branch : EDII
This commit is contained in:
parent
9fdda9e70a
commit
2990ef22e2
|
|
@ -135,10 +135,10 @@ public class MID_UploadTPB extends SvrProcess{
|
|||
int C_BPartner_ID = 0;
|
||||
int C_Currency_ID = 0;
|
||||
if(AJU_DocType_Value.equals("40")) {
|
||||
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? ", new Object[] { dataRow.getCell(93).getStringCellValue(), getAD_Client_ID()});
|
||||
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? AND ISVendor='Y' ", new Object[] { dataRow.getCell(93).getStringCellValue(), getAD_Client_ID()});
|
||||
C_Currency_ID = DB.getSQLValue(get_TrxName(), "SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code =? ", new Object[] { "IDR" });
|
||||
}else {
|
||||
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? ", new Object[] { dataRow.getCell(3).getStringCellValue(), getAD_Client_ID()});
|
||||
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? AND ISVendor='Y' ", new Object[] { dataRow.getCell(3).getStringCellValue(), getAD_Client_ID()});
|
||||
C_Currency_ID = DB.getSQLValue(get_TrxName(), "SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code =? ", new Object[] { dataRow.getCell(88).getStringCellValue()});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package andromedia.midsuit.validator;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.adempiere.base.event.IEventTopics;
|
||||
|
|
@ -80,8 +83,12 @@ public class MID_OrderValidator {
|
|||
.list();
|
||||
if(attLines.size()<=0)
|
||||
if(line.getM_AttributeSetInstance_ID()>0) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
|
||||
Timestamp regDate = (Timestamp) line.get_Value("RegisterDate");
|
||||
dateFormat.format(new Date(regDate.getTime()));
|
||||
|
||||
MAttributeSetInstance ASI = new MAttributeSetInstance(order.getCtx(), line.getM_AttributeSetInstance_ID(), order.get_TrxName());
|
||||
ASI.setSerNo(line.get_ValueAsString("NoAju"));
|
||||
ASI.setSerNo(line.get_ValueAsString("RegisterNo")+"-"+dateFormat.format(new Date(regDate.getTime())));
|
||||
ASI.setDescription();
|
||||
ASI.saveEx();
|
||||
}else {
|
||||
|
|
@ -91,8 +98,12 @@ public class MID_OrderValidator {
|
|||
}
|
||||
|
||||
for(X_C_OrderLineMA attLine : attLines) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
|
||||
Timestamp regDate = (Timestamp) line.get_Value("RegisterDate");
|
||||
dateFormat.format(new Date(regDate.getTime()));
|
||||
|
||||
MAttributeSetInstance ASI = new MAttributeSetInstance(order.getCtx(), attLine.getM_AttributeSetInstance_ID(), order.get_TrxName());
|
||||
ASI.setSerNo(line.get_ValueAsString("NoAju"));
|
||||
ASI.setSerNo(line.get_ValueAsString("RegisterNo")+"-"+dateFormat.format(new Date(regDate.getTime())));
|
||||
ASI.setDescription();
|
||||
ASI.saveEx();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue