Beispiel #1
0
        private void btnDirectGR_Click(object sender, EventArgs e)
        {
            // Console
            Console.WriteLine($"(K) Creating direct goods-in to shop...");


            if (Delivery.GoodsReceiptItems.Count > 0)
            {
                int bplid  = Delivery.oDraft.BPL_IDAssignedToInvoice;
                var result = GoodsReceipt.CreateGoodsReceipt(Sap_Ld, Delivery.GoodsReceiptItems.ToArray(), bplid);


                // Console
                if (result != 0)
                {
                    Console.WriteLine($"Error: {Sap_Ld.oCompany.GetLastErrorDescription()}" + Environment.NewLine);
                }
                else
                {
                    Console.WriteLine($"Success: {Sap_Ld.oCompany.GetNewObjectKey()}" + Environment.NewLine);
                }
            }
            else
            {
                Console.WriteLine($"No items for direct goods receipt.");
            }
        }
Beispiel #2
0
        private void btnDirectGRKS_Click(object sender, EventArgs e)
        {
            // Console
            Console.WriteLine($"(R) Creating direct goods-in to freezer...");

            if (Delivery.ZeroBatchLineNums.Count > 0)
            {
                var grItems = Delivery.CreateGoodsReceiptItemsFromZeroBatchLineNums();

                var result = GoodsReceipt.CreateGoodsReceipt(Sap_Ks, grItems, null);


                // Console
                if (result != 0)
                {
                    Console.WriteLine($"Error: {Sap_Ld.oCompany.GetLastErrorDescription()}" + Environment.NewLine);
                }
                else
                {
                    Console.WriteLine($"Success: {Sap_Ld.oCompany.GetNewObjectKey()}" + Environment.NewLine);
                }
            }
            else
            {
                Console.WriteLine($"No items for direct goods receipt.");
            }
        }
Beispiel #3
0
        private void btnInterBranchGRPO_Click(object sender, EventArgs e)
        {
            // Console
            Console.WriteLine($"(J) Creating inter-branch GRPO for unallocated items...");

            GoodsReceiptItem[] goodsItems = Delivery.CopyDeliveryXferItems2GRPO();

            if (goodsItems.Length > 0)
            {
                string   cardcode = "LDHQS";
                DateTime docdate  = Delivery.oDraft.DocDate;
                int      bplid    = Delivery.oDraft.BPL_IDAssignedToInvoice;
                //GoodsReceiptItem[] goodsItems = Delivery.CopyDeliveryXferItems2GRPO();

                int result = GoodsReceipt.CreateGRPO(Sap_Ld, goodsItems, cardcode, docdate, bplid);


                // Console
                if (result == 0)
                {
                    Console.WriteLine($"Inter-branch GRPO created successfully." + Environment.NewLine);
                }
                else
                {
                    Console.WriteLine($"Error: {Sap_Ld.oCompany.GetLastErrorDescription()}" + Environment.NewLine);
                }
            }
            else
            {
                Console.WriteLine($"No Inter-branch GRPO needed.");
            }
        }