Example #1
0
 internal static InvoiceParty CreateInvoiceParty(Country country, string taxNumber, string name = null, Address address = null)
 {
     return(InvoiceParty.Create(
                info: InvoicePartyInfo.Create(NonNegativeInt.Zero(), TaxpayerIdentificationNumber.Create(country, taxNumber).Success.Get(), name, address).Success.Get(),
                country: country
                ).Success.Get());
 }
        private Dto.Xsd.InvoiceParty GetInvoiceParty(InvoiceParty invoiceParty)
        {
            if (invoiceParty != null)
            {
                return(new Dto.Xsd.InvoiceParty
                {
                    Country = (Dto.Xsd.Country)Enum.Parse(typeof(Dto.Xsd.Country), invoiceParty.CountryCode.Value, true),
                    Branch = invoiceParty.Branch.Value,
                    Name = invoiceParty.Name.GetOrDefault(),
                    VatNumber = invoiceParty.TaxNumber.Value,
                    Address = GetAddress(invoiceParty.Address)
                });
            }

            return(null);
        }
Example #3
0
        private static Dto.Xsd.InvoiceParty GetInvoiceParty(InvoiceParty counterpart)
        {
            if (counterpart != null)
            {
                return(new Dto.Xsd.InvoiceParty
                {
                    Country = (Dto.Xsd.Country)Enum.Parse(typeof(Dto.Xsd.Country), counterpart.Country.Code.Value, true),
                    Branch = counterpart.Branch.Value,
                    Name = counterpart.Name,
                    VatNumber = counterpart.TaxIdentifier.Value,
                    Address = GetAddress(counterpart.Address)
                });
            }

            return(null);
        }