Exemple #1
0
        private EdiInvoice createInvoiceFrom(EdiSegmentCollection segs)
        {
            const string el       = "~";
            var          lst      = segs.SegmentList;
            var          begin    = lst.Find(s => s.Label == SegmentLabel.InvoiceBegin);
            var          beginEls = begin.GetElements(el);
            var          groupSeg = lst.Find(s => s.Label == SegmentLabel.GroupLabel);
            var          salesSeg = lst.Find(s => s.Label == SegmentLabel.TDS);
            var          taxSeg   = lst.Find(s => s.Label == SegmentLabel.TXI);
            var          inv      = new EdiInvoice();

            inv.InvoiceDate   = beginEls[1].DateFromEDIDate();
            inv.InvoiceNumber = beginEls[2];
            inv.SentDate      = groupSeg.GetElements("~")[4].DateFromEDIDate();
            inv.Sales         = decimal.Parse(salesSeg.GetElements(el)[1]) / 100;
            inv.Tax           = decimal.Parse(taxSeg.GetElements(el)[2]);
            return(inv);
        }
 private EdiInvoice createInvoiceFrom(EdiSegmentCollection segs)
 {
     const string el = "~";
     var lst = segs.SegmentList;
     var begin = lst.Find(s => s.Label == SegmentLabel.InvoiceBegin);
     var beginEls = begin.GetElements(el);
     var groupSeg = lst.Find(s => s.Label == SegmentLabel.GroupLabel);
     var salesSeg = lst.Find(s => s.Label  == SegmentLabel.TDS);
     var taxSeg = lst.Find(s => s.Label  == SegmentLabel.TXI);
     var inv = new EdiInvoice();
     inv.InvoiceDate = beginEls[1].DateFromEDIDate();
     inv.InvoiceNumber = beginEls[2];
     inv.SentDate = groupSeg.GetElements("~")[4].DateFromEDIDate();
     inv.Sales = decimal.Parse(salesSeg.GetElements(el)[1]) / 100;
     inv.Tax = decimal.Parse(taxSeg.GetElements(el)[2]);
     return inv;
 }