Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Bianco committed Jan 11, 2021
1 parent 9da3945 commit 0dc475a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ install:
update:
@docker-compose run --rm composer update

up:
@docker-compose up -d

## -------
## Testing
## -------
test:
test: up
@docker-compose run --rm phpunit tests

test-create-purchase-order:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "javanile/vtiger-client",
"version": "0.0.21",
"version": "0.0.22",
"license": "MIT",
"type": "project",
"authors": [
Expand Down
12 changes: 8 additions & 4 deletions src/ElementSanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ protected function sanitizeEmptyElement($element)
}

/**
* Sanitize an element for inventory modules.
*
* @param $operation
* @param $elementType
* @param $element
*
* @return array
*/
protected function sanitizeInventoryElement($elementType, $element)
protected function sanitizeInventoryElement($operation, $elementType, $element)
{
if (!in_array($elementType, $this->inventoryTypes)) {
return $element;
Expand All @@ -90,7 +94,7 @@ protected function sanitizeInventoryElement($elementType, $element)
$element['hdnTaxType'] = 'individual';
}

if (empty($element['LineItems'])) {
if (empty($element['LineItems']) && $operation == 'create') {
$element['LineItems'] = [[]];
}

Expand All @@ -117,7 +121,7 @@ public function create($elementType, $element)
{
$element = $this->sanitizeEmptyElement($element);
$element = $this->sanitizeAssignedUserId($element);
$element = $this->sanitizeInventoryElement($elementType, $element);
$element = $this->sanitizeInventoryElement('create', $elementType, $element);

return $element;
}
Expand All @@ -143,7 +147,7 @@ public function update($elementType, $element)
{
$element = $this->sanitizeEmptyElement($element);
$element = $this->sanitizeAssignedUserId($element);
$element = $this->sanitizeInventoryElement($elementType, $element);
$element = $this->sanitizeInventoryElement('update', $elementType, $element);

return $element;
}
Expand Down

0 comments on commit 0dc475a

Please sign in to comment.