Example #1
0
        public void SetOSAgainstSRItem(SalesReturnItem doi)
        {
            double qtyAmount = doi.GetAmountInSmallestUnit();

            if (qtyAmount <= 0)
            {
                return;
            }
            if (AGAINST_SR_STATUS == AgainstStatus.Close)
            {
                throw new Exception("DO Item already fully delivered :" + this.PART.NAME);
            }
            if (qtyAmount > OUTSTANDING_AMOUNT_TO_SR)
            {
                throw new Exception("SR Item Amount exceed Outstanding DO Item Amount :" + this.PART.NAME);
            }
            OUTSTANDING_AMOUNT_TO_SR = OUTSTANDING_AMOUNT_TO_SR - qtyAmount;
            RETURNED_AMOUNT          = RETURNED_AMOUNT + qtyAmount;
            if (isValidToClose())
            {
                AGAINST_SR_STATUS = AgainstStatus.Close;
            }
            else
            {
                AGAINST_SR_STATUS = AgainstStatus.Outstanding;
            }
            ((DeliveryOrder)EVENT).UpdateAgainstSRStatusDO();
        }
Example #2
0
        public void UnSetOSAgainstSRItem(SalesReturnItem doi)
        {
            double qtyAmount = doi.GetAmountInSmallestUnit();

            if (qtyAmount > this.GetAmountInSmallestUnit() || OUTSTANDING_AMOUNT_TO_SR + qtyAmount > this.GetAmountInSmallestUnit())
            {
                throw new Exception("SR Item revise Amount exceed DO Item Amount :" + this.PART.NAME);
            }
            OUTSTANDING_AMOUNT_TO_SR = OUTSTANDING_AMOUNT_TO_SR + qtyAmount;
            RETURNED_AMOUNT          = RETURNED_AMOUNT - qtyAmount;
            if (RETURNED_AMOUNT > 0)
            {
                AGAINST_SR_STATUS = AgainstStatus.Outstanding;
            }
            else
            {
                AGAINST_SR_STATUS = AgainstStatus.Open;
            }
            ((DeliveryOrder)EVENT).UpdateAgainstSRStatusDO();
        }