Skip to content

Commit

Permalink
forgot to replace const, bit more cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninarchive committed Dec 1, 2023
1 parent 01acb49 commit 7d13312
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions backend/src/controllers/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const getTemplatesPath = (): string => {


export const createXml = (savedInvoice: IInvoice, companyConfig: ICompanyConfig): string => {


const invoiceXml = new Invoice(savedInvoice.number.toString(), {
//This empty object is created to keep TypeScript from complaining, it has no influence on the generated xml
issuer: {
Expand All @@ -107,20 +105,20 @@ export const createXml = (savedInvoice: IInvoice, companyConfig: ICompanyConfig)
if (savedInvoice && companyConfig) {
const currencyID = { currencyID: DEFAULT_CURRENCY };
const taxSchemeIDVAT = new TaxScheme({ id: 'VAT' });
const countryAndCode = COUNTRY_CODES.find(codes => codes.country === savedInvoice.client.country || codes.code === savedInvoice.client.country);
const customerCountryAndCode = COUNTRY_CODES.find(codes => codes.country === savedInvoice.client.country || codes.code === savedInvoice.client.country);

let cityRef = savedInvoice.client.city.trim();
const customerPostalAddress = new PostalAddress({
streetName: savedInvoice.client.address,
cityName: cityRef,
country: new Country({ identificationCode: countryAndCode ? countryAndCode.code : DEFAULT_COUNTRY_CODE })
country: new Country({ identificationCode: customerCountryAndCode ? customerCountryAndCode.code : DEFAULT_COUNTRY_CODE })
});

cityRef = companyConfig.company.city.trim();
const supplierPostalAddress = new PostalAddress({
streetName: companyConfig.company.address,
cityName: cityRef,
country: new Country({ identificationCode: 'BE' })
country: new Country({ identificationCode: DEFAULT_COUNTRY_CODE })
});
const supplierLegalEntity = new PartyLegalEntity({
registrationName: companyConfig.company.name,
Expand Down

0 comments on commit 7d13312

Please sign in to comment.