[ExtensionOf(classStr(WhsPostEngine))]final class WhsPostEngine_RevolutionDancewear_Extension{ public static boolean post(WHSWaveTable _waveTable, WHSReleaseToWarehouseId _releaseToWarehouseId) { WHSWaveLine waveLine; SalesTable salesTable; LogisticsPostalAddress LogisticsPostalAddress; LogisticsPostalAddress logisticsPostalAddressOld; utcdatetime now = DateTimeUtil::getSystemDateTime(); utcdatetime futureDate = DateTimeUtil::addMonths(now,6); DirPartyTable dirPartyTable; CustTable custTable; utcDateTime utcMinVal = DateTimeUtil::minValue(); utcDateTime utcMaxVal = DateTimeUtil::maxValue(); Common common; DictTable dictTable; ; ttsbegin; while select waveLine where waveLine.WaveID == _waveTable.waveID outer join SalesTable where SalesTable.SalesID == waveLine.OrderNum // outer join forupdate validtimeState(dateFrom,dateTo) * from LogisticsPostalAddress where LogisticsPostalAddress.RecId == SalesTable.AddressRefRecId { dictTable = new DictTable(salesTable.AddressRefTableId); common = dictTable.makeRecord(); //common.selectForUpdate(_forUpdate); select custTable where custTable.RecId == salesTable.AddressRefRecId; LogisticsPostalAddress = CustTable.postalAddress(); //select dirPartyTable where dirPartyTable.RecId == custTable.Party; while select forupdate validtimeState(utcMinVal,utcMaxVal) logisticsPostalAddressOld where logisticsPostalAddressOld.Location == LogisticsPostalAddress.Location && logisticsPostalAddressOld.RecId != LogisticsPostalAddress.RecId //logisticsPostalAddress where logisticsPostalAddress.RecId == SalesTable.AddressRefRecId; if(LogisticsPostalAddress.ValidTo < now) { logisticsPostalAddressOld.validTimeStateUpdateMode(ValidTimeStateUpdate::CreateNewTimePeriod); logisticsPostalAddressOld.ValidTo = futureDate; logisticsPostalAddressOld.update(); } } ttscommit; boolean ret = next post(_waveTable, _releaseToWarehouseId); return ret; }}
final class WhsPostEngine_RevolutionDancewear_Extension
{
public static boolean post(WHSWaveTable _waveTable, WHSReleaseToWarehouseId _releaseToWarehouseId)
{
WHSWaveLine waveLine;
SalesTable salesTable;
LogisticsPostalAddress LogisticsPostalAddress;
LogisticsPostalAddress logisticsPostalAddressOld;
utcdatetime now = DateTimeUtil::getSystemDateTime();
utcdatetime futureDate = DateTimeUtil::addMonths(now,6);
DirPartyTable dirPartyTable;
CustTable custTable;
utcDateTime utcMaxVal = DateTimeUtil::maxValue();
DictTable dictTable;
;
ttsbegin;
outer join SalesTable where SalesTable.SalesID == waveLine.OrderNum
// outer join forupdate validtimeState(dateFrom,dateTo) * from LogisticsPostalAddress where LogisticsPostalAddress.RecId == SalesTable.AddressRefRecId
{
dictTable = new DictTable(salesTable.AddressRefTableId);
common = dictTable.makeRecord();
//common.selectForUpdate(_forUpdate);
select custTable where custTable.RecId == salesTable.AddressRefRecId;
LogisticsPostalAddress = CustTable.postalAddress();
//select dirPartyTable where dirPartyTable.RecId == custTable.Party;
&& logisticsPostalAddressOld.RecId != LogisticsPostalAddress.RecId
//logisticsPostalAddress where logisticsPostalAddress.RecId == SalesTable.AddressRefRecId;
if(LogisticsPostalAddress.ValidTo < now)
{
logisticsPostalAddressOld.validTimeStateUpdateMode(ValidTimeStateUpdate::CreateNewTimePeriod);
logisticsPostalAddressOld.ValidTo = futureDate;
logisticsPostalAddressOld.update();
}
boolean ret = next post(_waveTable, _releaseToWarehouseId);
return ret;
}
}