Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class PageRepresentation<T> {

private Meta meta;
private List<T> data;
private List<T> items;

public Meta getMeta() {
return meta;
Expand All @@ -34,12 +34,12 @@ public void setMeta(Meta meta) {
this.meta = meta;
}

public List<T> getData() {
return data;
public List<T> getItems() {
return items;
}

public void setData(List<T> data) {
this.data = data;
public void setItems(List<T> items) {
this.items = items;
}

@RegisterForReflection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public static <T, R> PageRepresentation<R> toRepresentation(List<T> pageElements
repMeta.setCount(totalElements);

// Data
rep.setData(pageElements.stream()
rep.setItems(pageElements.stream()
.map(mapper)
.collect(Collectors.toList())
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package io.github.project.openubl.ublhub.sender;

import io.github.project.openubl.ublhub.models.jpa.entities.NamespaceEntity;
import io.github.project.openubl.xmlsenderws.webservices.exceptions.InvalidXMLFileException;
import io.github.project.openubl.xmlsenderws.webservices.exceptions.UnsupportedDocumentTypeException;
import io.github.project.openubl.xmlsenderws.webservices.exceptions.ValidationWebServiceException;
Expand Down Expand Up @@ -68,7 +69,7 @@ public Uni<XmlContentModel> getFileContent(byte[] file) {
public Uni<XSenderConfig> getXSenderConfig(String namespaceId, String ruc) {
return Panache.withTransaction(() -> companyRepository.findByRuc(namespaceId, ruc)
.onItem().ifNotNull().transform(companyEntity -> companyEntity.sunat)
.onItem().ifNull().switchTo(() -> namespaceRepository.findById(namespaceId).map(namespaceEntity -> namespaceEntity.sunat))
.onItem().ifNull().switchTo(() -> namespaceRepository.find("id", namespaceId).singleResult().map(namespaceEntity -> namespaceEntity.sunat))
)
.onItem().ifNotNull().transform(sunatEntity -> XSenderConfigBuilder.aXSenderConfig()
.withFacturaUrl(sunatEntity.sunatUrlFactura)
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"axios": "^0.24.0",
"dayjs": "^1.10.7",
"formik": "^2.2.9",
"i18next": "^21.6.3",
"i18next-http-backend": "^1.3.1",
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@
"actions": "Acciones",
"algorithm": "Algoritmo",
"companies": "Empresas",
"created-on": "Creado en",
"credentials": "Credenciales",
"description": "Descripción",
"document": "Documento",
"general": "General",
"id": "Id",
"keys": "Llaves",
"kid": "Kid",
"name": "Nombre",
"password": "Contraseña",
"priority": "Prioridad",
"progress": "Progreso",
"provider": "Proveedor",
"review": "Revisión",
"status": "Estado",
Expand Down
24 changes: 12 additions & 12 deletions src/main/webapp/src/api/ublhub.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ export interface DebitNoteInputModel extends NoteInputModel {

export interface SummaryDocumentInputModel {
numero: number;
fechaEmision: number;
fechaEmision?: number;
fechaEmisionDeComprobantesAsociados: number;
firmante: FirmanteInputModel;
firmante?: FirmanteInputModel;
proveedor: ProveedorInputModel;
detalle: SummaryDocumentLineInputModel[];
}

export interface VoidedDocumentInputModel {
numero: number;
fechaEmision: number;
firmante: FirmanteInputModel;
fechaEmision?: number;
firmante?: FirmanteInputModel;
proveedor: ProveedorInputModel;
descripcionSustento: string;
comprobante: VoidedDocumentLineInputModel;
Expand Down Expand Up @@ -175,7 +175,7 @@ export interface DocTribRelacionadoInputModel_DebitNote
export interface SummaryDocumentLineInputModel {
tipoOperacion: string;
comprobante: SummaryDocumentComprobanteInputModel;
comprobanteAfectado: SummaryDocumentComprobanteAfectadoInputModel;
comprobanteAfectado?: SummaryDocumentComprobanteAfectadoInputModel;
}

export interface VoidedDocumentLineInputModel {
Expand Down Expand Up @@ -220,14 +220,14 @@ export interface SummaryDocumentComprobanteAfectadoInputModel {

export interface SummaryDocumentComprobanteValorVentaInputModel {
importeTotal: number;
otrosCargos: number;
gravado: number;
exonerado: number;
inafecto: number;
gratuito: number;
otrosCargos?: number;
gravado?: number;
exonerado?: number;
inafecto?: number;
gratuito?: number;
}

export interface SummaryDocumentImpuestosInputModel {
igv: number;
icb: number;
igv?: number;
icb?: number;
}
Binary file added src/main/webapp/src/images/sunat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
BreadCrumbPath,
NamespaceContextSelector,
SimplePageSection,
useNamespaceContext,
YAMLEditor,
} from "shared/components";

Expand Down Expand Up @@ -68,9 +67,6 @@ export const CreateDocument: React.FC = () => {
history.push(documentsPath(namespaceId));
});

// Context
const namespaceContext = useNamespaceContext();

// Editor
const editorRef = useRef<monacoEditor.editor.IStandaloneCodeEditor | null>(
null
Expand Down Expand Up @@ -126,9 +122,7 @@ export const CreateDocument: React.FC = () => {
breadcrumbs={[
{
title: "Documents",
path: namespaceContext
? documentsPath(namespaceContext.id!)
: "/",
path: documentsPath(namespaceId),
},
{ title: t("actions.create"), path: "/" },
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,99 @@ export const InputData: InputTemplate[] = [
},
},
},
{
category: "VoidedDocument",
metadata: {
title: "Basic voided document",
description: "Create a basic voided document with minimal data",
},
input: {
kind: "VoidedDocument",
spec: {
idGenerator: {
name: "none",
},
document: {
numero: 1,
proveedor: {
ruc: "12345678912",
razonSocial: "Mi razón social S.A.C.",
},
descripcionSustento: "mi razon de baja",
comprobante: {
serieNumero: "F001-1",
tipoComprobante: "factura",
fechaEmision: 1641394054167,
},
},
},
},
},
{
category: "SummaryDocument",
metadata: {
title: "Basic summary document",
description: "Create a basic summary document with minimal data",
},
input: {
kind: "SummaryDocument",
spec: {
idGenerator: {
name: "none",
},
document: {
numero: 1,
fechaEmisionDeComprobantesAsociados: 1641394054167,
proveedor: {
ruc: "12345678912",
razonSocial: "Mi razón social S.A.C.",
},
detalle: [
{
tipoOperacion: "ADICIONAR",
comprobante: {
tipo: "BOLETA",
serieNumero: "B001-1",
cliente: {
nombre: "nombre de mi cliente",
numeroDocumentoIdentidad: "12345678",
tipoDocumentoIdentidad: "DNI",
},
impuestos: {
igv: 100,
},
valorVenta: {
importeTotal: 118,
gravado: 100,
},
},
},
{
tipoOperacion: "ADICIONAR",
comprobante: {
tipo: "NOTA_CREDITO",
serieNumero: "BC01-1",
cliente: {
nombre: "nombre de mi cliente",
numeroDocumentoIdentidad: "12345678",
tipoDocumentoIdentidad: "DNI",
},
impuestos: {
igv: 100,
},
valorVenta: {
importeTotal: 118,
gravado: 100,
},
},
comprobanteAfectado: {
tipo: "BOLETA",
serieNumero: "B001-1",
},
},
],
},
},
},
},
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.pf-c-table.documents-table tr > * {
max-width: none;
}

.pf-c-table.documents-table tbody > tr > * {
vertical-align: middle;
}

.pf-c-table.documents-table tbody > tr > td.pf-c-table__toggle {
padding-bottom: var(--pf-c-table--tbody--cell--PaddingBottom);
}

.pf-c-table.documents-table tbody > tr > td.pf-c-table__toggle .pf-c-button {
margin-top: 0;
}

.pf-c-table.documents-table table.expanded-content tr > th {
padding-left: 0;
font-weight: bold;
}

.pf-c-table.documents-table table.expanded-content tr > td {
padding-left: var(--pf-global--spacer--xl);
}

.pf-c-table.documents-table button.clickable-progress-bar {
margin: calc(0px - var(--pf-global--spacer--form-element))
calc(0px - var(--pf-global--spacer--md));
width: 100%;
text-align: left;
}

.documents-table .pf-c-progress {
--pf-c-progress--GridGap: var(--pf-global--spacer--xs);
}
Loading