Skip to content

Commit

Permalink
e-invoice update
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Dec 13, 2024
1 parent be9d4ae commit 696a40e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ public XMLDataCollection getDocumentsBySyncPoint(@PathParam("syncpoint") long lS
query += " WHERE document.modified > '" + isoFormat.format(syncpoint) + "'";
query += " AND document.type LIKE '" + SnapshotService.TYPE_PRAFIX + "%' ";
query += " ORDER BY document.modified ASC";
logger.info("......QUERY-1=" + query);

result = documentService.getDocumentsByQuery(query, 1);
// do we found new data?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private void resolveItemValues(ItemCollection workitem, EInvoiceModel model) {

workitem.setItemValue("invoice.number", model.getId());
workitem.setItemValue("invoice.date", model.getIssueDateTime());
workitem.setItemValue("invoice.duedate", model.getDueDateTime());

workitem.setItemValue("invoice.total", model.getGrandTotalAmount().setScale(2, RoundingMode.HALF_UP));
workitem.setItemValue("invoice.total.net", model.getNetTotalAmount().setScale(2, RoundingMode.HALF_UP));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public abstract class EInvoiceModel {
protected String id = null;
protected String buyerReference = null;
protected LocalDate issueDateTime = null;
protected LocalDate dueDateTime = null;
protected BigDecimal grandTotalAmount = new BigDecimal("0.00");
protected BigDecimal taxTotalAmount = new BigDecimal("0.00");
protected BigDecimal netTotalAmount = new BigDecimal("0.00");
Expand Down Expand Up @@ -90,6 +91,10 @@ public LocalDate getIssueDateTime() {
return issueDateTime;
}

public LocalDate getDueDateTime() {
return dueDateTime;
}

public BigDecimal getGrandTotalAmount() {
return grandTotalAmount;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,22 @@ private void loadDocumentCoreData() {

}

// due date
Element specifiedTradePaymentTermsElement = findChildNodeByName(element, EInvoiceNS.RAM,
"SpecifiedTradePaymentTerms");
if (specifiedTradePaymentTermsElement != null) {
Element dateTimeElement = findChildNodeByName(specifiedTradePaymentTermsElement, EInvoiceNS.RAM,
"DueDateDateTime");
if (dateTimeElement != null) {
Element dateTimeElementString = findChildNodeByName(dateTimeElement, EInvoiceNS.UDT,
"DateTimeString");
if (dateTimeElementString != null) {
String dateStr = dateTimeElementString.getTextContent();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
dueDateTime = LocalDate.parse(dateStr, formatter);
}
}
}
}

// read ApplicableHeaderTradeAgreement - buyerReference
Expand Down

0 comments on commit 696a40e

Please sign in to comment.