public void Parse_settings()
        {
            var parser = new Inforoom.PriceProcessor.Models.Parser("FarmSet_VoronezhParser", appSupplier);

            parser.Add("DOCNO", "Header_ProviderDocumentId");
            parser.Add("DOCDAT", "Header_DocumentDate");
            parser.Add("CODTOVAR", "Code");
            parser.Add("TOVARNAME", "Product");
            parser.Add("PROIZV", "Producer");
            parser.Add("STRANA", "Country");
            parser.Add("KOLVO", "Quantity");
            parser.Add("NDS", "Nds");
            parser.Add("CENAPOST", "SupplierCostWithoutNDS");
            parser.Add("CENASNDS", "SupplierCost");
            parser.Add("SERIA", "SerialNumber");
            parser.Add("SERT", "Certificates");
            parser.Add("DATAOT", "CertificatesDate");
            parser.Add("DATADO", "CertificatesEndDate");
            parser.Add("ORGAN", "CertificateAuthority");
            parser.Add("SROK", "Period");
            parser.Add("CENAREESTR", "RegistryCost");
            parser.Add("CENAPROIZ", "ProducerCostWithoutNDS");
            parser.Add("PV", "VitallyImportant");
            parser.Add("SHTRIH", "EAN13");
            parser.Add("KODEI", "UnitCode");
            parser.Add("SERTFILE", "CertificateFilename");
            parser.Add("GTD", "BillOfEntryNumber");
            parser.Add("DOC_ID", "OrderId");
            parser.Add("KODSTRANA", "CountryCode");
            session.Save(parser);

            var ids      = new WaybillService().ParseWaybill(new[] { CreateTestLog("Ли081018.dbf").Id });
            var document = session.Load <Document>(ids[0]);

            Assert.That(document.Lines.Count, Is.EqualTo(10));
            Assert.That(document.ProviderDocumentId, Is.EqualTo("ФК002081018"));
            Assert.That(document.DocumentDate, Is.EqualTo(Convert.ToDateTime("08.10.2014")));

            var line = document.Lines[3];

            Assert.That(line.Code, Is.EqualTo("12879"));
            Assert.That(line.BillOfEntryNumber, Is.EqualTo("10130130/090714/0011201/3"));
            Assert.That(line.EAN13, Is.EqualTo(4013054001264));
            Assert.That(line.CountryCode, Is.EqualTo("276"));
            Assert.That(line.UnitCode, Is.EqualTo("778"));
        }
Пример #2
0
        public void Parse_GrandCapitalVrn_settings()
        {
            var parser = new Inforoom.PriceProcessor.Models.Parser("TekoSParser", appSupplier);

            parser.Add("TTN", "Header_ProviderDocumentId");
            parser.Add("TTN_DATE", "Header_DocumentDate");
            parser.Add("NAME_POST", "Product");
            parser.Add("PRZV_POST", "Producer");
            parser.Add("SERIA", "SerialNumber");
            parser.Add("SGODN", "Period");
            parser.Add("SERT", "Certificates");
            parser.Add("PRCENABNDS", "ProducerCostWithoutNDS");
            parser.Add("PCENA_BNDS", "SupplierCostWithoutNDS");
            parser.Add("NDS", "Nds");
            parser.Add("PCENA_NDS", "SupplierCost");
            parser.Add("KOL_TOV", "Quantity");
            parser.Add("SP_PRD_ID", "Code");
            parser.Add("VT", "VitallyImportant");
            parser.Add("P_NDS_AMNT", "NdsAmount");
            parser.Add("P_AMNT", "Amount");
            parser.Add("UNIT", "Unit");
            parser.Add("BLL_NTR_ID", "BillOfEntryNumber");
            parser.Add("BAR_CODE", "EAN13");
            parser.Add("SERT_END", "CertificatesEndDate");
            parser.Add("GR_CENA", "RegistryCost");
            parser.Add("MAN_DATE", "DateOfManufacture");
            parser.Add("PRZV_CNTR", "Country");
            parser.Add("REG_DATE", "RegistryDate");
            parser.Add("SERT_AUTH", "CertificateAuthority");
            parser.Add("SERT_DATE", "CertificatesDate");

            parser.Add("I_SEL_ADR", "Invoice_SellerAddress");
            parser.Add("I_SEL_INN", "Invoice_SellerINN");
            parser.Add("I_SEL_KPP", "Invoice_SellerKPP");
            parser.Add("I_RES_NAME", "Invoice_RecipientName");
            parser.Add("I_RES_ID", "Invoice_RecipientId");
            parser.Add("I_BU_ID", "Invoice_BuyerId");
            parser.Add("I_BU_NAME", "Invoice_BuyerName");
            parser.Add("I_BU_INN", "Invoice_BuyerINN");
            parser.Add("I_SEL_NAME", "Invoice_SellerName");
            parser.Add("AMNT", "Invoice_Amount");
            parser.Add("AMNT_N_ALL", "Invoice_NDSAmount");
            parser.Add("I_DEL_D", "Invoice_DelayOfPaymentInDays");
            session.Save(parser);

            var ids      = new WaybillService().ParseWaybill(new[] { CreateTestLog("6-000486_00660.dbf").Id });
            var document = session.Load <Document>(ids[0]);
            var invoice  = document.Invoice;

            Assert.That(invoice.SellerName, Is.EqualTo("\"ФК Гранд Капитал ВОРОНЕЖ\""));
            Assert.That(invoice.Amount, Is.EqualTo(14236.3));
            Assert.That(invoice.AmountWithoutNDS0, Is.EqualTo(0));
            Assert.That(invoice.AmountWithoutNDS10, Is.EqualTo(12867));
            Assert.That(invoice.AmountWithoutNDS18, Is.EqualTo(70));
            Assert.That(invoice.AmountWithoutNDS, Is.EqualTo(12937));
            Assert.That(invoice.NDSAmount10, Is.EqualTo(1286.7));
            Assert.That(invoice.NDSAmount18, Is.EqualTo(12.6));
            Assert.That(invoice.NDSAmount, Is.EqualTo(1299.3));
            Assert.That(invoice.DelayOfPaymentInDays, Is.EqualTo(7));

            var line = document.Lines[0];

            Assert.That(line.RegistryCost, Is.EqualTo(0));
            Assert.That(line.DateOfManufacture, Is.EqualTo(new DateTime(2015, 08, 01)));
            Assert.That(line.Country, Is.EqualTo("Россия"));
            Assert.That(line.RegistryDate, Is.Null);
            Assert.That(line.CertificateAuthority, Is.EqualTo("Формат качества"));
            Assert.That(line.CertificatesDate, Is.EqualTo("16.09.2015"));
            Assert.That(line.ExportCode, Is.EqualTo("2-001200"));
        }
        public void PulsBrianskParser_settings()
        {
            var parser = new Inforoom.PriceProcessor.Models.Parser("PulsBrianskParser", appSupplier);

            parser.Add("DOCNO", "Header_ProviderDocumentId");
            parser.Add("DOCDAT", "Header_DocumentDate");
            parser.Add("CODE", "Code");
            parser.Add("GOOD", "Product");
            parser.Add("SERIAL", "SerialNumber");
            parser.Add("DATEB", "Period");
            parser.Add("PRICE", "SupplierCost");
            parser.Add("QUANT", "Quantity");
            parser.Add("SERT", "Certificates");
            parser.Add("DATES", "CertificatesDate");
            parser.Add("SERTWHO", "CertificateAuthority");
            parser.Add("MARGIN", "SupplierPriceMarkup");
            parser.Add("NDS", "Nds");
            parser.Add("REESTR", "RegistryCost");
            parser.Add("ENTERP", "Producer");
            parser.Add("COUNTRY", "Country");
            parser.Add("PRICEWONDS", "SupplierCostWithoutNDS");
            parser.Add("PRICEENT", "ProducerCostWithoutNDS");
            parser.Add("SUMSNDS", "Amount");
            parser.Add("PV", "VitallyImportant");
            parser.Add("orderID", "OrderId");
            parser.Add("BARCODE", "EAN13");
            parser.Add("customerCD", "Invoice_RecipientId");
            parser.Add("customerNM", "Invoice_RecipientAddress");
            session.Save(parser);

            var ids = new WaybillService().ParseWaybill(new[] { CreateTestLog("00004858.dbf").Id });
            var doc = session.Load <Document>(ids[0]);

            Assert.That(doc.ProviderDocumentId, Is.EqualTo("00004858"));
            Assert.That(doc.DocumentDate.Value.ToShortDateString(), Is.EqualTo("10.01.2013"));
            var line = doc.Lines[0];

            Assert.That(line.EAN13, Is.EqualTo(4607027762292));
            Assert.That(line.Code, Is.EqualTo("14251"));
            Assert.That(line.Product, Is.EqualTo("Амитриптилин табл. 25 мг х50"));
            Assert.That(line.SerialNumber, Is.EqualTo("130912"));
            Assert.That(line.Period, Is.EqualTo("01.10.2015"));
            Assert.That(line.SupplierCost, Is.EqualTo(13.19));
            Assert.That(line.Quantity, Is.EqualTo(10));
            Assert.That(line.Certificates, Is.EqualTo("РОСС RU.ФМ05.Д40352"));
            Assert.That(line.CertificateAuthority, Is.EqualTo("ООО \"ОЦС\" г. Екатеринбург"));
            Assert.That(line.CertificatesDate, Is.EqualTo("05.10.2012"));
            Assert.That(line.SupplierPriceMarkup, Is.EqualTo(4.72));
            Assert.That(line.Nds, Is.EqualTo(10));
            Assert.That(line.RegistryCost, Is.EqualTo(43.01));
            Assert.That(line.Producer, Is.EqualTo("Озон"));
            Assert.That(line.Country, Is.EqualTo("Россия"));
            Assert.That(line.SupplierCostWithoutNDS, Is.EqualTo(11.99));
            Assert.That(line.ProducerCostWithoutNDS, Is.EqualTo(11.45));
            Assert.That(line.NdsAmount, Is.EqualTo(12m));
            Assert.That(line.Amount, Is.EqualTo(131.89));
            Assert.That(line.OrderId, Is.EqualTo(37468018));
            Assert.That(line.VitallyImportant, Is.EqualTo(true));
            Assert.That(doc.Invoice.RecipientId, Is.EqualTo(13505));
            Assert.That(doc.Invoice.RecipientAddress, Is.EqualTo("307340, Курская обл., Рыльский р-н, с. Ивановское, ул. Ананьева, д. 1б"));
        }
        public void Parse_settings()
        {
            var parser = new Inforoom.PriceProcessor.Models.Parser("ASTIFarmacevtika12799Parser", appSupplier);

            parser.Add("NOMDOC", "Header_ProviderDocumentId");
            parser.Add("DATDOC", "Header_DocumentDate");
            parser.Add("TO", "Invoice_BuyerAddress");
            parser.Add("CodeTov", "Code");
            parser.Add("TovName", "Product");
            parser.Add("PrName", "Producer");
            parser.Add("PrStrana", "Country");
            parser.Add("EdIzm", "Unit");
            parser.Add("Kol", "Quantity");
            parser.Add("CwoNDS", "SupplierCostWithoutNDS");
            parser.Add("CwNDS", "SupplierCost");
            parser.Add("CPwoNDS", "ProducerCostWithoutNDS");
            parser.Add("CPwNDS", "ProducerCost");
            parser.Add("StNDS", "Nds");
            parser.Add("SumNDS", "NdsAmount");
            parser.Add("Vsego", "Amount");
            parser.Add("SrokGodn", "Period");
            parser.Add("Seriya", "SerialNumber");
            parser.Add("GTD", "BillOfEntryNumber");
            parser.Add("SertNom", "Certificates");
            parser.Add("SertData", "CertificatesDate");
            parser.Add("SertOrg", "CertificateAuthority");
            parser.Add("Proc", "SupplierPriceMarkup");
            parser.Add("Creestr", "RegistryCost");
            parser.Add("GN2", "VitallyImportant");
            parser.Add("EAN", "EAN13");
            session.Save(parser);

            var ids      = new WaybillService().ParseWaybill(new[] { CreateTestLog("61487.dbf").Id });
            var document = session.Load <Document>(ids[0]);

            Assert.That(document.Lines.Count, Is.EqualTo(36));
            Assert.That(document.ProviderDocumentId, Is.EqualTo(" 61487"));             // Откуда пробел?
            Assert.That(document.DocumentDate.Value.ToShortDateString(), Is.EqualTo("02.05.2012"));

            var invoice = document.Invoice;

            Assert.That(invoice, Is.Not.Null);
            Assert.That(invoice.BuyerAddress, Is.EqualTo(null));

            var line = document.Lines[0];

            Assert.That(line.Code, Is.EqualTo("1Y2Z-34"));
            Assert.That(line.Product, Is.EqualTo("Атровент Н аэрозоль 200 доз 10мл"));
            Assert.That(line.Producer, Is.EqualTo("BOEHRINGER INGELHEIM"));
            Assert.That(line.Country, Is.EqualTo("Германия"));
            Assert.That(line.Unit, Is.EqualTo("уп."));
            Assert.That(line.Quantity, Is.EqualTo(2));
            Assert.That(line.SupplierCostWithoutNDS, Is.EqualTo(273.45));
            Assert.That(line.SupplierCost, Is.EqualTo(300.80));
            Assert.That(line.ProducerCostWithoutNDS, Is.EqualTo(282.55));
            Assert.That(line.ProducerCost, Is.EqualTo(310.81));
            Assert.That(line.Nds, Is.EqualTo(10));

            Assert.That(line.NdsAmount, Is.EqualTo(54.69));
            Assert.That(line.Amount, Is.EqualTo(601.59));
            Assert.That(line.Period, Is.EqualTo("31.08.2014"));
            Assert.That(line.SerialNumber, Is.EqualTo("106177"));
            Assert.That(line.BillOfEntryNumber, Is.EqualTo("10130130/281111/0026488/18"));
            Assert.That(line.Certificates, Is.EqualTo("РОСС DE.ФМ08.Д52854"));
            Assert.That(line.CertificatesDate, Is.EqualTo("31.08.2014"));
            Assert.That(line.CertificateAuthority, Is.EqualTo("ООО\"Окружной центр контроля и качества\""));

            Assert.That(line.VitallyImportant, Is.EqualTo(true));
            Assert.That(line.EAN13, Is.EqualTo(9006968003115));

            Assert.That(line.SupplierPriceMarkup, Is.EqualTo(-3.33));
            Assert.That(line.RegistryCost, Is.EqualTo(283.27));
        }
        public void Parse_Roton_settings()
        {
            var parser = new Inforoom.PriceProcessor.Models.Parser("PulsRyazanParser", appSupplier);

            parser.Add("NUM_DOC", "Header_ProviderDocumentId");
            parser.Add("DATE_DOC", "Header_DocumentDate");
            parser.Add("NUM_SF", "Invoice_InvoiceNumber");
            parser.Add("DATE_SF", "Invoice_InvoiceDate");
            parser.Add("ORG", "Invoice_ShipperInfo");
            parser.Add("POLUCH", "Invoice_BuyerName");
            parser.Add("CODE_TOVAR", "Code");
            parser.Add("NAME_TOVAR", "Product");
            parser.Add("PROIZ", "Producer");
            parser.Add("COUNTRY", "Country");
            parser.Add("PR_PROIZ", "ProducerCostWithoutNDS");
            parser.Add("PRICE_NDS", "SupplierCost");
            parser.Add("PRICE", "SupplierCostWithoutNDS");
            parser.Add("VOLUME", "Quantity");
            parser.Add("SUMMA", "Amount");
            parser.Add("SROK", "Period");
            parser.Add("GTD", "BillOfEntryNumber");
            parser.Add("PCT_NDS", "Nds");
            parser.Add("SUMMA_NDS", "NdsAmount");
            parser.Add("SERIA", "SerialNumber");
            parser.Add("PRICE_RR", "RegistryCost");
            parser.Add("JNVLS", "VitallyImportant");
            parser.Add("CER_NUMBER", "Certificates");
            parser.Add("SERT_ORG", "CertificateAuthority");
            parser.Add("EAN13", "EAN13");
            session.Save(parser);

            var ids      = new WaybillService().ParseWaybill(new[] { CreateTestLog("40308608_Ротон(9687).DBF").Id });
            var document = session.Load <Document>(ids[0]);
            var line     = document.Lines[0];

            Assert.That(line.Code, Is.EqualTo("986"));
            Assert.That(line.Amount, Is.EqualTo(801));
            Assert.That(line.Certificates, Is.EqualTo("РОСС RU.АЯ46Д70664"));
            Assert.That(line.Product, Is.EqualTo("Т-1442  Бандаж противогрыжевый при вентральных грыжах р. 7-ХXL (Тривес)"));
        }
Пример #6
0
        public void Parse_settings()
        {
            var parser = new Inforoom.PriceProcessor.Models.Parser("PulsFK3996Parser", appSupplier);

            parser.Add("DocName", "Header_ProviderDocumentId");
            parser.Add("DateDoc", "Header_DocumentDate");
            parser.Add("Vendor", "Invoice_ShipperInfo");
            parser.Add("Code", "Code");
            parser.Add("Good", "Product");
            parser.Add("Enterp", "Producer");
            parser.Add("Country", "Country");
            parser.Add("Price", "SupplierCost");
            parser.Add("Quant", "Quantity");
            parser.Add("Priceent", "ProducerCostWithoutNDS");
            parser.Add("PRDWNDS", "ProducerCost");
            parser.Add("DateB", "Period");
            parser.Add("Sert", "Certificates");
            parser.Add("NDS", "Nds");
            parser.Add("Reestr", "RegistryCost");
            parser.Add("ZNVLS", "VitallyImportant");
            parser.Add("Serial", "SerialNumber");
            parser.Add("SertWho", "CertificateAuthority");
            parser.Add("ProdSBar", "EAN13");
            parser.Add("PriceWONDS", "SupplierCostWithoutNDS");
            parser.Add("GTD", "BillOfEntryNumber");
            parser.Add("SUMSNDS", "Amount");
            parser.Add("SUMNDS", "NdsAmount");
            session.Save(parser);

            var ids = new WaybillService().ParseWaybill(new[] { CreateTestLog("00627149.dbf").Id });
            var doc = session.Load <Document>(ids[0]);
            var now = DateTime.Now;

            Assert.That(doc.ProviderDocumentId, Is.EqualTo("00627149"));
            Assert.That(doc.DocumentDate.Value.ToShortDateString(), Is.EqualTo("13.08.2012"));
            Assert.That(doc.Invoice.ShipperInfo, Is.EqualTo("ООО ФК ПУЛЬС"));
            Assert.That(doc.Lines.Count, Is.EqualTo(18));
            var line = doc.Lines[0];

            Assert.That(line.Code, Is.EqualTo("05583"));
            Assert.That(line.Product, Is.EqualTo("Ампициллина т/г табл. 250 мг х20"));
            Assert.That(line.SerialNumber, Is.EqualTo("430612"));
            Assert.That(line.Period, Is.EqualTo("01.07.2015"));
            Assert.That(line.SupplierCost, Is.EqualTo(9.46));
            Assert.That(line.Quantity, Is.EqualTo(10));
            Assert.That(line.Certificates, Is.EqualTo("РОСС BY.ФМ05.Д87322"));
            Assert.That(line.CertificateAuthority, Is.EqualTo("ООО \"ОЦС\" г. Екатеринбург"));
            Assert.That(line.Nds, Is.EqualTo(10));
            Assert.That(line.RegistryCost, Is.EqualTo(14.23));
            Assert.That(line.Producer, Is.EqualTo("Белмедпрепараты"));
            Assert.That(line.Country, Is.EqualTo("БЕЛАРУСЬ"));
            Assert.That(line.SupplierCostWithoutNDS, Is.EqualTo(8.6));
            Assert.That(line.ProducerCostWithoutNDS, Is.EqualTo(8.8));
            Assert.That(line.BillOfEntryNumber, Is.Null);
            Assert.That(line.VitallyImportant, Is.True);
            Assert.That(line.ProducerCost, Is.EqualTo(9.68));
            Assert.That(line.EAN13, Is.EqualTo(4810133000169));
            Assert.That(line.Amount, Is.EqualTo(94.6));
            Assert.That(line.NdsAmount, Is.EqualTo(8.6));
        }