%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.191.168.10 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/admin/ |
Upload File : |
<? require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php"); global $USER, $APPLICATION; $saleModulePermissions = $APPLICATION->GetGroupRight("sale"); if ($saleModulePermissions == "D") $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED")); CModule::IncludeModule('sale'); IncludeModuleLangFile(__FILE__); require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/prolog.php"); $urlParams = ''; $errorMsg = ''; $orderId = intval($_GET['ORDER_ID']); $orderParams = array( 'select' => array('STATUS_ID'), 'filter' => array( 'ID' => $orderId ) ); $orderRes = \Bitrix\Sale\Internals\OrderTable::getList($orderParams); if (!$order = $orderRes->fetch()) { $errorMsg .= GetMessage('SOP_ERROR_ORDER_NOT_FOUND'); } $allowOrderView = false; if (empty($errorMsg)) { $allowedStatusesOrderView = \Bitrix\Sale\OrderStatus::getStatusesUserCanDoOperations($USER->GetID(), array('view')); $allowOrderView = (in_array($order["STATUS_ID"], $allowedStatusesOrderView)); } require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php"); if (empty($errorMsg) && $_SERVER["REQUEST_METHOD"] == "GET" && check_bitrix_sessid()) { $doc = (string)$_GET['doc']; if ($doc == '') { $errorMsg .= GetMessage("SOP_ERROR_REPORT").'<br>'; } else { if (isset($_GET['SHIPMENT_ID']) && intval($_GET['SHIPMENT_ID']) > 0) { $orderId = intval($_GET['ORDER_ID']); $shipmentId = intval($_GET['SHIPMENT_ID']); $shipmentParams = array( 'select' => array('STATUS_ID'), 'filter' => array( 'ORDER_ID' => $orderId, 'ID' => $shipmentId ) ); $shipmentRes = \Bitrix\Sale\Internals\ShipmentTable::getList($shipmentParams); if ($shipment = $shipmentRes->fetch()) { $allowedStatusesDeliveryView = \Bitrix\Sale\DeliveryStatus::getStatusesUserCanDoOperations($USER->GetID(), array('view')); if(!in_array($shipment["STATUS_ID"], $allowedStatusesDeliveryView)) { $errorMsg .= GetMessage('SOP_ERROR_ACCESS'); } if (strval($errorMsg) === '') { $params = array( 'select' => array('BASKET_ID', 'QUANTITY'), 'filter' => array( 'DELIVERY.ORDER_ID' => $orderId, 'ORDER_DELIVERY_ID' => $shipmentId, 'BASKET.SET_PARENT_ID' => 0 ) ); $items = \Bitrix\Sale\Internals\ShipmentItemTable::getList($params); $quantity = array(); $basketIds = array(); while ($item = $items->fetch()) { $basketIds[] = $item['BASKET_ID']; $quantity[] = $item['QUANTITY']; } $urlParams .= 'BASKET_IDS='.urlencode(join(',', $basketIds)).'&QUANTITIES='.urlencode(join(',', $quantity)); LocalRedirect('/bitrix/admin/sale_print.php?PROPS_ENABLE=Y&doc='.CUtil::JSEscape($doc).'&ORDER_ID='.$orderId.'&'.$urlParams.'&SHIPMENT_ID='.$shipmentId); } } else { $errorMsg .= GetMessage('SOP_ERROR_SHIPMENT_NOT_FOUND'); } } elseif ($allowOrderView) { $urlParams = "SHOW_ALL=Y"; LocalRedirect('/bitrix/admin/sale_print.php?PROPS_ENABLE=Y&doc='.CUtil::JSEscape($doc).'&ORDER_ID='.$orderId.'&'.$urlParams); } else { $errorMsg .= GetMessage('SOP_ERROR_ACCESS'); } } } else { $errorMsg .= GetMessage('SOP_ERROR_ACCESS'); } if (!empty($errorMsg)) { echo $errorMsg; } require($DOCUMENT_ROOT."/bitrix/modules/main/include/epilog_admin.php");?>