using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace ConsoleApp3.DataContracts { internal class Invoice { [JsonProperty(PropertyName ="id")] public int? Id { get; set; } [JsonProperty(PropertyName = "objectName")] public string ObjectName { get; set; } /// /// /// /// [DataMember(Name = "invoiceNumber", EmitDefaultValue = false)] [JsonProperty(PropertyName = "invoiceNumber")] public string InvoiceNumber { get; set; } /// /// the contact the invoice belongs to /// /// the contact the invoice belongs to [DataMember(Name = "contact", EmitDefaultValue = false)] [JsonProperty(PropertyName = "contact")] public ModelContact Contact { get; set; } /// /// the date the invoice was created /// /// the date the invoice was created [DataMember(Name = "create", EmitDefaultValue = false)] [JsonProperty(PropertyName = "create")] public DateTime? Create { get; set; } /// /// the date the invoice was last updated /// /// the date the invoice was last updated [DataMember(Name = "update", EmitDefaultValue = false)] [JsonProperty(PropertyName = "update")] public DateTime? Update { get; set; } /// /// the date of the invoice /// /// the date of the invoice [DataMember(Name = "invoiceDate", EmitDefaultValue = false)] [JsonProperty(PropertyName = "invoiceDate")] public DateTime? InvoiceDate { get; set; } /// /// header/subject of the invoice /// /// header/subject of the invoice [DataMember(Name = "header", EmitDefaultValue = false)] [JsonProperty(PropertyName = "header")] public string Header { get; set; } /// /// head text of the invoice /// /// head text of the invoice [DataMember(Name = "headText", EmitDefaultValue = false)] [JsonProperty(PropertyName = "headText")] public string HeadText { get; set; } /// /// foot text of the invoice /// /// foot text of the invoice [DataMember(Name = "footText", EmitDefaultValue = false)] [JsonProperty(PropertyName = "footText")] public string FootText { get; set; } /// /// time left for paying the invoice, use format dd.MM.yyyy or number for number of days left /// /// time left for paying the invoice, use format dd.MM.yyyy or number for number of days left [DataMember(Name = "timeToPay", EmitDefaultValue = false)] [JsonProperty(PropertyName = "timeToPay")] public DateTime? TimeToPay { get; set; } /// /// /// /// /*[DataMember(Name = "discountTime", EmitDefaultValue = false)] [JsonProperty(PropertyName = "discountTime")] public DateTime? DiscountTime { get; set; } */ /// /// the discount value in '%' /// /// the discount value in '%' [DataMember(Name = "discount", EmitDefaultValue = false)] [JsonProperty(PropertyName = "discount")] public float? Discount { get; set; } /// /// the name in the address, equals the contacts name /// /// the name in the address, equals the contacts name [DataMember(Name = "addressName", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressName")] public string AddressName { get; set; } /// /// the street in the address, equals the contacts street /// /// the street in the address, equals the contacts street [DataMember(Name = "addressStreet", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressStreet")] public string AddressStreet { get; set; } /// /// the zip-code in the address, equals the contacts zip /// /// the zip-code in the address, equals the contacts zip [DataMember(Name = "addressZip", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressZip")] public string AddressZip { get; set; } /// /// the city in the address, equals the contacts city /// /// the city in the address, equals the contacts city [DataMember(Name = "addressCity", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressCity")] public string AddressCity { get; set; } /// /// the country in the address, equals the contacts country /// /// the country in the address, equals the contacts country [DataMember(Name = "addressCountry", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressCountry")] public ModelStaticCountry AddressCountry { get; set; } /// /// time left for paying the invoice, use format DD.MM.YYYY or number for number of days left /// /// time left for paying the invoice, use format DD.MM.YYYY or number for number of days left [DataMember(Name = "payDate", EmitDefaultValue = false)] [JsonProperty(PropertyName = "payDate")] public DateTime? PayDate { get; set; } /// /// SevUser who created the invoice /// /// SevUser who created the invoice [DataMember(Name = "createUser", EmitDefaultValue = false)] [JsonProperty(PropertyName = "createUser")] public ModelSevUser CreateUser { get; set; } /// /// sevClient is the unique id every customer has and is used in nearly all operations /// /// sevClient is the unique id every customer has and is used in nearly all operations [DataMember(Name = "sevClient", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sevClient")] public Object SevClient { get; set; } /// /// delivery date of the goods from the invoice, please use dd.MM.yyyy /// /// delivery date of the goods from the invoice, please use dd.MM.yyyy [DataMember(Name = "deliveryDate", EmitDefaultValue = false)] [JsonProperty(PropertyName = "deliveryDate")] public DateTime? DeliveryDate { get; set; } /// /// status of the invoice /// /// status of the invoice [DataMember(Name = "status", EmitDefaultValue = false)] [JsonProperty(PropertyName = "status")] public EInvoiceStatus Status { get; set; } /// /// /// /// /*[DataMember(Name = "smallSettlement", EmitDefaultValue = false)] [JsonProperty(PropertyName = "smallSettlement")] public bool? SmallSettlement { get; set; } */ /// /// SevUser who created the invoice and therefore is the contact person /// /// SevUser who created the invoice and therefore is the contact person [DataMember(Name = "contactPerson", EmitDefaultValue = false)] [JsonProperty(PropertyName = "contactPerson")] public ModelSevUser ContactPerson { get; set; } = new ModelSevUser() { }; /// /// tax rate used when adding a value added tax regulation /// /// tax rate used when adding a value added tax regulation [DataMember(Name = "taxRate", EmitDefaultValue = false)] [JsonProperty(PropertyName = "taxRate")] public float? TaxRate { get; set; } /// /// additional text when adding a value added tax regulation /// /// additional text when adding a value added tax regulation [DataMember(Name = "taxText", EmitDefaultValue = false)] [JsonProperty(PropertyName = "taxText")] public string TaxText { get; set; } /// /// dunning level of the invoice /// /// dunning level of the invoice [DataMember(Name = "dunningLevel", EmitDefaultValue = false)] [JsonProperty(PropertyName = "dunningLevel")] public int? DunningLevel { get; set; } /// /// name of the contacts address /// /// name of the contacts address [DataMember(Name = "addressParentName", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressParentName")] public string AddressParentName { get; set; } /// /// a reference to the contacts address /// /// a reference to the contacts address [DataMember(Name = "addressContactRef", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressContactRef")] public ModelContactAddress AddressContactRef { get; set; } /// /// /// /// [DataMember(Name = "taxType", EmitDefaultValue = false)] [JsonProperty(PropertyName = "taxType")] public string TaxType { get; set; } /// /// /// /// [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] [JsonProperty(PropertyName = "paymentMethod")] public ModelPaymentMethod PaymentMethod { get; set; } /// /// /// /// [DataMember(Name = "costCentre", EmitDefaultValue = false)] [JsonProperty(PropertyName = "costCentre")] public ModelCostCentre CostCentre { get; set; } /// /// /// /// [DataMember(Name = "sendDate", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sendDate")] public DateTime? SendDate { get; set; } /// /// /// /// [DataMember(Name = "origin", EmitDefaultValue = false)] [JsonProperty(PropertyName = "origin")] public Object Origin { get; set; } /// /// type of the invoice /// /// type of the invoice [DataMember(Name = "invoiceType", EmitDefaultValue = false)] [JsonProperty(PropertyName = "invoiceType")] public string InvoiceType { get; set; } /// /// /// /// [DataMember(Name = "accountIntervall", EmitDefaultValue = false)] [JsonProperty(PropertyName = "accountIntervall")] public int? AccountIntervall { get; set; } /// /// /// /// [DataMember(Name = "accountLastInvoice", EmitDefaultValue = false)] [JsonProperty(PropertyName = "accountLastInvoice")] public DateTime? AccountLastInvoice { get; set; } /// /// /// /// [DataMember(Name = "accountNextInvoice", EmitDefaultValue = false)] [JsonProperty(PropertyName = "accountNextInvoice")] public DateTime? AccountNextInvoice { get; set; } /// /// /// /// [DataMember(Name = "reminderTotal", EmitDefaultValue = false)] [JsonProperty(PropertyName = "reminderTotal")] public float? ReminderTotal { get; set; } /// /// /// /// [DataMember(Name = "reminderDebit", EmitDefaultValue = false)] [JsonProperty(PropertyName = "reminderDebit")] public float? ReminderDebit { get; set; } /// /// /// /// [DataMember(Name = "reminderDeadline", EmitDefaultValue = false)] [JsonProperty(PropertyName = "reminderDeadline")] public DateTime? ReminderDeadline { get; set; } /// /// /// /// [DataMember(Name = "reminderCharge", EmitDefaultValue = false)] [JsonProperty(PropertyName = "reminderCharge")] public float? ReminderCharge { get; set; } /// /// /// /// [DataMember(Name = "addressParentName2", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressParentName2")] public string AddressParentName2 { get; set; } /// /// /// /// [DataMember(Name = "addressName2", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressName2")] public string AddressName2 { get; set; } /// /// /// /// [DataMember(Name = "taxSet", EmitDefaultValue = false)] [JsonProperty(PropertyName = "taxSet")] public ModelTaxSet TaxSet { get; set; } /// /// /// /// [DataMember(Name = "addressGender", EmitDefaultValue = false)] [JsonProperty(PropertyName = "addressGender")] public string AddressGender { get; set; } /// /// /// /// [DataMember(Name = "accountEndDate", EmitDefaultValue = false)] [JsonProperty(PropertyName = "accountEndDate")] public DateTime? AccountEndDate { get; set; } /// /// /// /// [DataMember(Name = "address", EmitDefaultValue = false)] [JsonProperty(PropertyName = "address")] public string Address { get; set; } /// /// /// /// [DataMember(Name = "currency", EmitDefaultValue = false)] [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } = "EUR"; /// /// /// /// [DataMember(Name = "sumNet", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumNet")] public float? SumNet { get; set; } /// /// /// /// [DataMember(Name = "sumTax", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumTax")] public float? SumTax { get; set; } /// /// /// /// [DataMember(Name = "sumGross", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumGross")] public float? SumGross { get; set; } /// /// /// /// [DataMember(Name = "sumDiscounts", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumDiscounts")] public float? SumDiscounts { get; set; } /// /// /// /// [DataMember(Name = "sumNetForeignCurrency", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumNetForeignCurrency")] public float? SumNetForeignCurrency { get; set; } /// /// /// /// [DataMember(Name = "sumTaxForeignCurrency", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumTaxForeignCurrency")] public float? SumTaxForeignCurrency { get; set; } /// /// /// /// [DataMember(Name = "sumGrossForeignCurrency", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumGrossForeignCurrency")] public float? SumGrossForeignCurrency { get; set; } /// /// /// /// [DataMember(Name = "sumDiscountsForeignCurrency", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumDiscountsForeignCurrency")] public float? SumDiscountsForeignCurrency { get; set; } /// /// /// /// [DataMember(Name = "sumNetAccounting", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumNetAccounting")] public float? SumNetAccounting { get; set; } /// /// /// /// [DataMember(Name = "sumTaxAccounting", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumTaxAccounting")] public float? SumTaxAccounting { get; set; } /// /// /// /// [DataMember(Name = "sumGrossAccounting", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sumGrossAccounting")] public float? SumGrossAccounting { get; set; } /// /// /// /// [DataMember(Name = "entryType", EmitDefaultValue = false)] [JsonProperty(PropertyName = "entryType")] public ModelEntryType EntryType { get; set; } /// /// /// /// [DataMember(Name = "costumerInternalNote", EmitDefaultValue = false)] [JsonProperty(PropertyName = "costumerInternalNote")] public string CostumerInternalNote { get; set; } /// /// /// /// [DataMember(Name = "showNet", EmitDefaultValue = false)] [JsonProperty(PropertyName = "showNet")] public int ShowNet { get; set; } = 0; /// /// /// /// [DataMember(Name = "enshrined", EmitDefaultValue = false)] [JsonProperty(PropertyName = "enshrined")] public bool? Enshrined { get; set; } /// /// /// /// [DataMember(Name = "sendType", EmitDefaultValue = false)] [JsonProperty(PropertyName = "sendType")] public string SendType { get; set; } /// /// /// /// [DataMember(Name = "deliveryDateUntil", EmitDefaultValue = false)] [JsonProperty(PropertyName = "deliveryDateUntil")] public DateTime? DeliveryDateUntil { get; set; } [DataMember(Name = "mapAll", EmitDefaultValue = false)] [JsonProperty(PropertyName = "mapAll")] public bool MapAll { get; set; } = true; } enum EInvoiceStatus { DEACTIVE = 50, DRAFT = 100, OPEN = 200, PAYED = 1000 } }