Exemple #1
0
        private byte[] ToTLVArcCloseFs(uint i, Fs.Native.IArchive fsArc, Fs.Native.ArchiveDoc ad)
        {
            byte[] TLV = null;
            //ОТЧЕТ О ЗАКРЫТИИ ФН
            /// ↓
            if (ad.Data is Fs.Native.ArcCloseFs arcCloseFs)
            {
                TLV = GetTLV((short)(ad.TlvTag + 100), GetTLV((short)(ad.TlvTag),
                                                              GetTLV((int)Fw16.Model.TLVTag.FsId, this.FsId),
                                                              GetTLV((int)Fw16.Model.TLVTag.RegId, GetByte(arcCloseFs.RegId)),
                                                              GetTLV((int)Fw16.Model.TLVTag.OwnerTaxId, dictionary.Values.Last()[1018]),
                                                              GetTLV((int)Fw16.Model.TLVTag.FiscalNumber, GetByte(arcCloseFs.Freq.FiscalNumber)),
                                                              GetTLV((int)Fw16.Model.TLVTag.DateTime, GetByte(arcCloseFs.Freq.DT)),
                                                              GetTLV((int)Fw16.Model.TLVTag.FsSignature, GetByte(arcCloseFs.Freq.FiscalSignature, 0)),
                                                              GetTLV((int)Fw16.Model.TLVTag.t1209, dictionary.Values.Last()[1209]),
                                                              GetTLV((int)Fw16.Model.TLVTag.Operator, dictionary.Values.Last()[1021]),
                                                              GetTLV((int)Fw16.Model.TLVTag.OwnerName, dictionary.Values.Last()[1048]),
                                                              GetTLV((int)Fw16.Model.TLVTag.Location, dictionary.Values.Last()[1187]),
                                                              GetTLV((int)Fw16.Model.TLVTag.LocationAddress, dictionary.Values.Last()[1009]),
                                                              GetTLV((int)Fw16.Model.TLVTag.ShiftNumber, GetByte(maxShift)),
                                                              GetAcknowledg(fsArc, i + 1, ad)
                                                              ));
            }

            return(TLV);
        }
Exemple #2
0
 private byte[] ToTLVArcReg(uint i, Fs.Native.IArchive fsArc, Fs.Native.ArchiveDoc ad)
 {
     byte[] TLV = null;
     ///РЕГИСТРАЦИЯ
     /// ↓
     if (ad.Data is Fs.Native.ArcReg reg)
     {
         ///!!!!!
         ///важно обновить информацию о текущей регистрации
         SetCurrentStat(i + 1, dictionary);
         Dictionary <uint, byte[]> dictionaryREG;
         dictionary.TryGetValue(i + 1, out dictionaryREG);
         foreach (var v in dictionaryREG)
         {
             TLV = ByteArrayMerging(TLV, GetTLV((short)v.Key, v.Value));
         }
         if (ad.Acknowledged)
         {
             ByteArrayMerging(TLV, GetAcknowledg(fsArc, i + 1, ad));
         }
         TLV = GetTLV((short)(ad.TlvTag + 100),
                      GetTLV((short)(ad.TlvTag), TLV
                             )
                      );
     }
     return(TLV);
 }
Exemple #3
0
 /// <summary>
 /// получение поддтверждения документа
 /// </summary>
 /// <param name="fsArc">ссылка на объект IArchive</param>
 /// <param name="count">номер документа</param>
 private byte[] GetAcknowledg(Fs.Native.IArchive fsArc, uint count, Fs.Native.ArchiveDoc ad)
 {
     if (ad.Acknowledged)
     {
         fsArc.GetAcknowledge(count, out Fs.Native.ArcAck arcAck);
         return(GetTLV(((short)107),
                       GetTLV(((int)Fw16.Model.TLVTag.OfdTaxId), (this.OfdTaxId)),
                       GetTLV(((int)Fw16.Model.TLVTag.DateTime), GetByte(arcAck.DT)),
                       GetTLV(((int)Fw16.Model.TLVTag.OfdSignature), arcAck.Signature)
                       ));
     }
     else
     {
         return(null);
     }
 }
Exemple #4
0
 private byte[] ToTLVArcReceipt(uint i, Fs.Native.IArchive fsArc, Fs.Native.ArchiveDoc ad)
 {
     byte[] TLV = null;
     if (ad.Data is Fs.Native.ArcReceipt rcpt)     //ЭТО ЧЕК!_! 103
     {
         TLV = GetTLV((short)(ad.TlvTag + 100),
                      GetTLV((int)Fw16.Model.TLVTag.DateTime, GetByte(rcpt.Freq.DT)),
                      GetTLV((int)Fw16.Model.TLVTag.Operation, GetByte((byte)rcpt.Operation)),
                      GetTLV((int)Fw16.Model.TLVTag.Total, GetByte((rcpt.Total))),
                      GetTLV((int)Fw16.Model.TLVTag.FiscalNumber, GetByte((rcpt.Freq.FiscalNumber))),
                      GetTLV((int)Fw16.Model.TLVTag.FsId, this.FsId),
                      GetTLV((int)Fw16.Model.TLVTag.FsSignature, GetByte(rcpt.Freq.FiscalSignature, 0)),
                      GetAcknowledg(fsArc, i + 1, ad)
                      );
     }
     return(TLV);
 }
Exemple #5
0
 private byte[] ToTLVArcReport(uint i, Fs.Native.IArchive fsArc, Fs.Native.ArchiveDoc ad)
 {
     byte[] TLV = null;
     //ОТЧЕТ О СОСТОЯНИИ ФН
     /// ↓
     if (ad.Data is Fs.Native.ArcReport arcReport)
     {
         TLV = GetTLV((short)(ad.TlvTag + 100),
                      GetTLV((int)Fw16.Model.TLVTag.DateTime, GetByte(arcReport.Freq.DT)),
                      GetTLV((int)Fw16.Model.TLVTag.NoAckCounter, GetByte(arcReport.NoAckCounter)),
                      GetTLV((int)Fw16.Model.TLVTag.FirstNoAckDate, GetByte(arcReport.FirstNoAckDate)),
                      GetTLV((int)Fw16.Model.TLVTag.FiscalNumber, GetByte(arcReport.Freq.FiscalNumber)),
                      GetTLV((int)Fw16.Model.TLVTag.FsSignature, GetByte(arcReport.Freq.FiscalSignature, 0)),
                      GetAcknowledg(fsArc, i + 1, ad)
                      );
     }
     return(TLV);
 }
Exemple #6
0
 private byte[] ToTLVArcShift(uint i, Fs.Native.IArchive fsArc, Fs.Native.ArchiveDoc ad)
 {
     byte[] TLV = null;
     ///ОТКРЫТИЕ\ЗАКРЫТИЕ СМЕНЫ
     /// ↓
     if (ad.Data is Fs.Native.ArcShift shift) //Закрытие\откытие смены 102\105
     {
         //добавление 1 в счетчик смен если это открытие смены
         if ((ushort)(ad.TlvTag + 100) == 102)
         {
             maxShift++;
         }
         TLV = GetTLV((short)(ad.TlvTag + 100),
                      GetTLV((int)Fw16.Model.TLVTag.DateTime, GetByte(shift.Freq.DT)),
                      GetTLV((int)Fw16.Model.TLVTag.ShiftNumber, GetByte((uint)shift.Number)),
                      GetTLV((int)Fw16.Model.TLVTag.FiscalNumber, GetByte(shift.Freq.FiscalNumber)),
                      GetTLV((int)Fw16.Model.TLVTag.FsSignature, GetByte(shift.Freq.FiscalSignature, 0)),
                      GetAcknowledg(fsArc, i + 1, ad)
                      );
     }
     return(TLV);
 }