- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/cashboxbitrixv2.php
- Класс: BitrixSaleCashboxCashboxBitrixV2
- Вызов: CashboxBitrixV2::buildPosition
protected function buildPosition(array $checkData, array $item)
{
$checkTypeMap = $this->getCheckTypeMap();
$paymentObjectMap = $this->getPaymentObjectMap();
$vat = $this->getValueFromSettings('VAT', $item['vat']);
if ($vat === null)
{
$vat = $this->getValueFromSettings('VAT', 'NOT_VAT');
}
$position = [
'type' => 'position',
'name' => $item['name'],
'price' => (float)$item['price'],
'quantity' => $item['quantity'],
'amount' => (float)$item['sum'],
'paymentMethod' => $checkTypeMap[$checkData['type']],
'paymentObject' => $paymentObjectMap[$item['payment_object']],
'tax' => [
'type' => $this->mapVatValue($checkData['type'], $vat)
],
];
if (isset($item['supplier_info']))
{
$position['supplierInfo'] = [
'phones' => $item['supplier_info']['phones'],
'name' => $item['supplier_info']['name'],
'vatin' => $item['supplier_info']['inn']
];
}
if (isset($item['nomenclature_code']))
{
$position['nomenclatureCode'] = base64_encode($item['nomenclature_code']);
}
return $position;
}