Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create endpoint to directly insert invoice candidates #5755

Open
metas-ts opened this issue Nov 3, 2019 · 1 comment
Open

Create endpoint to directly insert invoice candidates #5755

metas-ts opened this issue Nov 3, 2019 · 1 comment

Comments

@metas-ts
Copy link
Member

metas-ts commented Nov 3, 2019

Is this a bug or feature request?

What is the current behavior?

Which are the steps to reproduce?

What is the expected or desired behavior?

metas-ts added a commit that referenced this issue Nov 3, 2019
starting both endpoint and model, in broad brushed
#5755
metas-ts added a commit that referenced this issue Nov 4, 2019
* extend generic/fallback error handler to allow multiple errors
* change response protocols to for multiple errors
* attempt to have something that asap allows users to develop against the new REST-API
#5755
metas-ts added a commit that referenced this issue Nov 4, 2019
metas-ts added a commit that referenced this issue Nov 5, 2019
* starting to work on lookup/retrieval-code for masterdata (BPartner) and ICs
#5755
metas-ts added a commit that referenced this issue Nov 7, 2019
* continue implementing lookup and sync of invoice candidates
* along the way:
  * refactor: move ExternalId to de.metas.util; move MetasfreshRestAPIConstants to de.metas.util.web
  * modernize InvoiceCandidate query to
    * load many ICs at ones
    * also support loading via externalIds
  * extract common code for BPartner lookup

#5755
metas-ts added a commit that referenced this issue Nov 8, 2019
…n stuff

solved Conflicts:
	de.metas.business.rest-api-impl/src/main/java/de/metas/rest_api/invoicecandidates/impl/InvoiceJsonConverters.java
	de.metas.business.rest-api-impl/src/main/java/de/metas/rest_api/invoicecandidates/impl/InvoicesRestControllerImpl.java
	de.metas.business.rest-api-impl/src/test/java/de/metas/rest_api/invoicecandidates/impl/InvoiceJsonConverterServiceTest.java
	de.metas.business.rest-api/src/main/java/de/metas/rest_api/invoicecandidates/IInvoicesRestEndpoint.java
	de.metas.business.rest-api/src/main/java/de/metas/rest_api/invoicecandidates/request/JsonInvoiceCandidate.java
	de.metas.business.rest-api/src/main/java/de/metas/rest_api/invoicecandidates/request/JsonInvoiceCandidateReference.java
	de.metas.business.rest-api/src/main/java/de/metas/rest_api/invoicecandidates/request/JsonRequestEnqueueForInvoicing.java
	de.metas.business.rest-api/src/main/java/de/metas/rest_api/invoicecandidates/request/JsonRequestInvoiceCandidateExternalIdSpec.java
	de.metas.swat/de.metas.swat.base/src/main/java/de/metas/invoicecandidate/api/IInvoiceCandBL.java
	de.metas.swat/de.metas.swat.base/src/main/java/de/metas/invoicecandidate/api/IInvoiceCandDAO.java

#5755
metas-ts added a commit that referenced this issue Nov 11, 2019
* inserted my first "real" manual IC via API
#5755
metas-ts added a commit that referenced this issue Nov 11, 2019
* minor fixes regarding this issue
* bunch of unrelated minor improvements
#5755
metas-ts added a commit that referenced this issue Nov 11, 2019
* solve unit test issues
* extract pricing and tex-finding BL out of ExternallyReferencedCandidateRepository
#5755
metas-ts added a commit that referenced this issue Nov 12, 2019
* InvoicesRestControllerImpl et al:
  * harmomize method names and request/response class names
  * use the request RestControllerImpl only as entrypoint, delegator and for swagger; move the actual work (also high-level) into services
  * remove try-catch code in RestControllerImpl; instead using the generic exception handler
* refactor: move common JsonTypes to dedicated package
#5755
metas-ts added a commit that referenced this issue Nov 12, 2019
metas-ts added a commit that referenced this issue Nov 12, 2019
@metas-ts
Copy link
Member Author

Dev-Test / Documentation

Check out the sagger-documentation at {{baseURL}}/swagger-ui.html#/invoices-rest-controller-impl/createInvoiceCandidatesUsingPOST

image

Invoke {{baseURL}}/api/invoices/createCandidates with this request pody:

{
  "items" : [ {
    "orgCode" : "001",
    "externalHeaderId" : "externalHeaderId_unique3",
    "externalLineId" : "externalLineId_1",
    "poReference" : null,
    "billPartnerIdentifier" : "val-G0001",
    "billLocationIdentifier" : null,
    "billContactIdentifier" : null,
    "productIdentifier" : "val-P002737",
    "soTrx" : "SALES",
    "invoiceDocType" : null,
    "invoiceRuleOverride" : "Immediate",
    "presetDateInvoiced" : null,
    "dateOrdered" : null,
    "qtyOrdered" : 10,
    "qtyDelivered" : null,
    "uomCode" : null,
    "priceEnteredOverride" : null,
    "discountOverride" : null,
    "lineDescription" : null
  },
  {
    "externalHeaderId" : "externalHeaderId_unique3",
    "externalLineId" : "externalLineId_2",
    "billPartnerIdentifier" : "val-G0001",
    "productIdentifier" : "val-P002737",
    "soTrx" : "SALES",
    "qtyOrdered" : 10,
    "qtyDelivered" : 9,
    "lineDescription" : "testlinedescr"
  }]
}

Notes:

  • the first item explicitly sets the orgCode; the 2nd one goes with the user's org
  • the first item explicitly sets the invoiceRuleOverride; the 2nd one goes with the bpartner's invoice-rule (after delivery in this case)

Take a look in the webui

image

The ICs were creted as specified;
They can also be invoiced like any onther IC

metas-ts added a commit that referenced this issue Nov 12, 2019
* add externalId as filter to IC window; remove some less usable columns from filtering
#5755
metas-ts added a commit that referenced this issue Nov 18, 2019
  * [#5430](#5430) report server: autodetect and use workspace jasperreports folders
  * [#5637](#5637) Add DPD Shipper and DPD integration
  * [#5755](#5755) Create endpoint to directly insert invoice candidates
  * [#5774](#5774) Invoice candidates sometimes remain "ToUpdate" after the invoice was created
  * [#5776](#5776) Distribution Network from Main-Warehouse to Picking Warehouse
  * [#5782](#5782) Endpoint: Close Invoice Candidates
  * [#5784](#5784) Adjust LU Label
  * [#5789](#5789) Don't log migration scripts for AD_Attachment tables
  * [#5778](#5778) Fix potential threadLocalTrxName leakage
  * [#5787](#5787) BPartner API error if CreatedBy or UpdatedBy == -1
metas-ts added a commit that referenced this issue Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant