public static StringBuilder GetTab(string sCode, string sQty, string sName) { StringBuilder sb = new StringBuilder(); sb.Append(sCode + PrtCommon.GetSpace(4 - sCode.Length) + sQty + PrtCommon.GetSpace(3 - sQty.Length)); if (sName.Length > 21) { sb.Append(sName.Substring(0, 20)); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace(7) + sName.Substring(20, sName.Length - 21)); sb.Append(Environment.NewLine); PRT_BILL_SHUANGYU_ROW_COUNT += 1; } else { sb.Append(sName + PrtCommon.GetSpace(21 - sName.Length)); } return(sb); }
public static string GetPrtStrKit(List <TAOrderItemInfo> lstOI, Hashtable ht) { StringBuilder sb = new StringBuilder(); string L = PrtCommon.GetSplit(); string L1 = (string)ht["ChkNum"]; //账单号 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L1.Length) / 2) + L1); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); sb.Append("Code" + PrtCommon.GetSpace(2) + "Qty" + PrtCommon.GetSpace(2) + "Name" + PrtCommon.GetSpace(24)); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); PRT_BILL_SHUANGYU_ROW_COUNT = lstOI.Count * 2; foreach (var taOrderItemInfo in lstOI) { sb.Append(GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty, taOrderItemInfo.ItemDishName)); sb.Append(Environment.NewLine); var CNameList = CommonData.TaMenuItemList.Where(s => s.DishCode.Equals(taOrderItemInfo.ItemCode)); if (CNameList.Any()) { sb.Append(PrtCommon.GetHanZiTabKitchen(CNameList.FirstOrDefault().OtherName)); sb.Append(Environment.NewLine); } } sb.Append(L); sb.Append(Environment.NewLine); return(sb.ToString()); }
public string GetPrtStrCashBilingual(List <TAOrderItemInfo> lstOI, Hashtable ht) { StringBuilder sb = new StringBuilder(); string L = PrtCommon.GetSplit(); string L1 = PrtCommon.GetRestName(); string L2 = PrtCommon.GetRestAddr(); string L3 = PrtCommon.GetRestTel(); string L4 = PrtCommon.GetRestVATNo(); string L5 = PrtCommon.GetPrtTime(); string L6 = PrtCommon.GetPrtDateTime(); string L7 = (string)ht["Staff"]; //餐厅名称 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L1.Length) / 2) + L1); sb.Append(Environment.NewLine); //餐厅地址 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L2.Length) / 2) + L2); sb.Append(Environment.NewLine); //Tel sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L3.Length) / 2) + L3); sb.Append(Environment.NewLine); //VAT sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L4.Length) / 2) + L4); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); //时间 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L5.Length) / 2) + L5); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace(6) + L6); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace(6) + L7); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append("Code" + PrtCommon.GetSpace(2) + "Qty" + PrtCommon.GetSpace(2) + "Name" + PrtCommon.GetSpace(17) + "Price" + PrtCommon.GetSpace(2)); sb.Append(Environment.NewLine); foreach (var taOrderItemInfo in lstOI) { sb.Append(PrtCommon.GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty, taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice)); sb.Append(Environment.NewLine); } sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetItemTotal((string)ht["ItemQty"], (string)ht["SubTotal"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetTotal((string)ht["Total"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetPay((string)ht["PayType"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtStatic.PRT_COMP_NAME); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace(8) + PrtStatic.PRT_COMP_WEBSITE); sb.Append(Environment.NewLine); return(sb.ToString()); }
public static string GetPrtStrBillBilingual(List <TAOrderItemInfo> lstOI, Hashtable ht) { StringBuilder sb = new StringBuilder(); string L = PrtCommon.GetSplit(); string L1 = PrtCommon.GetRestName(); string L2 = PrtCommon.GetRestAddr(); string L3 = PrtCommon.GetRestTel(); string L4 = PrtCommon.GetRestVATNo(); string L5 = PrtCommon.GetPrtTime(); string L6 = PrtCommon.GetPrtDateTime(); string L7 = "Staff:" + (ht["Staff"]).ToString() + " " + @"Order No:" + (ht["OrderNo"]).ToString(); //餐厅名称 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L1.Length) / 2) + L1); sb.Append(Environment.NewLine); //餐厅地址 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L2.Length) / 2) + L2); sb.Append(Environment.NewLine); //Tel sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L3.Length) / 2) + L3); sb.Append(Environment.NewLine); //VAT sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L4.Length) / 2) + L4); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); //时间 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L5.Length) / 2) + L5); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); //sb.Append(PrtCommon.GetSpace(6) + L6); sb.Append(L6); sb.Append(Environment.NewLine); //sb.Append(PrtCommon.GetSpace(6) + L7); sb.Append(L7); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append("Code" + PrtCommon.GetSpace(2) + "Qty" + PrtCommon.GetSpace(2) + "Name" + PrtCommon.GetSpace(17) + "Price" + PrtCommon.GetSpace(2)); sb.Append(Environment.NewLine); PRT_BILL_SHUANGYU_ROW_COUNT = lstOI.Count * 2; foreach (var taOrderItemInfo in lstOI) { //涉及到多行需要计算行数 //sb.Append(PrtCommon.GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty, // taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice)); sb.Append(GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty, taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice)); sb.Append(Environment.NewLine); var CNameList = CommonData.TaMenuItemList.Where(s => s.DishCode.Equals(taOrderItemInfo.ItemCode)); if (CNameList.Any()) { sb.Append(PrtCommon.GetHanZiTab(CNameList.FirstOrDefault().OtherName)); sb.Append(Environment.NewLine); } } sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetItemTotal((ht["ItemQty"]).ToString(), (ht["SubTotal"]).ToString())); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetTotal((ht["Total"]).ToString())); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetText("Tendered:", (ht["Tendered"]).ToString())); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetText("Change:", (ht["Change"]).ToString())); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(PrtCommon.GetPay((ht["PayType"]).ToString())); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtStatic.PRT_COMP_NAME); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace(8) + PrtStatic.PRT_COMP_WEBSITE); sb.Append(Environment.NewLine); return(sb.ToString()); }
public static string GetPrtStrReceipt(List <TAOrderItemInfo> lstOI, Hashtable ht) { StringBuilder sb = new StringBuilder(); string L = PrtCommon.GetSplit(); string L1 = PrtCommon.GetRestName(); string L2 = PrtCommon.GetRestAddr(); string L3 = PrtCommon.GetRestTel(); string L4 = PrtCommon.GetRestVATNo(); //string L5 = PrtCommon.GetPrtTime(); string L6 = PrtCommon.GetPrtDateTime(); string L7 = "Staff:" + (string)ht["Staff"]; //餐厅名称 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L1.Length) / 2) + L1); sb.Append(Environment.NewLine); //餐厅地址 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L2.Length) / 2) + L2); sb.Append(Environment.NewLine); //Tel sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L3.Length) / 2) + L3); sb.Append(Environment.NewLine); //VAT sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L4.Length) / 2) + L4); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); ////时间 //sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L5.Length) / 2) + L5); //sb.Append(Environment.NewLine); ////分隔行 //sb.Append(L); //sb.Append(Environment.NewLine); sb.Append(L6); sb.Append(Environment.NewLine); sb.Append(L7); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append("Code" + PrtCommon.GetSpace(2) + "Qty" + PrtCommon.GetSpace(2) + "Name" + PrtCommon.GetSpace(17) + "Price" + PrtCommon.GetSpace(2)); sb.Append(Environment.NewLine); foreach (var taOrderItemInfo in lstOI) { sb.Append(PrtCommon.GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty, taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice)); sb.Append(Environment.NewLine); } sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetItemTotal((string)ht["ItemQty"], (string)ht["SubTotal"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetTotal((string)ht["Total"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetText("Tendered:", (string)ht["Tendered"])); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetText("Change:", (string)ht["Change"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetPay((string)ht["PayType"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(PrtCommon.GetSpace(15) + "VAT SUMMARY"); sb.Append(Environment.NewLine); sb.Append("Rate" + PrtCommon.GetSpace(7) + "Net" + PrtCommon.GetSpace(7) + "VAT-A" + PrtCommon.GetSpace(7) + "Gross"); sb.Append(Environment.NewLine); sb.Append((string)ht["Rate1"] + PrtCommon.GetSpace(11 - ((string)ht["Rate1"]).Length) + (string)ht["Net1"] + PrtCommon.GetSpace(10 - ((string)ht["Net1"]).Length) + (string)ht["VAT-A"] + PrtCommon.GetSpace(12 - ((string)ht["VAT-A"]).Length) + (string)ht["Gross1"]); sb.Append(Environment.NewLine); sb.Append("Rate" + PrtCommon.GetSpace(7) + "Net" + PrtCommon.GetSpace(7) + "VAT-B" + PrtCommon.GetSpace(7) + "Gross"); sb.Append(Environment.NewLine); sb.Append((string)ht["Rate2"] + PrtCommon.GetSpace(11 - ((string)ht["Rate2"]).Length) + (string)ht["Net2"] + PrtCommon.GetSpace(10 - ((string)ht["Net2"]).Length) + (string)ht["VAT-B"] + PrtCommon.GetSpace(12 - ((string)ht["VAT-B"]).Length) + (string)ht["Gross2"]); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtStatic.PRT_COMP_NAME); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace(8) + PrtStatic.PRT_COMP_WEBSITE); sb.Append(Environment.NewLine); return(sb.ToString()); }
public static string GetPrtStrPayCollection(List <TAOrderItemInfo> lstOI, Hashtable ht) { StringBuilder sb = new StringBuilder(); string L = PrtCommon.GetSplit(); string L1 = PrtCommon.GetRestName(); string L2 = PrtCommon.GetRestAddr(); string L3 = PrtCommon.GetRestTel(); string L4 = PrtCommon.GetRestVATNo(); //string L5 = PrtCommon.GetPrtTime(); string L51 = (string)ht["CustName"]; string L52 = "[" + (string)ht["CustPhone"] + "]"; string L6 = PrtCommon.GetPrtDateTime(); string L7 = "Staff:" + (string)ht["Staff"]; //餐厅名称 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L1.Length) / 2) + L1); sb.Append(Environment.NewLine); //餐厅地址 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L2.Length) / 2) + L2); sb.Append(Environment.NewLine); //Tel sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L3.Length) / 2) + L3); sb.Append(Environment.NewLine); //VAT sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L4.Length) / 2) + L4); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); //时间 sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_15 - L51.Length) / 2) + L51); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_15 - L52.Length) / 2) + L52); sb.Append(Environment.NewLine); //分隔行 sb.Append(L); sb.Append(Environment.NewLine); //sb.Append(PrtCommon.GetSpace(6) + L6); sb.Append(L6); sb.Append(Environment.NewLine); //sb.Append(PrtCommon.GetSpace(6) + L7); sb.Append(L7); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append("Code" + PrtCommon.GetSpace(2) + "Qty" + PrtCommon.GetSpace(2) + "Name" + PrtCommon.GetSpace(17) + "Price" + PrtCommon.GetSpace(2)); sb.Append(Environment.NewLine); foreach (var taOrderItemInfo in lstOI) { //涉及到多行需要计算行数 //sb.Append(PrtCommon.GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty, // taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice)); sb.Append(GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty, taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice)); sb.Append(Environment.NewLine); } sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetItemTotal((string)ht["ItemQty"], (string)ht["SubTotal"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetTotal((string)ht["Total"])); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetText("NOT PAID")); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetText("[]CASH []CARD")); sb.Append(Environment.NewLine); sb.Append(L); sb.Append(Environment.NewLine); sb.Append(PrtStatic.PRT_COMP_NAME); sb.Append(Environment.NewLine); sb.Append(PrtCommon.GetSpace(8) + PrtStatic.PRT_COMP_WEBSITE); sb.Append(Environment.NewLine); return(sb.ToString()); }