public void processoperation()
{
CustPackingSlipJour custPackingSlipJour;
CustPackingSlipTrans custPackingSlipTrans;
CustInvoiceTrans custInvoiceTrans;
InventTransOrigin inventTransOrigin;
InventTrans inventTrans;
str curCompany;
CustInvoiceJour custInvoiceJour ;
while select custPackingSlipJour
where custPackingSlipJour.DTInvoiceId == ''
{
ttsbegin;
select firstonly inventTrans
group by inventTrans.PackingSlipId,inventTrans.InvoiceId
exists join inventTransOrigin
where inventTransOrigin.RecId == inventTrans.InventTransOrigin
exists join custInvoiceTrans
where custInvoiceTrans.InventTransId == inventTransOrigin.InventTransId
&& custInvoiceTrans.InvoiceId == inventTrans.InvoiceId
exists join custPackingSlipTrans
where custPackingSlipTrans.PackingSlipId == inventTrans.PackingSlipId
&& custPackingSlipTrans.InventTransId == inventTransOrigin.InventTransId
&& custPackingSlipTrans.PackingSlipId == custPackingSlipJour.PackingSlipId;
custPackingSlipJour.reread();
custPackingSlipJour.selectForUpdate(true);
custPackingSlipJour.InvoiceId = inventTrans.InvoiceId;
custPackingSlipJour.doUpdate();
ttscommit;
}
}
while select custPackingSlipJour
where custPackingSlipJour.DTInvoiceId == ''
{
ttsbegin;
select firstonly PackingSlipId,InvoiceId from inventTrans
group by inventTrans.PackingSlipId,inventTrans.InvoiceId
exists join inventTransOrigin
where inventTransOrigin.RecId == inventTrans.InventTransOrigin
exists join custInvoiceTrans
where custInvoiceTrans.InventTransId == inventTransOrigin.InventTransId
exists join custPackingSlipTrans
where custPackingSlipTrans.PackingSlipId == inventTrans.PackingSlipId
&& custPackingSlipTrans.InventTransId == inventTransOrigin.InventTransId
exists join custPackingSlipJour
where custPackingSlipTrans.PackingSlipId == custPackingSlipJour.PackingSlipId;
custPackingSlipJour.reread();
custPackingSlipJour.selectForUpdate(true);
custPackingSlipJour.InvoiceId = inventTrans.InvoiceId;
custPackingSlipJour.doUpdate();
ttscommit;
}
final class CustPackingSlpJrSysOperationService extends SysOperationServiceBase
{
public void processoperation()
{
CustPackingSlipJour custPackingSlipJour;
CustPackingSlipTrans custPackingSlipTrans;
CustInvoiceTrans custInvoiceTrans;
InventTransOrigin inventTransOrigin;
InventTrans inventTrans;
str curCompany;
CustInvoiceJour custInvoiceJour ;
curCompany = curExt();
while select * from custPackingSlipJour
join custPackingSlipTrans
group by custPackingSlipJour.PackingSlipId
where custPackingSlipJour.PackingSlipId == custPackingSlipTrans.PackingSlipId
join inventTransOrigin
where inventTransOrigin.InventTransId == custPackingSlipTrans.InventTransId
join custInvoiceTrans
where custInvoiceTrans.InventTransId == inventTransOrigin.InventTransId
join inventTrans
where inventTrans.InventTransOrigin == inventTransOrigin.RecId
&& inventTrans.InvoiceId == custInvoiceTrans.InvoiceId
&& inventTrans.PackingSlipId == custPackingSlipTrans.PackingSlipId
join custInvoiceJour
where custInvoiceJour.InvoiceId == custInvoiceTrans.InvoiceId
&& custPackingSlipJour.DataAreaId == curCompany
&& custPackingSlipJour.DTInvoiceId == ''
{
custPackingSlipJour = custPackingSlipJour::findFromCustPackingSlipTrans(custPackingSlipTrans.SalesId,custPackingSlipTrans.PackingSlipId,custPackingSlipTrans.DeliveryDate);
if(custPackingSlipJour.DTInvoiceId == '' )
{
custPackingSlipJour.selectForUpdate(true);
custPackingSlipJour.DTInvoiceId = custInvoiceJour.InvoiceId;
custPackingSlipJour.update();
}
}
}
}
final class CustPackingSlpJrSysOperationService extends SysOperationServiceBase
{
public void processoperation()
{
CustPackingSlipJour custPackingSlipJour;
CustPackingSlipTrans custPackingSlipTrans;
CustInvoiceTrans custInvoiceTrans;
InventTransOrigin inventTransOrigin;
InventTrans inventTrans;
str curCompany;
CustInvoiceJour custInvoiceJour ;
curCompany = curExt();
while select custPackingSlipJour
join custPackingSlipTrans
group by custPackingSlipTrans.PackingSlipId
where custPackingSlipJour.PackingSlipId == custPackingSlipTrans.PackingSlipId
join inventTransOrigin
where inventTransOrigin.InventTransId == custPackingSlipTrans.InventTransId
join custInvoiceTrans
where custInvoiceTrans.InventTransId == inventTransOrigin.InventTransId
join inventTrans
where inventTrans.InventTransOrigin == inventTransOrigin.RecId
&& inventTrans.InvoiceId == custInvoiceTrans.InvoiceId
&& inventTrans.PackingSlipId == custPackingSlipTrans.PackingSlipId
join custInvoiceJour
where custInvoiceJour.InvoiceId == custInvoiceTrans.InvoiceId
&& custPackingSlipJour.DataAreaId == curCompany
&& custPackingSlipJour.DTInvoiceId == ''
{
custPackingSlipJour.selectForUpdate(true);
custPackingSlipJour.DTInvoiceId = custInvoiceJour.InvoiceId;
custPackingSlipJour.update();
}
}
}
André Arnaud de Cal... 291,784 Super User 2024 Season 2
Martin Dráb 230,476 Most Valuable Professional
nmaenpaa 101,156