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