Skip to content

Commit

Permalink
Merge pull request #97 from global-fashion/master
Browse files Browse the repository at this point in the history
обновлена версия Guzzle + для сущности Demand name не обязателен
  • Loading branch information
tooyz authored Jul 13, 2021
2 parents 464a495 + 002afb9 commit 7ce47df
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "tooyz/moysklad",
"description": "Get it here: https://github.com/Tooyz/moysklad",
"require": {
"php": ">=7.0",
"guzzlehttp/guzzle": "^6.2.1"
"php": ">=7.2",
"guzzlehttp/guzzle": "^7.0.1"
},
"authors": [
{
Expand Down
18 changes: 18 additions & 0 deletions src/Components/MutationBuilders/AbstractMutationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ public function __construct(AbstractEntity &$entity){
$this->e = $entity;
}

public function addOperation($linkedSum, AbstractEntity $entity)
{
$this->e->fields->operations = [
[
'meta' => $entity->getMeta(),
'linkedSum' => $linkedSum * 100
]
];

return $this;
}

public function setSum($sum)
{
$this->e->fields->sum = $sum * 100;
return $this;
}

/**
* @param Account $account
* @param LinkingSpecs|null $specs
Expand Down
8 changes: 8 additions & 0 deletions src/Entities/Documents/Movements/Demand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

namespace MoySklad\Entities\Documents\Movements;

use MoySklad\Entities\Organization;
use MoySklad\Entities\Store;

class Demand extends AbstractMovement {
public static $entityName = 'demand';

public static function getFieldsRequiredForCreation()
{
return ['agent', Organization::$entityName, Store::$entityName];
}
}

0 comments on commit 7ce47df

Please sign in to comment.