<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Newtonsoft.Json;
using ONIT.VismaNetApi.Lib;
using ONIT.VismaNetApi.Models.CustomDto;
using ONIT.VismaNetApi.Models.Enums;

namespace ONIT.VismaNetApi.Models
{
    public class SupplierNumber : IProvideCustomDto
    {
        public string number { get; set; }
        public string name { get; set; }

        public object ToDto()
        {
            return new DtoValue(number);
        }

        public static implicit operator SupplierNumber(Supplier sup)
        {
            return new SupplierNumber
            {
                name = sup.name,
                number = sup.number
            };
        }
    }

    public class SupplierInvoice : DtoProviderBase, IProvideIdentificator
    {
        public SupplierInvoice()
        {
            IgnoreProperties.Add(nameof(referenceNumber));
        }
        /// <summary>
        /// Create a new supplier invoice without auto numbering
        /// </summary>
        /// <param name="referenceNumber"></param>
        public SupplierInvoice(string referenceNumber)
        {
            this.referenceNumber = referenceNumber;
        }
        public string financialPeriod
        {
            get { return Get<string>(); }
            set { Set(value); }
        }

        public List<SupplierInvoiceLine> invoiceLines
        {
            get { return Get(defaultValue: new List<SupplierInvoiceLine>()); }
            private set { Set(value); }
        }

        public SupplierNumber supplier
        {
            get { return Get(defaultValue: new SupplierNumber(), key: "supplierNumber"); }
            set { Set(value, "supplierNumber"); }
        }

        public bool hold
        {
            get { return Get<bool>(); }
            set { Set(value); }
        }

        public Location location
        {
            get { return Get<Location>("locationId"); }
            set { Set(value, "locationId"); }
        }

        public CreditTerms creditTerms
        {
            get { return Get<CreditTerms>(); }
            set { Set(value); }
        }

        public string cashDiscountDate
        {
            get { return Get<string>(); }
            set { Set(value); }
        }

        public decimal detailTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal detailTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTaxableTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTaxableTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatExemptTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatExemptTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal withholdingTax<commit_msg>Add exchange rate to supplier invoice. Closes #38<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Newtonsoft.Json;
using ONIT.VismaNetApi.Lib;
using ONIT.VismaNetApi.Models.CustomDto;
using ONIT.VismaNetApi.Models.Enums;

namespace ONIT.VismaNetApi.Models
{
    public class SupplierNumber : IProvideCustomDto
    {
        public string number { get; set; }
        public string name { get; set; }

        public object ToDto()
        {
            return new DtoValue(number);
        }

        public static implicit operator SupplierNumber(Supplier sup)
        {
            return new SupplierNumber
            {
                name = sup.name,
                number = sup.number
            };
        }
    }

    public class SupplierInvoice : DtoProviderBase, IProvideIdentificator
    {
        public SupplierInvoice()
        {
            IgnoreProperties.Add(nameof(referenceNumber));
        }
        /// <summary>
        /// Create a new supplier invoice without auto numbering
        /// </summary>
        /// <param name="referenceNumber"></param>
        public SupplierInvoice(string referenceNumber)
        {
            this.referenceNumber = referenceNumber;
        }
        public string financialPeriod
        {
            get { return Get<string>(); }
            set { Set(value); }
        }

        public List<SupplierInvoiceLine> invoiceLines
        {
            get { return Get(defaultValue: new List<SupplierInvoiceLine>()); }
            private set { Set(value); }
        }

        public SupplierNumber supplier
        {
            get { return Get(defaultValue: new SupplierNumber(), key: "supplierNumber"); }
            set { Set(value, "supplierNumber"); }
        }

        public bool hold
        {
            get { return Get<bool>(); }
            set { Set(value); }
        }

        public Location location
        {
            get { return Get<Location>("locationId"); }
            set { Set(value, "locationId"); }
        }

        public CreditTerms creditTerms
        {
            get { return Get<CreditTerms>(); }
            set { Set(value); }
        }

        public string cashDiscountDate
        {
            get { return Get<string>(); }
            set { Set(value); }
        }

        public decimal detailTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal detailTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTaxableTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTaxableTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }
        public decimal exchangeRate
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatExemptTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatExemptTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTotal
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal vatTotalInCurrency
        {
            get { return Get<decimal>(); }
            set { Set(value); }
        }

        public decimal withholdingTax
{'fraction_non_alphanumeric': 0.09608591210965098, 'fraction_numerical': 0.00028260562385191464, 'mean_word_length': 1.5126020589279374, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6187286', 'n_tokens_mistral': 1847, 'n_tokens_neox': 1810, 'n_words': 430}