Skip to content

Commit 227c445

Browse files
add docs
1 parent 9d2bfa0 commit 227c445

10 files changed

+601
-1
lines changed

docs/docs/peru_creditnote.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
id: peru_creditnote
3+
title: CreditNote (Nota de crédito)
4+
---
5+
6+
## Create _CreditNoteType_
7+
8+
To create a `CreditNoteType` you only need to create an instance of `CreditNoteInputModel`.
9+
10+
```java
11+
Config config;
12+
SystemClock clock;
13+
14+
// Create the POJO
15+
CreditNoteInputModel pojo = CreditNoteInputModel.Builder.aCreditNoteInputModel()
16+
.withSerie("FC01")
17+
.withNumero(1)
18+
.withSerieNumeroComprobanteAfectado("F001-1")
19+
.withDescripcionSustento("mi sustento")
20+
.withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
21+
.withRuc("12345678912")
22+
.withRazonSocial("Softgreen S.A.C.")
23+
.build()
24+
)
25+
.withCliente(ClienteInputModel.Builder.aClienteInputModel()
26+
.withNombre("Carlos Feria")
27+
.withNumeroDocumentoIdentidad("12121212121")
28+
.withTipoDocumentoIdentidad(Catalog6.RUC.toString())
29+
.build()
30+
)
31+
.withDetalle(Arrays.asList(
32+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
33+
.withDescripcion("Item1")
34+
.withCantidad(new BigDecimal(10))
35+
.withPrecioUnitario(new BigDecimal(100))
36+
.build(),
37+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
38+
.withDescripcion("Item2")
39+
.withCantidad(new BigDecimal(10))
40+
.withPrecioUnitario(new BigDecimal(100))
41+
.build())
42+
)
43+
.build();
44+
45+
// Create XML
46+
DocumentWrapper<CreditNoteOutputModel> result = DocumentManager.createXML(pojo, config, systemClock);
47+
CreditNoteOutputModel output = result.getOutput();
48+
String xml = result.getXml();
49+
```

docs/docs/peru_debitnote.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
id: peru_debitnote
3+
title: DebitNote (Nota de débito)
4+
---
5+
6+
## Create _DebitNoteType_
7+
8+
To create a `DebitNoteType` you only need to create an instance of `DebitNoteInputModel`.
9+
10+
```java
11+
Config config;
12+
SystemClock clock;
13+
14+
// Create the POJO
15+
DebitNoteInputModel pojo = DebitNoteInputModel.Builder.aDebitNoteInputModel()
16+
.withSerie("FD01")
17+
.withNumero(1)
18+
.withSerieNumeroComprobanteAfectado("F001-1")
19+
.withDescripcionSustento("mi sustento")
20+
.withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
21+
.withRuc("12345678912")
22+
.withRazonSocial("Softgreen S.A.C.")
23+
.build()
24+
)
25+
.withCliente(ClienteInputModel.Builder.aClienteInputModel()
26+
.withNombre("Carlos Feria")
27+
.withNumeroDocumentoIdentidad("12121212121")
28+
.withTipoDocumentoIdentidad(Catalog6.RUC.toString())
29+
.build()
30+
)
31+
.withDetalle(Arrays.asList(
32+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
33+
.withDescripcion("Item1")
34+
.withCantidad(new BigDecimal(10))
35+
.withPrecioUnitario(new BigDecimal(100))
36+
.build(),
37+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
38+
.withDescripcion("Item2")
39+
.withCantidad(new BigDecimal(10))
40+
.withPrecioUnitario(new BigDecimal(100))
41+
.build())
42+
)
43+
.build();
44+
45+
// Create XML
46+
DocumentWrapper<DebitNoteOutputModel> result = DocumentManager.createXML(pojo, config, systemClock);
47+
DebitNoteOutputModel output = result.getOutput();
48+
String xml = result.getXml();
49+
```

docs/docs/peru_icb.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
id: peru_icb
3+
title: ICB
4+
---
5+
6+
_Inpuesto al Consumo de Bolsas plásticas (ICB)_ is a type of tax applied only to plastic bags. Whenever you create an **_InvoiceType_, _CreditNoteType_, or _DebitNoteType_** you can define, for each item selled, if you want to apply the _ICB_ taxes or not.
7+
8+
The current value of _ICB_ is _0.2 Soles_ but this might change in the future. Don't worry you are safe if you use your own [Config](./concepts#config) default values.
9+
10+
## Examples
11+
12+
### _Invoice (boleta/factura)_
13+
14+
Use the field `icb` in each item selled:
15+
16+
```java
17+
InvoiceInputModel input = InvoiceInputModel.Builder.anInvoiceInputModel()
18+
.withDetalle(Arrays.asList(
19+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
20+
.withIcb(true)
21+
.build(),
22+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
23+
.withIcb(true)
24+
.build())
25+
)
26+
.build();
27+
```
28+
29+
### _CreditNote (nota de crédito)_
30+
31+
Use the field `icb` in each item selled:
32+
33+
```java
34+
CreditNoteInputModel pojo = CreditNoteInputModel.Builder.aCreditNoteInputModel()
35+
.withDetalle(Arrays.asList(
36+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
37+
.withIcb(true)
38+
.build(),
39+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
40+
.withIcb(true)
41+
.build())
42+
)
43+
.build();
44+
```
45+
46+
### _DebitNote (nota de débito)_
47+
48+
Use the field `icb` in each item selled:
49+
50+
```java
51+
DebitNoteInputModel pojo = DebitNoteInputModel.Builder.aDebitNoteInputModel()
52+
.withDetalle(Arrays.asList(
53+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
54+
.withIcb(true)
55+
.build(),
56+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
57+
.withIcb(true)
58+
.build())
59+
)
60+
.build();
61+
```
62+
63+
## Value of _ICB_
64+
65+
The value of _ICB_ is defined by the value you setted in the [Config](./concepts#config) object.
66+
67+
## Default value of _ICB_
68+
69+
If _icb_ is not defined or is `false`, then `XBuilder` won't apply this type of tax.

docs/docs/peru_igv.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
id: peru_igv
3+
title: IGV
4+
---
5+
6+
_Inpuesto General a las Ventas (IGV)_ is a type of tax valid in Perú. Whenever you create a **_InvoiceType_, _CreditNoteType_, or _DebitNoteType_** you can define, for each item selled, a specific type of _IGV_. All _IGV_ types might be grouped into 4 groups:
7+
8+
- Gravadas
9+
- Exoneradas
10+
- Inafectas
11+
- Gratuitas
12+
13+
## Examples
14+
15+
### _Invoice (boleta/factura)_
16+
17+
Use the field `tipoIgv` in each item selled:
18+
19+
```java
20+
InvoiceInputModel pojo = InvoiceInputModel.Builder.anInvoiceInputModel()
21+
.withDetalle(Arrays.asList(
22+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
23+
.withTipoIgv(Catalog7.GRAVADO_OPERACION_ONEROSA.toString())
24+
.build(),
25+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
26+
.withTipoIgv(Catalog7.GRAVADO_OPERACION_ONEROSA.toString())
27+
.build())
28+
)
29+
.build();
30+
```
31+
32+
### _CreditNote (nota de crédito)_
33+
34+
Use the field `tipoIgv` in each item selled:
35+
36+
```java
37+
CreditNoteInputModel pojo = CreditNoteInputModel.Builder.aCreditNoteInputModel()
38+
.withDetalle(Arrays.asList(
39+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
40+
.withTipoIgv(Catalog7.GRAVADO_OPERACION_ONEROSA.toString())
41+
.build(),
42+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
43+
.withTipoIgv(Catalog7.GRAVADO_OPERACION_ONEROSA.toString())
44+
.build())
45+
)
46+
.build();
47+
```
48+
49+
### _DebitNote (nota de débito)_
50+
51+
Use the field `tipoIgv` in each item selled:
52+
53+
```java
54+
DebitNoteInputModel pojo = DebitNoteInputModel.Builder.aDebitNoteInputModel()
55+
.withDetalle(Arrays.asList(
56+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
57+
.withTipoIgv(Catalog7.GRAVADO_OPERACION_ONEROSA.toString())
58+
.build(),
59+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
60+
.withTipoIgv(Catalog7.GRAVADO_OPERACION_ONEROSA.toString())
61+
.build())
62+
)
63+
.build();
64+
```
65+
66+
## Values of _tipoIgv_
67+
68+
The list of possible values of _tipoIgv_ can be found in the **Catalog 07** defined by the SUNAT.
69+
70+
| Value | Code |
71+
| ----------------------------------------- | ---- |
72+
| GRAVADO_OPERACION_ONEROSA | 10 |
73+
| GRAVADO_RETIRO_POR_PREMIO | 11 |
74+
| GRAVADO_RETIRO_POR_DONACION | 12 |
75+
| GRAVADO_RETIRO | 13 |
76+
| GRAVADO_RETIRO_POR_PUBLICIDAD | 14 |
77+
| GRAVADO_BONIFICACIONES | 15 |
78+
| GRAVADO_RETIRO_POR_ENTREGA_A_TRABAJADORES | 16 |
79+
| GRAVADO_IVAP | 17 |
80+
| EXONERADO_OPERACION_ONEROSA | 20 |
81+
| EXONERADO_TRANSFERENCIA_GRATUITA | 21 |
82+
| INAFECTO_OPERACION_ONEROSA | 30 |
83+
| INAFECTO_RETIRO_POR_BONIFICACION | 31 |
84+
| INAFECTO_RETIRO | 32 |
85+
| INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS | 33 |
86+
| INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO | 34 |
87+
| INAFECTO_RETIRO_POR_PREMIO | 35 |
88+
| INAFECTO_RETIRO_POR_PUBLICIDAD | 36 |
89+
| EXPORTACION | 40 |
90+
91+
## Default value of _tipoIgv_
92+
93+
If _tipoIgv_ is not defined within the POJO, then a default value defined in the **Config** will be applied. Learn how to configure the config in the [Concepts page](./concepts#config)

docs/docs/peru_invoice.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
id: peru_invoice
3+
title: Invoice (Boleta/Factura)
4+
---
5+
6+
## Create *InvoiceType*
7+
8+
To create an invoice you only need to create an instance of `InvoiceInputModel`.
9+
10+
```java
11+
Config config;
12+
SystemClock clock;
13+
14+
// Create the POJO
15+
InvoiceInputModel input = InvoiceInputModel.Builder.anInvoiceInputModel()
16+
.withSerie("F001")
17+
.withNumero(1)
18+
.withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
19+
.withRuc("12345678912")
20+
.withRazonSocial("Softgreen S.A.C.")
21+
.build()
22+
)
23+
.withCliente(ClienteInputModel.Builder.aClienteInputModel()
24+
.withNombre("Carlos Feria")
25+
.withNumeroDocumentoIdentidad("12121212121")
26+
.withTipoDocumentoIdentidad(Catalog6.RUC.toString())
27+
.build()
28+
)
29+
.withDetalle(Arrays.asList(
30+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
31+
.withDescripcion("Item1")
32+
.withCantidad(new BigDecimal(10))
33+
.withPrecioUnitario(new BigDecimal(100))
34+
.build(),
35+
DocumentLineInputModel.Builder.aDocumentLineInputModel()
36+
.withDescripcion("Item2")
37+
.withCantidad(new BigDecimal(10))
38+
.withPrecioUnitario(new BigDecimal(100))
39+
.build())
40+
)
41+
.build();
42+
43+
// Create Invoice
44+
DocumentWrapper<InvoiceOutputModel> result = DocumentManager.createXML(input, config, systemClock);
45+
46+
InvoiceOutputModel output = result.getOutput(); // XML Var values
47+
String xml = result.getXml(); // XML content
48+
```

0 commit comments

Comments
 (0)