.
This commit is contained in:
parent
2ae822c02e
commit
86253f5dcd
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.7",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "WEB: Vite (Chrome)",
|
"name": "WEB: Vite (Chrome)",
|
||||||
|
|||||||
@ -29,4 +29,4 @@ DOCUMENTS_PATH=/home/rodax/Documentos/uecko-erp/out/rodax/documents
|
|||||||
SIGN_DOCUMENTS=false
|
SIGN_DOCUMENTS=false
|
||||||
SIGNED_DOCUMENTS_PATH=/home/rodax/Documentos/uecko-erp/out/rodax/signed-documents
|
SIGNED_DOCUMENTS_PATH=/home/rodax/Documentos/uecko-erp/out/rodax/signed-documents
|
||||||
|
|
||||||
FASTREPORT_BIN=/home/rodax/Documentos/uecko-erp/tools/fastreport-cli/publish/linux/FastReportCliGenerator
|
FASTREPORT_BIN=/home/rodax/Documentos/uecko-erp/tools/fastreportcli-net-core-skia/FastReportCliGenerator/publish/linux/FastReportCliGenerator
|
||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@erp/factuges-server",
|
"name": "@erp/factuges-server",
|
||||||
"version": "0.1.7",
|
"version": "0.2.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup src/index.ts --config tsup.config.ts",
|
"build": "tsup src/index.ts --config tsup.config.ts",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@erp/factuges-web",
|
"name": "@erp/factuges-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.7",
|
"version": "0.2.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host --clearScreen false",
|
"dev": "vite --host --clearScreen false",
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export class IssuedInvoiceItemsReportPresenter extends Presenter<IssuedInvoiceIt
|
|||||||
private _mapItem(invoiceItem: IssuedInvoiceItemDTO, _index: number) {
|
private _mapItem(invoiceItem: IssuedInvoiceItemDTO, _index: number) {
|
||||||
const moneyOptions = {
|
const moneyOptions = {
|
||||||
hideZeros: true,
|
hideZeros: true,
|
||||||
minimumFractionDigits: 0,
|
minimumFractionDigits: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export class IssuedInvoiceTaxesReportPresenter extends Presenter<IssuedInvoiceTa
|
|||||||
private _mapTax(taxItem: IssuedInvoiceTaxDTO) {
|
private _mapTax(taxItem: IssuedInvoiceTaxDTO) {
|
||||||
const moneyOptions = {
|
const moneyOptions = {
|
||||||
hideZeros: true,
|
hideZeros: true,
|
||||||
minimumFractionDigits: 0,
|
minimumFractionDigits: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
//const taxCatalogItem = this._taxCatalog.findByCode(taxItem.tax_code);
|
//const taxCatalogItem = this._taxCatalog.findByCode(taxItem.tax_code);
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export class IssuedInvoiceReportPresenter extends Presenter<
|
|||||||
|
|
||||||
const moneyOptions = {
|
const moneyOptions = {
|
||||||
hideZeros: true,
|
hideZeros: true,
|
||||||
minimumFractionDigits: 0,
|
minimumFractionDigits: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -103,12 +103,12 @@ export class IssuedInvoiceReportPresenter extends Presenter<
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Provincia
|
// Provincia
|
||||||
if (recipient.province) {
|
if (recipient.province && recipient.province !== recipient.city) {
|
||||||
lines.push(recipient.province);
|
lines.push(recipient.province);
|
||||||
}
|
}
|
||||||
|
|
||||||
// País
|
// País
|
||||||
if (recipient.country) {
|
if (recipient.country && recipient.country !== "es") {
|
||||||
lines.push(recipient.country);
|
lines.push(recipient.country);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,6 +34,7 @@ import {
|
|||||||
} from "../application";
|
} from "../application";
|
||||||
|
|
||||||
import { CustomerInvoiceDomainMapper, CustomerInvoiceListMapper } from "./mappers";
|
import { CustomerInvoiceDomainMapper, CustomerInvoiceListMapper } from "./mappers";
|
||||||
|
import { IssuedInvoiceReportJSONRenderer } from "./renderers";
|
||||||
import { IssuedInvoiceReportPDFRenderer } from "./renderers/issued-invoice-report-pdf.renderer";
|
import { IssuedInvoiceReportPDFRenderer } from "./renderers/issued-invoice-report-pdf.renderer";
|
||||||
import { CustomerInvoiceRepository } from "./sequelize";
|
import { CustomerInvoiceRepository } from "./sequelize";
|
||||||
import { SequelizeInvoiceNumberGenerator } from "./services";
|
import { SequelizeInvoiceNumberGenerator } from "./services";
|
||||||
@ -100,6 +101,10 @@ export function buildIssuedInvoicesDependencies(params: ModuleParams): IssuedInv
|
|||||||
reportStorage
|
reportStorage
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: { resource: "issued-invoice", format: "JSON" },
|
||||||
|
renderer: new IssuedInvoiceReportJSONRenderer(),
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Aplicación */
|
/** Aplicación */
|
||||||
|
|||||||
@ -1,3 +1,2 @@
|
|||||||
export * from "./issued-invoice.renderer.html";
|
export * from "./issued-invoice-report-json.renderer";
|
||||||
export * from "./issued-invoice.renderer.json";
|
|
||||||
export * from "./issued-invoice-report-pdf.renderer";
|
export * from "./issued-invoice-report-pdf.renderer";
|
||||||
|
|||||||
@ -0,0 +1,20 @@
|
|||||||
|
import type { DTO } from "@erp/core";
|
||||||
|
import { Renderer } from "@erp/core/api";
|
||||||
|
import { Result } from "@repo/rdx-utils";
|
||||||
|
|
||||||
|
export type IssuedInvoiceReportJSONRenderOutput = Result<
|
||||||
|
{ payload: DTO; templateChecksum: string },
|
||||||
|
Error
|
||||||
|
>;
|
||||||
|
|
||||||
|
export class IssuedInvoiceReportJSONRenderer extends Renderer<
|
||||||
|
DTO,
|
||||||
|
IssuedInvoiceReportJSONRenderOutput
|
||||||
|
> {
|
||||||
|
render(source: DTO) {
|
||||||
|
return Result.ok({
|
||||||
|
payload: source,
|
||||||
|
templateChecksum: "",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import type { DTO } from "@erp/core";
|
import type { DTO } from "@erp/core";
|
||||||
import { FastReportRenderer } from "@erp/core/api";
|
import { FastReportRenderer } from "@erp/core/api";
|
||||||
|
import { Result } from "@repo/rdx-utils";
|
||||||
|
|
||||||
export type IssuedInvoiceReportPDFRendererParams = {
|
export type IssuedInvoiceReportPDFRendererParams = {
|
||||||
companySlug: string;
|
companySlug: string;
|
||||||
@ -10,10 +11,10 @@ export class IssuedInvoiceReportPDFRenderer extends FastReportRenderer {
|
|||||||
protected readonly templateName = "issued-invoice.frx";
|
protected readonly templateName = "issued-invoice.frx";
|
||||||
protected companySlug!: string;
|
protected companySlug!: string;
|
||||||
|
|
||||||
render(source: DTO, params: IssuedInvoiceReportPDFRendererParams) {
|
async render(source: DTO, params: IssuedInvoiceReportPDFRendererParams) {
|
||||||
this.companySlug = params.companySlug;
|
this.companySlug = params.companySlug;
|
||||||
|
|
||||||
return this.renderInternal({
|
const callResult = await this.renderInternal({
|
||||||
inputData: source,
|
inputData: source,
|
||||||
format: "PDF",
|
format: "PDF",
|
||||||
storageKey: {
|
storageKey: {
|
||||||
@ -22,6 +23,17 @@ export class IssuedInvoiceReportPDFRenderer extends FastReportRenderer {
|
|||||||
format: "PDF",
|
format: "PDF",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (callResult.isFailure) {
|
||||||
|
return Result.fail(callResult.error);
|
||||||
|
}
|
||||||
|
|
||||||
|
const { payload, templateChecksum } = callResult.data;
|
||||||
|
|
||||||
|
return Result.ok({
|
||||||
|
payload,
|
||||||
|
templateChecksum,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected resolveTemplatePath(): string {
|
protected resolveTemplatePath(): string {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@repo/rdx-criteria",
|
"name": "@repo/rdx-criteria",
|
||||||
"version": "0.1.7",
|
"version": "0.2.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@repo/rdx-ddd",
|
"name": "@repo/rdx-ddd",
|
||||||
"version": "0.1.7",
|
"version": "0.2.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@repo/rdx-logger",
|
"name": "@repo/rdx-logger",
|
||||||
"version": "0.1.7",
|
"version": "0.2.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@repo/rdx-utils",
|
"name": "@repo/rdx-utils",
|
||||||
"version": "0.1.7",
|
"version": "0.2.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user