Пример #1
0
        private void CreateRetailSaleOrderLineWithBarcode(NebimV3.Orders.RetailSale TW, string barcode, int quantity, decimal?discountIncludingTax,
                                                          decimal?priceIncludingTax, string description, string currencyCode, string discountNames)
        {
            // Create a new line.
            NebimV3.Orders.RetailSaleLine line = (NebimV3.Orders.RetailSaleLine)(TW.TransactionFactory.CreateLine(TW));

            // If you do not have any item variant info(ItemCode, ColorCode, Dim1Code, etc...)
            // But have a Barcode Number
            line.UsedBarcode             = barcode;
            line.Qty1                    = quantity;
            line.ActualPriceCurrencyCode = currencyCode;

            if (priceIncludingTax.HasValue)
            {
                line.PriceVI = priceIncludingTax.Value;// kdv ddahil
            }
            line.LineDescription = description;
            // Optional properties(LineDescription, DeliveryDate etc...) can be assigned also as described in previous method.
            line.Save();

            //save discount names(campaign names)
            if (_nebimIntegrationSettings.DiscountNameSavingEnabled && !string.IsNullOrWhiteSpace(discountNames))
            {
                foreach (var name in discountNames.Split(new string[] { "--" }, StringSplitOptions.RemoveEmptyEntries))
                {
                    SaveOrderDiscountOffer(Guid.Empty, TW.HeaderID, line.LineID, 0, 0, "1", name);
                }
            }
        }
Пример #2
0
        private void CreateRetailSaleOrderExpense(NebimV3.Orders.RetailSale ST,
                                                  string itemCode,
                                                  decimal?discountIncludingTax,
                                                  decimal?priceIncludingTax,
                                                  string currencyCode
                                                  )
        {
            // Create a new line.
            NebimV3.Orders.RetailSaleLine line = (NebimV3.Orders.RetailSaleLine)(ST.TransactionFactory.CreateLine(ST));

            // Required
            //line.ItemTypeCode = (byte)(NebimV3.ApplicationCommon.ItemTypes.Expense);
            line.ItemTypeCode = (byte)(NebimV3.ApplicationCommon.ItemTypes.Product);
            line.ItemCode     = itemCode;
            line.ColorCode    = "";
            line.ItemDim1Code = "";
            line.ItemDim2Code = "";
            line.ItemDim3Code = "";
            line.Qty1         = 1;
            //line.CurrencyCode = currencyCode;
            line.ActualPriceCurrencyCode = currencyCode;

            if (priceIncludingTax.HasValue)
            {
                line.PriceVI = priceIncludingTax.Value; // kdv ddahil
            }
            line.Save();                                // Saving the first line of the transaction, also saves the transaction header.
        }
Пример #3
0
        // This method demonstrates how to use "variant info" and other options.
        private void CreateRetailSaleOrderLineWithItemVariant(NebimV3.Orders.RetailSale ST,
                                                              string itemCode,
                                                              string colorCode,
                                                              string itemDim1Code,
                                                              string itemDim2Code,
                                                              int quantity,
                                                              decimal?discountIncludingTax,
                                                              decimal?priceIncludingTax,
                                                              string description,
                                                              string currencyCode,
                                                              string discountNames
                                                              )
        {
            // Create a new line.
            NebimV3.Orders.RetailSaleLine line = (NebimV3.Orders.RetailSaleLine)(ST.TransactionFactory.CreateLine(ST));

            // Required
            line.ItemTypeCode = (byte)(NebimV3.ApplicationCommon.ItemTypes.Product);
            line.ItemCode     = itemCode;
            line.ColorCode    = colorCode;
            line.ItemDim1Code = itemDim1Code;
            line.ItemDim2Code = itemDim2Code;
            line.ItemDim3Code = "";
            line.Qty1         = quantity;
            //line.CurrencyCode = currencyCode;
            line.ActualPriceCurrencyCode = currencyCode;


            if (priceIncludingTax.HasValue)
            {
                line.PriceVI = priceIncludingTax.Value;// kdv dahil
            }


            line.LineDescription = description;

            line.Save(); // Saving the first line of the transaction, also saves the transaction header.

            //save discount names(campaign names)
            if (_nebimIntegrationSettings.DiscountNameSavingEnabled && !string.IsNullOrWhiteSpace(discountNames))
            {
                foreach (var name in discountNames.Split(new string[] { "--" }, StringSplitOptions.RemoveEmptyEntries))
                {
                    SaveOrderDiscountOffer(Guid.Empty, ST.HeaderID, line.LineID, 0, 0, "1", name);
                }
            }
        }