hellohq-io / hellohq.docs

1 stars 0 forks source link

PlannedCost POST Request Fehler #175

Closed salkin-hc closed 2 months ago

salkin-hc commented 2 months ago

Describe the bug PlannedCost lässt sich über POST request nicht erstellen. Jede documentTemplateEntityId produziert nur Response: 400 - {"message": "CreateDocumentException => NoDocumentTemplate"} Im FrontEnd lässt sich ein PlannedCost problemlos erstellen, auch mit dem DocumentTemplate (22) -> normale Vorlage für Incoming Invoice.

Selbst beim Ausprobieren bei Swagger kommt die gleiche Fehlermeldung.

POST Requests von Invoice / Incoming Invoice aus anderen Templates funktionieren einwandfrei

To Reproduce

curl -X 'POST' \
  'https://beta.hellohq.io/v2/Documents' \
  -H 'accept: */*' \
  -H 'Authorization: _Token_' \
  -H 'Content-Type: application/json' \
  -d '{
            "date": "2024-08-08T14:25:36.529Z",
            "validUntilDate": "2024-09-08T14:25:36.529Z", 
            "discountNet": 1,
            "discountPercent": 0,
            "marginNet": 0,
            "marginPercent": 0,
            "currency": "EUR", 
            "performancePeriodStartDate": "2024-08-08T14:25:36.530Z", 
            "performancePeriodEndDate": "2024-09-08T14:25:36.530Z", 
            "deliveryConditionId": null, 
            "paymentConditionId": null,
            "contactPersonId": null,
            "companyId": 61040, 
            "companyPurchaseOrderNumberId": null,
            "financesBankAccountId": null,
            "internalContactPersonId": null,
            "projectId": 667, 
            "leadId": null,
            "documentType": "PlannedCost", 
            "documentTemplateEntityId": 11,
            "number": "Test"
        }'

Response {"message": "CreateDocumentException => NoDocumentTemplate"}

monderino commented 2 months ago

Hey @salkin-hc,

normally it should not be possible to assign a document template for incoming invoices to a planned revenue. Could you please provide the url to your helloHQ System. Then I can check the behavior.

Thank you. Best Sven

salkin-hc commented 2 months ago

The problem is with Planned Costs. The default template in the front end is an incoming invoice template. Our URL is: hanseaticconsulting.hellohq.io

monderino commented 2 months ago

Hey,

Sorry, ich habe nicht gesehen das du die API v2 benutzt. Planumsätze und Plankosten kann man aktuell nicht über die API anlegen. Die Endpoints fehlen noch.

Über die Documents-Endpoints kann man diese nicht anlegen da spezielle Logik erforderlich ist.

Das in der Dokumentation die Typen auftauchen ist ein Fehler den wir beheben werden.

Viele Grüße Sven

salkin-hc commented 2 months ago

Das ist schade, trotzdem vielen Dank!