diff --git a/src/AmoCRM/EntitiesServices/CatalogElements.php b/src/AmoCRM/EntitiesServices/CatalogElements.php index 2b1691f3..c136bd10 100644 --- a/src/AmoCRM/EntitiesServices/CatalogElements.php +++ b/src/AmoCRM/EntitiesServices/CatalogElements.php @@ -154,6 +154,10 @@ protected function processModelAction(BaseApiModel $apiModel, array $entity): vo if (isset($entity['catalog_id'])) { $apiModel->setCatalogId($entity['catalog_id']); } + + if (isset($entity['invoice_link'])) { + $apiModel->setInvoiceLink($entity['invoice_link']); + } } diff --git a/src/AmoCRM/Models/AccountModel.php b/src/AmoCRM/Models/AccountModel.php index 09ec7ea1..1f9a17ff 100644 --- a/src/AmoCRM/Models/AccountModel.php +++ b/src/AmoCRM/Models/AccountModel.php @@ -454,7 +454,8 @@ public static function fromArray(array $account): self if (isset($account[self::INVOICES_SETTINGS])) { $accountModel->setInvoicesSettings(new InvoicesSettings( - $account[self::INVOICES_SETTINGS]['lang'] ?? null + $account[self::INVOICES_SETTINGS]['lang'] ?? null, + $account[self::INVOICES_SETTINGS]['invoices_catalog_id'] ?? null )); } diff --git a/src/AmoCRM/Models/AccountSettings/InvoicesSettings.php b/src/AmoCRM/Models/AccountSettings/InvoicesSettings.php index 3156382c..b9009d63 100644 --- a/src/AmoCRM/Models/AccountSettings/InvoicesSettings.php +++ b/src/AmoCRM/Models/AccountSettings/InvoicesSettings.php @@ -11,10 +11,17 @@ class InvoicesSettings implements Arrayable */ protected $lang; + /** + * @var int|null + */ + protected $invoicesCatalogId; + public function __construct( - ?string $lang + ?string $lang, + ?int $invoicesCatalogId ) { $this->lang = $lang; + $this->invoicesCatalogId = $invoicesCatalogId; } /** @@ -24,6 +31,7 @@ public function toArray(): array { return [ 'lang' => $this->getLang(), + 'invoices_catalog_id' => $this->getInvoicesCatalogId(), ]; } @@ -34,4 +42,12 @@ public function getLang(): ?string { return $this->lang; } + + /** + * @return int|null + */ + public function getInvoicesCatalogId(): ?int + { + return $this->invoicesCatalogId; + } }