public void Parse() { var files = WaybillParser.GetFilesForParsing(session, "b2921.dbf", "h2921.dbf"); var mergedFiles = MultifileDocument.Merge(files); Assert.That(mergedFiles.Count, Is.EqualTo(1)); var doc = WaybillParser.Parse(mergedFiles.Single().FileName); Assert.That(doc.ProviderDocumentId, Is.EqualTo("3088745")); Assert.That(doc.DocumentDate, Is.EqualTo(new DateTime(2010, 7, 24))); var line = doc.Lines[0]; Assert.That(line.Code, Is.EqualTo("12947")); Assert.That(line.Product, Is.EqualTo("Метеоспазмил, капс.№20")); Assert.That(line.Producer, Is.EqualTo("Майоли Спиндлер")); Assert.That(line.Country, Is.EqualTo("Франция")); Assert.That(line.Quantity, Is.EqualTo(5)); Assert.That(line.SupplierCostWithoutNDS, Is.EqualTo(179.272)); Assert.That(line.SupplierCost, Is.EqualTo(197.2)); Assert.That(line.Nds, Is.EqualTo(10)); Assert.That(line.SerialNumber, Is.EqualTo("vn4415")); Assert.That(line.Period, Is.EqualTo("01.12.2012")); Assert.That(line.Certificates, Is.EqualTo("РОСС.FR.ФМ08.Д98850")); Assert.That(line.VitallyImportant, Is.False); Assert.That(line.ProducerCostWithoutNDS, Is.EqualTo(179.27)); Assert.That(doc.Lines[1].VitallyImportant, Is.True); Assert.That(doc.Lines[1].RegistryCost, Is.EqualTo(27.88)); Assert.That(doc.Lines[1].SupplierPriceMarkup, Is.EqualTo(16.15)); }
public void Parse_with_znvls() { var files = WaybillParser.GetFilesForParsing(session, @"..\..\Data\Waybills\multifile\h150410_46902_.dbf", @"..\..\Data\Waybills\multifile\b150410_46902_.dbf"); var mergedFiles = MultifileDocument.Merge(files); Assert.That(mergedFiles.Count, Is.EqualTo(1)); parser.Parse(mergedFiles[0].FileName, document); Assert.That(document.ProviderDocumentId, Is.EqualTo("46902")); Assert.That(document.DocumentDate, Is.EqualTo(Convert.ToDateTime("15/04/2010"))); Assert.That(document.Lines.Count, Is.EqualTo(9)); Assert.That(document.Lines[0].Code, Is.EqualTo("2354939")); Assert.That(document.Lines[0].Product, Is.EqualTo("ГЕНТОС N20 ТАБЛ")); Assert.That(document.Lines[0].Country, Is.EqualTo("АВСТРИЯ")); Assert.That(document.Lines[0].Producer, Is.EqualTo("Рихард Биттнер АГ")); Assert.That(document.Lines[0].Quantity, Is.EqualTo(1)); Assert.That(document.Lines[0].ProducerCostWithoutNDS, Is.EqualTo(184.3900)); Assert.That(document.Lines[0].SupplierCost, Is.EqualTo(161.0400)); Assert.That(document.Lines[0].SupplierCostWithoutNDS, Is.EqualTo(146.4)); Assert.That(document.Lines[0].Nds.Value, Is.EqualTo(10)); Assert.That(document.Lines[0].VitallyImportant, Is.Null); Assert.That(document.Lines[0].Period, Is.EqualTo("01.05.2012")); Assert.That(document.Lines[0].Certificates, Is.EqualTo("РОСС AT.ФМ08.Д15648")); Assert.That(document.Lines[0].SerialNumber, Is.EqualTo("8379159")); Assert.That(document.Lines[0].RegistryCost, Is.EqualTo(0.0000)); }
public void Parse() { var files = WaybillParser.GetFilesForParsing(session, @"..\..\Data\Waybills\multifile\h271433.dbf", @"..\..\Data\Waybills\multifile\b271433.dbf"); var mergedFiles = MultifileDocument.Merge(files); Assert.That(mergedFiles.Count, Is.EqualTo(1)); parser.Parse(mergedFiles[0].FileName, document); Assert.That(document.ProviderDocumentId, Is.EqualTo("00000271433/0")); Assert.That(document.DocumentDate, Is.EqualTo(Convert.ToDateTime("26/03/2010"))); Assert.That(document.Lines.Count, Is.EqualTo(6)); Assert.That(document.Lines[0].Code, Is.EqualTo("30042")); Assert.That(document.Lines[0].Product, Is.EqualTo("Зинерит пор. д/приг. р-ра фл. с раствор. 30мл Нидерланды")); Assert.That(document.Lines[0].Country, Is.EqualTo("Нидерланды")); Assert.That(document.Lines[0].Producer, Is.EqualTo("Astellas Pharma Europe B.V.")); Assert.That(document.Lines[0].Quantity, Is.EqualTo(3)); Assert.That(document.Lines[0].ProducerCostWithoutNDS, Is.EqualTo(266.10)); Assert.That(document.Lines[0].SupplierCost, Is.EqualTo(292.71)); Assert.That(document.Lines[0].SupplierCostWithoutNDS, Is.EqualTo(266.10)); Assert.That(document.Lines[0].Nds.Value, Is.EqualTo(10)); Assert.That(document.Lines[0].VitallyImportant, Is.Null); Assert.That(document.Lines[0].Period, Is.EqualTo("01.05.2012")); Assert.That(document.Lines[0].Certificates, Is.EqualTo("РОСС.NL.ФМ09.Д00778")); Assert.That(document.Lines[0].SerialNumber, Is.EqualTo("09E20/02")); }
public void Parse_Schipakin() { var files = WaybillParser.GetFilesForParsing(session, @"..\..\Data\Waybills\multifile\h160410.dbf", @"..\..\Data\Waybills\multifile\b160410.dbf"); var mergedFiles = MultifileDocument.Merge(files); Assert.That(mergedFiles.Count, Is.EqualTo(1)); parser.Parse(mergedFiles[0].FileName, document); Assert.That(document.ProviderDocumentId, Is.EqualTo("Оф000000335")); Assert.That(document.DocumentDate, Is.EqualTo(Convert.ToDateTime("15/04/2010"))); Assert.That(document.Lines.Count, Is.EqualTo(18)); Assert.That(document.Lines[0].Code, Is.EqualTo("429")); Assert.That(document.Lines[0].Product, Is.EqualTo("Гольфы Артемис 70 Дэн черные")); Assert.That(document.Lines[0].Country, Is.EqualTo("КИТАЙ")); Assert.That(document.Lines[0].Producer, Is.EqualTo("Тайвань")); Assert.That(document.Lines[0].Quantity, Is.EqualTo(4)); Assert.That(document.Lines[0].ProducerCostWithoutNDS, Is.EqualTo(50.67)); Assert.That(document.Lines[0].SupplierCost, Is.EqualTo(68.76)); Assert.That(document.Lines[0].SupplierCostWithoutNDS, Is.EqualTo(68.76)); Assert.That(document.Lines[0].Nds.Value, Is.EqualTo(0)); Assert.That(document.Lines[0].VitallyImportant, Is.Null); Assert.That(document.Lines[0].Period, Is.EqualTo("15.10.2010")); Assert.That(document.Lines[0].Certificates, Is.EqualTo("РОСС TW.ИМ25.В02103")); Assert.That(document.Lines[0].SerialNumber, Is.EqualTo("51754406033007352161")); Assert.That(document.Lines[0].RegistryCost, Is.EqualTo(0.0000)); }
public void Check_file_format() { var files = WaybillParser.GetFilesForParsing(session, @"..\..\Data\Waybills\multifile\h271433.dbf", @"..\..\Data\Waybills\multifile\b271433.dbf"); var mergedFiles = MultifileDocument.Merge(files); Assert.That(mergedFiles.Count, Is.EqualTo(1)); Assert.IsFalse(AptekaHoldingParser.CheckFileFormat(Dbf.Load(@"..\..\Data\Waybills\1016416.dbf"))); Assert.IsFalse(AptekaHoldingParser.CheckFileFormat(Dbf.Load(@"..\..\Data\Waybills\1016416_char.DBF"))); Assert.IsFalse(AptekaHoldingParser.CheckFileFormat(Dbf.Load(@"..\..\Data\Waybills\0000470553.dbf"))); Assert.IsFalse(AptekaHoldingParser.CheckFileFormat(Dbf.Load(@"..\..\Data\Waybills\1040150.DBF"))); Assert.IsFalse(AptekaHoldingParser.CheckFileFormat(Dbf.Load(@"..\..\Data\Waybills\8916.dbf"))); Assert.IsFalse(AptekaHoldingParser.CheckFileFormat(Dbf.Load(@"..\..\Data\Waybills\890579.dbf"))); Assert.IsTrue(AptekaHoldingParser.CheckFileFormat(Dbf.Load(mergedFiles[0].FileName))); }