|
|
@@ -26,6 +26,7 @@ class BillsController extends Controller
|
|
|
'class' => VerbFilter::className(),
|
|
|
'actions' => [
|
|
|
'delete' => ['POST'],
|
|
|
+ 'payed' => ['GET'],
|
|
|
],
|
|
|
],
|
|
|
'access' => [
|
|
|
@@ -170,9 +171,9 @@ class BillsController extends Controller
|
|
|
$percent_g = 0.015;
|
|
|
$percent_r = 0.0015;
|
|
|
$amount_vat = $amount = $type == 'guarantee'
|
|
|
- ? $percent_g*$model->auction->lot->start_price
|
|
|
- : $percent_r*$model->auction->lot->start_price;
|
|
|
- if ($model->auction->lot->nds) {
|
|
|
+ ? $percent_g*($model->auction->lot->start_price ?? 0)
|
|
|
+ : $percent_r*($model->auction->lot->start_price ?? 0);
|
|
|
+ if ($model->auction->lot->nds ?? 0) {
|
|
|
$amount = $amount/1.2*1;
|
|
|
} else {
|
|
|
$amount_vat *= 1.2;
|
|
|
@@ -181,13 +182,13 @@ class BillsController extends Controller
|
|
|
$filename = templater()->process(
|
|
|
[
|
|
|
'billID' => $model->id,
|
|
|
- 'auctionID' => $model->auction->id,
|
|
|
+ 'auctionID' => $model->auction->id ?? 0,
|
|
|
'date' => date('d-m-Y'),
|
|
|
'inn' => $model->profile->inn,
|
|
|
'zkpo' => $model->profile->zkpo,
|
|
|
'uAddress' => $model->profile->u_address,
|
|
|
- 'bank' => $model->requisite->bank,
|
|
|
- 'payAccount' => $model->requisite->account,
|
|
|
+ 'bank' => $model->requisite->bank ?? 0,
|
|
|
+ 'payAccount' => $model->requisite->account ?? 0,
|
|
|
'phone' => $model->profile->phone,
|
|
|
'fax' => $model->profile->fax,
|
|
|
'firmaFull' => $model->profile->firma_full,
|
|
|
@@ -195,7 +196,7 @@ class BillsController extends Controller
|
|
|
'amountString' => num2str($amount_vat),
|
|
|
'amountVat' => $amount_vat,
|
|
|
'amount' => $amount,
|
|
|
- 'vat' => $model->auction->lot->nds ? 'з ПДВ' : 'без ПДВ',
|
|
|
+ 'vat' => ($model->auction->lot->nds ?? 0) ? 'з ПДВ' : 'без ПДВ',
|
|
|
],
|
|
|
$type
|
|
|
);
|