示例#1
0
        public void ReadRemittanceAdvice()
        {
            string filename          = "UBL-RemittanceAdvice-2.0-Example.xml";
            RemittanceAdviceType doc = UblDoc <RemittanceAdviceType> .Create(filename);

            Assert.AreEqual("849FBBCE-E081-40B4-906C-94C5FF9D1AC3", (string)doc.RemittanceAdviceLine[0].BillingReference[0].InvoiceDocumentReference.UUID);
            bool areEqual = UblXmlComparer.IsCopyEqual <RemittanceAdviceType>(filename, doc);

            Assert.IsTrue(areEqual, "Written UBL doc differs from original");
        }
示例#2
0
        public static RemittanceAdviceType Create()
        {
            var doc = new RemittanceAdviceType
            {
                UBLVersionID    = "2.0",
                CustomizationID = "urn:oasis:names:specification:ubl:xpath:RemittanceAdvice-2.0:sbs-1.0-draft",
                ProfileID       = "bpid:urn:oasis:names:draft:bpss:ubl-2-sbs-remittance-advice-notification-draft",
                ID            = "6577884",
                CopyIndicator = false,
                UUID          = "84E081CE-F9D1-94C5-40F9-94C5FF9D1AC3",
                IssueDate     = "2005-06-22",
                Note          = new List <TextType>()
                {
                    new TextType
                    {
                        Value = "dummy as sample"
                    }
                },
                TotalDebitAmount = new AmountType
                {
                    currencyID = "GBP",
                    Value      = 107.50M
                },
                TotalCreditAmount = new AmountType
                {
                    currencyID = "GBP",
                    Value      = 0.00M
                },
                TotalPaymentAmount = new AmountType
                {
                    currencyID = "GBP",
                    Value      = 107.50M
                },
                InvoicePeriod = new List <PeriodType>()
                {
                    new PeriodType
                    {
                        StartDate = "2005-06-01",
                        EndDate   = "2005-07-01"
                    }
                },
                AccountingCustomerParty = new CustomerPartyType
                {
                    CustomerAssignedAccountID = "XFB01",
                    SupplierAssignedAccountID = "GT00978567",
                    Party = new PartyType
                    {
                        PartyName = new List <PartyNameType>()
                        {
                            new PartyNameType
                            {
                                Name = "IYT Corporation"
                            }
                        },
                        PostalAddress = new AddressType
                        {
                            StreetName       = "Avon Way",
                            BuildingName     = "Thereabouts",
                            BuildingNumber   = "56A",
                            CityName         = "Bridgtow",
                            PostalZone       = "ZZ99 1ZZ",
                            CountrySubentity = "Avon",
                            AddressLine      = new List <AddressLineType>()
                            {
                                new AddressLineType
                                {
                                    Line = "3rd Floor, Room 5"
                                }
                            },
                            Country = new CountryType
                            {
                                IdentificationCode = "GB"
                            }
                        },
                        PartyTaxScheme = new List <PartyTaxSchemeType>()
                        {
                            new PartyTaxSchemeType
                            {
                                RegistrationName = "Bridgtow District Council",
                                CompanyID        = "12356478",
                                ExemptionReason  = new List <TextType>()
                                {
                                    new TextType
                                    {
                                        Value = "Local Authority"
                                    }
                                },
                                TaxScheme = new TaxSchemeType
                                {
                                    ID          = "UK VAT",
                                    TaxTypeCode = "VAT"
                                }
                            }
                        },
                        Contact = new ContactType
                        {
                            Name           = "Mr Fred Churchill",
                            Telephone      = "0127 2653214",
                            Telefax        = "0127 2653215",
                            ElectronicMail = "*****@*****.**"
                        }
                    }
                },
                AccountingSupplierParty = new SupplierPartyType
                {
                    CustomerAssignedAccountID = "CO001",
                    Party = new PartyType
                    {
                        PartyName = new List <PartyNameType>()
                        {
                            new PartyNameType
                            {
                                Name = "Consortial"
                            }
                        },
                        PostalAddress = new AddressType
                        {
                            StreetName       = "Busy Street",
                            BuildingName     = "Thereabouts",
                            BuildingNumber   = "56A",
                            CityName         = "Farthing",
                            PostalZone       = "AA99 1BB",
                            CountrySubentity = "Heremouthshire",
                            AddressLine      = new List <AddressLineType>()
                            {
                                new AddressLineType
                                {
                                    Line = "The Roundabout"
                                }
                            },
                            Country = new CountryType
                            {
                                IdentificationCode = "GB"
                            }
                        },
                        PartyTaxScheme = new List <PartyTaxSchemeType>()
                        {
                            new PartyTaxSchemeType
                            {
                                RegistrationName = "Farthing Purchasing Consortium",
                                CompanyID        = "175 269 2355",
                                ExemptionReason  = new List <TextType>()
                                {
                                    new TextType
                                    {
                                        Value = "N/A"
                                    }
                                },
                                TaxScheme = new TaxSchemeType
                                {
                                    ID          = "VAT",
                                    TaxTypeCode = "VAT"
                                }
                            }
                        },
                        Contact = new ContactType
                        {
                            Name           = "Mrs Bouquet",
                            Telephone      = "0158 1233714",
                            Telefax        = "0158 1233856",
                            ElectronicMail = "*****@*****.**"
                        }
                    }
                },
                PayeeParty = new PartyType
                {
                    PartyName = new List <PartyNameType>()
                    {
                        new PartyNameType
                        {
                            Name = "Consortial"
                        }
                    },
                    PostalAddress = new AddressType
                    {
                        StreetName       = "Busy Street",
                        BuildingName     = "Thereabouts",
                        BuildingNumber   = "56A",
                        CityName         = "Farthing",
                        PostalZone       = "AA99 1BB",
                        CountrySubentity = "Heremouthshire",
                        AddressLine      = new List <AddressLineType>()
                        {
                            new AddressLineType
                            {
                                Line = "The Roundabout"
                            }
                        },
                        Country = new CountryType
                        {
                            IdentificationCode = "GB"
                        }
                    },
                    PartyTaxScheme = new List <PartyTaxSchemeType>()
                    {
                        new PartyTaxSchemeType
                        {
                            RegistrationName = "Farthing Purchasing Consortium",
                            CompanyID        = "175 269 2355",
                            ExemptionReason  = new List <TextType>()
                            {
                                new TextType
                                {
                                    Value = "N/A"
                                }
                            },
                            TaxScheme = new TaxSchemeType
                            {
                                ID          = "VAT",
                                TaxTypeCode = "VAT"
                            }
                        }
                    },
                    Contact = new ContactType
                    {
                        Name           = "Mrs Bouquet",
                        Telephone      = "0158 1233714",
                        Telefax        = "0158 1233856",
                        ElectronicMail = "*****@*****.**"
                    }
                },
                PaymentMeans = new PaymentMeansType
                {
                    PaymentMeansCode      = "20",
                    PaymentDueDate        = "2005-07-21",
                    PayeeFinancialAccount = new FinancialAccountType
                    {
                        ID                         = "12345678",
                        Name                       = "Farthing Purchasing Consortium",
                        AccountTypeCode            = "Current",
                        CurrencyCode               = "GBP",
                        FinancialInstitutionBranch = new BranchType
                        {
                            ID   = "10-26-58",
                            Name = "Open Bank Ltd, Bridgstow Branch ",
                            FinancialInstitution = new FinancialInstitutionType
                            {
                                ID      = "10-26-58",
                                Name    = "Open Bank Ltd",
                                Address = new AddressType
                                {
                                    StreetName       = "City Road",
                                    BuildingName     = "Banking House",
                                    BuildingNumber   = "12",
                                    CityName         = "London",
                                    PostalZone       = "AQ1 6TH",
                                    CountrySubentity = @"London
",
                                    AddressLine      = new List <AddressLineType>()
                                    {
                                        new AddressLineType
                                        {
                                            Line = "5th Floor"
                                        }
                                    },
                                    Country = new CountryType
                                    {
                                        IdentificationCode = "GB"
                                    }
                                }
                            },
                            Address = new AddressType
                            {
                                StreetName       = "Busy Street",
                                BuildingName     = "The Mall",
                                BuildingNumber   = "152",
                                CityName         = "Farthing",
                                PostalZone       = "AA99 1BB",
                                CountrySubentity = "Heremouthshire",
                                AddressLine      = new List <AddressLineType>()
                                {
                                    new AddressLineType
                                    {
                                        Line = "West Wing"
                                    }
                                },
                                Country = new CountryType
                                {
                                    IdentificationCode = "GB"
                                }
                            }
                        },
                        Country = new CountryType
                        {
                            IdentificationCode = "GB"
                        }
                    }
                },
                RemittanceAdviceLine = new List <RemittanceAdviceLineType>()
                {
                    new RemittanceAdviceLineType
                    {
                        ID   = "1",
                        Note = new List <TextType>()
                        {
                            new TextType
                            {
                                Value = "please note that local offices will close for recess for the next three weeks - please send their invoices to central offices for that time"
                            }
                        },
                        DebitLineAmount = new AmountType
                        {
                            currencyID = "GBP",
                            Value      = 107.50M
                        },
                        CreditLineAmount = new AmountType
                        {
                            currencyID = "GBP",
                            Value      = 0.00M
                        },
                        BalanceAmount = new AmountType
                        {
                            currencyID = "GBP",
                            Value      = 107.50M
                        },
                        OriginatorCustomerParty = new CustomerPartyType
                        {
                            Party = new PartyType
                            {
                                PartyName = new List <PartyNameType>()
                                {
                                    new PartyNameType
                                    {
                                        Name = "The Terminus"
                                    }
                                },
                                PostalAddress = new AddressType
                                {
                                    StreetName       = "Avon Way",
                                    BuildingName     = "Thereabouts",
                                    BuildingNumber   = "56A",
                                    CityName         = "Bridgtow",
                                    PostalZone       = "ZZ99 1ZZ",
                                    CountrySubentity = "Avon",
                                    AddressLine      = new List <AddressLineType>()
                                    {
                                        new AddressLineType
                                        {
                                            Line = "3rd Floor, Room 5"
                                        }
                                    },
                                    Country = new CountryType
                                    {
                                        IdentificationCode = "GB"
                                    }
                                },
                                PartyTaxScheme = new List <PartyTaxSchemeType>()
                                {
                                    new PartyTaxSchemeType
                                    {
                                        RegistrationName = "Bridgtow District Council",
                                        CompanyID        = "12356478",
                                        ExemptionReason  = new List <TextType>()
                                        {
                                            new TextType
                                            {
                                                Value = "Local Authority"
                                            }
                                        },
                                        TaxScheme = new TaxSchemeType
                                        {
                                            ID          = "UK VAT",
                                            TaxTypeCode = "VAT"
                                        }
                                    }
                                },
                                Contact = new ContactType
                                {
                                    Name           = "S Massiah",
                                    Telephone      = "0127 98876545",
                                    Telefax        = "0127 98876546",
                                    ElectronicMail = "*****@*****.**"
                                }
                            }
                        },
                        BillingReference = new List <BillingReferenceType>()
                        {
                            new BillingReferenceType
                            {
                                InvoiceDocumentReference = new DocumentReferenceType
                                {
                                    ID        = "A00095678",
                                    UUID      = "849FBBCE-E081-40B4-906C-94C5FF9D1AC3",
                                    IssueDate = "2005-06-21"
                                }
                            }
                        },
                    }
                },
            };

            doc.Xmlns = new System.Xml.Serialization.XmlSerializerNamespaces(new[]
            {
                new XmlQualifiedName("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"),
                new XmlQualifiedName("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"),
            });
            return(doc);
        }