private Receipt FormatTransactionCountReport(List <DailyCountModel> ReportData, DateTime When, String Period, String ByWhat) { Receipt Rpt = new Receipt(); Rpt.AddCentered("Transaction Count Report"); Rpt.AddCentered("For " + Period + " Ending " + When.ToShortDateString()); Rpt.Add(""); Rpt.Add(ByWhat); foreach (DailyCountModel DC in ReportData) { Rpt.Add(CountLineFormat(DC.Level, DC.EntityName, DC.TotalCount)); } return(Rpt); }
Receipt ITransactionService.FormatCloseBatch(DateTime LocalTime) { Receipt aRep = new Receipt(); // format the date & time line String TransactionDate; String TransactionTime; if (LocalTime != null) { TransactionDate = LocalTime.ToShortDateString(); TransactionTime = LocalTime.ToShortTimeString(); aRep.JustifyBoth(TransactionDate, TransactionTime); //aRep.AddCentered("System time: " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString()); } else { TransactionDate = DateTime.Now.ToShortDateString(); TransactionTime = DateTime.Now.ToShortTimeString(); aRep.JustifyBoth(TransactionDate, TransactionTime); } // format the transaction type aRep.Add(""); aRep.AddCentered("Close Batch");//Utils.getMappedMessage("Activate")); return(aRep); }
Receipt ITransactionService.FormatDetailReport(DetailReportInformation ReportInfo) { Receipt aRep = new Receipt(); // format the date & time line String TransactionDate; String TransactionTime; if (ReportInfo.LocalTime != null) { TransactionDate = ReportInfo.LocalTime.ToShortDateString(); TransactionTime = ReportInfo.LocalTime.ToShortTimeString(); aRep.JustifyBoth(TransactionDate, TransactionTime); //aRep.AddCentered("System time: " + ReportInfo.When.ToShortDateString() + " " + ReportInfo.When.ToShortTimeString()); } else { TransactionDate = ReportInfo.When.ToShortDateString(); TransactionTime = ReportInfo.When.ToShortTimeString(); aRep.JustifyBoth(TransactionDate, TransactionTime); } // format the transaction type aRep.Add(""); aRep.AddCentered("Detail Report");//Utils.getMappedMessage("Activate")); int linelen = ("cardActivations" + " - " + ReportInfo.SummaryInformation.GiftActivationAmount.ToString()).Length + 9; aRep.Add(""); aRep.Add(String.Format( "{0,5} {1,5} {2,4} {3,10} {4, 10} {5,8}", " ID ", "Clerk", "Type", "Card Num", "Inv#", "Amount")); aRep.Add("--------------------------------------------------"); foreach (TransactionDetailInformation TDI in ReportInfo.Details) { aRep.Add(String.Format( "{0,5} {1,4} {2,4} ******{3,4} {4, 10} {5,8:C}", TDI.ID, TDI.Clerk, TDI.TransType, TDI.CardNumber, TDI.InvoiceNumber, TDI.Amount)); //aRep.Add(transactionnumber + Clerk + transactionType + cardnumber + amount); if (TDI.TransType == "LEVT") { aRep.Add(TDI.Text); } } aRep.Add(" "); FormatSummarySection(aRep, ReportInfo.SummaryInformation); return(aRep); }
Receipt ITransactionService.FormatDailyReport(DailySalesInformation ReportInfo) { Receipt aRep = new Receipt(); // format the date & time line String TransactionDate = ReportInfo.When.ToShortDateString(); String TransactionTime = ReportInfo.When.ToShortTimeString(); aRep.JustifyBoth(TransactionDate, TransactionTime); // format the transaction type aRep.Add(""); aRep.AddCentered("Daily Sales Report");//Utils.getMappedMessage("Activate")); aRep.Add(" "); FormatSummarySection(aRep, ReportInfo); return(aRep); }
// F o r m a t L o y a l t y R e c e i p t Receipt ITransactionService.FormatLoyaltyReceipt(ReceiptInformation RecInfo) { Merchant Merch; Receipt aRec = new Receipt(); using (GiftEntities GiftEntity = new GiftEntities()) { IMerchantDAO MerchantData = new MerchantDAO(GiftEntity); Merch = MerchantData.GetMerchant(RecInfo.MerchantID); // format the header lines aRec.AddCentered(Merch.ReceiptHeaderLine1); aRec.AddCentered(Merch.ReceiptHeaderLine2); aRec.AddCentered(Merch.ReceiptHeaderLine3); aRec.AddCentered(Merch.ReceiptHeaderLine4); aRec.AddCentered(Merch.ReceiptHeaderLine5); // format the date & time line String TransactionDate; String TransactionTime; if (RecInfo.LocalTime != null) { TransactionDate = RecInfo.LocalTime.ToShortDateString(); TransactionTime = RecInfo.LocalTime.ToShortTimeString(); } else { TransactionDate = RecInfo.When.ToShortDateString(); TransactionTime = RecInfo.When.ToShortTimeString(); } aRec.JustifyBoth(TransactionDate, TransactionTime); if (RecInfo.TransactionNumber > 0) { aRec.AddCentered("#: " + RecInfo.TransactionNumber.ToString()); } // format the transaction type aRec.Add(""); aRec.AddCentered(RecInfo.TransactionType);//Utils.getMappedMessage("Activate")); if (RecInfo.ApprovalMessage != null) { if (RecInfo.ApprovalMessage.Length > 0) { aRec.AddCentered(RecInfo.ApprovalMessage); } } aRec.Add(""); if (RecInfo.CardNumber != null) { if (RecInfo.CardNumber.Length > 0) { aRec.AddCentered("Account " + //Utils.getMappedMessage("Account") + " " aRec.GetPrintableCardNumber(RecInfo.CardNumber)); } else { aRec.AddCentered("Phone: " + //Utils.getMappedMessage("Phone:") + " " RecInfo.PhoneNumber); } } else { aRec.AddCentered("Phone: " + //Utils.getMappedMessage("Phone:") + " " RecInfo.PhoneNumber); } // format the amount line if (RecInfo.Amount != null) { aRec.Add(""); aRec.AddCentered("Amount: " + RecInfo.Amount); //Utils.getMappedMessage("Amount") + amount); } if (RecInfo.Description != null) { if (RecInfo.Description.Length > 0) { aRec.Add(""); aRec.AddCentered(RecInfo.Description); } } if (RecInfo.AdditionalMessage != null) { if (RecInfo.AdditionalMessage.Length > 0) { aRec.Add(""); aRec.AddCentered(RecInfo.AdditionalMessage); } } // add the footer lines aRec.Add(""); aRec.Add(Merch.ReceiptFooterLine1); aRec.Add(Merch.ReceiptFooterLine2); } return(aRec); }