Skip to content

Commit 071d163

Browse files
committed
v4.0.273 invoice status object added
1 parent 8b8b8aa commit 071d163

File tree

3 files changed

+57
-41
lines changed

3 files changed

+57
-41
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- Coordenadas del proyecto -->
88
<groupId>com.fiscalapi</groupId>
99
<artifactId>fiscalapi</artifactId>
10-
<version>4.0.272</version>
10+
<version>4.0.273</version>
1111
<name>${project.groupId}:${project.artifactId}</name>
1212
<description>Genera facturas CFDI válidas ante el SAT consumiendo la API de https://www.fiscalapi.com</description>
1313
<url>https://www.fiscalapi.com</url>

src/main/java/com/fiscalapi/Examples.java

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public void run() {
2929
FiscalApiSettings settings = new FiscalApiSettings();
3030
settings.setDebugMode(true);
3131
settings.setApiUrl("https://test.fiscalapi.com");
32-
settings.setApiKey("<api-key>");
33-
settings.setTenant("<tenant-key>");
32+
//settings.setApiKey("<api-key>");
33+
settings.setApiKey("sk_test_4e7ca2f5_6c02_4571_9767_212f32cebd59");
34+
settings.setTenant("102e5f13-e114-41dd-bea7-507fce177281");
35+
//settings.setTenant("<tenant-key>");
3436

3537

3638

@@ -251,8 +253,8 @@ public void run() {
251253
//region Facturas
252254

253255
// // ***Obtener una factura por Id***//
254-
// ApiResponse<Invoice> apiResponse = client.getInvoiceService().getById("bda0b31d-e1e0-4644-91ea-c6f0e90fb57c",true);
255-
// System.out.printf("apiResponse: %s\n", apiResponse);
256+
ApiResponse<Invoice> apiResponse = client.getInvoiceService().getById("1207c05b-9c4b-42ed-aa39-1fab4e993c7b",true);
257+
System.out.printf("apiResponse: %s\n", apiResponse);
256258

257259
// // ***Listar facturas***//
258260
// ApiResponse<PagedList<Invoice>> apiResponse = client.getInvoiceService().getList(1,3);
@@ -864,42 +866,42 @@ public void run() {
864866
// System.out.println(apiResponse);
865867

866868
// Generar nota de crédito con precios dinámicos
867-
Invoice invoice = new Invoice();
868-
invoice.setVersionCode("4.0");
869-
invoice.setSeries("CN");
870-
invoice.setDate(LocalDateTime.now().minusHours(2));
871-
invoice.setPaymentFormCode("03");
872-
invoice.setCurrencyCode("MXN");
873-
invoice.setTypeCode("E");
874-
invoice.setExpeditionZipCode("01160");
875-
invoice.setPaymentMethodCode("PUE");
876-
877-
// Emisor por referencia
878-
InvoiceIssuer issuer = new InvoiceIssuer();
879-
issuer.setId("3f3478b4-60fd-459e-8bfc-f8239fc96257");
880-
invoice.setIssuer(issuer);
881-
882-
// Receptor por referencia
883-
InvoiceRecipient recipient = new InvoiceRecipient();
884-
recipient.setId("96b46762-d246-4a67-a562-510a25dbafa9");
885-
invoice.setRecipient(recipient);
886-
887-
// Facturas relacionadas
888-
List<RelatedInvoice> relatedInvoices = new ArrayList<>();
889-
RelatedInvoice related = new RelatedInvoice();
890-
related.setUuid("5FB2822E-396D-4725-8521-CDC4BDD20CCF");
891-
related.setRelationshipTypeCode("01");
892-
relatedInvoices.add(related);
893-
invoice.setRelatedInvoices(relatedInvoices);
894-
895-
// Productos / Servicios por referencia
896-
List<InvoiceItem> items = new ArrayList<>();
897-
InvoiceItem item = new InvoiceItem();
898-
item.setId("114a4be5-fb65-40b2-a762-ff0c55c6ebfa");
899-
item.setQuantity(0.5);
900-
item.setUnitPrice(150.0);
901-
items.add(item);
902-
invoice.setItems(items);
869+
// Invoice invoice = new Invoice();
870+
// invoice.setVersionCode("4.0");
871+
// invoice.setSeries("CN");
872+
// invoice.setDate(LocalDateTime.now().minusHours(2));
873+
// invoice.setPaymentFormCode("03");
874+
// invoice.setCurrencyCode("MXN");
875+
// invoice.setTypeCode("E");
876+
// invoice.setExpeditionZipCode("01160");
877+
// invoice.setPaymentMethodCode("PUE");
878+
//
879+
// // Emisor por referencia
880+
// InvoiceIssuer issuer = new InvoiceIssuer();
881+
// issuer.setId("3f3478b4-60fd-459e-8bfc-f8239fc96257");
882+
// invoice.setIssuer(issuer);
883+
//
884+
// // Receptor por referencia
885+
// InvoiceRecipient recipient = new InvoiceRecipient();
886+
// recipient.setId("96b46762-d246-4a67-a562-510a25dbafa9");
887+
// invoice.setRecipient(recipient);
888+
//
889+
// // Facturas relacionadas
890+
// List<RelatedInvoice> relatedInvoices = new ArrayList<>();
891+
// RelatedInvoice related = new RelatedInvoice();
892+
// related.setUuid("5FB2822E-396D-4725-8521-CDC4BDD20CCF");
893+
// related.setRelationshipTypeCode("01");
894+
// relatedInvoices.add(related);
895+
// invoice.setRelatedInvoices(relatedInvoices);
896+
//
897+
// // Productos / Servicios por referencia
898+
// List<InvoiceItem> items = new ArrayList<>();
899+
// InvoiceItem item = new InvoiceItem();
900+
// item.setId("114a4be5-fb65-40b2-a762-ff0c55c6ebfa");
901+
// item.setQuantity(0.5);
902+
// item.setUnitPrice(150.0);
903+
// items.add(item);
904+
// invoice.setItems(items);
903905

904906
// ApiResponse<Invoice> apiResponse = client.getInvoiceService().create(invoice);
905907
// System.out.println(apiResponse);

src/main/java/com/fiscalapi/models/invoicing/Invoice.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import com.fasterxml.jackson.annotation.JsonIgnore;
33
import com.fasterxml.jackson.annotation.JsonProperty;
44
import com.fiscalapi.common.BaseDto;
5+
import com.fiscalapi.common.CatalogDto;
6+
57
import java.time.LocalDateTime;
68
import java.time.ZonedDateTime;
79
import java.time.format.DateTimeParseException;
@@ -42,6 +44,9 @@ public class Invoice extends BaseDto{
4244
private List<InvoicePayment> payments;
4345
private List<InvoiceResponse> responses;
4446

47+
48+
private CatalogDto status;
49+
4550
/**
4651
* Constructor por defecto
4752
*/
@@ -395,6 +400,13 @@ public void setRelatedInvoices(List<RelatedInvoice> relatedInvoices) {
395400
this.relatedInvoices = relatedInvoices;
396401
}
397402

403+
/**
404+
* @return estado asociado a la factura
405+
*/
406+
public CatalogDto getStatus() {
407+
return status;
408+
}
409+
398410
/**
399411
* @return Lista de pagos asociados a la factura
400412
*/
@@ -422,4 +434,6 @@ public List<InvoiceResponse> getResponses() {
422434
public void setResponses(List<InvoiceResponse> responses) {
423435
this.responses = responses;
424436
}
437+
438+
425439
}

0 commit comments

Comments
 (0)