public List <String> FormatVoid(IFiscalItem fi) { int currentLine = 0; if (CurrentSettings.GetProgramOption(Setting.PrintProductBarcode) == PosConfiguration.ON) { currentLine = GetCurrentLine(4); } else { currentLine = GetCurrentLine(3); } FormatLine(new Location(productNameLocation.X, CurrentPage.PageLines.Count + 1), PosMessage.VOID.PadLeft(PosMessage.VOID.Length + 4, ' ')); if (fi.Quantity != -1) { string specifier = "Q"; if (fi.Quantity % 1 < 0) { specifier = "0.000"; } FormatLine(new Location(productNameLocation.X, CurrentPage.PageLines.Count + 1), String.Format("{0} {1} X {2}", new Number(fi.Quantity).ToString(specifier), fi.Unit, new Number(fi.UnitPrice).ToString("C"))); } FormatLine(new Location(productNameLocation.X, CurrentPage.PageLines.Count + 1), String.Format("{0,-" + maxProductWidth + "}", fi.Name.Trim())); FormatLine(new Location(productVatLocation.X - 3, CurrentPage.PageLines.Count), String.Format("%{0:D2}", (int)(Department.TaxRates[fi.TaxGroupId - 1]))); FormatLine(new Location(productAmountLocation.X - maxAmountWidth, CurrentPage.PageLines.Count), String.Format("{0," + maxAmountWidth + "}", "*" + new Number(fi.TotalAmount).ToString("C"))); if (CurrentSettings.GetProgramOption(Setting.PrintProductBarcode) == PosConfiguration.ON) { FormatRemark(fi.Barcode); } return(CurrentPage.PageLines.GetRange(currentLine, CurrentPage.PageLines.Count - currentLine)); }
public void ShowSale(IFiscalItem fi) { Show(fi); lastItem = fi; soldItems.Add(fi); ShowItem(fi); }
public void ShowVoid(IFiscalItem fi) { if ((mode & Target.Customer) == Target.Customer) { customerForm.ShowVoid(fi); } }
public static List <String> Format(IFiscalItem fi) { currentLines = new List <string>(); if (fi.Quantity != 1) { string specifier = "Q"; if (fi.Quantity % 1 > 0) { specifier = "0.000"; } FormatLine(new Location(productQuantityLocation.X, currentLines.Count + 1), String.Format("{0} {1} X {2}", new Number(fi.Quantity - fi.VoidQuantity).ToString(specifier), fi.Unit, new Number(fi.UnitPrice).ToString("C"))); } FormatLine(new Location(productNameLocation.X, currentLines.Count + 1), String.Format("{0,-" + maxProductWidth + "}", fi.Name.Trim())); FormatLine(new Location(productVatLocation.X - 3, currentLines.Count), String.Format("%{0}", ((int)(Department.TaxRates[fi.TaxGroupId - 1])).ToString().PadLeft(2, ' '))); FormatLine(new Location(productAmountLocation.X - maxAmountWidth, currentLines.Count), String.Format("{0," + maxAmountWidth + "}", "*" + new Number(fi.ListedAmount).ToString("C"))); if (CurrentSettings.GetProgramOption(Setting.PrintProductBarcode) == PosConfiguration.ON) { FormatRemark(fi.Barcode); } return(currentLines); }
public void ShowVoid(IFiscalItem fi) { primaryDisplay.ShowVoid(fi); foreach (IDisplay d in auxilaryDisplays) { d.ShowVoid(fi); } }
public static List <String> FormatCorrect(IFiscalItem fi) { currentLines = new List <string>(); FormatLine(new Location(productNameLocation.X, currentLines.Count + 1), String.Format("{0,-" + maxProductWidth + "}", PosMessage.CORRECTION)); FormatLine(new Location(productAmountLocation.X - maxAmountWidth, currentLines.Count), String.Format("{0," + maxAmountWidth + "}", "*" + new Number(fi.TotalAmount).ToString("C"))); return(currentLines); }
public List <String> FormatCorrection(IFiscalItem fi) { int currentLine = GetCurrentLine(2); FormatLine(new Location(productNameLocation.X, CurrentPage.PageLines.Count + 1), String.Format("{0,-" + maxProductWidth + "}", PosMessage.CORRECTION)); FormatLine(new Location(productAmountLocation.X - maxAmountWidth, CurrentPage.PageLines.Count), String.Format("{0," + maxAmountWidth + "}", "*-" + new Number(fi.TotalAmount).ToString("C"))); return(CurrentPage.PageLines.GetRange(currentLine, CurrentPage.PageLines.Count - currentLine)); }
public void ShowVoid(IFiscalItem fi) { if ((mode & Target.Cashier) == Target.Cashier) { cashierDisplay.ShowVoid(fi); } if ((mode & Target.Customer) == Target.Customer) { customerDisplay.ShowVoid(fi); } }
public void Show(IFiscalItem fi) { try { bool large = ((fi.Quantity != (long)fi.Quantity) && fi.TotalAmount > 1000000); Show("{0}\n{1:G10} {2}\t{3:C}", fi.Name, new Number(Math.Round(fi.Quantity - fi.VoidQuantity, 3)), large ? "X" : fi.Unit, new Number(fi.TotalAmount - fi.VoidAmount)); } catch (Exception fex) { Display.Log.Error("FormatException occured. {0}", fex.Message); } }
internal void ShowVoid(IFiscalItem fi) { try { bool large = ((fi.Quantity != (long)fi.Quantity) && fi.TotalAmount > 1000000); Show("{0}\n{1:G10} {2}\t{3:C}", fi.Name, new Number(fi.Quantity), large ? "X" : fi.Unit, new Number(fi.TotalAmount)); } catch (FormatException fex) { EZLogger.Log.Error("FormatException occured. {0}", fex.Message); } }
internal void ShowSale(IFiscalItem fi) { try { bool large = ((fi.Quantity != (long)fi.Quantity) && fi.TotalAmount > 1000000); Show("{0}\n{1:G10} {2}\t{3:C}", fi.Name, new Number(Math.Round(fi.Quantity - fi.VoidQuantity, 3)), large ? "X" : fi.Unit, new Number(fi.TotalAmount - fi.VoidAmount)); } catch (FormatException) { } }
public void ShowVoid(IFiscalItem fi) { try { bool large = ((fi.Quantity != (long)fi.Quantity) && fi.TotalAmount > 1000000); Show("{0}\n{1:G10} {2}\t{3:C}", fi.Name, new Number(fi.Quantity), large ? "X" : fi.Unit, new Number(fi.TotalAmount)); WriteSegmentPrice(Symbol.MINUS, fi.TotalAmount); } catch (FormatException fex) { Display.Log.Error("FormatException occured. {0}", fex.Message); } }
public void ShowVoid(IFiscalItem fi) { try { bool large = ((fi.Quantity != (long)fi.Quantity) && fi.TotalAmount > 1000000); Show("{0}\n{1:G10} {2}\t{3:C}", fi.Name, new Number(fi.Quantity), large ? "X" : fi.Unit, new Number(fi.TotalAmount)); ShowItem(fi); this.dgSales.Rows[0].DefaultCellStyle.ForeColor = Color.Red; } catch (FormatException fex) { Display.Log.Error("FormatException occured. {0}", fex.Message); } }
public void ShowVoid(IFiscalItem vi) { if ((mode & Target.Cashier) == Target.Cashier) { touchForm.ShowVoid(vi); } if (external != null) { external.ShowVoid(vi); } if (customerForm != null && (mode & Target.Customer) == Target.Customer) { customerForm.ShowVoid(vi); } }
private void ShowItem(IFiscalItem fi) { if (dgSales.InvokeRequired) { this.dgSales.Invoke(new ShowItemDelegate(this.ShowItem), fi); } else { if (fi.Quantity > fi.VoidQuantity) { if (dgSales.Rows.Count - MAXGRIDROWS == 0) { //ClearDetails(); dgSales.Rows[MAXGRIDROWS - 1].Selected = true; } this.dgSales.Rows.Insert(0, new object[] { String.Format("{0:D3}", dgSales.Rows.Count + 1 - MAXGRIDROWS), //fi.Product.Barcode, fi.Name, fi.Quantity, //fi.Unit, String.Format("{0:0.00}", fi.UnitPrice), String.Format("{0:0.00}", fi.TotalAmount) }); String path = PosConfiguration.ImagePath + fi.Product.Barcode + ".jpg"; if (!System.IO.File.Exists(path)) { path = PosConfiguration.ImagePath + "NoImage.jpg"; } SetItemImage(path); SetDataGridRowSize(); if (productAdjustments != 0) { SetProductAdjustment(0); } UpdateSubtotal(); } } }
public void Show(IFiscalItem si) { if ((mode & Target.Cashier) == Target.Cashier) { touchForm.Show(si); } else { if (external != null) { external.ShowSale(si); } if (customerForm != null) { customerForm.ShowSale(si); } } }
private new IPrinterResponse Print(IFiscalItem fi) { if (SlipPrinter.Document.Id == 0) { SlipPrinter.Document.Id = FiscalPrinter.Printer.CurrentDocumentId; throw new DocumentIdNotSetException(); } List <String> fiscalItems = SlipPrinter.Invoicepage.Format(fi); IPrinterResponse response = null; foreach (String row in fiscalItems) { if (!SlipReady()) { DocumentRequested(new RequestSlipException(), new EventArgs()); WaitForSlip(); } response = Send(SlipRequest.WriteLine(row)); } SlipPrinter.Invoicepage.SubTotal += fi.TotalAmount; // adjustment on item Adjustment adj = new Adjustment(); decimal totalAdjAmount = 0; foreach (string adjOnItem in fi.GetAdjustments()) { string[] values = adjOnItem.Split('|'); totalAdjAmount += decimal.Parse(values[0]); } if (totalAdjAmount != 0) { adj = ParseAdjLine(fi.GetAdjustments()[0]); Print(adj); } return(response); }
public void ShowVoid(IFiscalItem fi) { try { bool large = ((fi.Quantity != (long)fi.Quantity) && fi.TotalAmount > 1000000); Show("{0}\n{1:G10} {2}\t{3:C}", fi.Name, new Number(fi.Quantity), large ? "X" : fi.Unit, new Number(fi.TotalAmount)); String path = PosConfiguration.ImagePath + fi.Product.Barcode + ".jpg"; System.Drawing.Image img = null; if (System.IO.File.Exists(path)) #if WindowsCE { img = new System.Drawing.Bitmap(path); } #else { img = System.Drawing.Image.FromFile(path); } #endif displayForm.ShowImage(img); } catch (FormatException fex) { EZLogger.Log.Error("FormatException occured. {0}", fex.Message); } }
private IPrinterResponse Print(IFiscalItem fi) { if (SlipPrinter.Document.Id == 0) { SlipPrinter.Document.Id = FiscalPrinter.Printer.CurrentDocumentId; throw new DocumentIdNotSetException(); } List <String> fiscalItems = SlipPrinter.Invoicepage.Format(fi); IPrinterResponse response = null; foreach (String row in fiscalItems) { if (!SlipReady()) { DocumentRequested(new RequestSlipException(), new EventArgs()); WaitForSlip(); } response = Send(SlipRequest.WriteLine(row)); } SlipPrinter.Invoicepage.SubTotal += fi.TotalAmount; return(response); }
public void Show(IFiscalItem fi) { try { string ttlAmount = new Number(fi.Product.UnitPrice * fi.Quantity).ToString("C"); if (fi.Product.SecondaryUnitPrice > 0 && fi.Product.UnitPrice != fi.Product.SecondaryUnitPrice) { ttlAmount = String.Format("{0:C}/{1:C}", new Number(fi.Product.UnitPrice * fi.Quantity), new Number(fi.Product.SecondaryUnitPrice * fi.Quantity)); } if (ttlAmount.Length > 13) { ttlAmount = String.Format("{0:C}", new Number(fi.TotalAmount - fi.VoidAmount)); } bool large = ((fi.Quantity != (long)fi.Quantity) && ttlAmount.Length > 9); Show("{0}\n{1:G10} {2}\t{3}", fi.Name, new Number(Math.Round(fi.Quantity - fi.VoidQuantity, 3)), large ? "X" : fi.Unit, ttlAmount); } catch (FormatException fex) { Display.Log.Error("FormatException occured. {0}", fex.Message); } }
public IPrinterResponse Void(IFiscalItem fi) { guiDocument.AddLines(Formatter.FormatVoid(fi)); WriteCurrentLog("Item=" + fi.TotalAmount); return(toResponse); }
public void ShowSale(IFiscalItem fi) { Show(fi); lastItem = fi; ShowItem(fi); }
public void Show(IFiscalItem fi) { bool large = ((fi.Quantity != (long)fi.Quantity) && fi.TotalAmount > 1000000); Show("{0}\n{1:G10} {2}\t{3:C}", fi.Name, new Number(Math.Round(fi.Quantity - fi.VoidQuantity, 3)), large ? "X" : fi.Unit, new Number(fi.TotalAmount - fi.VoidAmount)); }