Example #1
0
        private void btnPrtBill_Click(object sender, EventArgs e)
        {
            Hashtable ht = SetPrtInfo();

            ht["Tendered"] = checkPaid;

            ht["Change"] = "0.00";

            //new SystemData().GetTaOrderItem();
            var lstOi = CommonData.TaOrderItem.Where(s => s.CheckCode.Equals(checkCode) && s.BusDate.Equals(checkBusDate)).ToList();

            PrtPrint.PrtBillBilingual(lstOi, ht);
        }
Example #2
0
        private void btnPrtBillOnly_Click(object sender, EventArgs e)
        {
            if (Convert.ToDecimal(txtToPay.Text) > 0.0m)
            {
                return;
            }

            htPay["Tendered"] = txtTendered.Text;
            htPay["Change"]   = txtChange.Text;

            new OnLoadSystemCommonData().GetTAOrderItem();
            var lstOI = CommonData.TaOrderItemList.Where(s => s.CheckCode.Equals(chkNum)).ToList();

            //List<TAOrderItemInfo> lstOI = new List<TAOrderItemInfo>();
            PrtPrint.PrtBillBilingual(lstOI, htPay);
        }
Example #3
0
        private void btnPrtBillOnly_Click(object sender, EventArgs e)
        {
            SaveAllInfo();

            if (returnPaid)
            {
                htDetail["Tendered"] = txtPaid.Text;
                htDetail["Change"]   = (Math.Abs(dToPay)).ToString();

                htDetail["OrderNo"]  = checkID;
                htDetail["PayType"]  = payType;
                htDetail["SubTotal"] = txtTotal.Text;
                htDetail["Total"]    = txtTotal.Text;

                new SystemData().GetTaOrderItem();
                var lstOI = CommonData.TaOrderItem.Where(s => s.CheckCode.Equals(checkID) && s.BusDate.Equals(strBusDate)).ToList();

                PrtPrint.PrtBillBilingual(lstOI, htDetail);
            }
        }
        private void btnPrtAll_Click(object sender, EventArgs e)
        {
            if (Convert.ToDecimal(txtToPay.Text) > 0.0m)
            {
                return;
            }
            htPay["Tendered"] = txtTendered.Text;
            htPay["Change"]   = txtChange.Text;

            new OnLoadSystemCommonData().GetTAOrderItem();
            var lstOI = CommonData.TaOrderItemList.Where(s => s.CheckCode.Equals(chkNum)).ToList();

            PrtPrint.PrtBillBilingual(lstOI, htPay);

            //打印厨房单
            htPay["ChkNum"] = chkNum;
            PrtPrint.PrtKitchen(lstOI, htPay);

            //保存账单信息
            btnSave_Click(sender, e);
        }
Example #5
0
        private void btnPrtBill_Click(object sender, EventArgs e)
        {
            string sChkNum = dgvPendOrder.CurrentRow.Cells[1].Value.ToString();

            Hashtable htPay = new Hashtable();

            htPay["Staff"]    = userInfo.UsrName;
            htPay["ItemQty"]  = GetOrderItemCount(sChkNum);
            htPay["SubTotal"] = GetDgvItemTotalPrice(sChkNum);
            htPay["Total"]    = GetDgvItemTotalPrice(sChkNum);
            htPay["PayType"]  = "CASH";
            htPay["OrderNo"]  = sChkNum;

            htPay["Tendered"] = "0.00";
            htPay["Change"]   = "0.00";

            new OnLoadSystemCommonData().GetTAOrderItem();
            var lstOI = CommonData.TaOrderItemList.Where(s => s.CheckCode.Equals(sChkNum)).ToList();

            //List<TAOrderItemInfo> lstOI = new List<TAOrderItemInfo>();
            PrtPrint.PrtBillBilingual(lstOI, htPay);
        }
Example #6
0
        private void btnPrtAllReceipt_Click(object sender, EventArgs e)
        {
            if (Convert.ToDecimal(txtToPay.Text) > 0.0m)
            {
                return;
            }

            htPay["Tendered"] = txtTendered.Text;
            htPay["Change"]   = txtChange.Text;

            OnLoadSystemCommonData onLoadSystemCommonData = new OnLoadSystemCommonData();

            onLoadSystemCommonData.GetTAOrderItem();
            onLoadSystemCommonData.GetSysConfigList();
            onLoadSystemCommonData.GetTAMenuItemList();

            var lstOrderItem = CommonData.TaOrderItemList.Where(s => s.CheckCode.Equals(chkNum));
            var lstOI        = lstOrderItem.ToList();

            #region VAT计算
            if (CommonData.SysConfigList.Any())
            {
                //税率
                htPay["Rate1"] = CommonData.SysConfigList.FirstOrDefault().VATPerct + "%";

                var lstVAT = from o in lstOI
                             join m in CommonData.TaMenuItemList on o.ItemCode equals m.DishCode
                             where !string.IsNullOrEmpty(m.IsWithoutVAT) && m.IsWithoutVAT.Equals("Y")
                             select new
                {
                    itemTotalPrice = o.ItemTotalPrice
                };

                decimal dTotal  = 0;
                decimal dVatTmp = 0;
                decimal dVat    = 0;
                if (lstVAT.Any())
                {
                    dTotal = lstVAT.ToList().Sum(vat => Convert.ToDecimal(vat.itemTotalPrice));
                    //交税
                    dVatTmp = (Convert.ToDecimal(CommonData.SysConfigList.FirstOrDefault().VATPerct) / 100) * dTotal;

                    dVat = Math.Round(dVatTmp, 2, MidpointRounding.AwayFromZero);
                }

                htPay["VAT-A"] = dVat.ToString();
                //税前
                htPay["Net1"] = (dTotal - dVat).ToString();
                //总价
                htPay["Gross1"] = dTotal.ToString();
                htPay["Rate2"]  = "0.00%";
                htPay["Net2"]   = (Convert.ToDecimal(txtTotal.Text) - dTotal).ToString();
                htPay["VAT-B"]  = "0.00";
                htPay["Gross2"] = (Convert.ToDecimal(txtTotal.Text) - dTotal).ToString();
            }
            else
            {
                htPay["Rate1"]  = "0.00%";
                htPay["Net1"]   = "0.00";
                htPay["VAT-A"]  = "0.00";
                htPay["Gross1"] = "0.00";
                htPay["Rate2"]  = "0.00%";
                htPay["Net2"]   = "0.00";
                htPay["VAT-B"]  = "0.00";
                htPay["Gross2"] = "0.00";
            }
            #endregion


            PrtPrint.PrtReceipt(lstOI, htPay);

            PrtPrint.PrtBillBilingual(lstOI, htPay);

            //打印厨房单
            htPay["ChkNum"] = chkNum;
            PrtPrint.PrtKitchen(lstOI, htPay);
        }
Example #7
0
        private void btnPrtAllReceipt_Click(object sender, EventArgs e)
        {
            SaveAllInfo();

            if (returnPaid)
            {
                htDetail["Tendered"] = txtPaid.Text;
                htDetail["Change"]   = (Math.Abs(dToPay)).ToString();

                htDetail["OrderNo"]  = checkID;
                htDetail["ChkNum"]   = checkID;
                htDetail["PayType"]  = payType;
                htDetail["SubTotal"] = txtTotal.Text;
                htDetail["Total"]    = txtTotal.Text;

                #region VAT计算
                if (CommonData.GenSet.Any())
                {
                    htDetail["Rate1"] = CommonData.GenSet.FirstOrDefault().VATPer + @"%";

                    var lstVAT = from oi in CommonData.TaOrderItem.Where(s => s.CheckCode.Equals(checkID) && s.BusDate.Equals(strBusDate))
                                 join mi in CommonData.TaMenuItem on oi.ItemCode equals mi.MiDishCode
                                 where !string.IsNullOrEmpty(mi.MiRmk) && mi.MiRmk.Contains(@"Without VAT")
                                 select new
                    {
                        itemTotalPrice = oi.ItemTotalPrice
                    };

                    decimal dTotal  = 0;
                    decimal dVatTmp = 0;
                    decimal dVat    = 0;

                    if (lstVAT.Any())
                    {
                        dTotal = lstVAT.ToList().Sum(vat => Convert.ToDecimal(vat.itemTotalPrice));
                        //交税
                        dVatTmp = (Convert.ToDecimal(CommonData.GenSet.FirstOrDefault().VATPer) / 100) * dTotal;

                        dVat = Math.Round(dVatTmp, 2, MidpointRounding.AwayFromZero);
                    }

                    htDetail["VAT-A"] = dVat.ToString();
                    //税前
                    htDetail["Net1"] = dTotal.ToString();
                    //总价
                    htDetail["Gross1"] = (dTotal - dVat).ToString();
                    htDetail["Rate2"]  = "0.00%";
                    htDetail["Net2"]   = (Convert.ToDecimal(txtTotal.Text) - dTotal).ToString();
                    htDetail["VAT-B"]  = "0.00";
                    htDetail["Gross2"] = (Convert.ToDecimal(txtTotal.Text) - dTotal).ToString();
                }
                else
                {
                    htDetail["Rate1"]  = "0.00%";
                    htDetail["Net1"]   = "0.00";
                    htDetail["VAT-A"]  = "0.00";
                    htDetail["Gross1"] = "0.00";
                    htDetail["Rate2"]  = "0.00%";
                    htDetail["Net2"]   = "0.00";
                    htDetail["VAT-B"]  = "0.00";
                    htDetail["Gross2"] = "0.00";
                }
                #endregion

                new SystemData().GetTaOrderItem();
                var lstOI = CommonData.TaOrderItem.Where(s => s.CheckCode.Equals(checkID) && s.BusDate.Equals(strBusDate)).ToList();

                PrtPrint.PrtBillBilingual(lstOI, htDetail);

                PrtPrint.PrtKitchen(lstOI, htDetail);
            }
        }