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

            Assert.AreEqual("56A", doc.Delivery[0].DeliveryAddress.BuildingNumber.Value);
            bool areEqual = UblXmlComparer.IsCopyEqual <RequestForQuotationType>(filename, doc);

            Assert.IsTrue(areEqual, "Written UBL doc differs from original");
        }
        public static RequestForQuotationType Create()
        {
            var doc = new RequestForQuotationType
            {
                UBLVersionID    = "2.0",
                CustomizationID = "urn:oasis:names:specification:ubl:xpath:RequestForQuotation-2.0:sbs-1.0-draft",
                ProfileID       = "bpid:urn:oasis:names:draft:bpss:ubl-2-sbs-request-for-quotation-draft",
                ID            = "G867B",
                CopyIndicator = false,
                UUID          = "8D076867-AE6D-439F-8281-5AAFC7F4E3B1",
                IssueDate     = "2005-06-19",
                IssueTime     = "11:32:26.0Z",
                Note          = new TextType[]
                {
                    new TextType
                    {
                        Value = "sample"
                    }
                },
                CatalogueDocumentReference = new DocumentReferenceType
                {
                    ID        = "2005-9A",
                    IssueDate = "2005-11-03"
                },
                OriginatorCustomerParty = new CustomerPartyType
                {
                    Party = new PartyType
                    {
                        PartyName = new 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 AddressLineType[]
                            {
                                new AddressLineType
                                {
                                    Line = "3rd Floor, Room 5"
                                }
                            },
                            Country = new CountryType
                            {
                                IdentificationCode = "GB"
                            }
                        },
                        PartyTaxScheme = new PartyTaxSchemeType[]
                        {
                            new PartyTaxSchemeType
                            {
                                RegistrationName = "Bridgtow District Council",
                                CompanyID        = "12356478",
                                ExemptionReason  = new 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 = "*****@*****.**"
                        }
                    }
                },
                SellerSupplierParty = new SupplierPartyType
                {
                    CustomerAssignedAccountID = "CO001",
                    Party = new PartyType
                    {
                        PartyName = new PartyNameType[]
                        {
                            new PartyNameType
                            {
                                Name = "Consortial"
                            }
                        },
                        PostalAddress = new AddressType
                        {
                            StreetName       = "Busy Street",
                            BuildingName     = "Thereabouts",
                            BuildingNumber   = "56A",
                            CityName         = "Farthing",
                            PostalZone       = "AA99 1BB",
                            CountrySubentity = "Heremouthshire",
                            AddressLine      = new AddressLineType[]
                            {
                                new AddressLineType
                                {
                                    Line = "The Roundabout"
                                }
                            },
                            Country = new CountryType
                            {
                                IdentificationCode = "GB"
                            }
                        },
                        PartyTaxScheme = new PartyTaxSchemeType[]
                        {
                            new PartyTaxSchemeType
                            {
                                RegistrationName = "Farthing Purchasing Consortium",
                                CompanyID        = "175 269 2355",
                                ExemptionReason  = new 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 = "*****@*****.**"
                        }
                    }
                },
                Delivery = new DeliveryType[]
                {
                    new DeliveryType
                    {
                        DeliveryAddress = new AddressType
                        {
                            StreetName       = "Avon Way",
                            BuildingName     = "Thereabouts",
                            BuildingNumber   = "56A",
                            CityName         = "Bridgtow",
                            PostalZone       = "ZZ99 1ZZ",
                            CountrySubentity = "Avon",
                            AddressLine      = new AddressLineType[]
                            {
                                new AddressLineType
                                {
                                    Line = "3rd Floor, Room 5"
                                }
                            },
                            Country = new CountryType
                            {
                                IdentificationCode = "GB"
                            }
                        },
                        RequestedDeliveryPeriod = new PeriodType
                        {
                            StartDate = "2005-06-29",
                            StartTime = "09:30:47.0Z",
                            EndDate   = "2005-06-29",
                            EndTime   = "09:30:47.0Z"
                        }
                    }
                },
                DeliveryTerms = new DeliveryTermsType[]
                {
                    new DeliveryTermsType
                    {
                        SpecialTerms = new TextType[]
                        {
                            new TextType
                            {
                                Value = "1% deduction for late delivery as per contract"
                            }
                        }
                    }
                },
                DestinationCountry = new CountryType
                {
                    IdentificationCode = "GB",
                    Name = "Great Britain"
                },
                Contract = new ContractType[]
                {
                    new ContractType
                    {
                        ContractDocumentReference = new DocumentReferenceType[]
                        {
                            new DocumentReferenceType
                            {
                                ID        = "GHJ76849",
                                IssueDate = "2002-08-13"
                            }
                        }
                    }
                },
                RequestForQuotationLine = new RequestForQuotationLineType[]
                {
                    new RequestForQuotationLineType
                    {
                        ID   = "1",
                        Note = new TextType[]
                        {
                            new TextType
                            {
                                Value = "sample"
                            }
                        },
                        LineItem = new LineItemType
                        {
                            ID       = "1",
                            Quantity = new QuantityType
                            {
                                unitCode = "KGM",
                                Value    = 100M
                            },
                            Item = new ItemType
                            {
                                Description = new TextType[]
                                {
                                    new TextType
                                    {
                                        Value = "Acme beeswax"
                                    }
                                },
                                Name = "beeswax",
                                BuyersItemIdentification = new ItemIdentificationType
                                {
                                    ID = "6578489"
                                },
                                SellersItemIdentification = new ItemIdentificationType
                                {
                                    ID = "17589683"
                                }
                            }
                        }
                    }
                }
            };

            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);
        }
        public static RequestForQuotationType Create()
        {
            var doc = new RequestForQuotationType
            {
                UBLVersionID    = "2.1",
                CustomizationID = "OIOUBL-2.1",
                ProfileID       = new IdentifierType
                {
                    schemeAgencyID = "320",
                    schemeID       = "urn:oioubl:id:profileid-1.2",
                    Value          = "Procurement-QuoSim-1.0"
                },
                ID                = "G867B",
                CopyIndicator     = false,
                UUID              = "93T5G3G5-HYA3-7267-BVG3-GS46SW44WG53",
                IssueDate         = "2008-04-19",
                IssueTime         = "11:32:26.0Z",
                SubmissionDueDate = "2008-04-24",
                Note              = new List <TextType>()
                {
                    new TextType
                    {
                        Value = "Bestilling af computere"
                    }
                },
                PricingCurrencyCode     = "DKK",
                OriginatorCustomerParty = new CustomerPartyType
                {
                    Party = new PartyType
                    {
                        EndpointID = new IdentifierType
                        {
                            schemeAgencyID = "9",
                            schemeID       = "GLN",
                            Value          = "5798000416604"
                        },
                        PartyIdentification = new List <PartyIdentificationType>()
                        {
                            new PartyIdentificationType
                            {
                                ID = new IdentifierType
                                {
                                    schemeAgencyID = "9",
                                    schemeID       = "GLN",
                                    Value          = "5798000416604"
                                }
                            }
                        },
                        PartyName = new List <PartyNameType>()
                        {
                            new PartyNameType
                            {
                                Name = "Gentofte Kommune"
                            }
                        },
                        PostalAddress = new AddressType
                        {
                            AddressFormatCode = new CodeType
                            {
                                listAgencyID = "320",
                                listID       = "urn:oioubl:codelist:addressformatcode-1.1",
                                Value        = "StructuredDK"
                            },
                            StreetName     = "Bernstorffsvej",
                            BuildingNumber = "161",
                            CityName       = "Charlottenlund",
                            PostalZone     = "2920",
                            Country        = new CountryType
                            {
                                IdentificationCode = "DK"
                            }
                        },
                        PartyTaxScheme = new List <PartyTaxSchemeType>()
                        {
                            new PartyTaxSchemeType
                            {
                                CompanyID = new IdentifierType
                                {
                                    schemeID = "DK:SE",
                                    Value    = "DK12345678"
                                },
                                TaxScheme = new TaxSchemeType
                                {
                                    ID = new IdentifierType
                                    {
                                        schemeAgencyID = "320",
                                        schemeID       = "urn:oioubl:id:taxschemeid-1.1",
                                        Value          = "63"
                                    },
                                    Name = "Moms"
                                }
                            }
                        },
                        PartyLegalEntity = new List <PartyLegalEntityType>()
                        {
                            new PartyLegalEntityType
                            {
                                RegistrationName = "Gentofte Kommune",
                                CompanyID        = new IdentifierType
                                {
                                    schemeID = "DK:CVR",
                                    Value    = "DK12345678"
                                }
                            }
                        },
                        Contact = new ContactType
                        {
                            ID   = "12345678",
                            Name = "Sille Schyberg"
                        }
                    }
                },
                SellerSupplierParty = new SupplierPartyType
                {
                    CustomerAssignedAccountID = "LEV00123",
                    Party = new PartyType
                    {
                        EndpointID = new IdentifierType
                        {
                            schemeID = "DK:CVR",
                            Value    = "DK18296799"
                        },
                        PartyIdentification = new List <PartyIdentificationType>()
                        {
                            new PartyIdentificationType
                            {
                                ID = new IdentifierType
                                {
                                    schemeID = "DK:CVR",
                                    Value    = "DK18296799"
                                }
                            }
                        },
                        PartyName = new List <PartyNameType>()
                        {
                            new PartyNameType
                            {
                                Name = "Delcomputer A/S"
                            }
                        },
                        PostalAddress = new AddressType
                        {
                            AddressFormatCode = new CodeType
                            {
                                listAgencyID = "320",
                                listID       = "urn:oioubl:codelist:addressformatcode-1.1",
                                Value        = "StructuredDK"
                            },
                            StreetName     = "Arne Jacobsens Allé",
                            BuildingNumber = "15",
                            CityName       = "København S",
                            PostalZone     = "2300",
                            Country        = new CountryType
                            {
                                IdentificationCode = "DK"
                            }
                        },
                        PartyTaxScheme = new List <PartyTaxSchemeType>()
                        {
                            new PartyTaxSchemeType
                            {
                                CompanyID = new IdentifierType
                                {
                                    schemeID = "DK:SE",
                                    Value    = "DK18296799"
                                },
                                TaxScheme = new TaxSchemeType
                                {
                                    ID = new IdentifierType
                                    {
                                        schemeAgencyID = "320",
                                        schemeID       = "urn:oioubl:id:taxschemeid-1.1",
                                        Value          = "63"
                                    },
                                    Name = "Moms"
                                }
                            }
                        },
                        PartyLegalEntity = new List <PartyLegalEntityType>()
                        {
                            new PartyLegalEntityType
                            {
                                RegistrationName = "Delcomputer A/S",
                                CompanyID        = new IdentifierType
                                {
                                    schemeID = "DK:CVR",
                                    Value    = "DK18296799"
                                }
                            }
                        },
                    }
                },
                Delivery = new List <DeliveryType>()
                {
                    new DeliveryType
                    {
                        DeliveryAddress = new AddressType
                        {
                            AddressFormatCode = new CodeType
                            {
                                listAgencyID = "320",
                                listID       = "urn:oioubl:codelist:addressformatcode-1.1",
                                Value        = "StructuredDK"
                            },
                            StreetName     = "Bernstorffsvej",
                            BuildingNumber = "161",
                            CityName       = "Charlottenlund",
                            PostalZone     = "2920",
                            AddressLine    = new List <AddressLineType>()
                            {
                                new AddressLineType
                                {
                                    Line = "1. sal"
                                },
                                new AddressLineType
                                {
                                    Line = "IT-afdelingen"
                                }
                            },
                            Country = new CountryType
                            {
                                IdentificationCode = "DK"
                            }
                        },
                        RequestedDeliveryPeriod = new PeriodType
                        {
                            StartDate = "2008-05-06",
                            StartTime = "09:30:47.0Z",
                            EndDate   = "2008-05-10",
                            EndTime   = "09:30:47.0Z"
                        }
                    }
                },
                DeliveryTerms = new List <DeliveryTermsType>()
                {
                    new DeliveryTermsType
                    {
                        SpecialTerms = new List <TextType>()
                        {
                            new TextType
                            {
                                Value = "1% reduktion i kontraktsummen pr. dags forsinkelse jf. SKI kontrakt"
                            }
                        },
                    }
                },
                Contract = new List <ContractType>()
                {
                    new ContractType
                    {
                        ContractDocumentReference = new List <DocumentReferenceType>()
                        {
                            new DocumentReferenceType
                            {
                                ID        = "SKI123456",
                                IssueDate = "2006-01-01"
                            }
                        },
                    }
                },
                RequestForQuotationLine = new List <RequestForQuotationLineType>()
                {
                    new RequestForQuotationLineType
                    {
                        ID   = "1",
                        Note = new List <TextType>()
                        {
                            new TextType
                            {
                                Value = "Computer"
                            }
                        },
                        LineItem = new LineItemType
                        {
                            ID       = "DELL1052665",
                            Quantity = new QuantityType
                            {
                                unitCode = "NIU",
                                Value    = 35M
                            },
                            Item = new ItemType
                            {
                                Description = new List <TextType>()
                                {
                                    new TextType
                                    {
                                        Value = "Stationær computer"
                                    }
                                },
                                Name = "Dell PrecisionTM  T3400"
                            }
                        }
                    },
                    new RequestForQuotationLineType
                    {
                        ID   = "2",
                        Note = new List <TextType>()
                        {
                            new TextType
                            {
                                Value = "Skærm"
                            }
                        },
                        LineItem = new LineItemType
                        {
                            ID       = "DELL2363463",
                            Quantity = new QuantityType
                            {
                                unitCode = "NIU",
                                Value    = 35M
                            },
                            Item = new ItemType
                            {
                                Description = new List <TextType>()
                                {
                                    new TextType
                                    {
                                        Value = "Fladskærm"
                                    }
                                },
                                Name = "FP/BL 1908WFP"
                            }
                        }
                    },
                    new RequestForQuotationLineType
                    {
                        ID   = "3",
                        Note = new List <TextType>()
                        {
                            new TextType
                            {
                                Value = "Mus"
                            }
                        },
                        LineItem = new LineItemType
                        {
                            ID       = "DELL2367452",
                            Quantity = new QuantityType
                            {
                                unitCode = "NIU",
                                Value    = 35M
                            },
                            Item = new ItemType
                            {
                                Description = new List <TextType>()
                                {
                                    new TextType
                                    {
                                        Value = "Mus"
                                    }
                                },
                                Name = "Dell Quietkey USB-tastatur, sort - Dansk (QWERTY)"
                            }
                        }
                    },
                    new RequestForQuotationLineType
                    {
                        ID   = "4",
                        Note = new List <TextType>()
                        {
                            new TextType
                            {
                                Value = "Tastatur"
                            }
                        },
                        LineItem = new LineItemType
                        {
                            ID       = "DELL8436783",
                            Quantity = new QuantityType
                            {
                                unitCode = "NIU",
                                Value    = 35M
                            },
                            Item = new ItemType
                            {
                                Description = new List <TextType>()
                                {
                                    new TextType
                                    {
                                        Value = "Tastatur"
                                    }
                                },
                                Name = "Dell Quietkey USB-tastatur, sort - Dansk (QWERTY)"
                            }
                        }
                    }
                },
            };

            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);
        }