xcoreplatform / magento2-substituteorders

GNU General Public License v3.0
3 stars 9 forks source link

Error on Updating substitute Invoice #38

Open PatrickJager opened 3 years ago

PatrickJager commented 3 years ago

For a customer I had to add an substitute invoice (with pdf) to the substitude order. The flow would be like: PDF in exact -> sync start -> create substitute order if not exist->create substitute invoice if not exist -> update substitute invoice to add pdf.

But on doing so, I got the following error: Changing values did not change. POST works fine. So for now I am only able to add a single document to one invoice else I have to create a new invoice. (which is fine for now).

"Fatal Error: 'Uncaught TypeError: Argument 1 passed to Dealer4Dealer\\SubstituteOrders\\Model\\Invoice::setBillingAddress() must implement interface Dealer4Dealer\\SubstituteOrders\\Api\\Data\\OrderAddressInterface, null given, called in \/var\/www\/clients\/client6\/web11\/web\/vendor\/dealer4dealer\/module-substituteorders\/Model\/InvoiceManagement.php on line 155 and defined in \/var\/www\/clients\/client6\/web11\/web\/vendor\/dealer4dealer\/module-substituteorders\/Model\/Invoice.php:325\nStack trace:\n#0 \/var\/www\/clients\/client6\/web11\/web\/vendor\/dealer4dealer\/module-substituteorders\/Model\/InvoiceManagement.php(155): Dealer4Dealer\\SubstituteOrders\\Model\\Invoice->setBillingAddress(NULL)\n#1 [internal function]: Dealer4Dealer\\SubstituteOrders\\Model\\InvoiceManagement->putInvoice(Object(Dealer4Dealer\\SubstituteOrders\\Model\\Invoice))\n#2 \/var\/www\/clients\/client6\/web11\/web\/vendor\/magento\/module-webapi\/Controller\/Rest\/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)\n#3 \/var\/www\/clients\/client6\/web11\/web\/vendor\/magento\/module-webapi\/Con' in '\/var\/www\/clients\/client6\/web11\/web\/vendor\/dealer4dealer\/module-substituteorders\/Model\/Invoice.php' on line 325"