indice-co / EDI.Net

EDI Serializer/Deserializer. Supports EDIFact, X12 and TRADACOMS formats
MIT License
452 stars 169 forks source link

TRADACOMS 9 Invoice #111

Open jwilliamson1098 opened 6 years ago

jwilliamson1098 commented 6 years ago

Hi,

I've produced a TRADACOMS 9 Invoice interchange. I'm wondering what's the best way to share it with the community (given its a dull task doing the mapping!).

    public class Interchange
    {
        [EdiValue("X(14)", Path = "STX/1/0")]
        public string SenderCode { get; set; }

        [EdiValue("X(35)", Path = "STX/1/1")]
        public string SenderName { get; set; }

        [EdiValue("X(6)", Path = "MHD/1/0")]
        public String InvoiceType { get; set; }

        [EdiValue("9(1)", Path = "MHD/1/1")]
        public int InvoiceVersion { get; set; }

        [EdiValue("9(4)", Path = "TYP/0")]
        public string TransactionCode { get; set; }

        [EdiValue("X(12)", Path = "TYP/1")]
        public string TransactionType { get; set; }

        public Invoice9Supplier Supplier { get; set; }

        public Invoice9Customer Customer { get; set; }

        public string CustomerDepotGLN { get; set; }

        public string CustomerDepotCode { get; set; }

        public string CustomerDepot { get; set; }

        public string CustomerDepotAddress { get; set; }

        [EdiValue("X(17)", Path = "ODD/1/0")]
        public string CustomerOrderNo { get; set; }

        [EdiValue("X(17)", Path = "ODD/1/1")]
        public string SupplierOrderNo { get; set; }

        [EdiValue("X(17)", Path = "ODD/2/0")]
        public string DeliveryNoteNumber { get; set; }

        [EdiValue("9(6)", Path = "ODD/2/1", Format = "yyMMdd")]
        public DateTime DeliveryNoteDate { get; set; }

        [EdiValue("X(17)", Path = "CLO/0/1")]
        public string CustomerLocationCode { get; set; }

        [EdiValue("X(17)", Path = "CLO/0/2")]
        public string SupplierCustomerLocationIdentifier { get; set; }

        [EdiValue("X(17)", Path = "IRF/0")]
        public string InvoiceNo { get; set; }

        [EdiValue("9(6)", Path = "IRF/1", Format = "yyMMdd")]
        public DateTime InvoiceDate { get; set; }

        [EdiValue("9(6)", Path = "IRF/2", Format = "yyMMdd")]
        public DateTime TaxDate { get; set; }

        [EdiValue("9(6)", Path = "PYT/3/0", Format = "yyMMdd")]
        public DateTime SettlementDate { get; set; }

        [EdiValue("9(3)V9(3)", Path = "PYT/3/1")]
        public double SettlementPercentage { get; set; }

        public List<Invoice9Line> Invoice9Lines { get; set; }

        }

    [EdiSegment, EdiPath("ILD")]
    public class Invoice9Line
        {

        [EdiValue("9(10)", Path = "ILD/0")]
        public string LineNo1 { get; set; }

        [EdiValue("9(10)", Path = "ILD/1")]
        public string LineNo2 { get; set; }

        public string ProductSupplierGTIN { get; set; }

        [EdiValue("9(13)", Path = "ILD/2/0")]
        public string ProductTradeEAN { get; set; }

        [EdiValue("X(30)", Path = "ILD/2/1")]
        public string ProductSupplierCode { get; set; }

        [EdiValue("9(13)", Path = "ILD/3/0")]
        public string ProductConsumerEAN { get; set; }

        public string ProductGTIN { get; set; }

            public string ProductCustomerGTIN { get; set; }

            public string ProductCustomerCode { get; set; }

        [EdiValue("9(15)", Path = "ILD/5/0")]
        public int UnitSize { get; set; }

        [EdiValue("9(15)", Path = "ILD/6/0")]
        public int Qty { get; set; }

        [EdiValue("9(10)V9(4)", Path = "ILD/7/0")]
        public decimal UnitCost { get; set; }

        [EdiValue("9(10)V9(4)", Path = "ILD/8/0")]
        public decimal LineCost { get; set; }

        [EdiValue("X(1)", Path = "ILD/9/0")]
        public string VATCode { get; set; }

        [EdiValue("9(3)V9(3)", Path = "ILD/10/0")]
        public decimal VATPercentage { get; set; }

        [EdiValue("X(40)", Path = "ILD/13/0")]
        public string ProductDescription { get; set; }

        [EdiValue("X(40)", Path = "ILD/13/1")]
        public string ProductDescription2 { get; set; }
    }

    [EdiSegment, EdiPath("CDT")]
    public class Invoice9Customer
        {
        [EdiValue("9(13)", Path = "CDT/0")]
        public string CustomerGLN { get; set; }

        [EdiValue("X(40)", Path = "CDT/1")]
        public string CustomerName { get; set; }
        }

    [EdiSegment, EdiPath("SDT")]
    public class Invoice9Supplier
    {
        [EdiValue("9(13)", Path = "SDT/0")]
        public string SupplierGLN { get; set; }

        [EdiValue("X(35)", Path = "SDT/1")]
        public string SupplierName { get; set; }

        [EdiValue("X(35)", Path = "SDT/2/0")]
        public string SupplierAddress1 { get; set; }

        [EdiValue("X(35)", Path = "SDT/2/1")]
        public string SupplierAddress2 { get; set; }

        [EdiValue("X(35)", Path = "SDT/2/2")]
        public string SupplierAddress3 { get; set; }

        [EdiValue("X(35)", Path = "SDT/2/3")]
        public string SupplierAddress4 { get; set; }

        [EdiValue("X(8)", Path = "SDT/2/4")]
        public string SupplierPostCode { get; set; }

    }
cleftheris commented 6 years ago

Hi @jwilliamson1098 and thanks for your interest in Edi.Net.

At the moment the best way to share would be make a pull request that adds a test in the test project as well as your model and a sample interchange.

I am planning in the near future to make an additional package that will host complete transactions lake the one you mention. When tha takes place I will move these to that lib and push to nuget.

RDPerera commented 8 months ago

Hi, how did you get those Tradascom specifications?