Pages

Banner 468 x 60px

 

Monday, October 2, 2023

Physical on-hand Inventory Plus Minus without License Plate

0 comments

 


Physical on-hand Inventory 


static void ABUInventTransSolve(Args _args)
{
    InventTrans                     invTrans;
    InventTransOrigin               invTransOrigin;
    InventDim                       inventDim, iDim;

    /*while select invTransOrigin
        where invTransOrigin.ReferenceId == 'TO-000007756' &&
        invTransOrigin.ReferenceCategory == InventTransType::TransferOrderShip &&
        invTransOrigin.ItemId == 'P000371'*/

    select forUpdate invTrans
        join iDim
        join invTransOrigin order by ReferenceId asc
    where iDim.inventDimId == invTrans.inventDimId
    //&& iDim.InventLocationId == 'CNK'
    //&& invTransOrigin.ReferenceCategory == InventTransType::InventTransfer
    && invTransOrigin.RecId == invTrans.InventTransOrigin
    && invTransOrigin.ItemId == invTrans.ItemId
    //&& invTrans.StatusReceipt == StatusReceipt::Purchased
    && invTrans.RecId == 5655505580;
    {
        if(invTrans && WMSLocation::findInventLocation(iDim.wMSLocationId).sortCode > 0)
        {
            ttsBegin;
            inventDim.InventSiteId       = 'JBT';
            inventDim.InventLocationId   = 'CNK';
            inventDim.configId           = InventTable::find(invTrans.itemId).StandardConfigId;
            inventDim.InventStyleId      = InventTable::find(invTrans.itemId).StandardInventStyleId;
            inventDim.InventSizeId       = InventTable::find(invTrans.itemId).StandardInventSizeId;
            inventDim.InventColorId      = InventTable::find(invTrans.itemId).StandardInventColorId;
            inventDim.wMSLocationId      = '0079A-5-8';//ABUTallyLine::findFix(invTrans.ItemId, iDim.wMSLocationId, invTransOrigin.InventTransId).WMSLocationId;
            inventDim.LicensePlateId     = 'CNK-230919-999001';//ABUTallyLine::findFix(invTrans.ItemId, iDim.wMSLocationId, invTransOrigin.InventTransId).WHSLicensePlateId;
            inventDim.InventStatusId     = 'AVAILABLE';

            inventDim                    = inventDim::findOrCreate(inventDim);
            invTrans.inventDimId         = inventDim.inventDimId;
            invTrans.update();

            info(strFmt("%1 Location:%2 LP:%3  Status:%4", invTransOrigin.ReferenceId, inventDim.wMSLocationId, inventDim.LicensePlateId,  invTrans.StatusIssue));
            ttsCommit;
        }
    }

    //info("Done");
}

0 comments:

A financial dimension value is based on the record and has been used on a transaction. You cannot delete the record

  SOLUTION delete in table DimensionAttributeLevelValue base on Bank Account  :  and Delete the Bank Account FINISH