Exemplo n.º 1
0
        private ReceivedTransferMutation GetDifferenceRuleForIncompleteShipping(TransferOrderLine difference, int ReceivedFromWehkamp, int ShippedFromPFA, int storeID, string employeeNumber, int vendorID, DateTime receivedByWehkamp, int salesSlipNumber)
        {
            OrderLedger ledger = difference.OrderLine.OrderLedgers.FirstOrDefault(x => x.Status == (int)OrderLineStatus.ReceivedTransfer);

            var     product         = difference.OrderLine.Product;
            var     priceAssortment = product.VendorAssortments.FirstOrDefault(c => c.VendorID == vendorID).VendorPrices.FirstOrDefault();
            decimal markDown        = 0;

            if (priceAssortment.SpecialPrice.HasValue && priceAssortment.Price > priceAssortment.SpecialPrice.Value)
            {
                markDown = priceAssortment.Price.Value - priceAssortment.SpecialPrice.Value;
            }

            var productNumberParts = product.VendorItemNumber.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            var artikelCode        = productNumberParts[0];
            var colorCode          = productNumberParts[1].PadLeft(3, '0');

            ReceivedTransferMutation datcolLine = new ReceivedTransferMutation
            {
                StoreNumber         = String.Format("{0} {1}", storeID, "01"),
                EmployeeNumber      = employeeNumber,
                ReceiptNumber       = salesSlipNumber,
                TransactionType     = "21",
                DateNotified        = receivedByWehkamp.ToString("yyyyMMddhhmm"),
                RecordType          = "01",
                SubType             = "02",
                NumberOfDifferences = QuantityHelper.GetNumberOfDifferences(difference.ReceivedFromWehkamp, difference.ShippedFromPFA),
                FixedField1         = "000000001+",
                FixedField2         = (int)Math.Round(markDown * 100),
                NumberOfSkus        = String.Format("{0}+", difference.ShippedFromPFA),
                FixedField3         = "000",
                FixedField4         = "000000000+",
                FixedField5         = "000",
                FixedField6         = 0,
                FixedField7         = "000",
                FixedField8         = (int)Math.Round(priceAssortment.Price.Value * 100),
                FixedField9         = "00",
                FixedField10        = "000" + ProductHelper.GetPFAItemNumber(artikelCode, colorCode, product.ProductID).ToUpper(),
                FixedField11        = "0000000" + BarcodeHelper.GetBarcode(product.ProductID),
                TransferNumber      = difference.OrderLine.Order.WebSiteOrderNumber,
                EmployeeNumber2     = employeeNumber,
                ScannedIndication   = 0
            };

            return(datcolLine);
        }
Exemplo n.º 2
0
        private List <ReceivedTransferMutation> GetTotalRuleForIncompleteShipping(Order order, int ReceivedFromWehkamp, int ShippedFromPFA, int storeID, string employeeNumber, int vendorID, DateTime receivedByWehkamp, int salesSlipNumber)
        {
            var _list = new List <ReceivedTransferMutation>();

            var mutation = new ReceivedTransferMutation
            {
                StoreNumber         = String.Format("{0} {1}", storeID, "01"),
                EmployeeNumber      = employeeNumber,
                ReceiptNumber       = salesSlipNumber,
                TransactionType     = "21",
                DateNotified        = receivedByWehkamp.ToString("yyyyMMddhhMM"),
                RecordType          = "99",
                SubType             = "02",
                NumberOfDifferences = QuantityHelper.GetNumberOfDifferences(ReceivedFromWehkamp, ShippedFromPFA),
                FixedField1         = "1+",
                FixedField2         = 0,
                NumberOfSkus        = String.Format("{0}+", ReceivedFromWehkamp),
                FixedField3         = "000",
                FixedField4         = "0+",
                FixedField5         = "000",
                FixedField6         = 0,
                FixedField7         = "000",
                FixedField8         = 0,
                FixedField9         = "00",
                FixedField10        = "00000000000000000000",
                FixedField11        = "00000000000000000000",
                TransferNumber      = order.WebSiteOrderNumber,
                EmployeeNumber2     = employeeNumber,
                ScannedIndication   = 0
            };

            _list.Add(mutation);


            return(_list);
        }