1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
batchdocf103.php
См. документацию.
1<?
2namespace Sale\Handlers\Delivery\Additional\DeliveryRequests\RusPost\Requests;
3
4use Bitrix\Sale\Delivery\Requests;
5use Bitrix\Main\Localization\Loc;
6use Bitrix\Main;
7
8Loc::loadMessages(__FILE__);
9
16class BatchDocF103 extends BaseFile
17{
18 protected $path = "/1.0/forms/{name}/f103pdf";
19 protected $type = Main\Web\HttpClient::HTTP_GET;
20
27 public function process(array $requestIds, array $additional = array())
28 {
29 $result = new Requests\Result();
30
31 if(count($requestIds) !== 1)
32 {
33 $result->addError( new Main\Error(Loc::getMessage('SALE_DLVRS_ADD_DREQ_RBATCDF103_01')));
34 return $result;
35 }
36
37 $requestId = current($requestIds);
38
39 if(intval($requestId) <= 0)
40 {
41 $result->addError( new Main\Error(Loc::getMessage('SALE_DLVRS_ADD_DREQ_RBATCDF103_02')));
42 return $result;
43 }
44
45 $res =Requests\RequestTable::getList(array(
46 'filter' => array(
47 '=ID' => $requestId
48 )
49 ));
50
51 $row = $res->fetch();
52
53 if(!$row || $row['EXTERNAL_ID'] == '')
54 {
55 $result->addError( new Main\Error(Loc::getMessage('SALE_DLVRS_ADD_DREQ_RBATCDF103_03')));
56 return $result;
57 }
58
59 $this->path = str_replace('{name}', $row['EXTERNAL_ID'], $this->path);
60 $result = $this->send();
61
62 foreach($result->getErrors() as $error)
63 {
64 if($error->getCode() == 'STATUS_400')
65 {
67 $deliveryRequest = $this->deliveryService->getDeliveryRequestHandler();
68 $result = $deliveryRequest->getRequestObject('BATCH_DOC_PREPARE')->process($requestIds, array());
69
70 if($result->isSuccess())
71 $result = $this->send();
72
73 break;
74 }
75 }
76
77 return $result;
78 }
79}
</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
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
$error
Определения subscription_card_product.php:20
path
Определения template_copy.php:201