public void createRegisterline(SalesTable _salestable)
{
Integer lastRec = 0;
SalesId oldSalesId;
inventTrans inventTrans;
SalesFormLetter salesFormLetter;
inventTransOrigin inventTransOrigin;
TradeOrderLineRegister tradeOrderlineRegister;
SON_SalesReturnOrderLineRegister salesReturnOrderLineRegister;
InventTransWMS_Register inventTransWMS_register;
TmpInventTransWMS TmpInventTransWMS;
SalesLine salesLineReg;
ReturnDispositionCode returnDispositionCode;
SON_IPB49_InventStkTransHeader headerTable,headerTableLoc;
Description255 errorMsg;
Args args = new Args();
try
{
ttsBegin;
select firstOnly * from returnDispositionCode
where returnDispositionCode.DispositionAction == DispositionAction::Credit;
while select forUpdate salesLineReg
where _salestable.SalesId == salesLineReg.SalesId
&& _salestable.SalesType == SalesType::ReturnItem
{
try
{
args.record(salesLineReg);
tradeOrderLineRegister = SON_SalesReturnOrderLineRegister::construct();
tradeOrderLineRegister.parmArgs(args);
tradeOrderLineRegister.init();
salesReturnOrderLineRegister = tradeOrderLineRegister;
salesReturnOrderLineRegister.runPreSuper();
//update returnDisposioncode
salesLineReg.ReturnDispositionCodeId = returnDispositionCode.DispositionCodeId;
salesLineReg.update();
select firstOnly crossCompany inventTrans
join RecId,InventTransId from inventTransOrigin
where inventTransOrigin.InventTransId == salesLineReg.InventTransId
&& inventTrans.InventTransOrigin == inventTransOrigin.RecId;
inventTransWMS_register = inventTransWMS_register::newStandard(tmpInventTransWMS);
tmpInventTransWMS.clear();
tmpInventTransWMS.initFromInventTrans(inventTrans);
tmpInventTransWMS.InventDimId = inventTrans.InventDimId;
tmpInventTransWMS.insert();
inventTransWMS_register.writeTmpInventTransWMS(tmpInventTransWMS,
inventTrans,
inventTrans.inventDim());
inventTransWMS_register.updateInvent(salesLineReg);
}
catch
{
continue;
}
}
ttsCommit;
}
catch
{
}
}
{
Integer lastRec = 0;
SalesId oldSalesId;
inventTrans inventTrans;
SalesFormLetter salesFormLetter;
inventTransOrigin inventTransOrigin;
TradeOrderLineRegister tradeOrderlineRegister;
SON_SalesReturnOrderLineRegister salesReturnOrderLineRegister;
InventTransWMS_Register inventTransWMS_register;
TmpInventTransWMS TmpInventTransWMS;
SalesLine salesLineReg;
ReturnDispositionCode returnDispositionCode;
SON_IPB49_InventStkTransHeader headerTable,headerTableLoc;
Description255 errorMsg;
Args args = new Args();
try
{
ttsBegin;
select firstOnly * from returnDispositionCode
where returnDispositionCode.DispositionAction == DispositionAction::Credit;
while select forUpdate salesLineReg
where _salestable.SalesId == salesLineReg.SalesId
&& _salestable.SalesType == SalesType::ReturnItem
{
try
{
args.record(salesLineReg);
tradeOrderLineRegister = SON_SalesReturnOrderLineRegister::construct();
tradeOrderLineRegister.parmArgs(args);
tradeOrderLineRegister.init();
salesReturnOrderLineRegister = tradeOrderLineRegister;
salesReturnOrderLineRegister.runPreSuper();
//update returnDisposioncode
salesLineReg.ReturnDispositionCodeId = returnDispositionCode.DispositionCodeId;
salesLineReg.update();
select firstOnly crossCompany inventTrans
join RecId,InventTransId from inventTransOrigin
where inventTransOrigin.InventTransId == salesLineReg.InventTransId
&& inventTrans.InventTransOrigin == inventTransOrigin.RecId;
inventTransWMS_register = inventTransWMS_register::newStandard(tmpInventTransWMS);
tmpInventTransWMS.clear();
tmpInventTransWMS.initFromInventTrans(inventTrans);
tmpInventTransWMS.InventDimId = inventTrans.InventDimId;
tmpInventTransWMS.insert();
inventTransWMS_register.writeTmpInventTransWMS(tmpInventTransWMS,
inventTrans,
inventTrans.inventDim());
inventTransWMS_register.updateInvent(salesLineReg);
}
catch
{
continue;
}
}
ttsCommit;
}
catch
{
}
}