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(); } }
public static void ZReport(DateTime BD) { Utils.ToCardLog("FClient.ZReport"); FRSSrv.RemoteDataClient FClient = GetFRSClient(); //DateTime BD = AlohainiFile.BDate; if (FClient != null) { FRSSrv.ZReportResponce Res = null; try { Res = FClient.ZReport(AlohainiFile.DepNum, AlohaTSClass.GetTermNum(), BD); } catch (Exception e) { Utils.ToCardLog("Error FClient.ZReport" + e.Message); ZReportAskSaver.SaveZRepFRSAsk(BD); } if (Res != null) { 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.OutData.VoidPayments.Where(a => a.ExternalId == 1 && a.Term == 0).First().Summ; } catch { } try { Res.OutData.Payments.Where(a => a.ExternalId == 1 && a.Term == 0).First().Summ = cash + VCash; } catch { } } //if (iniFile.FRSPrintCheck) { if (Res.OutData.Payments.Count() > 0) { Utils.ToCardLog("FClient.ZReport print"); PrintOnWinPrinter.PrintDoc2(FiscalCheckCreator.GetEndOfSmenaVisual(Res)); } else { PrintOnWinPrinter.PrintDoc2(FiscalCheckCreator.GetZReportVisual(Res)); } } } } FClient.Close(); } else { Utils.ToCardLog("FClient == null"); ZReportAskSaver.SaveZRepFRSAsk(BD); } }