Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
converterdocumentinvoice.php
1<?php
2
4
5
7{
8 public static function normalizeExternalCode($xml)
9 {
10 static $sales = null;
11
12 list($originatorId, $productXmlId) = explode("#", $xml, 2);
13 if($productXmlId<>'')
14 {
15 if($sales === null)
16 $sales = \CCrmExternalSaleHelper::PrepareListItems();
17
18 if(isset($sales[$originatorId]))
19 {
20 $xml = $productXmlId;
21 }
22 }
23
24 return parent::normalizeExternalCode($xml);
25 }
26
31 static protected function getStatusNameById($id)
32 {
33 static $statuses;
34
35 if($statuses === null)
36 {
37 while($status = \Bitrix\Crm\Invoice\InvoiceStatus::getList()->fetch())
38 {
39 $statuses[$status['STATUS_ID']] = $status['NAME'];
40 }
41
42 if(!is_array($statuses))
43 {
44 $statuses = array();
45 }
46 }
47 return (isset($statuses[$id])?$statuses[$id]:'');
48 }
49}