Small fix
This commit is contained in:
miroman-afk
2022-12-22 12:52:42 +03:00
parent d24bba305f
commit 723e9a8768
15 changed files with 213 additions and 117 deletions

View File

@@ -13,15 +13,16 @@ class POSTPresale extends HRCCommand implements HRCCommandInterface
public function command($input, $output = null)
{
$client_guid = $input['client_id'];
$presale_amount = $input['amount'];
$presale_amount = abs($input['amount']);
$staff_id = $input['who'];
$presale_time = $input['date_transaction'];
ClientsPresale::presaleReg($client_guid, $presale_amount);
$type = $input['type'];
ClientsPresale::presaleReg($client_guid, $presale_amount, $type);
ClientsPresale::presaleLog($client_guid, $presale_amount, $presale_time, $staff_id);
if ($presale_amount > 0) {
if ($type == 'in') {
$message = 'Внесен аванс на сумму ' . $presale_amount . ' BYN';
} else {
$message = 'Зачтен аванс на сумму ' . abs($presale_amount) . ' BYN';
} elseif ($type == 'out') {
$message = 'Зачтен аванс на сумму ' . $presale_amount . ' BYN';
}
$presale_result = ClientsPresale::getPresale($client_guid);
return [