12 public static function getView(
Order $order, $useCurrentBudget =
true)
17 '<div class="adm-bus-pay">
18 <div class="adm-bus-component-content-container">
19 <div class="adm-bus-pay-section">
20 <div class="adm-bus-pay-section-content posr">
21 <input type="hidden" value="'.$data[
'PRICE'].
'" id="sale-order-financeinfo-price">
22 <input type="hidden" value="'.$data[
'SUM_PAID'].
'" id="sale-order-financeinfo-sum-paid">
23 <input type="hidden" value="'.$data[
'PAYABLE'].
'" id="sale-order-financeinfo-payable">
24 <table class="adm-bus-pay-statuspay " '.(isset($data[
'OVERPAYMENT']) ?
'style="width: 1000px"' :
'').
'>
28 <td class="separator"></td>
29 <td style="color: #749511;">'.
Loc::getMessage(
'SALE_ORDER_FINANCEINFO_SUM_PAID').
'</td>
30 <td class="separator"></td>
31 <td style="color: #f29129;">'.
Loc::getMessage(
'SALE_ORDER_FINANCEINFO_PAYABLE').
'</td>
36 <td id="sale-order-financeinfo-price-view">'.SaleFormatCurrency(floatval($data[
'PRICE']), $data[
'CURRENCY']).
'</td>
37 <td class="separator"></td>
38 <td id="sale-order-financeinfo-sum-paid-view">'.SaleFormatCurrency(floatval($data[
'SUM_PAID']), $data[
'CURRENCY']).
'</td>
39 <td class="separator"></td>
40 <td id="sale-order-financeinfo-payable-view">'.SaleFormatCurrency(floatval($data[
'PAYABLE']), $data[
'CURRENCY']).
'</td>
46 <div class="adm-bus-pay-section"'.(floatval($data[
'BUYER_BUDGET']) <= 0 ?
' style="display:none;"' :
'').
'>
47 <input id="sale-order-financeinfo-user-budget-input" type="hidden" value="'.floatval($data[
'BUYER_BUDGET']).
'">
48 <div class="adm-bus-pay-section-content posr">
49 <div class="adm-bus-pay-wallet">
50 '.
Loc::getMessage(
'SALE_ORDER_FINANCEINFO_BALANCE_INNER_BUDGET').
': <strong id="sale-order-financeinfo-user-budget">' . SaleFormatCurrency($data[
'BUYER_BUDGET'], $data[
'CURRENCY']) .
'</strong>';
52 if ($useCurrentBudget)
53 $result .=
'<span class="adm-bus-pay-use-current-budget" onclick="BX.Sale.Admin.GeneralPayment.useCurrentBudget(this);">'.Loc::getMessage(
'SALE_ORDER_FINANCEINFO_USE_INNER_BUDGET').
'</span>';
67 if ($order->getUserId() > 0)
69 $res = \CSaleUserAccount::getList(
72 'USER_ID' => $order->getUserId(),
73 'CURRENCY' => $order->getCurrency(),
82 $userAccount = $res->Fetch();
83 $currencyBudget = (float)($userAccount[
'CURRENT_BUDGET'] ?? 0);
86 $payable = $order->getPrice() - $order->getSumPaid();
87 $price = $order->getPrice();
88 $sumPaid = $order->getSumPaid();
91 'PRICE' => ($price) ? $price : 0,
92 'SUM_PAID' => ($sumPaid) ? $sumPaid : 0,
93 'PAYABLE' => ($payable >= 0) ? $payable : 0,
94 'CURRENCY' => $order->getCurrency(),
95 'BUYER_BUDGET' => $currencyBudget,
96 'STATUS_ID' => $order->getField(
'STATUS_ID')