mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for approving quote
This commit is contained in:
parent
6217419a2f
commit
637f298818
@ -113,18 +113,9 @@ class InvoiceService extends BaseService
|
|||||||
* @param Invitation|null $invitation
|
* @param Invitation|null $invitation
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function convertQuote($quote, Invitation $invitation = null)
|
public function convertQuote($quote)
|
||||||
{
|
{
|
||||||
$invoice = $this->invoiceRepo->cloneInvoice($quote, $quote->id);
|
return $this->invoiceRepo->cloneInvoice($quote, $quote->id);
|
||||||
if (!$invitation) {
|
|
||||||
return $invoice;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($invoice->invitations as $invoiceInvitation) {
|
|
||||||
if ($invitation->contact_id == $invoiceInvitation->contact_id) {
|
|
||||||
return $invoiceInvitation->invitation_key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,7 +132,13 @@ class InvoiceService extends BaseService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($account->auto_convert_quote || ! $account->hasFeature(FEATURE_QUOTES)) {
|
if ($account->auto_convert_quote || ! $account->hasFeature(FEATURE_QUOTES)) {
|
||||||
$invoice = $this->convertQuote($quote, $invitation);
|
$invoice = $this->convertQuote($quote);
|
||||||
|
|
||||||
|
foreach ($invoice->invitations as $invoiceInvitation) {
|
||||||
|
if ($invitation->contact_id == $invoiceInvitation->contact_id) {
|
||||||
|
$invitation = $invoiceInvitation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event(new QuoteInvitationWasApproved($quote, $invoice, $invitation));
|
event(new QuoteInvitationWasApproved($quote, $invoice, $invitation));
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?php //[STAMP] a3cf36879dbbec28f15389e7d8d325a2
|
<?php //[STAMP] 37380042138360812111baed01969345
|
||||||
namespace _generated;
|
namespace _generated;
|
||||||
|
|
||||||
// This class was automatically generated by build task
|
// This class was automatically generated by build task
|
||||||
@ -1375,6 +1375,15 @@ trait AcceptanceTesterActions
|
|||||||
* ?>
|
* ?>
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
* Or provide an associative array for the second argument to specifically define which selection method should be used:
|
||||||
|
*
|
||||||
|
* ``` php
|
||||||
|
* <?php
|
||||||
|
* $I->selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows'
|
||||||
|
* $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows'
|
||||||
|
* ?>
|
||||||
|
+ ```
|
||||||
|
*
|
||||||
* @param $select
|
* @param $select
|
||||||
* @param $option
|
* @param $option
|
||||||
* @see \Codeception\Module\WebDriver::selectOption()
|
* @see \Codeception\Module\WebDriver::selectOption()
|
||||||
@ -1492,7 +1501,8 @@ trait AcceptanceTesterActions
|
|||||||
* [!] Method is generated. Documentation taken from corresponding module.
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
*
|
*
|
||||||
* Finds and returns the text contents of the given element.
|
* Finds and returns the text contents of the given element.
|
||||||
* If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression.
|
* If a fuzzy locator is used, the element is found using CSS, XPath,
|
||||||
|
* and by matching the full page source by regular expression.
|
||||||
*
|
*
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
@ -1981,7 +1991,8 @@ trait AcceptanceTesterActions
|
|||||||
* [!] Method is generated. Documentation taken from corresponding module.
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
*
|
*
|
||||||
* Accepts the active JavaScript native popup window, as created by `window.alert`|`window.confirm`|`window.prompt`.
|
* Accepts the active JavaScript native popup window, as created by `window.alert`|`window.confirm`|`window.prompt`.
|
||||||
* Don't confuse popups with modal windows, as created by [various libraries](http://jster.net/category/windows-modals-popups).
|
* Don't confuse popups with modal windows,
|
||||||
|
* as created by [various libraries](http://jster.net/category/windows-modals-popups).
|
||||||
* @see \Codeception\Module\WebDriver::acceptPopup()
|
* @see \Codeception\Module\WebDriver::acceptPopup()
|
||||||
*/
|
*/
|
||||||
public function acceptPopup() {
|
public function acceptPopup() {
|
||||||
@ -2003,7 +2014,8 @@ trait AcceptanceTesterActions
|
|||||||
/**
|
/**
|
||||||
* [!] Method is generated. Documentation taken from corresponding module.
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
*
|
*
|
||||||
* Checks that the active JavaScript popup, as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
|
* Checks that the active JavaScript popup,
|
||||||
|
* as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
|
||||||
*
|
*
|
||||||
* @param $text
|
* @param $text
|
||||||
* Conditional Assertion: Test won't be stopped on fail
|
* Conditional Assertion: Test won't be stopped on fail
|
||||||
@ -2015,7 +2027,8 @@ trait AcceptanceTesterActions
|
|||||||
/**
|
/**
|
||||||
* [!] Method is generated. Documentation taken from corresponding module.
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
*
|
*
|
||||||
* Checks that the active JavaScript popup, as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
|
* Checks that the active JavaScript popup,
|
||||||
|
* as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
|
||||||
*
|
*
|
||||||
* @param $text
|
* @param $text
|
||||||
* @see \Codeception\Module\WebDriver::seeInPopup()
|
* @see \Codeception\Module\WebDriver::seeInPopup()
|
||||||
@ -2224,7 +2237,8 @@ trait AcceptanceTesterActions
|
|||||||
* [!] Method is generated. Documentation taken from corresponding module.
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
*
|
*
|
||||||
* Waits up to $timeout seconds for the given element to change.
|
* Waits up to $timeout seconds for the given element to change.
|
||||||
* Element "change" is determined by a callback function which is called repeatedly until the return value evaluates to true.
|
* Element "change" is determined by a callback function which is called repeatedly
|
||||||
|
* until the return value evaluates to true.
|
||||||
*
|
*
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
@ -2365,7 +2379,8 @@ trait AcceptanceTesterActions
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* This runs in the context of the [RemoteWebDriver class](https://github.com/facebook/php-webdriver/blob/master/lib/remote/RemoteWebDriver.php).
|
* This runs in the context of the
|
||||||
|
* [RemoteWebDriver class](https://github.com/facebook/php-webdriver/blob/master/lib/remote/RemoteWebDriver.php).
|
||||||
* Try not to use this command on a regular basis.
|
* Try not to use this command on a regular basis.
|
||||||
* If Codeception lacks a feature you need, please implement it and submit a patch.
|
* If Codeception lacks a feature you need, please implement it and submit a patch.
|
||||||
*
|
*
|
||||||
@ -2526,7 +2541,8 @@ trait AcceptanceTesterActions
|
|||||||
* [!] Method is generated. Documentation taken from corresponding module.
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
*
|
*
|
||||||
* Move mouse over the first element matched by the given locator.
|
* Move mouse over the first element matched by the given locator.
|
||||||
* If the second and third parameters are given, then the mouse is moved to an offset of the element's top-left corner.
|
* If the second and third parameters are given,
|
||||||
|
* then the mouse is moved to an offset of the element's top-left corner.
|
||||||
* Otherwise, the mouse is moved to the center of the element.
|
* Otherwise, the mouse is moved to the center of the element.
|
||||||
*
|
*
|
||||||
* ``` php
|
* ``` php
|
||||||
@ -2567,7 +2583,8 @@ trait AcceptanceTesterActions
|
|||||||
* Pauses test execution in debug mode.
|
* Pauses test execution in debug mode.
|
||||||
* To proceed test press "ENTER" in console.
|
* To proceed test press "ENTER" in console.
|
||||||
*
|
*
|
||||||
* This method is useful while writing tests, since it allows you to inspect the current page in the middle of a test case.
|
* This method is useful while writing tests,
|
||||||
|
* since it allows you to inspect the current page in the middle of a test case.
|
||||||
* @see \Codeception\Module\WebDriver::pauseExecution()
|
* @see \Codeception\Module\WebDriver::pauseExecution()
|
||||||
*/
|
*/
|
||||||
public function pauseExecution() {
|
public function pauseExecution() {
|
||||||
@ -2668,7 +2685,8 @@ trait AcceptanceTesterActions
|
|||||||
* [!] Method is generated. Documentation taken from corresponding module.
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
*
|
*
|
||||||
* Move to the middle of the given element matched by the given locator.
|
* Move to the middle of the given element matched by the given locator.
|
||||||
* Extra shift, calculated from the top-left corner of the element, can be set by passing $offsetX and $offsetY parameters.
|
* Extra shift, calculated from the top-left corner of the element,
|
||||||
|
* can be set by passing $offsetX and $offsetY parameters.
|
||||||
*
|
*
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
@ -2697,7 +2715,7 @@ trait AcceptanceTesterActions
|
|||||||
* ?>
|
* ?>
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param $table
|
* @param string $table
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*
|
*
|
||||||
* @return integer $id
|
* @return integer $id
|
||||||
@ -2714,21 +2732,13 @@ trait AcceptanceTesterActions
|
|||||||
* Asserts that a row with the given column values exists.
|
* Asserts that a row with the given column values exists.
|
||||||
* Provide table name and column values.
|
* Provide table name and column values.
|
||||||
*
|
*
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* Will generate:
|
|
||||||
*
|
|
||||||
* ``` sql
|
|
||||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
|
||||||
* ```
|
* ```
|
||||||
* Fails if no such user found.
|
* Fails if no such user found.
|
||||||
*
|
*
|
||||||
* @param $table
|
* @param string $table
|
||||||
* @param array $criteria
|
* @param array $criteria
|
||||||
* Conditional Assertion: Test won't be stopped on fail
|
* Conditional Assertion: Test won't be stopped on fail
|
||||||
* @see \Codeception\Module\Db::seeInDatabase()
|
* @see \Codeception\Module\Db::seeInDatabase()
|
||||||
@ -2742,21 +2752,13 @@ trait AcceptanceTesterActions
|
|||||||
* Asserts that a row with the given column values exists.
|
* Asserts that a row with the given column values exists.
|
||||||
* Provide table name and column values.
|
* Provide table name and column values.
|
||||||
*
|
*
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* Will generate:
|
|
||||||
*
|
|
||||||
* ``` sql
|
|
||||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
|
||||||
* ```
|
* ```
|
||||||
* Fails if no such user found.
|
* Fails if no such user found.
|
||||||
*
|
*
|
||||||
* @param $table
|
* @param string $table
|
||||||
* @param array $criteria
|
* @param array $criteria
|
||||||
* @see \Codeception\Module\Db::seeInDatabase()
|
* @see \Codeception\Module\Db::seeInDatabase()
|
||||||
*/
|
*/
|
||||||
@ -2814,21 +2816,13 @@ trait AcceptanceTesterActions
|
|||||||
* Asserts that there is no record with the given column values in a database.
|
* Asserts that there is no record with the given column values in a database.
|
||||||
* Provide table name and column values.
|
* Provide table name and column values.
|
||||||
*
|
*
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* Will generate:
|
|
||||||
*
|
|
||||||
* ``` sql
|
|
||||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
|
||||||
* ```
|
* ```
|
||||||
* Fails if such user was found.
|
* Fails if such user was found.
|
||||||
*
|
*
|
||||||
* @param $table
|
* @param string $table
|
||||||
* @param array $criteria
|
* @param array $criteria
|
||||||
* Conditional Assertion: Test won't be stopped on fail
|
* Conditional Assertion: Test won't be stopped on fail
|
||||||
* @see \Codeception\Module\Db::dontSeeInDatabase()
|
* @see \Codeception\Module\Db::dontSeeInDatabase()
|
||||||
@ -2844,21 +2838,13 @@ trait AcceptanceTesterActions
|
|||||||
* Asserts that there is no record with the given column values in a database.
|
* Asserts that there is no record with the given column values in a database.
|
||||||
* Provide table name and column values.
|
* Provide table name and column values.
|
||||||
*
|
*
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* Will generate:
|
|
||||||
*
|
|
||||||
* ``` sql
|
|
||||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
|
||||||
* ```
|
* ```
|
||||||
* Fails if such user was found.
|
* Fails if such user was found.
|
||||||
*
|
*
|
||||||
* @param $table
|
* @param string $table
|
||||||
* @param array $criteria
|
* @param array $criteria
|
||||||
* @see \Codeception\Module\Db::dontSeeInDatabase()
|
* @see \Codeception\Module\Db::dontSeeInDatabase()
|
||||||
*/
|
*/
|
||||||
@ -2873,18 +2859,13 @@ trait AcceptanceTesterActions
|
|||||||
* Fetches a single column value from a database.
|
* Fetches a single column value from a database.
|
||||||
* Provide table name, desired column and criteria.
|
* Provide table name, desired column and criteria.
|
||||||
*
|
*
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ``` php
|
* ``` php
|
||||||
* <?php
|
* <?php
|
||||||
* $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
|
* $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
|
||||||
*
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @version 1.1
|
* @param string $table
|
||||||
*
|
* @param string $column
|
||||||
* @param $table
|
|
||||||
* @param $column
|
|
||||||
* @param array $criteria
|
* @param array $criteria
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
@ -2893,4 +2874,20 @@ trait AcceptanceTesterActions
|
|||||||
public function grabFromDatabase($table, $column, $criteria = null) {
|
public function grabFromDatabase($table, $column, $criteria = null) {
|
||||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromDatabase', func_get_args()));
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromDatabase', func_get_args()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [!] Method is generated. Documentation taken from corresponding module.
|
||||||
|
*
|
||||||
|
* Returns the number of rows in a database
|
||||||
|
*
|
||||||
|
* @param string $table Table name
|
||||||
|
* @param array $criteria Search criteria [Optional]
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
* @see \Codeception\Module\Db::grabNumRecords()
|
||||||
|
*/
|
||||||
|
public function grabNumRecords($table, $criteria = null) {
|
||||||
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabNumRecords', func_get_args()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ class_name: AcceptanceTester
|
|||||||
modules:
|
modules:
|
||||||
enabled:
|
enabled:
|
||||||
- WebDriver:
|
- WebDriver:
|
||||||
url: 'http://ninja.dev:8000/'
|
url: 'http://ninja.dev/'
|
||||||
window_size: 1024x768
|
window_size: 1024x768
|
||||||
wait: 5
|
wait: 5
|
||||||
browser: firefox
|
browser: firefox
|
||||||
|
Loading…
x
Reference in New Issue
Block a user