8Localization\Loc::loadMessages(__FILE__);
20 private const MARK_CODE_TYPE_GS1_M =
'gs1m';
27 return Localization\Loc::getMessage(
'SALE_CASHBOX_ATOL_FARM_V5_TITLE');
40 'measure' => $this->buildPositionMeasure($item),
48 if (isset($item[
'marking_code']))
50 $result[
'mark_processing_mode'] =
'0';
51 $result[
'mark_code'] = $this->buildPositionGs1mMarkCode($item);
54 if (isset($item[
'supplier_info']))
56 $result[
'agent_info'] = $this->buildPositionAgentInfo();
57 $result[
'supplier_info'] = $this->buildPositionSupplierInfo($item[
'supplier_info']);
75 private function buildPositionMeasure(array $item): ?int
78 if (is_null($tag2108Value) || $tag2108Value ===
'')
83 return (is_null($tag2108Value) || $tag2108Value ===
'') ? null : (int)$tag2108Value;
90 private function buildPositionGs1mMarkCode(array $item): array
93 self::MARK_CODE_TYPE_GS1_M => base64_encode($item[
'marking_code']),
97 private function buildPositionAgentInfo(): array
107 private function buildPositionSupplierInfo(array $supplier): array
111 if (!empty($supplier[
'phones']))
113 $phoneParser = PhoneNumber\Parser::getInstance();
115 foreach ($supplier[
'phones'] as $phone)
117 $phoneNumber = $phoneParser->parse($phone);
118 $formattedPhone = $phoneNumber->format(PhoneNumber\
Format::E164);
121 $supplierInfo[
'phones'][] = $formattedPhone;
126 if (!empty($supplier[
'name']))
128 $supplierInfo[
'name'] = mb_substr($supplier[
'name'], 0, 256);
131 if (empty($supplier[
'inn']))
133 $supplierInfo[
'inn'] =
'000000000000';
137 $supplierInfo[
'inn'] = $supplier[
'inn'];
140 return $supplierInfo;
buildPositionQuantity(array $item)
buildPositionPrice(array $item)
buildPositionPaymentObject(array $item)
buildPositionSum(array $item)
buildPositionVatType(array $checkData, array $item)
buildPositionName(array $item)
buildPositionPaymentMethod(array $checkData)
buildPosition(array $checkData, array $item)
static hasMeasureSettings()
getValueFromSettings($name, $code)
const PAYMENT_OBJECT_EXCISE
const PAYMENT_OBJECT_LOTTERY
const PAYMENT_OBJECT_SOCIAL_INSURANCE
const PAYMENT_OBJECT_COMPOSITE
const PAYMENT_OBJECT_LOTTERY_PRIZE
const PAYMENT_OBJECT_MEDICAL_INSURANCE_IP
const PAYMENT_OBJECT_COMMODITY_MARKING_EXCISE
const PAYMENT_OBJECT_NON_OPERATING_GAIN
const PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING_EXCISE
const PAYMENT_OBJECT_RESORT_FEE
const PAYMENT_OBJECT_PENSION_INSURANCE_IP
const PAYMENT_OBJECT_PROPERTY_RIGHT
const PAYMENT_OBJECT_GAMBLING_PRIZE
const PAYMENT_OBJECT_COMMODITY_MARKING
const PAYMENT_OBJECT_COMMODITY
const PAYMENT_OBJECT_AGENT_COMMISSION
const PAYMENT_OBJECT_ANOTHER
const PAYMENT_OBJECT_DEPOSIT
const PAYMENT_OBJECT_MEDICAL_INSURANCE
const PAYMENT_OBJECT_SERVICE
const PAYMENT_OBJECT_INTELLECTUAL_ACTIVITY
const PAYMENT_OBJECT_PAYMENT
const PAYMENT_OBJECT_EXPENSE
const PAYMENT_OBJECT_GAMBLING_BET
const PAYMENT_OBJECT_CASINO_PAYMENT
const PAYMENT_OBJECT_PENSION_INSURANCE
const PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING
const PAYMENT_OBJECT_SALES_TAX