示例#1
0
        protected void btnCustomerordersubmit_click(object sender, EventArgs e)
        {
            pnlBills.Visible = true;
            btnCustomerorRemoveAllitam.Visible = false;
            pnlBill.Visible             = false;
            btnaddCustomeraItam.Visible = false;
            btnCustomerNewOrder.Visible = false;
            btnPrint.Visible            = true;

            int         result      = 0;
            Invoice     inovice     = new Invoice();
            InvoiceData invoiceData = new InvoiceData();

            inovice.orderDate      = (Convert.ToDateTime(txtCustamerorderDate.Text)).ToString("dd-MM-yyyy");
            inovice.AgencyID       = 0;
            inovice.ShecemeApplied = true;

            //salesEmployee
            DataSet  ds       = new DataSet();
            BillData billData = new BillData();

            ds = billData.getEmployeeByUserId(GlobalInfo.Userid);
            inovice.SaleEmployeeId = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["EmployeeID"].ToString()) ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["EmployeeID"]);

            inovice.totalCoast     = string.IsNullOrEmpty(hfcutomerTotal.Value) ? 0 : Comman.Comman.IsValidInteger(hfcutomerTotal.Value) ? Convert.ToDouble(hfcutomerTotal.Value) : 0;
            inovice.CreatedBy      = GlobalInfo.Userid;
            inovice.CreatedDate    = DateTime.Now.ToString("dd/MM/yyyy");
            inovice.TokanId        = hftokanno.Value;
            inovice.orderType      = 3;// employeeORder
            inovice.CurrentBoothID = GlobalInfo.CurrentbothID;
            DataSet chkds  = new DataSet();
            int     chkflg = 1;

            chkds = invoiceData.CheckBoothTemp(inovice, chkflg);
            if (!Comman.Comman.IsDataSetEmpty(chkds))
            {
                result = invoiceData.BoothLocalInserOrder(inovice);
            }

            if (result > 0)
            {
                btnCustomerordersubmit.Visible = false;
                btnPrint.Visible = true;

                updateStock();

                //BindEmployeeOrderDetails(inovice);
                // BindAgntTempItam(inovice);
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                pnlError.Update();
                upMain.Update();
                pnlBill.Enabled = false;


                //
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
                btnPrint.Visible = false;
                btnCustomerordersubmit.Visible = false;
                btnCustomerNewOrder.Visible    = true;
            }
        }
        public InvoiceData MakeBooking(AllData allData)
        {
            Booking booking = new Booking();

            booking.CustomerId = allData.CustomerId;
            booking.Checkin    = allData.userinfo.CheckIn;
            booking.Checkout   = allData.userinfo.CheckOut;
            booking.HotelId    = allData.userinfo.HotelId;
            int days = (allData.userinfo.CheckOut - allData.userinfo.CheckIn).Days + 1;
            int sum  = 0;

            for (int i = 0; i < allData.SelectedRooms.Count; i++)
            {
                sum += (int)allData.SelectedRooms[i].RoomPrice * days;
            }
            booking.TotalAmount = sum;
            context.Booking.Add(booking);
            context.SaveChanges();


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



            int Roomcount = allData.SelectedRooms.Count;

            BookingDetails[] bookingDetails = new BookingDetails[Roomcount];
            BookingDetails   temp;

            for (int i = 0; i < Roomcount; i++)
            {
                temp              = new BookingDetails();
                temp.BookingId    = booking.BookingId;
                temp.HotelId      = booking.HotelId;
                temp.RoomId       = allData.SelectedRooms[i].RoomId;
                temp.Days         = days;
                temp.RoomPrice    = allData.SelectedRooms[i].RoomPrice;
                bookingDetails[i] = temp;
                //  context.BookingDetails.Add(bookingDetails[i]);
            }
            context.BookingDetails.AddRange(bookingDetails);



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



            Payment payment = new Payment();

            payment.BookingId   = booking.BookingId;
            payment.CustomerId  = booking.CustomerId.Value;
            payment.HotelId     = booking.HotelId.Value;
            payment.PaymentType = allData.payMode;
            payment.TotalAmount = sum;
            payment.Date        = DateTime.Now;


            context.Payment.Add(payment);



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


            context.SaveChanges();

            Customer    customer = context.Customer.SingleOrDefault(c => c.CustomerId == allData.CustomerId);
            InvoiceData data     = new InvoiceData();

            data.customer         = customer;
            data.customer.Booking = null;  data.customer.Payment = null;
            data.InvoiceNo        = payment.PaymentInvoiceNo;
            return(data);
        }
示例#3
0
        private void submitOrders()
        {
            DataSet     DS          = new DataSet();
            Invoice     invoice     = new Invoice();
            Invoice     invocie     = new Invoice();
            InvoiceData invoiceData = new InvoiceData();

            invocie.TokanId = hftokanno.Value;
            invocie.UserID  = GlobalInfo.Userid;
            DS = invoiceData.GetOrdersForSubmit(invocie);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                try
                {
                    DS.Tables[0].Columns.Add("OrderDate", typeof(string));
                    string orderDate = (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy");
                    for (int i = 0; i <= DS.Tables[0].Rows.Count - 1; i++)
                    {
                        DS.Tables[0].Rows[i]["OrderDate"] = orderDate;
                    }

                    DS.Tables[0].Columns.Add("CreatedDate", typeof(string));
                    string createdDate = DateTime.Now.ToString("MM-dd-yyyy");
                    for (int i = 0; i <= DS.Tables[0].Rows.Count - 1; i++)
                    {
                        DS.Tables[0].Rows[i]["CreatedDate"] = createdDate;
                    }

                    DS.Tables[0].Columns.Add("CreatedBy", typeof(int));
                    int createdby = GlobalInfo.Userid;
                    for (int i = 0; i <= DS.Tables[0].Rows.Count - 1; i++)
                    {
                        DS.Tables[0].Rows[i]["CreatedBy"] = createdby;
                    }
                    DS.Tables[0].Columns.Add("OrderType", typeof(int));
                    int OrderType = 1;
                    for (int i = 0; i <= DS.Tables[0].Rows.Count - 1; i++)
                    {
                        DS.Tables[0].Rows[i]["OrderType"] = OrderType;
                    }
                    string consString = ConfigurationManager.ConnectionStrings["projectConnection"].ConnectionString;
                    using (SqlConnection con = new SqlConnection(consString))
                    {
                        using (SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(con))
                        {
                            //Set the database table name
                            sqlBulkCopy.DestinationTableName = "OrderMaster";

                            //[OPTIONAL]: Map the DataTable columns with that of the database table
                            sqlBulkCopy.ColumnMappings.Add("AgentID", "AgentID");
                            sqlBulkCopy.ColumnMappings.Add("OrderDate", "OrderDate");
                            sqlBulkCopy.ColumnMappings.Add("RouteID", "RouteID");
                            sqlBulkCopy.ColumnMappings.Add("TotalBill", "TotalBill");
                            sqlBulkCopy.ColumnMappings.Add("CreatedBy", "CreatedBy");
                            sqlBulkCopy.ColumnMappings.Add("CreatedDate", "CreatedDate");
                            sqlBulkCopy.ColumnMappings.Add("OrderType", "OrderType");
                            sqlBulkCopy.ColumnMappings.Add("ShcemheApplied", "ShcemheApplied");
                            sqlBulkCopy.ColumnMappings.Add("BillSeq", "BillSeq");
                            con.Open();
                            sqlBulkCopy.WriteToServer(DS.Tables[0]);
                            con.Close();
                        }
                        using (SqlBulkCopy sqlBulkCopy1 = new SqlBulkCopy(con))
                        {
                            //Set the database table name
                            sqlBulkCopy1.DestinationTableName = "OrderDetails";

                            //[OPTIONAL]: Map the DataTable columns with that of the database table
                            sqlBulkCopy1.ColumnMappings.Add("NewOrderID", "OrderId");
                            sqlBulkCopy1.ColumnMappings.Add("TypeId", "TypeID");
                            sqlBulkCopy1.ColumnMappings.Add("ProductID", "ProductID");
                            sqlBulkCopy1.ColumnMappings.Add("Qty", "Qty");
                            sqlBulkCopy1.ColumnMappings.Add("UnitCost", "UnitCost");
                            sqlBulkCopy1.ColumnMappings.Add("Total", "Total");
                            con.Open();
                            sqlBulkCopy1.WriteToServer(DS.Tables[1]);
                            con.Close();
                        }
                    }

                    int routeids  = Convert.ToInt32(DS.Tables[0].Rows[0]["RouteID"]);
                    int ordertype = 1;

                    invoiceData.updateBulkFlag(routeids, ordertype);
                }
                catch (Exception ex)
                {
                    string e = ex.ToString();
                }

                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Order Placed  Successfully";
                DataTable dt = new DataTable();
                rpAgentOrderdetails.DataSource = dt;
                rpAgentOrderdetails.DataBind();

                pnlError.Update();

                upMain.Update();
                //uprouteList.Update();
            }
        }
示例#4
0
        protected void RemoveTempID(int tempID)
        {
            InvoiceData invicedata = new InvoiceData();

            invicedata.BoothTempDelete(tempID);
        }
示例#5
0
 public UcGoodReturnSelect(InvoiceData invoiceData)
 {
     InitializeComponent();
     cbGoods.Properties.DataSource = invoiceData;
 }
        protected void btnGetPreviousOrder_Click(object sender, EventArgs e)
        {
            double      consume     = 0;
            DataSet     DS          = new DataSet();
            Invoice     invoice     = new Invoice();
            Invoice     invocie     = new Invoice();
            InvoiceData invoiceData = new InvoiceData();

            invoice.ROuteID   = Convert.ToInt32(dpagentRoute.SelectedItem.Value);
            invoice.orderDate = (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy");
            DS = invoiceData.GetPreviousDayOrderRouteWiseEmp(invoice);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpAgentOrderdetails.Visible = true;
                foreach (DataRow row in DS.Tables[0].Rows)
                {
                    DataSet     DS2         = new DataSet();
                    Product     product     = new Product();
                    ProductData productData = new ProductData();
                    product.AgencyID   = 1;
                    product.EmployeeId = string.IsNullOrEmpty(row["EmployeeID"].ToString()) ? 0 : Convert.ToInt32(row["EmployeeID"]);
                    product.orderDate  = DateTime.Now.ToString("dd-MM-yyyy").ToString();
                    DS2 = productData.GetTotalCount(product);
                    if (!Comman.Comman.IsDataSetEmpty(DS2))
                    {
                        consume = string.IsNullOrEmpty(DS2.Tables[0].Rows[0]["count"].ToString()) ? 0 : Convert.ToDouble(DS2.Tables[0].Rows[0]["count"]);
                    }
                    else
                    {
                        consume = 0;
                    }
                    invocie.TokanId   = hftokanno.Value;
                    invocie.UserID    = GlobalInfo.Userid;
                    invocie.AgentName = Convert.ToString(row["EmployeeName"]);
                    invocie.ProductID = string.IsNullOrEmpty(row["ProductID"].ToString()) ? 0 : Convert.ToInt32(row["ProductID"]);
                    invocie.qty       = string.IsNullOrEmpty(row["Qty"].ToString()) ? 0 : Convert.ToDouble(row["Qty"]);

                    invocie.TypeID         = string.IsNullOrEmpty(row["TypeID"].ToString()) ? 0 : Convert.ToInt32(row["TypeID"]);
                    invocie.AgencyID       = string.IsNullOrEmpty(row["EmployeeID"].ToString()) ? 0 : string.IsNullOrEmpty(row["EmployeeID"].ToString()) ? 0 : Convert.ToInt32(row["EmployeeID"]);
                    invocie.orderid        = string.IsNullOrEmpty(row["OrderID"].ToString()) ? 0 : Convert.ToInt32(row["OrderID"]);
                    invocie.ROuteID        = string.IsNullOrEmpty(row["RouteID"].ToString()) ? 0 : Convert.ToInt32(row["RouteID"]);
                    invocie.ShecemeApplied = Convert.ToBoolean(row["ShcemheApplied"]);
                    invocie.AgentCode      = string.IsNullOrEmpty(row["EmployeeCode"].ToString()) ? string.Empty : Convert.ToString(row["EmployeeCode"]);
                    invocie.BillSeq        = string.IsNullOrEmpty(row["BillSeq"].ToString()) ? 0 : Convert.ToInt32(row["BillSeq"]);
                    if (consume > 30)
                    {
                        double  price = 0;
                        double  qty   = 0;
                        Invoice inv   = new Invoice();
                        DataSet ds4   = new DataSet();
                        inv.ProductID = string.IsNullOrEmpty(row["ProductID"].ToString()) ? 0 : Convert.ToInt32(row["ProductID"]);
                        ds4           = invoiceData.getBulkEmpSlabPrice(inv);
                        if (!Comman.Comman.IsDataSetEmpty(ds4))
                        {
                            price = string.IsNullOrEmpty(ds4.Tables[0].Rows[0]["price"].ToString()) ? 0 : Convert.ToDouble(ds4.Tables[0].Rows[0]["price"]);
                        }
                        qty = string.IsNullOrEmpty(row["Qty"].ToString()) ? 0 : Convert.ToDouble(row["Qty"]);


                        invocie.UnitCost   = price;
                        invocie.totalCoast = price * qty;
                    }
                    else
                    {
                        invocie.UnitCost   = string.IsNullOrEmpty(row["UnitCost"].ToString()) ? 0 : Convert.ToDouble(row["UnitCost"]);
                        invocie.totalCoast = string.IsNullOrEmpty(row["Total"].ToString()) ? 0 : Convert.ToDouble(row["Total"]);
                    }

                    invoiceData.InsertTempBulkItam(invocie);
                    BindAgntTempItam(invocie);
                }
            }
        }
示例#7
0
        public void btnAgentORderSubmit_click(object sender, EventArgs e)
        {
            totsum = 0;
            int         result      = 0;
            Invoice     inovice     = new Invoice();
            InvoiceData invoiceData = new InvoiceData();

            inovice.orderDate = (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy");
            inovice.AgencyID  = Convert.ToInt32(dpAgent.SelectedItem.Value);

            inovice.ROuteID           = Convert.ToInt32(dpagentRoute.SelectedItem.Value);
            inovice.SaleEmployeeId    = 0;//Convert.ToInt32(dpAgentSelasEMployee.SelectedItem.Value);
            inovice.totalCoast        = string.IsNullOrEmpty(hftotalAmout.Value) ? 0 : Comman.Comman.IsValidInteger(hftotalAmout.Value) ? Convert.ToDouble(hftotalAmout.Value) : 0;
            inovice.CreatedBy         = GlobalInfo.Userid;
            inovice.CreatedDate       = DateTime.Now.ToString("MM-dd-yyyy");
            inovice.TokanId           = hftokanno.Value;
            inovice.TotalSchemeAmount = Convert.ToDouble(Session["schemeTemp"]);
            inovice.ShecemeApplied    = schemeApplied;
            inovice.orderid           = Convert.ToInt32(Session["PrvOrderID"]);
            //inovice.orderid = PrvOrderID; //previous order id
            inovice.orderType = 1;// Agent order

            DataSet chkds  = new DataSet();
            int     chkflg = 2;

            chkds = invoiceData.CheckBoothTemp(inovice, chkflg);
            if (!Comman.Comman.IsDataSetEmpty(chkds))
            {
                result = invoiceData.InsertOrder(inovice);
                if (result > 0)
                {
                    btnAddAgentProductItem.Visible = false;
                    btnagentItamsremove.Visible    = false;
                    btnAgentORderSubmit.Visible    = false;
                    clearAgentValues();
                    //txtagentOrderqty.Text = "0";
                    BindAgntTempItam(inovice);
                    divDanger.Visible   = false;
                    divwarning.Visible  = false;
                    divSusccess.Visible = true;
                    schemeApplied       = false;
                    pnlError.Update();
                    Session["PrvOrderID"] = 0;
                    // PrvOrderID = 0;
                    Session["schemeTemp"] = 0;
                    upMain.Update();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblwarning.Text     = "Please Contact to Site Admin";
                    pnlError.Update();
                }
            }
            else
            {
                divDanger.Visible   = true;
                divwarning.Visible  = false;
                divSusccess.Visible = false;
                lbldanger.Text      = "Blank order cannot be submitted. To Delete Order then Please go to Edit/Cancel Menu";
                pnlError.Update();
            }
        }
        /// <summary>
        /// This operation can be used to list the items of the order indicated by the
        /// given order id (only a single Amazon order id is allowed).
        ///
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebServiceOrders service</param>
        /// <param name="request">ListOrderItemsRequest request</param>
        public static void InvokeListOrderItems(MarketplaceWebServiceOrders service, ListOrderItemsRequest request)
        {
            try
            {
                ListOrderItemsResponse response = service.ListOrderItems(request);


                Console.WriteLine("Service Response");
                Console.WriteLine("=============================================================================");
                Console.WriteLine();

                Console.WriteLine("        ListOrderItemsResponse");
                if (response.IsSetListOrderItemsResult())
                {
                    Console.WriteLine("            ListOrderItemsResult");
                    ListOrderItemsResult listOrderItemsResult = response.ListOrderItemsResult;
                    if (listOrderItemsResult.IsSetNextToken())
                    {
                        Console.WriteLine("                NextToken");
                        Console.WriteLine("                    {0}", listOrderItemsResult.NextToken);
                    }
                    if (listOrderItemsResult.IsSetAmazonOrderId())
                    {
                        Console.WriteLine("                AmazonOrderId");
                        Console.WriteLine("                    {0}", listOrderItemsResult.AmazonOrderId);
                    }
                    if (listOrderItemsResult.IsSetOrderItems())
                    {
                        Console.WriteLine("                OrderItems");
                        OrderItemList    orderItems    = listOrderItemsResult.OrderItems;
                        List <OrderItem> orderItemList = orderItems.OrderItem;
                        foreach (OrderItem orderItem in orderItemList)
                        {
                            Console.WriteLine("                    OrderItem");
                            if (orderItem.IsSetASIN())
                            {
                                Console.WriteLine("                        ASIN");
                                Console.WriteLine("                            {0}", orderItem.ASIN);
                            }
                            if (orderItem.IsSetSellerSKU())
                            {
                                Console.WriteLine("                        SellerSKU");
                                Console.WriteLine("                            {0}", orderItem.SellerSKU);
                            }
                            if (orderItem.IsSetOrderItemId())
                            {
                                Console.WriteLine("                        OrderItemId");
                                Console.WriteLine("                            {0}", orderItem.OrderItemId);
                            }
                            if (orderItem.IsSetTitle())
                            {
                                Console.WriteLine("                        Title");
                                Console.WriteLine("                            {0}", orderItem.Title);
                            }
                            if (orderItem.IsSetQuantityOrdered())
                            {
                                Console.WriteLine("                        QuantityOrdered");
                                Console.WriteLine("                            {0}", orderItem.QuantityOrdered);
                            }
                            if (orderItem.IsSetQuantityShipped())
                            {
                                Console.WriteLine("                        QuantityShipped");
                                Console.WriteLine("                            {0}", orderItem.QuantityShipped);
                            }
                            if (orderItem.IsSetItemPrice())
                            {
                                Console.WriteLine("                        ItemPrice");
                                Money itemPrice = orderItem.ItemPrice;
                                if (itemPrice.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", itemPrice.CurrencyCode);
                                }
                                if (itemPrice.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", itemPrice.Amount);
                                }
                            }
                            if (orderItem.IsSetShippingPrice())
                            {
                                Console.WriteLine("                        ShippingPrice");
                                Money shippingPrice = orderItem.ShippingPrice;
                                if (shippingPrice.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", shippingPrice.CurrencyCode);
                                }
                                if (shippingPrice.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", shippingPrice.Amount);
                                }
                            }
                            if (orderItem.IsSetGiftWrapPrice())
                            {
                                Console.WriteLine("                        GiftWrapPrice");
                                Money giftWrapPrice = orderItem.GiftWrapPrice;
                                if (giftWrapPrice.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", giftWrapPrice.CurrencyCode);
                                }
                                if (giftWrapPrice.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", giftWrapPrice.Amount);
                                }
                            }
                            if (orderItem.IsSetItemTax())
                            {
                                Console.WriteLine("                        ItemTax");
                                Money itemTax = orderItem.ItemTax;
                                if (itemTax.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", itemTax.CurrencyCode);
                                }
                                if (itemTax.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", itemTax.Amount);
                                }
                            }
                            if (orderItem.IsSetShippingTax())
                            {
                                Console.WriteLine("                        ShippingTax");
                                Money shippingTax = orderItem.ShippingTax;
                                if (shippingTax.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", shippingTax.CurrencyCode);
                                }
                                if (shippingTax.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", shippingTax.Amount);
                                }
                            }
                            if (orderItem.IsSetGiftWrapTax())
                            {
                                Console.WriteLine("                        GiftWrapTax");
                                Money giftWrapTax = orderItem.GiftWrapTax;
                                if (giftWrapTax.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", giftWrapTax.CurrencyCode);
                                }
                                if (giftWrapTax.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", giftWrapTax.Amount);
                                }
                            }
                            if (orderItem.IsSetShippingDiscount())
                            {
                                Console.WriteLine("                        ShippingDiscount");
                                Money shippingDiscount = orderItem.ShippingDiscount;
                                if (shippingDiscount.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", shippingDiscount.CurrencyCode);
                                }
                                if (shippingDiscount.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", shippingDiscount.Amount);
                                }
                            }
                            if (orderItem.IsSetPromotionDiscount())
                            {
                                Console.WriteLine("                        PromotionDiscount");
                                Money promotionDiscount = orderItem.PromotionDiscount;
                                if (promotionDiscount.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", promotionDiscount.CurrencyCode);
                                }
                                if (promotionDiscount.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", promotionDiscount.Amount);
                                }
                            }
                            if (orderItem.IsSetPromotionIds())
                            {
                                Console.WriteLine("                        PromotionIds");
                                PromotionIdList promotionIds    = orderItem.PromotionIds;
                                List <String>   promotionIdList = promotionIds.PromotionId;
                                foreach (String promotionId in promotionIdList)
                                {
                                    Console.WriteLine("                            PromotionId");
                                    Console.WriteLine("                                {0}", promotionId);
                                }
                            }
                            if (orderItem.IsSetCODFee())
                            {
                                Console.WriteLine("                        CODFee");
                                Money CODFee = orderItem.CODFee;
                                if (CODFee.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", CODFee.CurrencyCode);
                                }
                                if (CODFee.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", CODFee.Amount);
                                }
                            }
                            if (orderItem.IsSetCODFeeDiscount())
                            {
                                Console.WriteLine("                        CODFeeDiscount");
                                Money CODFeeDiscount = orderItem.CODFeeDiscount;
                                if (CODFeeDiscount.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", CODFeeDiscount.CurrencyCode);
                                }
                                if (CODFeeDiscount.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", CODFeeDiscount.Amount);
                                }
                            }
                            if (orderItem.IsSetGiftMessageText())
                            {
                                Console.WriteLine("                        GiftMessageText");
                                Console.WriteLine("                            {0}", orderItem.GiftMessageText);
                            }
                            if (orderItem.IsSetGiftWrapLevel())
                            {
                                Console.WriteLine("                        GiftWrapLevel");
                                Console.WriteLine("                            {0}", orderItem.GiftWrapLevel);
                            }
                            if (orderItem.IsSetInvoiceData())
                            {
                                Console.WriteLine("                        InvoiceData");
                                InvoiceData invoiceData = orderItem.InvoiceData;
                                if (invoiceData.IsSetInvoiceRequirement())
                                {
                                    Console.WriteLine("                            InvoiceRequirement");
                                    Console.WriteLine("                                {0}", invoiceData.InvoiceRequirement);
                                }
                                if (invoiceData.IsSetBuyerSelectedInvoiceCategory())
                                {
                                    Console.WriteLine("                            BuyerSelectedInvoiceCategory");
                                    Console.WriteLine("                                {0}", invoiceData.BuyerSelectedInvoiceCategory);
                                }
                                if (invoiceData.IsSetInvoiceTitle())
                                {
                                    Console.WriteLine("                            InvoiceTitle");
                                    Console.WriteLine("                                {0}", invoiceData.InvoiceTitle);
                                }
                                if (invoiceData.IsSetInvoiceInformation())
                                {
                                    Console.WriteLine("                            InvoiceInformation");
                                    Console.WriteLine("                                {0}", invoiceData.InvoiceInformation);
                                }
                            }
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    Console.WriteLine("            ResponseMetadata");
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                        Console.WriteLine("                RequestId");
                        Console.WriteLine("                    {0}", responseMetadata.RequestId);
                    }
                }
                Console.WriteLine("            ResponseHeaderMetadata");
                Console.WriteLine("                RequestId");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.RequestId);
                Console.WriteLine("                ResponseContext");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.ResponseContext);
                Console.WriteLine("                Timestamp");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.Timestamp);
                Console.WriteLine();
            }
            catch (MarketplaceWebServiceOrdersException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
                Console.WriteLine("ResponseHeaderMetadata: " + ex.ResponseHeaderMetadata);
            }
        }
 public List <SqlParameter> MapParamsForDelete(InvoiceData entity)
 {
     return(MapParamsForDelete(entity.InvoiceKey));
 }
示例#10
0
        public int ExportInvoiceToTxt(List <InvoiceData> InvoiceDataList, bool ExportAll)
        {
            int count = 0;

            try
            {
                int          num3;
                XXFPPaper    paper;
                StreamWriter writer;
                MessageHelper.MsgWait("正在导出发票,请稍候...");
                string invExportTxtPath = PropValue.InvExportTxtPath;
                if (invExportTxtPath.Length <= 0)
                {
                    throw new FileNotFoundException("没有设置传出文件路径");
                }
                int startIndex = invExportTxtPath.LastIndexOf(@"\");
                if (startIndex == -1)
                {
                    throw new FileNotFoundException("路径格式错误");
                }
                string path = invExportTxtPath.Remove(startIndex);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                bool             checkBoxKqd = PropValue.CheckBoxKqd;
                List <XXFPPaper> list        = new List <XXFPPaper>();
                if (ExportAll)
                {
                    InvoiceDataList.Clear();
                    DataTable faPiao = this.GetFaPiao();
                    for (num3 = 0; num3 < faPiao.Rows.Count; num3++)
                    {
                        InvoiceData item = new InvoiceData {
                            m_strInvType = faPiao.Rows[num3]["FPZL"].ToString(),
                            m_strInvCode = faPiao.Rows[num3]["FPDM"].ToString(),
                            m_strInvNum  = faPiao.Rows[num3]["FPHM"].ToString()
                        };
                        InvoiceDataList.Add(item);
                    }
                }
                if (InvoiceDataList.Count > 0)
                {
                    FPCXbll xbll = new FPCXbll();
                    for (num3 = 0; num3 < InvoiceDataList.Count; num3++)
                    {
                        paper = xbll.GetInvPaper(InvoiceDataList[num3].m_strInvType, InvoiceDataList[num3].m_strInvCode, InvoiceDataList[num3].m_strInvNum, checkBoxKqd);
                        list.Add(paper);
                    }
                }
                else
                {
                    return(0);
                }
                string        str3    = "~~";
                StringBuilder builder = new StringBuilder();
                builder.Append(list.Count.ToString());
                builder.Append(str3);
                builder.Append(this._StartDate.ToString("yyyyMMdd"));
                builder.Append(str3);
                builder.Append(this._EndDate.ToString("yyyyMMdd"));
                using (writer = new StreamWriter(invExportTxtPath, false, ToolUtil.GetEncoding()))
                {
                    writer.WriteLine("SJJK0201" + str3 + "已开发票传出");
                    writer.WriteLine(builder.ToString());
                }
                count = list.Count;
                for (num3 = 0; num3 < list.Count; num3++)
                {
                    int          num5;
                    int          invType;
                    string       str6;
                    XXFP_MXModel model;
                    int          num10;
                    StreamWriter writer2;
                    paper = list[num3];
                    string str4 = paper.FPHM.ToString();
                    string str5 = string.Format("发票号码: {0} ", str4);
                    if ((paper.FPZL == "c") || (paper.FPZL == "s"))
                    {
                        int num4 = 0;
                        if (paper.ListInvWare.Count > 0)
                        {
                            num5 = 0;
                            while (num5 < paper.ListInvWare.Count)
                            {
                                if (!checkBoxKqd || ((paper.ListInvWare[num5].FPHXZ != 1) && (paper.ListInvWare[num5].FPHXZ != 5)))
                                {
                                    num4++;
                                }
                                num5++;
                            }
                        }
                        builder.Remove(0, builder.Length);
                        builder.Append(Convert.ToInt32(paper.ZFBZ));
                        builder.Append(str3);
                        builder.Append(Convert.ToInt32(paper.QDBZ));
                        builder.Append(str3);
                        invType = (int)CommonTool.GetInvType(paper.FPZL);
                        builder.Append(invType);
                        builder.Append(str3);
                        builder.Append(paper.FPDM);
                        builder.Append(str3);
                        builder.Append(paper.FPHM.ToString().PadLeft(8, '0'));
                        builder.Append(str3);
                        builder.Append(num4);
                        builder.Append(str3);
                        builder.Append(paper.KPRQ.ToString("yyyyMMdd"));
                        builder.Append(str3);
                        builder.Append(Convert.ToDateTime(paper.KPRQ).Month.ToString().PadLeft(2, '0'));
                        builder.Append(str3);
                        builder.Append(paper.XSDJBH);
                        builder.Append(str3);
                        str6 = paper.HJJE.ToString("0.00");
                        builder.Append(str6);
                        builder.Append(str3);
                        if (paper.MULSLV)
                        {
                            builder.Append("");
                        }
                        else if (paper.SLV == 0.0)
                        {
                            builder.Append(paper.SLV);
                        }
                        else
                        {
                            builder.Append(paper.SLV);
                        }
                        builder.Append(str3);
                        str6 = paper.HJSE.ToString("0.00");
                        builder.Append(str6);
                        builder.Append(str3);
                        builder.Append(paper.GFMC);
                        builder.Append(str3);
                        if (paper.FPZL == "c")
                        {
                            if (((paper.GFSH.Equals("000000000000000") || paper.GFSH.Equals("00000000000000000")) || paper.GFSH.Equals("000000000000000000")) || paper.GFSH.Equals("00000000000000000000"))
                            {
                                if ((paper.ZFBZ && (paper.HJJE == 0.0)) && (paper.HJSE == 0.0))
                                {
                                    builder.Append(paper.GFSH);
                                }
                                else
                                {
                                    builder.Append("");
                                }
                            }
                            else
                            {
                                builder.Append(paper.GFSH);
                            }
                        }
                        else
                        {
                            builder.Append(paper.GFSH);
                        }
                        builder.Append(str3);
                        builder.Append(paper.GFDZDH);
                        builder.Append(str3);
                        builder.Append(paper.GFYHZH);
                        builder.Append(str3);
                        builder.Append(paper.XFMC);
                        builder.Append(str3);
                        builder.Append(paper.XFSH);
                        builder.Append(str3);
                        builder.Append(paper.XFDZDH);
                        builder.Append(str3);
                        builder.Append(paper.XFYHZH);
                        builder.Append(str3);
                        if (paper.BZ.IndexOf("\r\n") == -1)
                        {
                            builder.Append(paper.BZ);
                        }
                        else
                        {
                            str6 = paper.BZ.Replace("\r\n", @"\n");
                            builder.Append(str6);
                        }
                        builder.Append(str3);
                        builder.Append(paper.KPR);
                        builder.Append(str3);
                        builder.Append(paper.FHR);
                        builder.Append(str3);
                        builder.Append(paper.SKR);
                        writer = new StreamWriter(invExportTxtPath, true, ToolUtil.GetEncoding());
                        using (writer2 = writer)
                        {
                            num10 = num3 + 1;
                            writer.WriteLine("//发票" + num10.ToString());
                            writer.WriteLine(builder.ToString());
                            if (paper.ListInvWare.Count > 0)
                            {
                                num5 = 0;
                                while (num5 < paper.ListInvWare.Count)
                                {
                                    model = paper.ListInvWare[num5];
                                    if (!checkBoxKqd || ((model.FPHXZ != 1) && (model.FPHXZ != 5)))
                                    {
                                        builder.Remove(0, builder.Length);
                                        if (model.FPHXZ == 4)
                                        {
                                            builder.Append("1");
                                        }
                                        else
                                        {
                                            builder.Append("0");
                                        }
                                        builder.Append(str3);
                                        builder.Append(model.SPMC);
                                        builder.Append(str3);
                                        builder.Append(model.GGXH);
                                        builder.Append(str3);
                                        builder.Append(model.JLDW);
                                        builder.Append(str3);
                                        if (Convert.ToDouble(model.SL) == 0.0)
                                        {
                                            builder.Append("");
                                        }
                                        else
                                        {
                                            builder.Append(Convert.ToDouble(model.SL));
                                        }
                                        builder.Append(str3);
                                        str6 = model.JE.ToString("0.00");
                                        builder.Append(str6);
                                        builder.Append(str3);
                                        if (((model.FPHXZ == 1) || (model.FPHXZ == 5)) && paper.MULSLV)
                                        {
                                            builder.Append("");
                                        }
                                        else
                                        {
                                            double sLV = model.SLV;
                                            builder.Append(model.SLV);
                                        }
                                        builder.Append(str3);
                                        str6 = model.SE.ToString("0.00");
                                        builder.Append(str6);
                                        builder.Append(str3);
                                        if (Convert.ToDouble(model.DJ) == 0.0)
                                        {
                                            builder.Append("");
                                        }
                                        else
                                        {
                                            builder.Append(Convert.ToDouble(model.DJ));
                                        }
                                        builder.Append(str3);
                                        builder.Append(Convert.ToInt32(model.HSJBZ));
                                        builder.Append(str3);
                                        builder.Append(model.SPSM);
                                        writer.WriteLine(builder.ToString());
                                    }
                                    num5++;
                                }
                            }
                        }
                    }
                    else if (paper.FPZL == "f")
                    {
                        builder.Remove(0, builder.Length);
                        builder.Append(Convert.ToInt32(paper.ZFBZ));
                        builder.Append(str3);
                        invType = (int)CommonTool.GetInvType(paper.FPZL);
                        builder.Append(invType);
                        builder.Append(str3);
                        builder.Append(paper.FPDM);
                        builder.Append(str3);
                        builder.Append(paper.FPHM.ToString().PadLeft(8, '0'));
                        builder.Append(str3);
                        builder.Append(paper.ListInvWare.Count);
                        builder.Append(str3);
                        builder.Append(paper.KPRQ.ToString("yyyyMMdd"));
                        builder.Append(str3);
                        builder.Append(Convert.ToDateTime(paper.KPRQ).Month);
                        builder.Append(str3);
                        builder.Append(paper.XSDJBH);
                        builder.Append(str3);
                        str6 = paper.HJJE.ToString("0.00");
                        builder.Append(str6);
                        builder.Append(str3);
                        if (paper.SLV == 0.0)
                        {
                            builder.Append(paper.SLV);
                        }
                        else
                        {
                            builder.Append(paper.SLV);
                        }
                        builder.Append(str3);
                        str6 = paper.HJSE.ToString("0.00");
                        builder.Append(str6);
                        builder.Append(str3);
                        builder.Append(paper.GFMC);
                        builder.Append(str3);
                        builder.Append(paper.GFSH);
                        builder.Append(str3);
                        builder.Append(paper.SHRMC);
                        builder.Append(str3);
                        builder.Append(paper.SHRSH);
                        builder.Append(str3);
                        builder.Append(paper.FHRMC);
                        builder.Append(str3);
                        builder.Append(paper.FHRSH);
                        builder.Append(str3);
                        builder.Append(paper.XFMC);
                        builder.Append(str3);
                        builder.Append(paper.XFSH);
                        builder.Append(str3);
                        builder.Append(paper.QYJYMD);
                        builder.Append(str3);
                        builder.Append(paper.CZCH);
                        builder.Append(str3);
                        builder.Append(paper.CCDW);
                        builder.Append(str3);
                        builder.Append(paper.YSHWXX);
                        builder.Append(str3);
                        if (paper.BZ.IndexOf("\r\n") == -1)
                        {
                            builder.Append(paper.BZ);
                        }
                        else
                        {
                            str6 = paper.BZ.Replace("\r\n", @"\n");
                            builder.Append(str6);
                        }
                        builder.Append(str3);
                        builder.Append(paper.KPR);
                        builder.Append(str3);
                        builder.Append(paper.FHR);
                        builder.Append(str3);
                        builder.Append(paper.SKR);
                        builder.Append(str3);
                        builder.Append(paper.ZGSWMC);
                        builder.Append(str3);
                        builder.Append(paper.ZGSWDM);
                        builder.Append(str3);
                        builder.Append(paper.JQBH);
                        writer = new StreamWriter(invExportTxtPath, true, ToolUtil.GetEncoding());
                        using (writer2 = writer)
                        {
                            num10 = num3 + 1;
                            writer.WriteLine("//发票" + num10.ToString());
                            writer.WriteLine(builder.ToString());
                            if (paper.ListInvWare.Count > 0)
                            {
                                for (num5 = 0; num5 < paper.ListInvWare.Count; num5++)
                                {
                                    model = paper.ListInvWare[num5];
                                    builder.Remove(0, builder.Length);
                                    builder.Append(model.SPMC);
                                    builder.Append(str3);
                                    str6 = model.JE.ToString("0.00");
                                    builder.Append(str6);
                                    writer.WriteLine(builder.ToString());
                                }
                            }
                        }
                    }
                    else if (paper.FPZL == "j")
                    {
                        builder.Remove(0, builder.Length);
                        builder.Append(Convert.ToInt32(paper.ZFBZ));
                        builder.Append(str3);
                        invType = (int)CommonTool.GetInvType(paper.FPZL);
                        builder.Append(invType);
                        builder.Append(str3);
                        builder.Append(paper.FPDM);
                        builder.Append(str3);
                        builder.Append(paper.FPHM.ToString().PadLeft(8, '0'));
                        builder.Append(str3);
                        builder.Append(paper.KPRQ.ToString("yyyyMMdd"));
                        builder.Append(str3);
                        builder.Append(Convert.ToDateTime(paper.KPRQ).Month);
                        builder.Append(str3);
                        builder.Append(paper.XSDJBH);
                        builder.Append(str3);
                        str6 = SaleBillCtrl.GetRound((double)(paper.HJJE + paper.HJSE), 2).ToString("0.00");
                        builder.Append(str6);
                        builder.Append(str3);
                        str6 = paper.HJJE.ToString("0.00");
                        builder.Append(str6);
                        builder.Append(str3);
                        if (paper.SLV == 0.0)
                        {
                            builder.Append(paper.SLV);
                        }
                        else
                        {
                            builder.Append(paper.SLV);
                        }
                        builder.Append(str3);
                        str6 = paper.HJSE.ToString("0.00");
                        builder.Append(str6);
                        builder.Append(str3);
                        builder.Append(paper.GFMC);
                        builder.Append(str3);
                        builder.Append(paper.GFSH);
                        builder.Append(str3);
                        builder.Append(paper.SFZHM);
                        builder.Append(str3);
                        builder.Append(paper.CLLX);
                        builder.Append(str3);
                        builder.Append(paper.CPXH);
                        builder.Append(str3);
                        builder.Append(paper.CD);
                        builder.Append(str3);
                        builder.Append(paper.SCCJMC);
                        builder.Append(str3);
                        builder.Append(paper.HGZH);
                        builder.Append(str3);
                        builder.Append(paper.JKZMSH);
                        builder.Append(str3);
                        builder.Append(paper.SJDH);
                        builder.Append(str3);
                        builder.Append(paper.FDJH);
                        builder.Append(str3);
                        builder.Append(paper.CLSBDH);
                        builder.Append(str3);
                        builder.Append(paper.XFMC);
                        builder.Append(str3);
                        builder.Append(paper.XFSH);
                        builder.Append(str3);
                        builder.Append(paper.DH);
                        builder.Append(str3);
                        builder.Append(paper.ZH);
                        builder.Append(str3);
                        builder.Append(paper.DZ);
                        builder.Append(str3);
                        builder.Append(paper.KHYH);
                        builder.Append(str3);
                        builder.Append(paper.DW);
                        builder.Append(str3);
                        builder.Append(paper.XCRS);
                        builder.Append(str3);
                        builder.Append(paper.KPR);
                        builder.Append(str3);
                        builder.Append(paper.ZGSWMC);
                        builder.Append(str3);
                        builder.Append(paper.ZGSWDM);
                        builder.Append(str3);
                        builder.Append(paper.JQBH);
                        builder.Append(str3);
                        string   zYSPMC   = paper.ZYSPMC;
                        string   str8     = "";
                        string   str9     = "";
                        string[] strArray = paper.SPSM.Split(new char[] { '#', '%' });
                        if (strArray.Length == 3)
                        {
                            str8 = strArray[0].Trim();
                            str9 = strArray[2].Trim();
                        }
                        string   str11     = "0";
                        string   str12     = "";
                        string[] strArray2 = paper.SKR.Split(new char[] { '#', '%' });
                        if (strArray2.Length == 3)
                        {
                            str11 = strArray2[0].Trim();
                            str12 = strArray2[3].Trim();
                        }
                        if (paper.BZ.IndexOf("\r\n") == -1)
                        {
                            builder.Append(paper.BZ);
                        }
                        else
                        {
                            str6 = paper.BZ.Replace("\r\n", @"\n");
                            builder.Append(str6);
                        }
                        writer = new StreamWriter(invExportTxtPath, true, ToolUtil.GetEncoding());
                        using (writer2 = writer)
                        {
                            writer.WriteLine("//发票" + ((num3 + 1)).ToString());
                            writer.WriteLine(builder.ToString());
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Thread.Sleep(100);
                MessageHelper.MsgWait();
            }
            return(count);
        }
示例#11
0
 public GoodsReturnAddModel(IUnityContainer unityContainer)
 {
     _unityContainer = unityContainer;
     invoiceData = _unityContainer.Resolve<InvoiceData>();
     invoiceData.Load(Guid.Parse(_unityContainer.Resolve<IOrderUserInfo>().Property["USER_SHOP"]));
 }
示例#12
0
        public async Task <HttpResponseMessage> loadInvoiceData([FromBody] int id)
        {
            try
            {
            }
            catch (Exception ex)
            {
                throw;
            }
            var organId = Convert.ToInt32(SecurityManager.CurrentUserContext.OrganizationId);

            var resualt = new InvoiceData();

            List <ContactVM> contacts    = new List <ContactVM>();
            ContactRule      contactRule = new ContactRule();

            var contactsSource = await contactRule.GetAllByOrganIdAsync(Convert.ToInt32(organId));

            contactsSource = contactsSource.ToList();

            contacts = TranslateHelper.TranslateEntityToEntityVMListContact(contactsSource);

            foreach (var contact in contacts)
            {
                contact.DetailAccount = new DetailAccount()
                {
                    Code = contact.Code,
                    Id   = (int)contact.ID,
                    Node = new Node()
                    {
                        FamilyTree = "اشخاص",
                        Id         = (int)contact.ID,
                        Name       = "اشخاص"
                    }
                };

                //var account1104 = await CalcAccountByCodeTafziliAsync(organId, "1104" + contact.Code);
                //var account1105 = await CalcAccountByCodeTafziliAsync(organId, "1105" + contact.Code);
                //var account2101 = await CalcAccountByCodeTafziliAsync(organId, "2101" + contact.Code);

                //contact.Balance = account1104.sumTotal + account1105.sumTotal + account2101.sumTotal;
                //contact.Credits = account1104.sumCredit + account1105.sumCredit + account2101.sumCredit;
                //contact.Liability = account1104.sumDebit + account1105.sumDebit + account2101.sumDebit;
            }



            resualt.contacts        = contacts;
            resualt.invoiceSettings = new InvoiceSettings()
            {
                allowApproveWithoutStock = false,
                autoAddTax            = true,
                bottomMargin          = "20",
                businessLogo          = "",
                font                  = "Iransans",
                fontSize              = "Medium",
                footerNote            = "",
                footerNoteDraft       = "",
                hideZeroItems         = false,
                onlineInvoiceEnabled  = false,
                pageSize              = "A4portrait",
                payReceiptTitle       = "رسید پرداخت وجه / چک",
                purchaseInvoiceTitle  = "فاکتور خرید",
                receiveReceiptTitle   = "رسید دریافت وجه / چک",
                rowPerPage            = "18",
                saleDraftInvoiceTitle = "پیش فاکتور",
                saleInvoiceTitle      = "صورتحساب فروش کالا و خدمات",
                showAmountInWords     = false,
                showCustomerBalance   = false,
                showItemUnit          = false,
                showSignaturePlace    = true,
                showTransactions      = true,
                showVendorInfo        = true,
                topMargin             = "10",
                updateBuyPrice        = false,
                updateSellPrice       = false
            };

            ItemGroupRule itemGroupRule = new ItemGroupRule();
            var           itemGroups    = await itemGroupRule.GetAllByOrganIdAsync(Convert.ToInt32(organId));

            var items = new List <ItemVM>();
            var item  = new ItemVM();

            foreach (var itemGroup in itemGroups)
            {
                foreach (var KalaKhadmat in itemGroup.Items)
                {
                    item = new ItemVM()
                    {
                        Barcode       = "",
                        BuyPrice      = KalaKhadmat.BuyPrice,
                        DetailAccount = new DetailAccount()
                        {
                            Code = KalaKhadmat.Code,
                            Id   = KalaKhadmat.ID,
                            Node = new Node()
                            {
                                FamilyTree = itemGroup.Name,
                                Name       = itemGroup.Name,
                                Id         = itemGroup.ID
                            }
                        },
                        ID             = KalaKhadmat.ID,
                        Name           = KalaKhadmat.Name,
                        UnitID         = KalaKhadmat.UnitID,
                        SalesTitle     = KalaKhadmat.SalesTitle,
                        PurchasesTitle = KalaKhadmat.PurchasesTitle,
                        SellPrice      = KalaKhadmat.SellPrice,
                        ItemType       = KalaKhadmat.ItemType,
                        Stock          = KalaKhadmat.Stock,
                        Code           = KalaKhadmat.Code,
                        IsGoods        = KalaKhadmat.IsGoods,
                        IsService      = KalaKhadmat.IsService,
                        MoneyStock     = KalaKhadmat.MoneyStock,
                        OrganId        = KalaKhadmat.OrganId,
                        ItemGroupId    = KalaKhadmat.ItemGroupId
                    };

                    items.Add(item);
                }
            }

            resualt.items = items;

            var InvoiceItems = new List <InvoiceItemVM>();


            if (id == 0)
            {
                InvoiceItems.Add(new InvoiceItemVM()
                {
                    Description = "",
                    Discount    = 0,
                    ID          = 0,
                    Inv         = null,
                    Item        = null,
                    ItemInput   = "",
                    Quantity    = 0,
                    RowNumber   = 0,
                    Sum         = 0,
                    Tax         = 0,
                    TotalAmount = 0,
                    Unit        = 0,
                    UnitPrice   = 0
                });

                InvoiceItems.Add(new InvoiceItemVM()
                {
                    Description = "",
                    Discount    = 0,
                    ID          = 0,
                    Inv         = null,
                    Item        = null,
                    ItemInput   = "",
                    Quantity    = 0,
                    RowNumber   = 1,
                    Sum         = 0,
                    Tax         = 0,
                    TotalAmount = 0,
                    Unit        = 0,
                    UnitPrice   = 0
                });

                InvoiceItems.Add(new InvoiceItemVM()
                {
                    Description = "",
                    Discount    = 0,
                    ID          = 0,
                    Inv         = null,
                    Item        = null,
                    ItemInput   = "",
                    Quantity    = 0,
                    RowNumber   = 2,
                    Sum         = 0,
                    Tax         = 0,
                    TotalAmount = 0,
                    Unit        = 0,
                    UnitPrice   = 0
                });

                InvoiceItems.Add(new InvoiceItemVM()
                {
                    Description = "",
                    Discount    = 0,
                    ID          = 0,
                    Inv         = null,
                    Item        = null,
                    ItemInput   = "",
                    Quantity    = 0,
                    RowNumber   = 3,
                    Sum         = 0,
                    Tax         = 0,
                    TotalAmount = 0,
                    Unit        = 0,
                    UnitPrice   = 0
                });

                resualt.invoice = new InvoiceVM()
                {
                    Contact        = null,
                    ContactTitle   = "",
                    DateTime       = DateTime.Now,
                    DisplayDate    = PersianDateUtils.ToPersianDate(DateTime.Now),
                    DisplayDueDate = PersianDateUtils.ToPersianDate(DateTime.Now),
                    invoiceDueDate = PersianDateUtils.ToPersianDate(DateTime.Now),

                    DueDate             = DateTime.Now,
                    ID                  = 0,
                    InvoiceItems        = InvoiceItems,
                    InvoiceStatusString = "موقت",
                    InvoiceType         = 0,
                    InvoiceTypeString   = "فروش",
                    IsDraft             = true,
                    IsPurchase          = false,
                    IsPurchaseReturn    = false,
                    IsSale              = true,
                    IsSaleReturn        = false,
                    IsWaste             = false,
                    Note                = "",
                    Number              = await createNumberInvoice(organId),
                    Paid                = 0,
                    Payable             = 0,
                    Profit              = 0,
                    Reference           = "",
                    Rest                = 0,
                    Returned            = false,
                    Sent                = false,
                    Status              = 0,
                    Sum                 = 0,
                    Tag                 = ""
                };
            }
            else
            {
                var invoice = await Rule.FindAsync(id);

                foreach (var invoiceItem in invoice.InvoiceItems ?? new List <InvoiceItem>())
                {
                    InvoiceItems.Add(new InvoiceItemVM()
                    {
                        Description = invoiceItem.Description,
                        Discount    = invoiceItem.Discount,
                        ID          = invoiceItem.ID,
                        Inv         = invoiceItem.Inv,
                        Item        = Mapper.Map <Item, ItemVM>(this.BusinessRule.UnitOfWork.Repository <Item>().Find(invoiceItem.ItemId)),
                        ItemId      = invoiceItem.ItemId,
                        ItemInput   = invoiceItem.ItemInput,
                        Quantity    = invoiceItem.Quantity,
                        RowNumber   = invoiceItem.RowNumber,
                        Sum         = invoiceItem.SumInvoiceItem,
                        Tax         = invoiceItem.Tax,
                        TotalAmount = invoiceItem.TotalAmount,
                        Unit        = invoiceItem.UnitInvoiceItem,
                        UnitPrice   = invoiceItem.UnitPrice
                    });
                }



                resualt.invoice = new InvoiceVM()
                {
                    Contact        = Mapper.Map <Contact, ContactVM>(this.BusinessRule.UnitOfWork.Repository <Contact>().Find(invoice.ContactId)),
                    ContactTitle   = invoice.ContactTitle,
                    DateTime       = invoice.DateTime,
                    DisplayDate    = invoice.DisplayDate,
                    DisplayDueDate = invoice.DisplayDueDate,
                    invoiceDueDate = invoice.DisplayDueDate,

                    DueDate             = invoice.DueDate,
                    ID                  = invoice.ID,
                    InvoiceItems        = InvoiceItems,
                    InvoiceStatusString = invoice.InvoiceStatusString,
                    InvoiceType         = invoice.InvoiceType,
                    InvoiceTypeString   = invoice.InvoiceTypeString,
                    IsDraft             = invoice.IsDraft,
                    IsPurchase          = invoice.IsPurchase,
                    IsPurchaseReturn    = invoice.IsPurchaseReturn,
                    IsSale              = invoice.IsSale,
                    IsSaleReturn        = invoice.IsSaleReturn,
                    IsWaste             = false,
                    Note                = invoice.Note,
                    Number              = invoice.Number,
                    Paid                = invoice.Paid,
                    Payable             = invoice.Payable,
                    Profit              = invoice.Profit,
                    Reference           = invoice.Refrence,
                    Rest                = invoice.Rest,
                    Returned            = invoice.Returned,
                    Sent                = invoice.Sent,
                    Status              = invoice.Status,
                    Sum                 = invoice.Sum,
                    Tag                 = invoice.Tag
                };

                return(Request.CreateResponse(HttpStatusCode.OK, new { resualtCode = (int)ZhivarEnums.ResultCode.Successful, data = resualt }));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, new { resualtCode = (int)ZhivarEnums.ResultCode.Successful, data = resualt }));
        }
示例#13
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         if ((this.dataSet == null) || (this.m_nTotalCount <= 0))
         {
             MessageManager.ShowMsgBox("INP-275101");
         }
         else
         {
             int count       = this.aisinoDataGrid1.get_SelectedRows().Count;
             int nTotalCount = this.m_nTotalCount;
             List <InvoiceData> invoiceDataList = new List <InvoiceData>();
             List <InvoiceData> list2           = new List <InvoiceData>();
             for (int i = count - 1; i >= 0; i--)
             {
                 InvoiceData item = new InvoiceData {
                     m_strInvType = this.aisinoDataGrid1.get_SelectedRows()[i].Cells["FPZL"].Value.ToString(),
                     m_strInvCode = this.aisinoDataGrid1.get_SelectedRows()[i].Cells["FPDM"].Value.ToString(),
                     m_strInvNum  = this.aisinoDataGrid1.get_SelectedRows()[i].Cells["FPHM"].Value.ToString()
                 };
                 list2.Add(item);
                 invoiceDataList.Add(item);
             }
             for (int j = 0; j < invoiceDataList.Count; j++)
             {
                 int result = 0;
                 int.TryParse(invoiceDataList[j].m_strInvNum, out result);
                 for (int k = j; k < invoiceDataList.Count; k++)
                 {
                     int num7 = 0;
                     int.TryParse(invoiceDataList[k].m_strInvNum, out num7);
                     if (result > num7)
                     {
                         InvoiceData data2 = invoiceDataList[k];
                         invoiceDataList[k] = invoiceDataList[j];
                         invoiceDataList[j] = data2;
                     }
                 }
             }
             bool exportAll = this.checkBox2.Checked;
             if (!(exportAll || (count > 0)))
             {
                 MessageManager.ShowMsgBox("INP-275104", new string[] { "没有选中任何记录" });
             }
             else
             {
                 PropValue.InvExportTxtPath = this.fileControl1.get_TextBoxFile().Text.Trim();
                 PropValue.CheckBoxKqd      = this.checkBox1.Checked;
                 int num8 = this.fpccBLL.ExportInvoiceToTxt(invoiceDataList, exportAll);
                 MessageManager.ShowMsgBox("INP-275102", "", new string[] { num8.ToString() });
             }
         }
     }
     catch (Exception exception)
     {
         if (((((exception.ToString().Contains("路径格式错误") || exception.ToString().Contains("没有设置传出文件路径")) || (exception.ToString().Contains("未能找到路径中的某个部分") || exception.ToString().Contains("未能找到路径"))) || ((exception.ToString().Contains("不支持给定路径") || exception.ToString().Contains("ArgumentNullException")) || (exception.ToString().Contains("SecurityException") || exception.ToString().Contains("ArgumentException")))) || (exception.ToString().Contains("UnauthorizedAccessException") || exception.ToString().Contains("PathTooLongException"))) || exception.ToString().Contains("NotSupportedException"))
         {
             MessageManager.ShowMsgBox("A320");
         }
         else if (exception.ToString().Contains("超时"))
         {
             this.log.Error(exception.ToString());
         }
         else
         {
             HandleException.HandleError(exception);
         }
     }
 }
示例#14
0
        //Aplica as regras de validação dos campos do invoice.data (seguir o exemplo do PDF "Semana 8 - Invoice File)
        public void Validate(InvoiceData recordContent, int line)
        {
            List <RecordError> list  = new List <RecordError>();
            RecordError        model = new RecordError();

            //Cliente
            if (recordContent.Cliente.Trim().Length != 10)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Cliente";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Cliente, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permite tipos não-numéricos";
                model.Line  = line;
                model.Field = "Cliente";
                list.Add(model);
            }
            if (recordContent.Cliente.Contains("#"))
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Cliente";
                list.Add(model);
            }

            //Cep
            if (recordContent.Cep.Trim().Length != 8)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "CEP";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Cep, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "CEP";
                list.Add(model);
            }

            //Número
            if (recordContent.Numero.Trim().Length != 5)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Número";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Numero, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Número";
                list.Add(model);
            }

            //Complemento
            if (recordContent.Complemento.Length != 20)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Complemento";
                list.Add(model);
            }

            //Região
            if (recordContent.Regiao.Trim().Length != 5)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Região";
                list.Add(model);
            }

            //Dia
            if (recordContent.Dia.Trim().Length != 2)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Dia";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Dia, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Dia";
                list.Add(model);
            }

            //Mês
            if (recordContent.Mes.Length != 10)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Mês";
                list.Add(model);
            }

            //Ano
            if (recordContent.Ano.Trim().Length != 4)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Ano";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Ano, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Ano";
                list.Add(model);
            }

            //Hora
            if (recordContent.Hora.Trim().Length != 2)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Hora";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Hora, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Hora";
                list.Add(model);
            }

            //Minuto
            if (recordContent.Minuto.Trim().Length != 2)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Minuto";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Minuto, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Minuto";
                list.Add(model);
            }

            //Segundo
            if (recordContent.Segundo.Trim().Length != 2)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Segundo";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Segundo, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Segundo";
                list.Add(model);
            }

            //Medidor
            if (recordContent.Medidor.Trim().Length != 10)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Medidor";
                list.Add(model);
            }

            //Aparelho
            if (recordContent.Aparelho.Trim().Length != 2)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Aparelho";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Aparelho, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não é permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Aparelho";
                list.Add(model);
            }

            //Kilo Watts
            if (recordContent.KiloWatts.Trim().Length != 6)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "KiloWatts";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.KiloWatts, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "KiloWatts";
                list.Add(model);
            }

            //Custo
            if (recordContent.Custo.Trim().Length != 7)
            {
                model.Error = "Não atingiu os caracteres necessários";
                model.Line  = line;
                model.Field = "Custo";
                list.Add(model);
            }

            if (Regex.Matches(recordContent.Custo, @"[a-zA-Z]").Count > 0)
            {
                model.Error = "Não permitido tipos não-numéricos";
                model.Line  = line;
                model.Field = "Custo";
                list.Add(model);
            }

            //Finalizado as validações

            if (list.Count != 0)
            {
                throw new Exception.RecordValidatorException(list);
            }
        }
示例#15
0
        protected void dpagentRoute_SelectedIndexChanged(object sender, EventArgs e)
        {
            DS = new DataSet();
            DS = BindCommanData.BindCommanDropDwon("OrderID", "OrderID as Name  ", "OrderMaster", "OrderDate = '" + (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy") + "' and RouteID = " + dpagentRoute.SelectedItem.Value + "and IsPrinted = 1");
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                btnAddAgentProductItem.Visible = false;
                btnagentItamsremove.Visible    = false;
                btnAgentORderSubmit.Visible    = false;
                dpagentRoute.ClearSelection();
                upMain.Update();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage1", "alert('On This Route Orders are placed and Printed')", true);
            }
            else
            {
                if (dpAgent.SelectedItem.Value != "0")
                {
                    Invoice     invocie    = new Invoice();
                    InvoiceData invicedata = new InvoiceData();
                    invocie.AgencyID  = Convert.ToInt32(dpAgent.SelectedItem.Value);
                    invocie.ROuteID   = Convert.ToInt32(dpagentRoute.SelectedItem.Value);
                    invocie.orderDate = (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy");
                    DS = invicedata.GetPreviousDayOrder(invocie);
                    if (!Comman.Comman.IsDataSetEmpty(DS))
                    {
                        //RemoveAllItam();
                        deleteAllItem();
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "11", "<script type='text/javascript'> $('#MainContent_dpAgent').attr('disabled', 'disabled'); </script>", false);
                        //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "12", "<script type='text/javascript'> $('#MainContent_txtGentOrderDate').attr('disabled', 'disabled'); </script>", false);
                        //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "13", "<script type='text/javascript'> $('#MainContent_dpagentRoute').attr('disabled', 'disabled'); </script>", false);
                        PrvAgentID            = Convert.ToInt32(DS.Tables[0].Rows[0]["AgentID"]);
                        Session["PrvOrderID"] = Convert.ToInt32(DS.Tables[0].Rows[0]["OrderID"]);
                        // PrvOrderID = Convert.ToInt32(DS.Tables[0].Rows[0]["OrderID"]);
                        //dpAgent.Enabled = false;

                        foreach (DataRow row in DS.Tables[0].Rows)
                        {
                            invocie.TokanId    = hftokanno.Value;
                            invocie.UserID     = GlobalInfo.Userid;
                            invocie.ProductID  = Convert.ToInt32(row["ProductID"]);
                            invocie.qty        = Convert.ToDouble(row["Qty"]);
                            invocie.UnitCost   = Convert.ToDouble(row["UnitCost"]);
                            invocie.totalCoast = Convert.ToDouble(row["Total"]);
                            invocie.TypeID     = Convert.ToInt32(row["TypeID"]);
                            totsum             = totsum + Convert.ToDouble(row["Total"]);
                            invicedata.InsertTempInvoiceItam(invocie);
                            BindAgntTempItam(invocie);


                            //txtagentOrderqty.Text = "0";
                        }
                    }
                    else
                    {
                        Session["PrvOrderID"] = 0;
                        // PrvOrderID = 0;
                        //RemoveAllItam();
                        deleteAllItem();
                    }
                }
            }
            dpagentRoute.Focus();
        }
示例#16
0
        public byte[] GenerateInvoiceUbl(InvoiceData data)
        {
            var invoice = new InvoiceType
            {
                UUID = new UUIDType()
                {
                    Value = Guid.NewGuid().ToString()
                },
                UBLVersionID = new UBLVersionIDType()
                {
                    Value = "2.1"
                },
                CustomizationID = new CustomizationIDType()
                {
                    Value = "TR1.2"
                },
                ProfileID = new ProfileIDType()
                {
                    Value = "TEMELFATURA"
                },
                ID = new IDType()
                {
                    Value = "FAT20200000000001"
                },
                CopyIndicator = new CopyIndicatorType()
                {
                    Value = false
                },
                InvoicePeriod = new PeriodType
                {
                    StartDate = new StartDateType {
                        Value = data.FATURA_BASLANGIC
                    },
                    EndDate = new EndDateType {
                        Value = data.FATURA_BITIS
                    }
                },
                Signature = new SignatureType[]
                {
                    new SignatureType
                    {
                        ID = new IDType {
                            schemeID = "VKN_TCKN", Value = data.SATICI_VKN
                        },
                        SignatoryParty = new PartyType
                        {
                            PartyIdentification = new PartyIdentificationType[]
                            {
                                new PartyIdentificationType {
                                    ID = new IDType {
                                        schemeID = "VKN", Value = data.SATICI_VKN
                                    }
                                }
                            },
                            PostalAddress = new AddressType
                            {
                                CityName = new CityNameType
                                {
                                    Value = data.SATICI_IL
                                },
                                CitySubdivisionName = new CitySubdivisionNameType
                                {
                                    Value = data.SATICI_ILCE
                                },
                                Country = new CountryType
                                {
                                    Name = new NameType1
                                    {
                                        Value = "Türkiye"
                                    }
                                }
                            }
                        },
                        DigitalSignatureAttachment = new AttachmentType
                        {
                            ExternalReference = new ExternalReferenceType
                            {
                                URI = new URIType {
                                    Value = "#Signature"
                                }
                            }
                        }
                    }
                },
                AccountingSupplierParty = new SupplierPartyType
                {
                    Party = new PartyType
                    {
                        WebsiteURI = new WebsiteURIType
                        {
                            Value = data.SATICI_WEBSITE
                        },
                        PartyIdentification = new PartyIdentificationType[]
                        {
                            new PartyIdentificationType
                            {
                                ID = new IDType
                                {
                                    schemeID = "VKN",
                                    Value    = data.SATICI_VKN
                                }
                            }
                        },
                        PartyName = new PartyNameType
                        {
                            Name = new NameType1
                            {
                                Value = data.SATICI_UNVAN
                            }
                        },
                        PostalAddress = new AddressType
                        {
                            CityName = new CityNameType
                            {
                                Value = data.SATICI_IL
                            },
                            CitySubdivisionName = new CitySubdivisionNameType
                            {
                                Value = data.SATICI_ILCE
                            },
                            Country = new CountryType
                            {
                                Name = new NameType1
                                {
                                    Value = "Türkiye"
                                }
                            }
                        },
                        PartyTaxScheme = new PartyTaxSchemeType
                        {
                            TaxScheme = new TaxSchemeType
                            {
                                Name = new NameType1
                                {
                                    Value = data.SATICI_VERGIDAIRESI
                                }
                            }
                        },
                        Contact = new ContactType
                        {
                            Telephone = new TelephoneType
                            {
                                Value = data.SATICI_TELEFON
                            },
                            Telefax = new TelefaxType
                            {
                                Value = data.SATICI_FAX
                            },
                            ElectronicMail = new ElectronicMailType
                            {
                                Value = data.SATICI_EPOSTA
                            }
                        }
                    }
                },
                AccountingCustomerParty = new CustomerPartyType
                {
                    Party = new PartyType
                    {
                        WebsiteURI = new WebsiteURIType
                        {
                            Value = ""
                        },
                        PartyIdentification = new PartyIdentificationType[]
                        {
                            new PartyIdentificationType
                            {
                                ID = new IDType
                                {
                                    schemeID = "TCKN",
                                    Value    = data.MUSTERI_TCKN
                                }
                            }
                        },
                        PostalAddress = new AddressType
                        {
                            CityName = new CityNameType
                            {
                                Value = data.MUSTERI_IL
                            },
                            CitySubdivisionName = new CitySubdivisionNameType
                            {
                                Value = data.MUSTERI_ILCE
                            },
                            Country = new CountryType
                            {
                                Name = new NameType1
                                {
                                    Value = "Türkiye"
                                }
                            }
                        },
                        Contact = new ContactType
                        {
                            Telephone = new TelephoneType
                            {
                                Value = data.MUSTERI_TELEFON
                            },
                            ElectronicMail = new ElectronicMailType
                            {
                                Value = data.MUSTERI_EPOSTA
                            }
                        },
                        Person = new PersonType
                        {
                            FirstName = new FirstNameType {
                                Value = data.MUSTERI_AD
                            },
                            FamilyName = new FamilyNameType {
                                Value = data.MUSTERI_SOYAD
                            }
                        }
                    }
                },
                PaymentTerms = new PaymentTermsType
                {
                    Note = new NoteType
                    {
                        Value = data.FATURA_NOT
                    },
                    Amount = new AmountType2
                    {
                        Value = data.FATURA_TUTARI
                    },
                    PaymentDueDate = new PaymentDueDateType
                    {
                        Value = data.FATURA_BITIS
                    }
                },
                TaxTotal = new TaxTotalType[]
                {
                    new TaxTotalType
                    {
                        TaxAmount = new TaxAmountType
                        {
                            currencyID = "TRY",
                            Value      = data.VERGI_TUTARI
                        },
                        TaxSubtotal = new TaxSubtotalType[]
                        {
                            new TaxSubtotalType
                            {
                                TaxableAmount = new TaxableAmountType
                                {
                                    currencyID = "TRY",
                                    Value      = data.FATURA_TUTARI
                                },
                                TaxAmount = new TaxAmountType
                                {
                                    currencyID = "TRY",
                                    Value      = data.VERGI_TUTARI
                                },
                                TaxCategory = new TaxCategoryType
                                {
                                    TaxScheme = new TaxSchemeType
                                    {
                                        TaxTypeCode = new TaxTypeCodeType
                                        {
                                            Value = data.VERGI_TIPI
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                InvoiceLine = data.Details.Select(d => new InvoiceLineType
                {
                    InvoicedQuantity = new InvoicedQuantityType
                    {
                        Value = d.ADET
                    },
                    LineExtensionAmount = new LineExtensionAmountType
                    {
                        currencyID = "TRY",
                        Value      = d.TUTAR
                    },
                    TaxTotal = new TaxTotalType
                    {
                        TaxAmount = new TaxAmountType
                        {
                            currencyID = "TRY",
                            Value      = d.VERGI_TUTARI
                        },
                        TaxSubtotal = new TaxSubtotalType[]
                        {
                            new TaxSubtotalType
                            {
                                TaxableAmount = new TaxableAmountType
                                {
                                    currencyID = "TRY",
                                    Value      = d.TUTAR
                                },
                                TaxAmount = new TaxAmountType
                                {
                                    currencyID = "TRY",
                                    Value      = d.VERGI_TUTARI
                                },
                                TaxCategory = new TaxCategoryType
                                {
                                    TaxScheme = new TaxSchemeType
                                    {
                                        TaxTypeCode = new TaxTypeCodeType
                                        {
                                            Value = d.VERGI_TIPI
                                        }
                                    }
                                }
                            }
                        }
                    },
                    Item = new ItemType
                    {
                        Name = new NameType1
                        {
                            Value = d.ACIKLAMA
                        }
                    },
                    Price = new PriceType
                    {
                        PriceAmount = new PriceAmountType
                        {
                            currencyID = "TRY",
                            Value      = d.TUTAR
                        }
                    }
                }).ToArray()
            };
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(InvoiceType));

            using (MemoryStream output = new MemoryStream())
            {
                xmlSerializer.Serialize(output, invoice, new Common.UblGenerator());
                return(output.ToArray());
            }
        }
示例#17
0
 public GoodsReturnAddModel(IUnityContainer unityContainer)
 {
     _unityContainer = unityContainer;
     invoiceData     = _unityContainer.Resolve <InvoiceData>();
     invoiceData.Load(Guid.Parse(_unityContainer.Resolve <IOrderUserInfo>().Property["USER_SHOP"]));
 }
示例#18
0
        protected void btnemployeeOrdersubmit_click(object sender, EventArgs e)
        {
            if (dpEmployee.SelectedItem.Value != "0")
            {
                int         result      = 0;
                Invoice     inovice     = new Invoice();
                InvoiceData invoiceData = new InvoiceData();
                inovice.orderDate      = (Convert.ToDateTime(txtEmployeeOrderDate.Text)).ToString("dd-MM-yyyy");
                inovice.AgencyID       = 0;
                inovice.ShecemeApplied = true;

                //salesEmployee
                DataSet  ds       = new DataSet();
                BillData billData = new BillData();
                ds = billData.getEmployeeByUserId(GlobalInfo.Userid);
                inovice.SaleEmployeeId = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["EmployeeID"].ToString()) ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["EmployeeID"]);

                inovice.EmployeeID     = Convert.ToInt32(dpEmployee.SelectedItem.Value);
                inovice.totalCoast     = string.IsNullOrEmpty(hfemployeeTotalBill.Value) ? 0 : Comman.Comman.IsValidInteger(hfemployeeTotalBill.Value) ? Convert.ToDouble(hfemployeeTotalBill.Value) : 0;
                inovice.CreatedBy      = GlobalInfo.Userid;
                inovice.CreatedDate    = DateTime.Now.ToString("dd/MM/yyyy");
                inovice.TokanId        = hftokanno.Value;
                inovice.orderType      = 2;// employeeORder
                inovice.CurrentBoothID = GlobalInfo.CurrentbothID;
                inovice.PaymentMode    = "Employee";

                DataSet chkds = new DataSet();
                chkds = invoiceData.CheckBoothTemp(inovice, 1);
                if (!Comman.Comman.IsDataSetEmpty(chkds))
                {
                    result = invoiceData.BoothInserOrder(inovice);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Add Items')", true);
                }
                if (result > 0)
                {
                    //ScriptManager.RegisterStartupScript(pnlBill2, pnlBill2.GetType(), "PrintPanel2", "PrintPanel2()", true))
                    updateStock();
                    btnPrintEmp.Visible             = true;
                    Button1.Visible                 = false;
                    btnAddEmployeeOrderItem.Visible = false;
                    btnEmployeeNewOrder.Visible     = false;
                    btnRemoveOrder.Visible          = false;
                    pnlBill2.Visible                = false;
                    pnlBills.Visible                = true;
                    divDanger.Visible               = false;
                    divwarning.Visible              = false;
                    divSusccess.Visible             = true;
                    pnlError.Update();
                    upMain.Update();
                    pnlBill2.Enabled = false;
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblwarning.Text     = "Please Contact to Site Admin";
                    pnlError.Update();
                }
            }
            else
            {
                // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Select Employee')", true);
            }
        }
 public InvoiceReceivedEvent(string invoiceNumber, DateTime invoiceDate, string companyCode, string referenceId, InvoiceData invoiceData)
 {
     InvoiceNumber = invoiceNumber;
     InvoiceDate   = invoiceDate;
     CompanyCode   = companyCode;
     ReferenceId   = referenceId;
     InvoiceData   = invoiceData;
 }
示例#20
0
 public UcGoodReturnSelect(InvoiceData invoiceData)
 {
     InitializeComponent();
     cbGoods.Properties.DataSource = invoiceData;
 }
示例#21
0
        // Generates PDF.
        private void generateButton_Click(object sender, EventArgs e)
        {
            Customer customer = null;

            if (string.IsNullOrWhiteSpace(companyNameTextbox.Text) ||
                string.IsNullOrWhiteSpace(nameTextbox.Text) ||
                string.IsNullOrWhiteSpace(departmentTextbox.Text) ||
                string.IsNullOrWhiteSpace(postalcodeTextbox.Text) ||
                string.IsNullOrWhiteSpace(locationTextbox.Text) ||
                string.IsNullOrWhiteSpace(phonenumberTextbox.Text) ||
                string.IsNullOrWhiteSpace(emailTextbox.Text) ||
                string.IsNullOrWhiteSpace(kvkNumberTextbox.Text) ||
                string.IsNullOrWhiteSpace(ibanTextbox.Text))
            {
                MessageBox.Show("Vul alstublieft alle velden in.", "Foutmelding",
                                MessageBoxButtons.OK);
            }
            else
            {
                if (selected != null)
                {
                    customer = new Customer(
                        companyNameTextbox.Text,
                        nameTextbox.Text,
                        departmentTextbox.Text,
                        postalcodeTextbox.Text,
                        locationTextbox.Text,
                        adresTextbox.Text,
                        phonenumberTextbox.Text,
                        emailTextbox.Text,
                        kvkNumberTextbox.Text,
                        ibanTextbox.Text,
                        selected.subThemeId
                        );
                }
                else
                {
                    customer = new Customer(
                        companyNameTextbox.Text,
                        nameTextbox.Text,
                        departmentTextbox.Text,
                        postalcodeTextbox.Text,
                        locationTextbox.Text,
                        adresTextbox.Text,
                        phonenumberTextbox.Text,
                        emailTextbox.Text,
                        kvkNumberTextbox.Text,
                        ibanTextbox.Text
                        );
                }
                AddCustomer(customer);
                FillExistingCustomerList();
            }

            // Adds Invoice to database.
            //if (ic.productPanelList.Count > 0)
            //{ }
            //    bool exists = false;
            //    foreach(Customer c in DatabaseController.customerList)
            //    {
            //        if ((c.companyName + c.department + c.name).Equals((customer.companyName + customer.department + customer.name)))
            //        {
            //            Console.WriteLine("Exist == true");
            //            exists = true;
            //        }
            //    }
            //        if(!exists)
            //        {
            //        Console.WriteLine("Exist == false");
            //            DatabaseController.AddCustomer(customer);
            //        }
            InvoiceData invoice = new InvoiceData(customer, representative, DateTime.Parse(dateInvoiceDateLabel.Text), room);

            DatabaseController.AddRoom(room);
            DatabaseController.AddInvoice(invoice);
            invoice = DatabaseController.invoiceList.Last();
            foreach (InvoiceProductPanel ipp in ic.productPanelList)
            {
                DatabaseController.AddOrderedProduct(invoice.InvoiceDataId, ipp.product, ipp.amountOfCopies);
            }

            ic.SetInfo(customer, representative, intInvoiceNumberLabel.Text.ToString(), room);
            ic.MakePdf();
            Close();
        }
 public Invoice Map(InvoiceData ent) => new Invoice(ent);
示例#23
0
 public AddInvoiceCommand(string invoiceNumber, DateTime invoiceDate, string companyCode, string referenceId, InvoiceData invoiceData)
 {
     InvoiceNumber = invoiceNumber;
     InvoiceDate   = invoiceDate;
     CompanyCode   = companyCode;
     ReferenceId   = referenceId;
     InvoiceData   = invoiceData;
 }
示例#24
0
        public void btnAgentORderSubmit_click(object sender, EventArgs e)
        {
            int         result      = 0;
            Invoice     inovice     = new Invoice();
            InvoiceData invoiceData = new InvoiceData();

            inovice.orderDate      = (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy");
            inovice.AgencyID       = Convert.ToInt32(dpAgent.SelectedItem.Value);
            inovice.ShecemeApplied = true;


            //salesEmployee
            DataSet  ds       = new DataSet();
            BillData billData = new BillData();

            ds = billData.getEmployeeByUserId(GlobalInfo.Userid);
            inovice.SaleEmployeeId = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["EmployeeID"].ToString()) ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["EmployeeID"]);

            inovice.totalCoast        = string.IsNullOrEmpty(hftotalAmout.Value) ? 0 : Comman.Comman.IsValidInteger(hftotalAmout.Value) ? Convert.ToDouble(hftotalAmout.Value) : 0;
            inovice.CreatedBy         = GlobalInfo.Userid;
            inovice.CreatedDate       = DateTime.Now.ToString("dd/MM/yyyy");
            inovice.TokanId           = hftokanno.Value;
            inovice.TotalSchemeAmount = schemeTemp;
            inovice.ShecemeApplied    = schemeApplied;
            inovice.orderType         = 1;// AgentORder
            inovice.CurrentBoothID    = GlobalInfo.CurrentbothID;
            inovice.PaymentMode       = dpPaymentMode.SelectedItem.Text;
            DataSet chkds = new DataSet();

            chkds = invoiceData.CheckBoothTemp(inovice, 1);
            if (!Comman.Comman.IsDataSetEmpty(chkds))
            {
                result = invoiceData.BoothInserOrder(inovice);
            }
            if (result > 0)
            {
                updateStock();
                btnAgentORderSubmit.Visible    = false;
                btnPrintAgent.Visible          = true;
                pnlBills.Visible               = true;
                btnagentItamsremove.Visible    = false;
                btnAddAgentProductItem.Visible = false;
                btnAgentNewOrder.Visible       = false;
                btnAgentORderSubmit.Visible    = false;
                pnlBill1.Visible               = false;
                lblSuccess.Visible             = true;

                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;

                pnlError.Update();
                upMain.Update();

                pnlBill1.Enabled = false;
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }
        private async Task <WebApiResponseRecord> ProcessInvoiceRecord(WebApiRequestRecord webApiRequestRecord,
                                                                       WebApiResponseRecord webApiResponseRecord)
        {
            var formUrl = webApiRequestRecord.Data["formUrl"] as string;

            _log.LogInformation($"{ServiceConstants.FormAnalyzerServiceName} - Got form URL: {formUrl}");

            var analysisResult = await ProcessInvoiceDocumentContent(formUrl);

            webApiResponseRecord.Data = new Dictionary <string, object>();
            var invoiceData = new InvoiceData();

            if (analysisResult.documentResults != null)
            {
                var documents = analysisResult.documentResults;
                foreach (var documentResult in documents)
                {
                    var documentFields = documentResult.fields;
                    if (documentFields != null)
                    {
                        if (documentFields.Charges != null)
                        {
                            webApiResponseRecord.Data.Add(documentFields.Charges.fieldName, documentFields.Charges.text);
                            invoiceData.Charges = documentFields.Charges.text;
                        }
                        else
                        {
                            _log.LogWarning($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get field: 'Charges' for the form with URL: {formUrl}");
                        }
                        if (documentFields.ForCompany != null)
                        {
                            webApiResponseRecord.Data.Add(documentFields.ForCompany.fieldName, documentFields.ForCompany.text);
                            invoiceData.ForCompany = documentFields.ForCompany.text;
                        }
                        else
                        {
                            _log.LogWarning($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get field: 'ForCompany' for the form with URL: {formUrl}");
                        }
                        if (documentFields.FromCompany != null)
                        {
                            webApiResponseRecord.Data.Add(documentFields.FromCompany.fieldName, documentFields.FromCompany.text);
                            invoiceData.FromCompany = documentFields.FromCompany.text;
                        }
                        else
                        {
                            _log.LogWarning($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get field: 'FromCompany' for the form with URL: {formUrl}");
                        }
                        if (documentFields.InvoiceDate != null)
                        {
                            webApiResponseRecord.Data.Add(documentFields.InvoiceDate.fieldName, documentFields.InvoiceDate.text);
                            invoiceData.InvoiceDate = documentFields.InvoiceDate.text;
                        }
                        else
                        {
                            _log.LogWarning($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get field: 'InvoiceDate' for the form with URL: {formUrl}");
                        }
                        if (documentFields.InvoiceDueDate != null)
                        {
                            webApiResponseRecord.Data.Add(documentFields.InvoiceDueDate.fieldName, documentFields.InvoiceDueDate.text);
                            invoiceData.InvoiceDueDate = documentFields.InvoiceDueDate.text;
                        }
                        else
                        {
                            _log.LogWarning($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get field: 'InvoiceDueDate' for the form with URL: {formUrl}");
                        }
                        if (documentFields.InvoiceNumber != null)
                        {
                            webApiResponseRecord.Data.Add(documentFields.InvoiceNumber.fieldName, documentFields.InvoiceNumber.text);
                            invoiceData.InvoiceNumber = documentFields.InvoiceNumber.text;
                        }
                        else
                        {
                            _log.LogWarning($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get field: 'InvoiceNumber' for the form with URL: {formUrl}");
                        }
                        if (documentFields.VatID != null)
                        {
                            webApiResponseRecord.Data.Add(documentFields.VatID.fieldName, documentFields.VatID.text);
                            invoiceData.VatID = documentFields.VatID.text;
                        }
                        else
                        {
                            _log.LogWarning($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get field: 'VatID' for the form with URL: {formUrl}");
                        }
                    }
                    else
                    {
                        _log.LogError($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get any fields from the form with URL: {formUrl}");
                    }
                }
            }
            else
            {
                _log.LogError($"{ServiceConstants.FormAnalyzerServiceName} - Cannot get any document results from the form with URL: {formUrl}");
            }

            await _dataService.AddAsync(invoiceData);

            return(webApiResponseRecord);
        }
示例#26
0
        ///customer
        ///
        public void BindCustomerTempItam(Invoice invocie)
        {
            string      result     = string.Empty;
            InvoiceData invicedata = new InvoiceData();

            rpCutamoer.DataSource = invicedata.GetBoothTempItam(invocie);
            rpCutamoer.DataBind();
            DS = invicedata.GetBoothTempItam(invocie);
            string  dates    = string.IsNullOrEmpty(txtCustamerorderDate.Text)? string.Empty: (Convert.ToDateTime(txtCustamerorderDate.Text)).ToString("dd-MM-yyyy");
            DataSet ds       = new DataSet();
            int     boothIds = GlobalInfo.CurrentbothID;

            ds = invicedata.getBillCount(dates, boothIds);
            string boothcode = Convert.ToString(ds.Tables[1].Rows[0]["AgentCode"]);
            int    no        = Convert.ToInt32(ds.Tables[0].Rows[0]["Count"]) + 1;

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<style type='text / css'>");
                sb.Append(".tg  { border - collapse:collapse; border - spacing:0; border: none; }");
                sb.Append(".tg .tg-yw4l{vertical-align:top}");
                sb.Append(".tg .tg-baqh{text-align:center;vertical-align:top}");
                sb.Append("</style>");
                sb.Append("<table class='tg style1' style='page-break-inside:avoid; align:center;'>");
                sb.Append("<colgroup>");
                sb.Append("<col style = 'width:150px'>");
                sb.Append("<col style = 'width:150px'>");
                sb.Append("<col style = 'width:120px'>");
                sb.Append("<col style = 'width:120px'>");
                sb.Append("<col style = 'width:100px'>");

                sb.Append("</colgroup>");

                sb.Append("<tr>");
                sb.Append("<th class='tg-yw4l' rowspan='2'>");
                sb.Append("<img src='/Theme/img/logo1.png' class='img-circle' alt='Logo' width='50px' hight='50px'>");
                sb.Append("</th>");

                sb.Append("<th class='tg-baqh' colspan='2' style='text-align:center; font-size: 80%;'>");
                sb.Append("<u> Cash/Credit Bill </u> <br/>");
                sb.Append("</th>");

                sb.Append("<th class='tg-yw4l' colspan='2' style='text-align:right; font-size: 80%;'>");

                sb.Append("TIN:330761667331<br>");
                sb.Append("</th>");
                sb.Append("</tr>");

                sb.Append("<tr style='border-bottom:1px solid'>");
                sb.Append("<td class='tg-yw4l' colspan='4' style='text-align:Left'>");
                sb.Append("<b>Nanjil Integrated Dairy Development, Mulagumoodu, K.K.Dt.  Ph:248370, 248605</b>");

                sb.Append("</td>");

                //sb.Append("<td class='tg-yw4l'  colspan='2' style='text-align:right; font-size: 80%;'>");

                //sb.Append("PH:248370,248605");

                //sb.Append("</td>");
                sb.Append("</tr>");

                sb.Append("<tr style='border-bottom:1px solid'>");
                sb.Append("<td colspan ='2' style='text-align:left; font-size: 80%;'>");
                sb.Append("Local Sale");
                sb.Append("</td>");

                sb.Append("<td>");
                sb.Append("&nbsp;");
                sb.Append("</td>");
                sb.Append("<td colspan='2' style='text-align:right; font-size: 80%;'>");
                sb.Append("Bill No " + DateTime.Now.ToString("yyyyMMdd") + "/" + no.ToString() + "L");
                sb.Append("</td>");

                sb.Append("</tr>");

                sb.Append("<tr style='border-bottom:1px solid'>");
                sb.Append("<td colspan ='2' style='text-align:left; font-size: 80%;'>");
                sb.Append(DateTime.Now.ToString());
                sb.Append("</td>");

                sb.Append("<td>");
                sb.Append("&nbsp;");
                sb.Append("</td>");
                sb.Append("<td colspan='2' style='text-align:right; font-size: 80%;'>");
                sb.Append(boothcode);
                sb.Append("</td>");

                sb.Append("</tr>");

                //sb.Append("<tr style='border-bottom:1px solid'> <td colspan = '5'> &nbsp; </td> </tr>");
                sb.Append("<tr style='border-bottom:0.5px solid'>");



                sb.Append("<td colspan='2'>");

                sb.Append("Product Name");

                sb.Append("</td>");

                sb.Append("<td>");

                sb.Append("Qty.");

                sb.Append("</td>");
                sb.Append("<td>");

                sb.Append("Price");

                sb.Append("</td>");

                sb.Append("<td style='text-align:center'>");

                sb.Append("Amount");

                sb.Append("</td>");
                sb.Append("</tr>");

                foreach (DataRow row in DS.Tables[0].Rows)
                {
                    sb.Append("<tr>");
                    sb.Append("<td class='tg-yw4l'  style='text-align:left' colspan='2'>");
                    sb.Append(row["ProductName"].ToString());
                    sb.Append("</td>");

                    sb.Append("<td class='tg-yw4l'  style='text-align:left'>");
                    sb.Append(row["Qty"].ToString() + " " + row["UnitName"].ToString());
                    sb.Append("</td>");

                    sb.Append("<td class='tg-yw4l' style='text-align:left'>");
                    sb.Append((Convert.ToDecimal(row["UnitCost"]).ToString("#.00")));
                    sb.Append("</td>");

                    sb.Append("<td class='tg-yw4l' style='text-align:right'>");
                    sb.Append((Convert.ToDecimal(row["Total"]).ToString("#.00")));
                    sb.Append("</td>");

                    sb.Append("</tr>");
                }
                // sb.Append("<tr style='border-bottom:1px solid'> <td colspan = '5'> &nbsp; </td> </tr>");

                sb.Append("<tr style='border-bottom:1px solid'> <td colspan = '5'> &nbsp; </td> </tr>");
                sb.Append("<tr style='border-bottom:1px solid'> ");

                sb.Append("<td>");
                sb.Append("&nbsp;");
                sb.Append("</td>");
                sb.Append("<td>");
                sb.Append("&nbsp;");
                sb.Append("</td>");

                sb.Append("<td colspan='2'>");
                sb.Append("Total Amount: ");
                sb.Append("</td>");
                sb.Append("<td style='text-align:right'> <b>");
                sb.Append(total.ToString("#0.00"));
                sb.Append("</b> </td>");

                sb.Append("</tr>");
                sb.Append("<tr > <td colspan = '5'style='text-align:center > Thanks, Visit Again...!! </td> </tr>");
                //sb.Append("<tr> <td colspan='5' style='text-align:left> Thanks, Visit Again...!! </td> </tr>" );

                result            = sb.ToString();
                genratedBIll.Text = result;
                //Session["ctrl"] = sb.ToString();
                Session["ctrl"] = pnlBills;
                //Response.Redirect("/print.aspx", true);
            }
            else
            {
                //result = "No Records Found";
                //genratedBIll.Text = result;
            }
        }
示例#27
0
        public async Task <IActionResult> Detail(int id)
        {
            InvoiceData result = await _billing.GetById(id);

            return(View(result));
        }
示例#28
0
        /// <summary>
        /// Enregistre une facture complète dans le MCF et retour une châine pour générer le QR code
        /// </summary>
        /// <param name="invoiceData">informations de la facture</param>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        /// <exception cref="DecoderFallbackException"></exception>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="ArgumentException"></exception>
        /// <exception cref="InvalidOperationException"></exception>
        /// <exception cref="System.ServiceProcess.TimeoutException"></exception>
        /// <exception cref="ConfigurationErrorsException"></exception>
        /// <returns></returns>
        public string AddNewInvoice(InvoiceData invoiceData)
        {
            OpenPort();
            //InvoiceDataDetail
            string _stringVATApplied = string.Empty, _stringPrice = string.Empty, _stringQuantity = string.Empty,
                   _stringSpecificTax = string.Empty, _stringVAT = string.Empty, _responseMCF = string.Empty;

            int _newNum = 0;

            string _stringAIB = invoiceData.BuyerAIB == 0 ? "" : invoiceData.BuyerAIB.ToString();

            if (invoiceData != null)
            {
                _stringVAT = string.Format("{0:N}", invoiceData.VAT);
                _stringVAT = _stringVAT.Replace(',', '.');
                try
                {
                    //Création de la facture
                    _newNum++;//= GetNewNumCommande();
                    SerialData _responseOpenInvoice = cmdOuvrirFacture(
                        _newNum,
                        "1",
                        invoiceData.OperatorName,
                        invoiceData.IFU,
                        "0.00",
                        _stringVAT,
                        invoiceData.FactureContent,
                        invoiceData.FactureRembContent,
                        "",
                        invoiceData.BuyerIFU,
                        invoiceData.BuyerName,
                        _stringAIB);

                    //if (string.IsNullOrEmpty(_responseOpenInvoice.Value) == false)
                    //{
                    //Ajout d'articles
                    //_newNum++;//= GetNewNumCommande();
                    SerialData _responseAddArticle = null;
                    foreach (InvoiceDataDetail _detail in invoiceData.Articles)
                    {
                        _stringVAT         = _detail.VatApplied == false ? "A" : "B";
                        _stringPrice       = _detail.PriceATI.ToString();
                        _stringQuantity    = _detail.Quantity.ToString();
                        _stringSpecificTax = _detail.SpecificTAX.ToString();
                        _newNum++;
                        _responseAddArticle = cmdAddArticle(
                            _newNum,
                            _detail.ArticleName,
                            _detail.Description,
                            _stringVAT,
                            _stringPrice,
                            _stringQuantity,
                            _stringSpecificTax
                            );

                        _responseAddArticle = null;
                    }
                    _newNum++;    ///= GetNewNumCommande();
                    SerialData _responseValideInvoice = cmdVerifTotal(_newNum);
                    _newNum++;    //= GetNewNumCommande();
                    SerialData _responseCloseInvoice = cmdFactStateSet(_newNum);
                    _responseMCF = _responseCloseInvoice.Value;
                    //}
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    throw ex;
                }
                catch (DecoderFallbackException ex)
                {
                    throw ex;
                }
                catch (ArgumentNullException ex)
                {
                    throw ex;
                }
                catch (ArgumentException ex)
                {
                    throw ex;
                }
                catch (InvalidOperationException ex)
                {
                    throw ex;
                }
                catch (System.ServiceProcess.TimeoutException ex)
                {
                    throw ex;
                }
                catch (ConfigurationErrorsException ex)
                {
                    throw ex;
                }
            }
            else
            {
                throw new ArgumentNullException(ExceptionString.ARGUMENT_INVOICE_DATA_EXCEPTION);
            }
            ClosePort();
            return(_responseMCF);
        }
示例#29
0
 void Awake()
 {
     StartCoroutine(getTokenProp());
     StartCoroutine(getTokenAndGetPais());
     invoiceData = new InvoiceData();
 }