Skip to content

Conversation

luigifab
Copy link
Contributor

@luigifab luigifab commented Aug 9, 2022

Description

This PR allow to full invoice an order from API, like you can already create full shipment or full credit memo.

$proxy = new SoapClient('...', ['trace' => 1, 'user_agent' => 'Local/Test']);
$sessionId = $proxy->login('covid', $pass);
var_dump($proxy->call($sessionId, 'sales_order.info', 'increment_id'));
var_dump($proxy->call($sessionId, 'sales_order_invoice.create', 'increment_id'));
var_dump($proxy->call($sessionId, 'sales_order_shipment.create', 'increment_id'));
var_dump($proxy->call($sessionId, 'sales_order_creditmemo.create', 'increment_id'));

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Component: Sales Relates to Mage_Sales label Aug 9, 2022
@tobihille
Copy link
Contributor

Forgive me my ignorance but I don't see how your changes would allow full automatic invoice from api, there are only default values in functions added.
Can you please explain?

On the other hand: I don't see how your changes could harm anything.

@luigifab
Copy link
Contributor Author

Because this is the default behaviour of prepareInvoice:

/**
* Prepare order invoice based on order data and requested items qtys. If $qtys is not empty - the function will
* prepare only specified items, otherwise all containing in the order.
*
* @param array $qtys
* @return Mage_Sales_Model_Order_Invoice
*/
public function prepareInvoice($qtys = [])
{

@fballiano
Copy link

I also fail to understand (at first sight) how adding only the default value for the qtys fixes it (but didn't have time to actually test)

@fballiano fballiano merged commit 52f2c75 into OpenMage:1.9.4.x Oct 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
7 runs  ±0  5 ✔️ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 52f2c75. ± Comparison against base commit 01edaf6.

@luigifab luigifab deleted the api-auto-invoice branch October 10, 2022 08:19
sreichel added a commit that referenced this pull request Oct 17, 2022
* Fixed "should return string but returns false"

* Fixed "should return XYZ but returns false"

* Fixed "should return array but returns null"

* Fixed "should return string but returns null"

* Fixed "should return int but returns null"

* Fixed "should return bool but returns"

* Fixed docs (see comments)

* Fixed "should return array"

* Update app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Update app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Update app/code/core/Mage/Tag/Model/Resource/Tag.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Update app/code/core/Mage/Customer/Block/Form/Register.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Added module names to helper(#2617)

* Get catalog search result collection from engine (#2634)

* Add PHP dependencies security check workflow (#2639)

* [security-workflow] Fixed cron syntax (#2640)

* Added OpenMage Contributors Copyright (#2295)

* Added ddev snippets to docs (#2575)

* Improve dev/openmage/install.sh script for newer versions of Docker - no longer requires separate compose.

* Only run workflows when relevant files change (#2641)

* Add back notification popup severity icons URL (#2633)

* Reduce reprocessed jpeg file size by defaulting quality to 85% (#2629)

* Fixed issue #475.

* Removed <frontend_type>text</frontend_type> as it is the default.

* Fixed bug on users not able to modify image quality in backend if deprecated config exists.

* Fixed bug on incorrect check if image quality was not set in backend.

* Improved note in system.xml.

* Prevented editing of a non-editable order (#2632)

* Fix dev/openmage/install.sh script setting permissions on var directory.

* Allowed automatic full invoice from API (#2393)

* Add check if array key isset before using it (#2649)

* Fixed phpstan-baseline.neon

* Fixed phpstan-baseline.neon (updated dev tools)

* Revert "Fixed phpstan-baseline.neon"

This reverts commit 3c82e76.

* Fixed getRegion()

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
Co-authored-by: Mohamed ELIDRISSI <67818913+elidrissidev@users.noreply.github.com>
Co-authored-by: Justin Beaty <51970393+justinbeaty@users.noreply.github.com>
Co-authored-by: Colin Mollenhour <colin@mollenhour.com>
Co-authored-by: luigifab <31816829+luigifab@users.noreply.github.com>
Co-authored-by: Przemysław Piotrowski <przemyslaw.p@deligo.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Sales Relates to Mage_Sales

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants