diff --git a/.gitignore b/.gitignore index b248083..cfb831a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,12 +23,14 @@ mono_crash.* [Rr]eleases/ x64/ x86/ +[Ww][Ii][Nn]32/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ +[Ll]ogs/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -60,6 +62,9 @@ project.lock.json project.fragment.lock.json artifacts/ +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + # StyleCop StyleCopReport.xml @@ -85,6 +90,7 @@ StyleCopReport.xml *.tmp_proj *_wpftmp.csproj *.log +*.tlog *.vspscc *.vssscc .builds @@ -126,9 +132,6 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding add-in -.JustCode - # TeamCity is a build add-in _TeamCity* @@ -139,6 +142,11 @@ _TeamCity* .axoCover/* !.axoCover/settings.json +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + # Visual Studio code coverage results *.coverage *.coveragexml @@ -347,3 +355,35 @@ healthchecksdb # Backup folder for Package Reference Convert tool in Visual Studio 2017 MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +.idea/ +*.sln.iml + +#custom filters +TestFiles/ +Report/ \ No newline at end of file diff --git a/openTRANS/DISPATCHNOTIFICATION/TODO b/openTRANS/DISPATCHNOTIFICATION/TODO new file mode 100644 index 0000000..e69de29 diff --git a/openTRANS/INVOICE/TODO b/openTRANS/INVOICE/TODO new file mode 100644 index 0000000..e69de29 diff --git a/openTRANS/ORDER/Order.cs b/openTRANS/ORDER/Order.cs index 38a0583..95dbc71 100644 --- a/openTRANS/ORDER/Order.cs +++ b/openTRANS/ORDER/Order.cs @@ -12,7 +12,7 @@ public partial class Order public string xsiSchemaLocation = "http://www.opentrans.org/XMLSchema/2.1%20opentrans_2_1.xsd"; [XmlAttribute("version")] - public string Version = "2.1"; + public const string Version = "2.1"; [XmlAttribute("type")] public string Type = OrderType.Standard; diff --git a/openTRANS/ORDERRESPONSE/OrderResponse.cs b/openTRANS/ORDERRESPONSE/OrderResponse.cs index 98790fc..4695ea9 100644 --- a/openTRANS/ORDERRESPONSE/OrderResponse.cs +++ b/openTRANS/ORDERRESPONSE/OrderResponse.cs @@ -7,7 +7,7 @@ namespace openTRANS public partial class OrderResponse { [XmlAttribute("version")] - public string Version = "2.1"; + public const string Version = "2.1"; [XmlElement("ORDERRESPONSE_HEADER")] public OrderResponseHeader OrderResponseHeader = new OrderResponseHeader(); diff --git a/openTRANS/QUOTATION/Quotation.cs b/openTRANS/QUOTATION/Quotation.cs new file mode 100644 index 0000000..4d38839 --- /dev/null +++ b/openTRANS/QUOTATION/Quotation.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace openTRANS { + [XmlRoot("QUOTATION", Namespace = "http://www.opentrans.org/XMLSchema/2.1", IsNullable = false)] + public partial class Quotation { + [XmlAttribute("schemaLocation", Namespace = XmlSchema.InstanceNamespace)] + public string xsiSchemaLocation = "http://www.opentrans.org/XMLSchema/2.1%20opentrans_2_1.xsd"; + + [XmlAttribute("version")] + public const string Version = "2.1"; + + [XmlElement("QUOTATION_HEADER")] + public QuotationHeader QuotationHeader { get; set; } = new QuotationHeader(); + + [XmlArray("QUOTATION_ITEM_LIST")] + [XmlArrayItem("QUOTATION_ITEM")] + public List QuotationItemList { get; set; } = new List(); + + [XmlElement("QUOTATION_SUMMARY")] + public QuotationSummary QuotationSummary { + get { + return new QuotationSummary(this); + } + set { } + } + } +} diff --git a/openTRANS/QUOTATION/QuotationHeader.cs b/openTRANS/QUOTATION/QuotationHeader.cs new file mode 100644 index 0000000..671826a --- /dev/null +++ b/openTRANS/QUOTATION/QuotationHeader.cs @@ -0,0 +1,11 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class QuotationHeader { + [XmlElement("CONTROL_INFO")] + public ControlInfo ControlInfo { get; set; } = new ControlInfo(); + + [XmlElement("QUOTATION_INFO")] + public QuotationInfo QuotationInfo { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/QUOTATION/QuotationInfo.cs b/openTRANS/QUOTATION/QuotationInfo.cs new file mode 100644 index 0000000..0b9147e --- /dev/null +++ b/openTRANS/QUOTATION/QuotationInfo.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using static openTRANS.Common; + +namespace openTRANS { + public class QuotationInfo { + [XmlElement("QUOTATION_ID")] + public string QoutationId { get; set; } + + [XmlElement("QUOTATION_DATE")] + public DateTime QuotationDate { get; set; } + + [XmlElement("VALID_START_DATE")] + public DateTime ValidStartDate { get; set; } + + [XmlElement("VALID_END_DATE")] + public DateTime ValidEndDate { get; set; } + + [XmlElement("DELIVERY_DATE")] + public DeliveryDate DeliveryDate { get; set; } + + [XmlElement("LANGUAGE")] + public Language Language { get; set; } + + [XmlElement("MIME_ROOT")] + public string MimeRoot { get; set; } + + [XmlArray("PARTIES")] + [XmlArrayItem("PARTY")] + public List Parties { get; set; } + + [XmlElement("ORDER_PARTIES_REFERENCE")] + public OrderPartiesReference OrderPartiesReference { get; set; } + + [XmlElement("DOCEXCHANGE_PARTIES_REFERENCE")] + public DocExchangePartiesReference DocExchangePartiesReference { get; set; } + + [XmlElement("AGREEMENT")] + public Agreement Agreement { get; set; } + + [XmlElement("CATALOG_REFERENCE")] + public CatalogReference CatalogReference { get; set; } + + [XmlElement("CURRENCY")] + public string Currency { get; set; } = Currencies.EUR; + + [XmlElement("PAYMENT")] + public Payment Payment { get; set; } + + [XmlElement("")] + public string TermsAndConditions { get; set; } + + [XmlElement("TRANSPORT")] + public Transport Transport { get; set; } + + [XmlElement("INTERNATIONAL_RESTRICTIONS")] + public InternationalRestrictions InternationalRestrictions { get; set; } + + [XmlElement("TERRITORY")] + public string Territory { get; set; } + + [XmlElement("MIME_INFO")] + public MimeInfo MimeInfo { get; set; } + + [XmlElement("REMARKS")] + public List Remarks { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/QUOTATION/QuotationItem.cs b/openTRANS/QUOTATION/QuotationItem.cs new file mode 100644 index 0000000..c035303 --- /dev/null +++ b/openTRANS/QUOTATION/QuotationItem.cs @@ -0,0 +1,65 @@ +using System.Collections.Generic; +using System.Xml.Serialization; +using static openTRANS.Common; + +namespace openTRANS { + public class QuotationItem { + [XmlElement("LINE_ITEM_ID")] + public string LineItemId { get; set; } + + [XmlElement("PRODUCT_ID")] + public ProductId ProductId { get; set; } + + [XmlElement("PRODUCT_FEATURES")] + public ProductFeatures ProductFeatures { get; set; } + + [XmlElement("PRODUCT_COMPONENTS")] + public ProductComponents ProductComponents { get; set; } + + [XmlElement("QUANTITIY")] + public decimal Quantity { get; set; } + + [XmlElement("ORDER_UNIT", Namespace = Namespace.bmecat)] + public string OrderUnit; + + [XmlElement("PRODUCT_PRICE_FIX")] + public ProductPriceFix ProductPriceFix { get; set; } + + [XmlElement("PRICE_LINE_AMOUNT")] + public decimal PriceLineAmount { get; set; } + + [XmlElement("AGREEMENT")] + public Agreement Agreement { get; set; } + + [XmlElement("CATALOG_REFERENCE")] + public CatalogReference CatalogReference { get; set; } + + [XmlElement("PARTIAL_SHIPMENT")] + public bool PartialShipment { get; set; } + + [XmlElement("DELIVERY_DATE")] + public DeliveryDate DeliveryDate { get; set; } + + [XmlArray("PARTIAL_DELIVERY_LIST")] + [XmlArrayItem("PARTIAL_DELIVERY")] + public List PartialDeliveryList { get; set; } + + [XmlElement("SHIPMENT_PARTIES_REFERENCE")] + public ShipmentPartiesReference ShipmentPartiesReference { get; set; } + + [XmlElement("TRANSPORT", Namespace = Namespace.bmecat)] + public Transport Transport { get; set; } + + [XmlElement("INTERNATIONAL_RESTRICTIONS", Namespace = Namespace.bmecat)] + public InternationalRestrictions InternationalRestrictions { get; set; } + + [XmlElement("SPECIAL_TREATMENT_CLASS", Namespace = Namespace.bmecat)] + public SpecialTreatmentClass SpecialTreatmentClass { get; set; } + + [XmlElement("MIME_INFO")] + public MimeInfo MimeInfo { get; set; } + + [XmlElement("REMARKS")] + public List Remarks { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/QUOTATION/QuotationSummary.cs b/openTRANS/QUOTATION/QuotationSummary.cs new file mode 100644 index 0000000..cd08eb9 --- /dev/null +++ b/openTRANS/QUOTATION/QuotationSummary.cs @@ -0,0 +1,20 @@ +using System.Linq; +using System.Xml.Serialization; + +namespace openTRANS { + public class QuotationSummary { + public QuotationSummary() { + + } + public QuotationSummary(Quotation quotation) { + TotalItemNum = quotation.QuotationItemList.Count; + TotalAmount = quotation.QuotationItemList.Sum(qi => qi.PriceLineAmount); + } + + [XmlElement("TOTAL_ITEM_NUM")] + public decimal TotalItemNum { get; set; } + + [XmlElement("TOTAL_AMOUNT")] + public decimal TotalAmount { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/Card.cs b/openTRANS/SHARED/Card.cs new file mode 100644 index 0000000..450a24f --- /dev/null +++ b/openTRANS/SHARED/Card.cs @@ -0,0 +1,24 @@ +using System; +using System.Xml.Serialization; + +namespace openTRANS { + public class Card { + [XmlAttribute("type")] + public string Type { get; set; } + + [XmlElement("CARD_NUM")] + public string CardNum { get; set; } + + [XmlElement("CARD_AUTH_CODE")] + public string CardAuthCode { get; set; } + + [XmlElement("CARD_REF_NUM")] + public string CardRefNum { get; set; } + + [XmlElement("CARD_EXPIRATION_DATE")] + public DateTime CardExpirationDate{ get; set; } + + [XmlElement("CARD_HOLDER_NAME")] + public string CardHolderName { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/CatalogReference.cs b/openTRANS/SHARED/CatalogReference.cs new file mode 100644 index 0000000..c3d3a90 --- /dev/null +++ b/openTRANS/SHARED/CatalogReference.cs @@ -0,0 +1,15 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class CatalogReference { + [XmlElement("CATALOG_ID")] + public string CatalogId { get; set; } + + [XmlElement("CATALOG_VERSION")] + public string CatalogVersion { get; set; } + + [XmlElement("CATALOG_NAME")] + public string CatalogName { get; set; } + + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/Common.cs b/openTRANS/SHARED/Common.cs index d8aa6ac..9ee52ee 100644 --- a/openTRANS/SHARED/Common.cs +++ b/openTRANS/SHARED/Common.cs @@ -124,6 +124,35 @@ public static class TaxCategory public const string ZeroRate = "zero_rate"; } + public static class InternationalRestrictions { + public const string EUEmbargo = "eu-embargo"; + public const string National = "national"; + public const string UNEmbargo = "un-embargo"; + public const string USEmbargo = "us-embargo"; + public const string WTOEmbargo = "wto-embargo"; + public const string Sonstige = "other"; + public const string Custom = ""; + } + + public static class Currencies { + public const string EUR = "EUR"; + public const string USD = "USD"; + } + + public static class CardType { + public const string MasterCard = "MasterCard"; + public const string VISA = "VISA"; + public const string AmericanExpress = "AmericanExpress"; + public const string DinersClub = "DinersClub"; + public const string JCB = "JCB"; + public const string Maestro = "Maestro"; + public const string DiscoverCard = "DiscoverCard"; + public const string Transcard = "Transcard"; + public const string DinaCard = "DinaCard"; + public const string ChinaUnionPay = "ChinaUnionPay"; + public const string Custom = ""; + } + public class TypedItem { public TypedItem() //needed for serializer diff --git a/openTRANS/SHARED/Components.cs b/openTRANS/SHARED/Components.cs deleted file mode 100644 index 8a849da..0000000 --- a/openTRANS/SHARED/Components.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace openTRANS -{ - public class Components - { - } -} \ No newline at end of file diff --git a/openTRANS/SHARED/InternationalRestrictions.cs b/openTRANS/SHARED/InternationalRestrictions.cs new file mode 100644 index 0000000..9340a59 --- /dev/null +++ b/openTRANS/SHARED/InternationalRestrictions.cs @@ -0,0 +1,8 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class InternationalRestrictions { + [XmlAttribute("type")] + public string Type { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/PartialDelivery.cs b/openTRANS/SHARED/PartialDelivery.cs new file mode 100644 index 0000000..9cb4987 --- /dev/null +++ b/openTRANS/SHARED/PartialDelivery.cs @@ -0,0 +1,11 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class PartialDelivery { + [XmlElement("QUANTITY")] + public decimal Quantity { get; set; } + + [XmlElement("DELIVERY_DATE")] + public DeliveryDate DeliveryDate { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/Payment.cs b/openTRANS/SHARED/Payment.cs new file mode 100644 index 0000000..998618e --- /dev/null +++ b/openTRANS/SHARED/Payment.cs @@ -0,0 +1,26 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class Payment { + [XmlElement("CARD")] + public Card Card { get; set; } + + [XmlElement("ACCOUNT")] + public Account Account { get; set; } + + [XmlElement("DEBIT")] + public bool Debit { get; set; } + + [XmlElement("CHECK")] + public bool Check { get; set; } + + [XmlElement("CASH")] + public bool Cash { get; set; } + + [XmlElement("CENTRAL_REGULATIONS")] + public bool CentralRegulations { get; set; } = false; + + [XmlElement("PAYMENT_TERMS")] + public PaymentTerms PaymentTerms { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/PaymentTerms.cs b/openTRANS/SHARED/PaymentTerms.cs new file mode 100644 index 0000000..665b39d --- /dev/null +++ b/openTRANS/SHARED/PaymentTerms.cs @@ -0,0 +1,15 @@ +using System; +using System.Xml.Serialization; + +namespace openTRANS { + public class PaymentTerms { + [XmlElement("PAYMENT_TERMS")] + public string PaymentTerm { get; set; } + + [XmlElement("TIME_FOR_PAYMENT")] + public TimeForPayment TimeForPayment { get; set; } + + [XmlElement("VALUE_DATE")] + public DateTime ValueDate { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/SpecialTreatmentClass.cs b/openTRANS/SHARED/SpecialTreatmentClass.cs new file mode 100644 index 0000000..17eb247 --- /dev/null +++ b/openTRANS/SHARED/SpecialTreatmentClass.cs @@ -0,0 +1,9 @@ +using System.Xml.Serialization; +using static openTRANS.Common; + +namespace openTRANS { + public class SpecialTreatmentClass { + [XmlAttribute("type", Namespace = Namespace.bmecat)] + public string Type { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/TimeForPayment.cs b/openTRANS/SHARED/TimeForPayment.cs new file mode 100644 index 0000000..c808806 --- /dev/null +++ b/openTRANS/SHARED/TimeForPayment.cs @@ -0,0 +1,18 @@ +using System; +using System.Xml.Serialization; + +namespace openTRANS { + public class TimeForPayment { + [XmlElement("PAYMENT_DATE")] + public DateTime PaymentDate { get; set; } + + [XmlElement("DAYS")] + public int Days { get; set; } + + [XmlElement("DISCOUNT_FACTOR")] + public double DiscountFactor { get; set; } + + [XmlElement("ALLOW_OR_CHARGES_FIX")] + public AllowOrChargesFix AllowOrChargesFix { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/Transport.cs b/openTRANS/SHARED/Transport.cs new file mode 100644 index 0000000..47d688e --- /dev/null +++ b/openTRANS/SHARED/Transport.cs @@ -0,0 +1,14 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class Transport { + [XmlElement("INCOTERM")] + public string Incoterm { get; set; } + + [XmlElement("LOCATION")] + public string Location { get; set; } + + [XmlElement("TRANSPORT_REMARK")] + public string TransportRemark { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/openTRANS.csproj b/openTRANS/openTRANS.csproj index af412ab..0960c9b 100644 --- a/openTRANS/openTRANS.csproj +++ b/openTRANS/openTRANS.csproj @@ -1,36 +1,38 @@  - - netstandard2.0 - true - DXSdata - DXSdata GmbH - .NET Core / Standard implementation of the openTRANS v2.1 definitions by Fraunhofer IAO - 1.1.0 - + + netstandard2.0 + true + DXSdata + DXSdata GmbH + .NET Core / Standard implementation of the openTRANS v2.1 definitions by Fraunhofer IAO + 1.1.0 + - - - + + + - - - - - + + + + + + + - - - 1701;1702;1591,1573 - + + + 1701;1702;1591,1573 + - - - true - https://www.dxsdata.com/2019/08/opentrans-for-net-core/ - MIT - https://github.com/DXSdata/openTRANS - + + + true + https://www.dxsdata.com/2019/08/opentrans-for-net-core/ + MIT + https://github.com/DXSdata/openTRANS +