Cliente:
- - `; + return readFileSync(path.join(__dirname, "./templates/quote.hbs")).toString(); }; + +const map = (quote: Quote, context: ISalesContext) => { + const { dealer } = context; + + return { + id: quote.id.toString(), + status: quote.status.toString(), + date: quote.date.toISO8601(), + reference: quote.reference.toString(), + customer_information: quote.customer.toString(), + lang_code: quote.language.toString(), + currency_code: quote.currency.toString(), + + payment_method: quote.paymentMethod.toString(), + validity: quote.validity.toString(), + notes: quote.notes.toString(), + + subtotal_price: quote.subtotalPrice.toFormat(), + + discount: quote.discount.toFormat(), + discount_price: quote.discountPrice.toFormat(), + + before_tax_price: quote.beforeTaxPrice.toFormat(), + + tax: quote.tax.toFormat(), + tax_price: quote.taxPrice.toFormat(), + + total_price: quote.totalPrice.toFormat(), + + items: quoteItemPresenter(quote.items, context), + + dealer: { + id: dealer?.id.toString(), + name: dealer?.name.toString(), + currency_code: dealer?.currency.code, + lang_code: dealer?.language.code, + contact_information: dealer?.additionalInfo.get("contact_information"), + default_payment_method: dealer?.additionalInfo.get("contact_information"), + default_notes: dealer?.additionalInfo.get("contact_information"), + default_legal_terms: dealer?.additionalInfo.get("contact_information"), + default_quote_validity: dealer?.additionalInfo.get("contact_information"), + }, + }; +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const quoteItemPresenter = (items: ICollectionEssential Furniture
+PREMIO AMBARRO DEL AÑO 2021
+LUXURY SPAIN
+ELLE 2021
+Presupuesto nº: {{id}}
+Fecha: {{date}}
+Validez: {{validity}}
+Vendedor: {{dealer.name}}
+Referencia cliente: {{reference}}
+{{customer_information}}
+| Cant. | +Descripción | +Prec. Unitario | +Subtotal | +Dto (%) | +Importe total | +
|---|---|---|---|---|---|
| {{quantity}} | +{{description}} | +{{unit_price}} | +{{subtotal_price}} | +{{discount}} | +{{total_price}} | +
Forma de pago: {{payment_method}}
+Notas: {{notes}}
+| Importe neto | ++ | {{subtotal_price}} | +
| % Descuento | +{{discount.amount}} | +{{discount_price}} | +
| Base imponible | ++ | {{before_tax_price}} | +
| % IVA | +{{tax}} | +{{tax_price}} | +
| Importe total | ++ | {{total_price}} | +
Información básica sobre protección de datos
+{{quote.default_legal_terms}}
+