Error en presentación de impuestos
This commit is contained in:
parent
b97d32b607
commit
700ace3b76
@ -1,13 +1,11 @@
|
||||
export function formatPaymentMethodDTO(paymentMethod: object) {
|
||||
import { GetCustomerInvoiceByIdResponseDTO } from "@erp/customer-invoices/common";
|
||||
|
||||
export function formatPaymentMethodDTO(
|
||||
paymentMethod?: GetCustomerInvoiceByIdResponseDTO["payment_method"]
|
||||
) {
|
||||
if (!paymentMethod) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Construir objeto paymentMethod para comprobar que existe
|
||||
//const value = PaymentMethod.create(
|
||||
// id: paymentMethod.payment_id),
|
||||
//).data;
|
||||
//return value.format(locale);
|
||||
|
||||
return paymentMethod.payment_description;
|
||||
return paymentMethod.payment_description ?? "";
|
||||
}
|
||||
|
||||
@ -46,6 +46,8 @@ export class CustomerInvoiceFullPresenter extends Presenter<
|
||||
invoice_date: invoice.invoiceDate.toDateString(),
|
||||
operation_date: toEmptyString(invoice.operationDate, (value) => value.toDateString()),
|
||||
|
||||
reference: toEmptyString(invoice.reference, (value) => value.toString()),
|
||||
description: toEmptyString(invoice.description, (value) => value.toString()),
|
||||
notes: toEmptyString(invoice.notes, (value) => value.toString()),
|
||||
|
||||
language_code: invoice.languageCode.toString(),
|
||||
@ -57,8 +59,8 @@ export class CustomerInvoiceFullPresenter extends Presenter<
|
||||
taxes: invoice.taxes.map((taxItem) => {
|
||||
return {
|
||||
tax_code: taxItem.tax.code,
|
||||
taxable_amount: taxItem.taxableAmount.toObjectString(),
|
||||
taxes_amount: taxItem.taxesAmount.toObjectString(),
|
||||
taxable_amount: taxItem.taxableAmount.convertScale(2).toObjectString(),
|
||||
taxes_amount: taxItem.taxesAmount.convertScale(2).toObjectString(),
|
||||
};
|
||||
}),
|
||||
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
import { Tax } from "@erp/core/api";
|
||||
import { DomainEntity, UniqueID } from "@repo/rdx-ddd";
|
||||
import { Result } from "@repo/rdx-utils";
|
||||
import { ItemAmount } from "../../value-objects";
|
||||
import { InvoiceAmount } from "../../value-objects/invoice-amount";
|
||||
|
||||
export interface InvoiceTaxProps {
|
||||
tax: Tax;
|
||||
taxesAmount: ItemAmount;
|
||||
taxesAmount: InvoiceAmount;
|
||||
}
|
||||
|
||||
export class InvoiceTax extends DomainEntity<InvoiceTaxProps> {
|
||||
|
||||
@ -12,6 +12,7 @@ export const GetCustomerInvoiceByIdResponseSchema = z.object({
|
||||
invoice_date: z.string(),
|
||||
operation_date: z.string(),
|
||||
|
||||
reference: z.string(),
|
||||
description: z.string(),
|
||||
notes: z.string(),
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user