1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
batchdocprepare.php
См. документацию.
1<?
2namespace Sale\Handlers\Delivery\Additional\DeliveryRequests\RusPost\Requests;
3
4use Bitrix\Main;
5use Bitrix\Main\Localization\Loc;
6use Bitrix\Sale\Delivery\Requests;
7use Sale\Handlers\Delivery\Additional\DeliveryRequests\RusPost\Reference;
8
9Loc::loadMessages(__FILE__);
10
17class BatchDocPrepare extends Base
18{
19 protected $path = "/1.0/batch/{name}/checkin?sendEmail=true";
20 protected $type = Main\Web\HttpClient::HTTP_POST;
21
27 protected function convertResponse($rawData, $requestData)
28 {
29 $result = new Requests\Result();
30
31 if(!empty($rawData['error-code']))
32 $result->addError(new Main\Error(Reference::getErrorDescription($rawData['error-code'], '/1.0/batch/{name}/checkin')));
33
34 if(isset($rawData['f103-sent']) && $rawData['f103-sent'] == true)
35 $result->addMessage(new Requests\Message(Loc::getMessage('SALE_DLVRS_ADD_DREQ_RBATCDP_01')));
36
37 return $result;
38 }
39
46 public function process(array $requestIds, array $additional = array())
47 {
48 $result = new Requests\Result();
49
50 if(count($requestIds) !== 1)
51 {
52 $result->addError( new Main\Error(Loc::getMessage('SALE_DLVRS_ADD_DREQ_RBATCDP_02')));
53 return $result;
54 }
55
56 $requestId = current($requestIds);
57
58 if(intval($requestId) <= 0)
59 {
60 $result->addError( new Main\Error(Loc::getMessage('SALE_DLVRS_ADD_DREQ_RBATCDP_03')));
61 return $result;
62 }
63
64 $res =Requests\RequestTable::getList(array(
65 'filter' => array(
66 '=ID' => $requestId
67 )
68 ));
69
70 $row = $res->fetch();
71
72 if(!$row || $row['EXTERNAL_ID'] == '')
73 {
74 $result->addError( new Main\Error(Loc::getMessage('SALE_DLVRS_ADD_DREQ_RBATCDP_04')));
75 return $result;
76 }
77
78 $this->path = str_replace('{name}', $row['EXTERNAL_ID'], $this->path);
79 return $this->send();
80 }
81}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
send(AbstractCommand $command, Workgroup $entity)
Определения SendInvitationTrait.php:31
trait Error
Определения error.php:11
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
path
Определения template_copy.php:201