<?php
 if ($R['blockIdBalance']) { try { DB::startTransaction(); $balance=\Entity\Balance::block($R['blockIdBalance']); $balance->save(); DB::commitTransaction(); $balance->assignMessages($showMessage); $userTrailItem->updateActionOld('Modules/Invoices/BalancesList-confirm'); $userTrailItem->updateEntityOld('invoiceBalance', $balance->getId()); header("Location: ./"); exit; } catch (\App\Entity\Exception $e) { $e->decorate($showMessage); DB::rollbackTransaction(); } } if ($R['unblockIdBalance']) { try { DB::startTransaction(); $balance=\Entity\Balance::unblock($R['unblockIdBalance']); $balance->save(); DB::commitTransaction(); $balance->assignMessages($showMessage); $userTrailItem->updateActionOld('invoiceBalanceUnconfirm'); $userTrailItem->updateEntityOld('invoiceBalance', $balance->getId()); header("Location: ./"); exit; } catch (\App\Entity\Exception $e) { $e->decorate($showMessage); DB::rollbackTransaction(); } } 