Ejemplo n.º 1
0
 private void CreateStornaPF550(PF550.PaidMode PaidMode = PF550.PaidMode.VoGotovo)
 {
     if (File.Exists(this.TextFile))
     {
         File.Delete(this.TextFile);
     }
     using (StreamWriter streamWriter = new StreamWriter(this.TextFile, false, this.cyrillic))
     {
         streamWriter.Write(" U1,000,1\r\n");
         int num = 0;
         foreach (var current in this.Stavki)
         {
             char ch = Strings.Chr((int)current.VAT);
             if (num % 2 == 0)
             {
                 streamWriter.Write("#1" + current.Name + "\t" + Conversions.ToString(ch) + this.FormatNumber(current.Price, 2) + "*" + this.FormatNumber(current.Quantity, 3) + "\r\n");
             }
             else
             {
                 streamWriter.Write("$1" + current.Name + "\t" + Conversions.ToString(ch) + this.FormatNumber(current.Price, 2) + "*" + this.FormatNumber(current.Quantity, 3) + "\r\n");
             }
             checked { ++num; }
         }
         streamWriter.Write(" 5\t\r\n");
         streamWriter.Write("%V");
         streamWriter.Close();
     }
 }
Ejemplo n.º 2
0
 public void StornaSmetka(PF550.PaidMode PaidType = PF550.PaidMode.VoGotovo)
 {
     if (this.Stavki.Count == 0)
     {
         return;
     }
     this.CreateStornaPF550(PaidType);
     this.Run();
 }
Ejemplo n.º 3
0
        private void CreateFiskalnaPF550(PF550.PaidMode PaidMode = PF550.PaidMode.VoGotovo)
        {
            Encoding encoding = Encoding.GetEncoding("windows-1251");

            if (File.Exists(this.TextFile))
            {
                File.Delete(this.TextFile);
            }
            using (StreamWriter streamWriter = new StreamWriter(this.TextFile, false, encoding))
            {
                streamWriter.Write(" 01,0000,1\r\n");
                int     num1 = 0;
                Decimal num2 = new Decimal();
                foreach (var current in this.Stavki)
                {
                    char ch = Strings.Chr((int)current.VAT);
                    if (num1 % 2 == 0)
                    {
                        streamWriter.Write("#1" + current.Name + "\t" + Conversions.ToString(ch) + this.FormatNumber(current.Price, 0) + "*" + this.FormatNumber(current.Quantity, 3) + "\r\n");
                    }
                    else
                    {
                        streamWriter.Write("$1" + current.Name + "\t" + Conversions.ToString(ch) + this.FormatNumber(current.Price, 0) + "*" + this.FormatNumber(current.Quantity, 3) + "\r\n");
                    }
                    num2 = Decimal.Add(num2, Decimal.Multiply(current.Price, current.Quantity));
                    checked { ++num1; }
                }
                char ch1 = 'P';
                switch (PaidMode)
                {
                case PF550.PaidMode.VoGotovo:
                    ch1 = 'P';
                    break;

                case PF550.PaidMode.SoKarticka:
                    ch1 = 'D';
                    break;

                case PF550.PaidMode.SoKredit:
                    ch1 = 'N';
                    break;
                }
                streamWriter.Write(" 5\t" + Conversions.ToString(ch1) + this.FormatNumber(num2, 2) + "\r\n");
                streamWriter.Write("%8");
                streamWriter.Close();
            }
        }
Ejemplo n.º 4
0
 public void StornaSmetka(List <Article> Stavki, PF550.PaidMode PaidType = PF550.PaidMode.VoGotovo)
 {
     this.Stavki = Stavki;
     this.StornaSmetka(PaidType);
 }