Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -60,6 +62,9 @@ project.lock.json
project.fragment.lock.json
artifacts/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

Expand All @@ -85,6 +90,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -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*

Expand All @@ -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
Expand Down Expand Up @@ -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/
Empty file.
Empty file added openTRANS/INVOICE/TODO
Empty file.
2 changes: 1 addition & 1 deletion openTRANS/ORDER/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion openTRANS/ORDERRESPONSE/OrderResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
31 changes: 31 additions & 0 deletions openTRANS/QUOTATION/Quotation.cs
Original file line number Diff line number Diff line change
@@ -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<QuotationItem> QuotationItemList { get; set; } = new List<QuotationItem>();

[XmlElement("QUOTATION_SUMMARY")]
public QuotationSummary QuotationSummary {
get {
return new QuotationSummary(this);
}
set { }
}
}
}
11 changes: 11 additions & 0 deletions openTRANS/QUOTATION/QuotationHeader.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
69 changes: 69 additions & 0 deletions openTRANS/QUOTATION/QuotationInfo.cs
Original file line number Diff line number Diff line change
@@ -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<Party> 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<TypedItem> Remarks { get; set; }
}
}
65 changes: 65 additions & 0 deletions openTRANS/QUOTATION/QuotationItem.cs
Original file line number Diff line number Diff line change
@@ -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<PartialDelivery> 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<TypedItem> Remarks { get; set; }
}
}
20 changes: 20 additions & 0 deletions openTRANS/QUOTATION/QuotationSummary.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
24 changes: 24 additions & 0 deletions openTRANS/SHARED/Card.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
15 changes: 15 additions & 0 deletions openTRANS/SHARED/CatalogReference.cs
Original file line number Diff line number Diff line change
@@ -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; }

}
}
29 changes: 29 additions & 0 deletions openTRANS/SHARED/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading