Function getInventoryData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getInventoryData(): array
{
$inventoryData = [];
foreach ($this->inventory as $inventoryKey => $inventoryItem) {
foreach (\Vtiger_Inventory_Model::getInstance($this->moduleName)->getFields() as $columnName => $fieldModel) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getProductsByInventory
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getProductsByInventory()
{
$isUserPermissions = \Api\WebservicePremium\Privilege::USER_PERMISSIONS === $this->permissionType;
$this->products = [];
$crmIds = array_keys($this->inventory);
Function getProductsByInventory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getProductsByInventory()
{
$isUserPermissions = \Api\WebservicePremium\Privilege::USER_PERMISSIONS === $this->permissionType;
$this->products = [];
$crmIds = array_keys($this->inventory);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function validate(): bool
{
$inventoryErrors = [];
foreach ($this->inventory as $inventoryKey => $inventoryItem) {
if ('Products' === $this->products[$inventoryKey]['module']) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid using undefined variables such as '$item' which will lead to PHP notices. Open
$item[$columnName] = $this->getValue($columnName, $inventoryKey) ?? $inventoryItem[$columnName] ?? $fieldModel->getDefaultValue();
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$item' which will lead to PHP notices. Open
$inventoryData[] = $item;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$item' which will lead to PHP notices. Open
$item['taxparam'] = \App\Json::encode(\Api\WebservicePremium\Record::getTaxParam($availableTaxes, $this->products[$inventoryKey]['taxes'], $regionalTaxes));
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Missing class import via use statement (line '229', column '21'). Open
'module' => new \yii\db\Expression("'Service'"), 'id' => 'serviceid', 'service_usageunit',
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '246', column '21'). Open
'module' => new \yii\db\Expression("'Products'"), 'id' => 'vtiger_products.productid', 'usageunit',
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '244', column '17'). Open
$query = (new \App\Db\Query())
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '238', column '48'). Open
$queryService->addSelect(['quantity' => new \yii\db\Expression('0')]);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '230', column '22'). Open
'subunit' => new \yii\db\Expression("''"), 'description', 'unit_price', 'purchase', 'taxes',
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '265', column '30'). Open
$multiCurrencyUiType = new \Vtiger_MultiCurrency_UIType();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '227', column '24'). Open
$queryService = (new \App\Db\Query())
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method getInventoryData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$availableTaxes = $this->parentRecordModel->get('accounts_available_taxes');
$regionalTaxes = $this->parentRecordModel->get('taxes');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Api\WebservicePremium\Record' in method 'getInventoryData'. Open
$item['taxparam'] = \App\Json::encode(\Api\WebservicePremium\Record::getTaxParam($availableTaxes, $this->products[$inventoryKey]['taxes'], $regionalTaxes));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Fields\Currency' in method 'getInventoryCurrency'. Open
}
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Vtiger_Inventory_Model' in method 'getInventoryFromRecord'. Open
$inventoryData = \Vtiger_Inventory_Model::getInventoryDataById($recordId, $moduleName);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getProductsByInventory uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$row['unit_price'] = $multiCurrencyUiType->getValueForCurrency($row['unit_price'], $currencyId);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Vtiger_Record_Model' in method '__construct'. Open
$this->parentRecordModel = \Vtiger_Record_Model::getInstanceById($accountId, 'Accounts');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'getInventoryData'. Open
$item['taxparam'] = \App\Json::encode(\Api\WebservicePremium\Record::getTaxParam($availableTaxes, $this->products[$inventoryKey]['taxes'], $regionalTaxes));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Fields\Currency' in method 'getProductsByInventory'. Open
}
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "unit_price" 7 times. Open
'price' => 'unit_price',
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Remove the unused function parameter "$inventoryKey". Open
protected function getInventoryTaxmode(int $inventoryKey)
- Read upRead up
- Exclude checks
Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.
Noncompliant Code Example
function doSomething($a, $b) { // "$a" is unused return compute($b); }
Compliant Solution
function doSomething($b) { return compute($b); }
Exceptions
Functions in classes that override a class or implement interfaces are ignored.
class C extends B { function doSomething($a, $b) { // no issue reported on $b compute($a); } }
See
- MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
- MISRA C:2012, 2.7 - There should be no unused parameters in functions
- CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
- CERT, MSC12-CPP. - Detect and remove code that has no effect
Remove the unused function parameter "$inventoryKey". Open
protected function getInventorySeq(int $inventoryKey): int
- Read upRead up
- Exclude checks
Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.
Noncompliant Code Example
function doSomething($a, $b) { // "$a" is unused return compute($b); }
Compliant Solution
function doSomething($b) { return compute($b); }
Exceptions
Functions in classes that override a class or implement interfaces are ignored.
class C extends B { function doSomething($a, $b) { // no issue reported on $b compute($a); } }
See
- MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
- MISRA C:2012, 2.7 - There should be no unused parameters in functions
- CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
- CERT, MSC12-CPP. - Detect and remove code that has no effect
Define a constant instead of duplicating this literal "description" 3 times. Open
'comment1' => 'description',
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Remove the unused function parameter "$inventoryKey". Open
protected function getInventoryCurrency(int $inventoryKey): int
- Read upRead up
- Exclude checks
Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.
Noncompliant Code Example
function doSomething($a, $b) { // "$a" is unused return compute($b); }
Compliant Solution
function doSomething($b) { return compute($b); }
Exceptions
Functions in classes that override a class or implement interfaces are ignored.
class C extends B { function doSomething($a, $b) { // no issue reported on $b compute($a); } }
See
- MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
- MISRA C:2012, 2.7 - There should be no unused parameters in functions
- CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
- CERT, MSC12-CPP. - Detect and remove code that has no effect
Define a constant instead of duplicating this literal "taxes" 4 times. Open
$regionalTaxes = $this->parentRecordModel->get('taxes');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "quantity" 4 times. Open
$quantityInStorage = $this->products[$inventoryKey]['quantity'] ?? 0.0;
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "purchase" 6 times. Open
'purchase' => 'purchase'
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "module" 3 times. Open
if ('Products' === $this->products[$inventoryKey]['module']) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Avoid unused parameters such as '$inventoryKey'. Open
protected function getInventoryTaxmode(int $inventoryKey)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$inventoryKey'. Open
protected function getInventorySeq(int $inventoryKey): int
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$inventoryKey'. Open
protected function getInventoryCurrency(int $inventoryKey): int
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Variable $item
was undeclared, but array fields are being added to it. Open
$item['taxparam'] = \App\Json::encode(\Api\WebservicePremium\Record::getTaxParam($availableTaxes, $this->products[$inventoryKey]['taxes'], $regionalTaxes));
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
'module' => new \yii\db\Expression("'Service'"), 'id' => 'serviceid', 'service_usageunit',
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$query = (new \App\Db\Query())
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
'subunit' => new \yii\db\Expression("''"), 'description', 'unit_price', 'purchase', 'taxes',
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$queryService = (new \App\Db\Query())
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
'module' => new \yii\db\Expression("'Products'"), 'id' => 'vtiger_products.productid', 'usageunit',
- Exclude checks
Variable $item
was undeclared, but array fields are being added to it. Open
$item[$columnName] = $this->getValue($columnName, $inventoryKey) ?? $inventoryItem[$columnName] ?? $fieldModel->getDefaultValue();
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
$queryService->addSelect(['quantity' => new \yii\db\Expression('0')]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $errors = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Inventory items passed from request. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $fieldMapping;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var int|null Price book id. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array|null Field mapping. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var int Storage ID */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $storage;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $moduleName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $parentRecordModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Module name. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $inventory;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Products */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $products = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \Vtiger_Record_Model Parent record model */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get Inventory from record.
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
foreach (\Vtiger_Inventory_Model::getInstance($this->moduleName)->getFields() as $columnName => $fieldModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventoryData[] = $item;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($fromRow[$columnName])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$method = 'getInventory' . ucfirst($columnName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->fieldMapping;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
$item['taxparam'] = \App\Json::encode(\Api\WebservicePremium\Record::getTaxParam($availableTaxes, $this->products[$inventoryKey]['taxes'], $regionalTaxes));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $inventoryData;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __construct(string $moduleName, \Api\Core\BaseAction $actionModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->storage = $actionModel->getUserStorageId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\in_array($fieldModel->getColumnName(), ['total', 'margin', 'marginp', 'net', 'gross', 'discount'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->inventory = $actionModel->controller->request->getArray('inventory');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->permissionType = $actionModel->getPermissionType();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => 'id',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purchase' => 'purchase'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->fieldMapping[$row['tofield']] = $row['field'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getInventoryCurrency(int $inventoryKey): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$quantityInStorage = $this->products[$inventoryKey]['quantity'] ?? 0.0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getInventoryData(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('tax' === $columnName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $columnName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getFieldMapping(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ((\Vtiger_Inventory_Model::getInstance($this->moduleName)->getAutoCompleteFields()['Products'] ?? []) as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getErrors(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $inventoryData;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$availableTaxes = 'LBL_GROUP';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Arrays with errors. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $priceBookId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->priceBookId = $this->parentRecordModel->get('pricebook_id');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function validate(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventoryData = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
$item[$columnName] = $this->getValue($columnName, $inventoryKey) ?? $inventoryItem[$columnName] ?? $fieldModel->getDefaultValue();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($accountId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Validate inventory.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->errors['inventory'] = $inventoryErrors;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\Vtiger_Inventory_Model::getInstance($this->moduleName)->getFields() as $columnName => $fieldModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->parentRecordModel)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$item['taxparam'] = \App\Json::encode(\Api\WebservicePremium\Record::getTaxParam($availableTaxes, $this->products[$inventoryKey]['taxes'], $regionalTaxes));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->products[$inventoryKey][$fromRow[$columnName]];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get currency.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $permissionType;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->moduleName = $moduleName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->errors;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return !$inventoryErrors;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->inventory as $inventoryKey => $inventoryItem) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$availableTaxes = $this->parentRecordModel->get('accounts_available_taxes');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$item[$columnName] = $this->getValue($columnName, $inventoryKey) ?? $inventoryItem[$columnName] ?? $fieldModel->getDefaultValue();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->fieldMapping)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventoryErrors[$inventoryKey] = ['params' => ['quantity' => $quantityInStorage]];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$regionalTaxes = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->parentRecordModel = \Vtiger_Record_Model::getInstanceById($accountId, 'Accounts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getProductsByInventory();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventoryData = \Vtiger_Inventory_Model::getInventoryDataById($recordId, $moduleName);
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
if (\in_array($fieldModel->getColumnName(), ['total', 'margin', 'marginp', 'net', 'gross', 'discount'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'comment1' => 'description',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'price' => 'unit_price',
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
foreach ((\Vtiger_Inventory_Model::getInstance($this->moduleName)->getAutoCompleteFields()['Products'] ?? []) as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get errors.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($inventoryErrors) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $recordId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var int Sequence. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getInventoryFromRecord(int $recordId, string $moduleName): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Construct.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventoryErrors = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($inventoryData as &$inventoryRow) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $inventoryKey
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get field mapping.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $inventoryKey
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var int Permission type. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventoryRow['qty'] = $this->inventory[$inventoryRow['name']]['qty'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get inventory data.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->fieldMapping = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \Api\Core\BaseAction $actionModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accountId = $actionModel->getParentCrmId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->inventory as $inventoryKey => $inventoryItem) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Products' === $this->products[$inventoryKey]['module']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$regionalTaxes = $this->parentRecordModel->get('taxes');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fromRow = $this->getFieldMapping();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere(['discontinued' => 1])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$isUserPermissions) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['unit_price'] = $row['listprice'] ?? $multiCurrencyUiType->getValueForCurrency($row['unit_price'], $currencyId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryService->addSelect(['vtiger_pricebookproductrel.listprice']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['vtiger_crmentity.deleted' => 0])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere(['vtiger_products.productid' => $crmIds])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currencyId = \App\Fields\Currency::getDefault()['id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'subunit' => new \yii\db\Expression("''"), 'description', 'unit_price', 'purchase', 'taxes',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['vtiger_crmentity.deleted' => 0])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($dataReader as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $inventoryKey
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isUserPermissions = \Api\WebservicePremium\Privilege::USER_PERMISSIONS === $this->permissionType;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->innerJoin('vtiger_crmentity', 'vtiger_products.productid = vtiger_crmentity.crmid')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['unit_price'] = $multiCurrencyUiType->getValueForCurrency($row['unit_price'], $currencyId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getInventoryTaxmode(int $inventoryKey)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getInventorySeq(int $inventoryKey): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get products by inventory.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->select([
- Exclude checks
Line exceeds 120 characters; contains 191 characters Open
$query->leftJoin('vtiger_pricebookproductrel', "vtiger_pricebookproductrel.pricebookid={$this->priceBookId} AND vtiger_pricebookproductrel.productid = vtiger_products.productid");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_service')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = $query->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Returns sequence.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere(['vtiger_service.serviceid' => $crmIds]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryService->addSelect(['quantity' => new \yii\db\Expression('0')]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query->leftJoin('u_#__istorages_products', "u_#__istorages_products.crmid={$this->storage} AND u_#__istorages_products.relcrmid = vtiger_products.productid");
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$query->leftJoin('u_#__istorages_products', "u_#__istorages_products.crmid={$this->storage} AND u_#__istorages_products.relcrmid = vtiger_products.productid");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module' => new \yii\db\Expression("'Products'"), 'id' => 'vtiger_products.productid', 'usageunit',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query->addSelect(['quantity' => 'u_#__istorages_products.qtyinstock']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$isUserPermissions && !empty($this->priceBookId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $seq;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($quantityInStorage < (float) $inventoryItem['qty']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get the value for the column. Return null if it does not apply to this column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getValue(string $columnName, int $inventoryKey)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \method_exists($this, $method) ? $this->{$method}($inventoryKey) : null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (int) \App\Fields\Currency::getDefault()['id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->select([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($this->storage)) {
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$row['unit_price'] = $row['listprice'] ?? $multiCurrencyUiType->getValueForCurrency($row['unit_price'], $currencyId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->products = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$crmIds = array_keys($this->inventory);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function getProductsByInventory()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module' => new \yii\db\Expression("'Service'"), 'id' => 'serviceid', 'service_usageunit',
- Exclude checks
Line exceeds 120 characters; contains 197 characters Open
$queryService->leftJoin('vtiger_pricebookproductrel', "vtiger_pricebookproductrel.pricebookid={$this->priceBookId} AND vtiger_pricebookproductrel.productid = vtiger_service.serviceid");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_products')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere(['discontinued' => 1])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['purchase'] = $multiCurrencyUiType->getValueForCurrency($row['purchase'], $currencyId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->innerJoin('vtiger_crmentity', 'vtiger_service.serviceid = vtiger_crmentity.crmid')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'subunit', 'description', 'unit_price', 'purchase', 'taxes'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->union($queryService, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query->leftJoin('vtiger_pricebookproductrel', "vtiger_pricebookproductrel.pricebookid={$this->priceBookId} AND vtiger_pricebookproductrel.productid = vtiger_products.productid");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$multiCurrencyUiType = new \Vtiger_MultiCurrency_UIType();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryService = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryService->leftJoin('vtiger_pricebookproductrel', "vtiger_pricebookproductrel.pricebookid={$this->priceBookId} AND vtiger_pricebookproductrel.productid = vtiger_service.serviceid");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->products[$row['id']] = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ++$this->seq;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($this->storage)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$isUserPermissions && !empty($this->priceBookId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query->addSelect(['vtiger_pricebookproductrel.listprice']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks