public static void XReport() { FRSSrv.RemoteDataClient FClient = GetFRSClient(); if (FClient != null) { FRSSrv.XReportResponce res = FClient.XReport(AlohainiFile.BDate, AlohainiFile.DepNum, AlohaTSClass.GetTermNum()); if (res.Result) { if (iniFile.XFromGes) { decimal cash = 0; decimal card = 0; GesData.GetGesData(AlohainiFile.BDate, AlohainiFile.DepNum, out cash, out card); decimal VCash = 0; try { VCash = res.VoidPayments.Where(a => a.ExternalId == 1 && a.Term == 0).First().Summ; } catch { } try { res.Payments.Where(a => a.ExternalId == 1 && a.Term == 0).First().Summ = cash + VCash; } catch { } } //if (iniFile.FRSPrintCheck) { PrintOnWinPrinter.PrintDoc2(FiscalCheckCreator.GetXReportVisual(res)); } } FClient.Close(); } }
internal static List <FiscalCheckVisualString> GetXReportVisual(FRSSrv.XReportResponce XRepData) { if (XRepData == null) { XRepData = new FRSSrv.XReportResponce(); } List <FiscalCheckVisualString> Res = new List <FiscalCheckVisualString>(); Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString(AlohainiFile.UNITNAME)); Res.Add(new FiscalCheckVisualString(AlohainiFile.ADDRESS1)); Res.Add(new FiscalCheckVisualString(AlohainiFile.ADDRESS2)); Res.Add(new FiscalCheckVisualString("Смена ", DateTime.Now.ToString("dd.MM.yy HH:mm:ss"))); Res.Add(new FiscalCheckVisualString("Отчет без гашения", "ДБ: " + XRepData.BUsinessDate.ToString("dd.MM.yy"))); Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString(" ")); if (XRepData.Payments == null) { XRepData.Payments = (new List <FRSSrv.XRepFiskalPayment>()).ToArray(); } if (XRepData.Payments.Where(a => a.Term > 0).Select(a => a.Term).Distinct().Count() > 1) { foreach (int Trm in XRepData.Payments.Where(a => a.Term > 0).Select(a => a.Term).Distinct().OrderBy(b => b)) { Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString("Касса №" + Trm.ToString())); Res.Add(new FiscalCheckVisualString(" ")); Res.AddRange(GetXReportVisualPaymentsTerm(XRepData.Payments.Where(a => a.Term == Trm).ToArray(), XRepData.VoidPayments.Where(a => a.Term == Trm).ToArray())); } Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString("По всем кассам")); } Res.AddRange(GetXReportVisualPaymentsTerm(XRepData.Payments.Where(a => a.Term == 0).ToArray(), XRepData.VoidPayments.Where(a => a.Term == 0).ToArray())); Res.Add(new FiscalCheckVisualString(" ")); Res.Add(new FiscalCheckVisualString(" ")); return(Res); }