Ejemplo n.º 1
0
?>
">
	<?php 
echo bitrix_sessid_post();
?>
	<div style="position: relative; vertical-align: top">
		<?php 
$tabControl->DraggableBlocksStart();
?>
		<?php 
foreach ($blocksOrder as $blockCode) {
    echo '<a id="' . $blockCode . '"></a>';
    $tabControl->DraggableBlockBegin(Loc::getMessage("SALE_OVIEW_BLOCK_TITLE_" . toUpper($blockCode)), $blockCode);
    switch ($blockCode) {
        case "statusorder":
            echo Admin\Blocks\OrderStatus::getEdit($saleOrder, $USER, true, true);
            break;
        case "buyer":
            echo Admin\Blocks\OrderBuyer::getView($saleOrder);
            break;
        case "delivery":
            $shipments = $saleOrder->getShipmentCollection();
            $index = 0;
            /** @var \Bitrix\Sale\Shipment  $shipment*/
            foreach ($shipments as $shipment) {
                if (!$shipment->isSystem()) {
                    echo Admin\Blocks\OrderShipment::getView($shipment, $index++);
                }
            }
            echo Admin\Blocks\OrderShipment::createNewShipmentButton();
            break;
Ejemplo n.º 2
0
 protected function cancelOrderAction()
 {
     global $USER;
     $orderId = isset($this->request['orderId']) ? intval($this->request['orderId']) : 0;
     $canceled = isset($this->request['canceled']) ? $this->request['canceled'] : "N";
     $comment = isset($this->request['comment']) ? trim($this->request['comment']) : "";
     $errors = array();
     if (!\CSaleOrder::CanUserCancelOrder($orderId, $USER->GetUserGroupArray(), $this->userId)) {
         throw new UserMessageException("Insufficient rights to cancel order");
     }
     /** @var  \Bitrix\Sale\Order $saleOrder*/
     if (!($saleOrder = \Bitrix\Sale\Order::load($orderId))) {
         throw new UserMessageException("Can't load order with id: " . $orderId);
     }
     $state = $saleOrder->getField("CANCELED");
     if ($state != $canceled) {
         throw new UserMessageException($state == "Y" ? "Order already canceled." : "Order not canceled yet.");
     }
     /** @var \Bitrix\Sale\Result $res */
     $res = $saleOrder->setField("CANCELED", $canceled == "Y" ? "N" : "Y");
     if (!$res->isSuccess()) {
         $errors = array_merge($errors, $res->getErrorMessages());
     }
     $saleOrder->setField("REASON_CANCELED", $canceled == "N" ? $comment : "");
     if (!($res = $saleOrder->save())) {
         $errors = array_merge($errors, $res->getErrorMessages());
     }
     $canceled = $saleOrder->getField("CANCELED");
     $this->addResultData("CANCELED", $canceled);
     if ($canceled == "Y") {
         $userInfo = Admin\Blocks\OrderStatus::getUserInfo($saleOrder->getField("EMP_CANCELED_ID"));
         $this->addResultData("DATE_CANCELED", $saleOrder->getField("DATE_CANCELED")->toString());
         $this->addResultData("EMP_CANCELED_ID", $saleOrder->getField("EMP_CANCELED_ID"));
         $this->addResultData("EMP_CANCELED_NAME", $userInfo["NAME"] . " (" . $userInfo["LOGIN"] . ")");
     }
     if (!empty($errors)) {
         throw new UserMessageException(implode("<br>\n", $errors));
     }
 }
Ejemplo n.º 3
0
            foreach ($payments as $payment) {
                echo Blocks\OrderPayment::getEdit($payment, ++$index, $_POST['PAYMENT'][$index]);
            }
            echo Blocks\OrderPayment::createButtonAddPayment('edit');
            break;
        case 'relprops':
            echo Blocks\OrderBuyer::getPropsEdit($order);
            break;
        case "financeinfo":
            echo Blocks\OrderFinanceInfo::getView($order);
            break;
        case "additional":
            echo Blocks\OrderAdditional::getEdit($order, $formId . "_form", 'ORDER');
            break;
        case "statusorder":
            echo Blocks\OrderStatus::getEditSimple($USER->GetID(), 'STATUS_ID', \Bitrix\Sale\OrderStatus::getInitialStatus());
            break;
    }
    $tabControl->DraggableBlockEnd();
}
?>
	</div>
</td></tr>
<?php 
$tabControl->EndTab();
$tabControl->Buttons(array("back_url" => "/bitrix/admin/sale_order_create.php?lang=" . LANGUAGE_ID . "&SITE_ID=" . $siteId . GetFilterParams("filter_")));
$tabControl->End();
?>
<div style="display: none;">
	<?php 
echo $orderBasket->getSettingsDialogContent();
Ejemplo n.º 4
0
?>
">
	<?php 
echo bitrix_sessid_post();
?>
	<div style="position: relative; vertical-align: top">
		<?php 
$tabControl->DraggableBlocksStart();
?>
		<?php 
foreach ($blocksOrder as $blockCode) {
    echo '<a id="' . $blockCode . '"></a>';
    $tabControl->DraggableBlockBegin(Loc::getMessage("SALE_BLOCK_TITLE_" . toUpper($blockCode)), $blockCode);
    switch ($blockCode) {
        case "statusorder":
            echo Blocks\OrderStatus::getEdit($order, $USER, false, false);
            break;
        case "buyer":
            echo Blocks\OrderBuyer::getEdit($order);
            break;
        case "delivery":
            $shipments = $order->getShipmentCollection();
            $index = 0;
            /** @var \Bitrix\Sale\Shipment  $shipment*/
            foreach ($shipments as $shipment) {
                if (!$shipment->isSystem()) {
                    echo Blocks\OrderShipment::getView($shipment, ++$index, 'edit');
                }
            }
            break;
        case "payment":
Ejemplo n.º 5
0
    switch ($blockCode) {
        case "financeinfo":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderFinanceInfo::getView($saleOrder, $new);
            break;
        case "payment":
            $index = 1;
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderPayment::getEdit($payment, $index, $_POST['PAYMENT'][$index]);
            break;
        case "buyer":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderBuyer::getView($saleOrder);
            break;
        case "additional":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderAdditional::getEdit($payment, $tableId . "_form", 'PAYMENT[1]');
            break;
        case "statusorder":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderStatus::getEditSimple($USER->GetID(), 'PAYMENT[1][ORDER_STATUS_ID]', $saleOrder->getField('STATUS_ID'));
            break;
    }
    $tabControl->DraggableBlockEnd();
}
?>
		</div>
	</td>
</tr>

</form>
<?php 
//--TAB order
if ($paymentId > 0) {
    //TAB history --
    $tabControl->BeginNextTab();