Пример #1
0
 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();
     }
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
        public static void ReprintFChk(Guid CheckId)
        {
            try
            {
                FRSSrv.RemoteDataClient FClient = GetFRSClient();
                if (FClient != null)
                {
                    FRSSrv.AddCheckResponce Resp = FClient.PrintCheck(CheckId);

                    if (Resp.Check.Sucсess)
                    {
                        Utils.ToCardLog("ReprintFChk ExtNum " + Resp.Check.ExtNum + " ReprintFChk");
                        //  if (iniFile.FRSPrintCheck)
                        {
                            PrintOnWinPrinter.PrintDoc2(new PrintDocArgs()
                            {
                                FStrs = FiscalCheckCreator.GetFisckalCheckVisual(Resp), QRAsStr = Resp.Check.FROutData.QRAsStr
                            });
                        }
                    }
                    try
                    {
                        if (Resp.ParentCheck != null)
                        {
                            if (Resp.ParentCheck.Sucсess)
                            {
                                Utils.ToCardLog("ReprintFChk Parent ExtNum " + Resp.Check.ExtNum + " ReprintFChk");
                                //  if (iniFile.FRSPrintCheck)
                                {
                                    PrintOnWinPrinter.PrintDoc2(new PrintDocArgs()
                                    {
                                        FStrs = FiscalCheckCreator.GetFisckalCheckVisual(Resp, true), QRAsStr = Resp.ParentCheck.FROutData.QRAsStr
                                    });
                                }
                            }
                        }
                    }
                    catch (Exception ee)
                    {
                        Utils.ToCardLog("Error SendChk ParentCheck" + ee.Message);
                    }
                    FClient.Close();
                }
            }
            catch (Exception e)
            {
                Utils.ToCardLog("Error SendChk " + e.Message);
            }
        }
Пример #4
0
        private static FRSSrv.AddCheckResponce SendChk(FRSSrv.FiskalCheck Chk)
        {
            try
            {
                long Mbefore = GC.GetTotalMemory(false);
                Utils.ToCardLog("SendChk memory " + Mbefore);

                FRSSrv.AddCheckResponce Resp    = new AddCheckResponce();
                FRSSrv.RemoteDataClient FClient = GetFRSClient();
                if (FClient != null)
                {
                    FRSSrv.AddCheckRequest Request = new FRSSrv.AddCheckRequest()
                    {
                        Id    = new Guid(),
                        Check = Chk
                    };

                    Resp = FClient.AddCheck(Request);

                    if (Resp.Check.Sucсess)
                    {
                        Utils.ToCardLog("SendChk ExtNum " + Chk.ExtNum + " ClosedSucsees");

                        if ((iniFile.FRSPrintCheck) && (!Resp.Check.WrongChk))
                        {
                            PrintOnWinPrinter.PrintDoc2(new PrintDocArgs()
                            {
                                FStrs = FiscalCheckCreator.GetFisckalCheckVisual(Resp), QRAsStr = Resp.Check.FROutData.QRAsStr
                            });
                        }
                    }
                    FClient.InnerChannel.Close();
                    FClient.InnerChannel.Dispose();
                    FClient.Close();
                    long MAfter = GC.GetTotalMemory(false);
                    Utils.ToCardLog("SendChk memory " + MAfter);
                }
                return(Resp);
            }
            catch (Exception e)
            {
                Utils.ToCardLog("Error SendChk " + e.Message);
                return(null);
            }



            //System.Windows.Forms.MessageBox.Show(Resp.Check.FD+" "+Resp.Check.FP);
        }