예제 #1
0
    public static function getEdit(Order $order, $showProfiles = false)
    {
        $data = self::prepareData($order);
        $result = '
			<div class="adm-bus-table-container">
				<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table">
					<tbody>
						<tr' . (intval($data["USER_ID"]) > 0 && $data["USER_ID"] != \CSaleUser::GetAnonymousUserID() ? ' style="display: none"' : '') . ' id="sale-order-buyer-find-button-wrap">
							<td class="adm-detail-content-cell-l fwb" width="40%">
								&nbsp;
							</td>
							<td class="adm-detail-content-cell-r">
								<input type="button" name="FIND_BUYER" value="' . Loc::getMessage("SALE_ORDER_BUYER_FIND") . '" onclick="BX.Sale.Admin.OrderBuyer.showChooseBuyerWindow(\'' . LANGUAGE_ID . '\')"><br>
								<i>' . Loc::getMessage("SALE_ORDER_BUYER_START_TO_CREATE") . ':</i>
							</td>
						</tr>
						<tr' . (intval($data["USER_ID"]) <= 0 || $data["USER_ID"] == \CSaleUser::GetAnonymousUserID() ? ' style="display: none"' : '') . ' id="sale-order-buyer-name-wrap">
							<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage("SALE_ORDER_BUYER") . ':</td>
							<td class="adm-detail-content-cell-r">
								<div class="adm-s-order-person-choose">
									<a id="BUYER_USER_NAME" href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $data["USER_ID"] . '">' . htmlspecialcharsbx($data["BUYER_USER_NAME"]) . '</a>&nbsp;
									<a class="adm-s-bus-morelinkqhsw" onclick="BX.Sale.Admin.OrderBuyer.showChooseBuyerWindow(\'' . LANGUAGE_ID . '\')" href="javascript:void(0);">
										' . Loc::getMessage("SALE_ORDER_BUYER_CHANGE") . '
									</a>&nbsp;
									<a class="adm-s-bus-morelinkqhsw" onclick="BX.Sale.Admin.OrderBuyer.clearBuyer();" href="javascript:void(0);">
										' . Loc::getMessage("SALE_ORDER_BUYER_CLEAR") . '
									</a>
									<input type="hidden" name="USER_ID" id="USER_ID" value="' . $data["USER_ID"] . '" onchange="BX.Sale.Admin.OrderBuyer.onBuyerIdChange(this);">
								</div>
							</td>
						</tr>
						<tr>
							<td class="adm-detail-content-cell-l fwb">' . Loc::getMessage("SALE_ORDER_BUYER_PAYER_TYPE") . ':</td>
							<td class="adm-detail-content-cell-r">' . \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml("PERSON_TYPE_ID", self::getBuyerTypesList($order->getSiteId()), isset($data["PERSON_TYPE_ID"]) ? $data["PERSON_TYPE_ID"] : "", false, array("class" => "adm-bus-select", "id" => "PERSON_TYPE_ID", "onchange" => "BX.Sale.Admin.OrderBuyer.onBuyerTypeChange(this.value);")) . '</td>
						</tr>
						<tr id="sale-order-buyer-profiles-list-row"' . ($showProfiles ? '' : ' style="display:none;"') . '>
							<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BUYER_CHOOSE_PROFILE") . ':</td>
							<td class="adm-detail-content-cell-r"><div id="BUYER_PROFILE_ID_CONTAINER">';
        if ($showProfiles) {
            $result .= \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml("BUYER_PROFILE_ID", self::getBuyerProfilesList($data["USER_ID"], $data["PERSON_TYPE_ID"]), isset($data["BUYER_PROFILE_ID"]) ? $data["BUYER_PROFILE_ID"] : "", false, array("class" => "adm-bus-select", "id" => "BUYER_PROFILE_ID", "onchange" => "BX.Sale.Admin.OrderBuyer.onBuyerProfileChange();"));
        }
        $result .= '</div></td>
						</tr>
					</tbody>
				</table>
			</div>' . '<div id="order_properties_container"></div>' . '<div>' . self::getOrderPropertiesByJS($order) . '</div>' . '<div class="adm-bus-table-container caption border sale-order-props-group">' . '<div class="adm-bus-table-caption-title">' . Loc::getMessage("SALE_ORDER_BUYER_COMMENT") . '</div>
				<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
					<tbody>
						<tr>
							<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage("SALE_ORDER_BUYER_ORDERCOMMENT") . ':</td>
							<td class="adm-detail-content-cell-r">
								<textarea style="width:400px;min-height:100px;" name="USER_DESCRIPTION" id="USER_DESCRIPTION">' . $data["USER_DESCRIPTION"] . '</textarea>
							</td>
						</tr>
					</tbody>
				</table>
			</div>';
        return $result;
    }
예제 #2
0
    public static function getEditTemplate($data, $index)
    {
        return '
			<div class="adm-bus-pay">
				<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
					<tbody>
						<tr>
							<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_STATUS') . ':</td>
							<td class="adm-detail-content-cell-r">' . \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml("SHIPMENT[" . $index . "][STATUS_ID]", self::getShipmentStatusList(), $data['STATUS_ID'], false, array("class" => "adm-bus-select", "id" => "SHIPMENT_STATUS_ID")) . '</td>
						</tr>
					</tbody>
				</table>
			</div>';
    }
예제 #3
0
    private static function getEditTemplate($data, $index, $post = array())
    {
        $paid = $post ? $post['PAID'] : $data['PAID'];
        $id = $post ? $post['PAYMENT_ID'] : $data['ID'];
        $paidString = $paid == 'Y' ? 'YES' : 'NO';
        if (!$post) {
            if ($data['SUM'] > 0) {
                $sum = $data['SUM'];
            } else {
                $sum = $data['ORDER_PRICE'] - $data['ORDER_PAYMENT_SUM'] <= 0 ? 0 : $data['ORDER_PRICE'] - $data['ORDER_PAYMENT_SUM'];
            }
        } else {
            $sum = $post['SUM'];
        }
        $psData = self::getPaySystemParams(isset($post['PAY_SYSTEM_ID']) ? $post['PAY_SYSTEM_ID'] : $data['PAY_SYSTEM_ID'], $data['PERSON_TYPE_ID']);
        if (isset($psData["LOGOTIP_PATH"])) {
            $data['PAY_SYSTEM_LOGOTIP'] = $psData["LOGOTIP_PATH"];
        }
        $paymentStatus = '<span><span id="BUTTON_PAID_' . $index . '" ' . ($paid != 'Y' ? 'class="notpay"' : '') . '>' . Loc::getMessage('SALE_ORDER_PAYMENT_STATUS_' . $paidString) . '</span><span class="triangle"> &#9662;</span></span>';
        $note = BeginNote();
        $note .= Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_ALERT');
        $note .= EndNote();
        $hiddenPaySystemInnerId = '';
        if ($index == 1) {
            $hiddenPaySystemInnerId = '<input type="hidden" value="' . PaySystemInner::getId() . '" id="PAYMENT_INNER_BUDGET_ID">';
        }
        $notPaidBlock = $paid == 'N' && !empty($data['EMP_PAID_ID']) ? '' : 'style="display:none;"';
        $return = $post['IS_RETURN'] == 'Y' ? '' : 'style="display:none;"';
        $returnInformation = '
		<tr ' . $return . ' class="return">
			<td class="adm-detail-content-cell-l fwb">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_TO') . ':</td>
			<td class="adm-detail-content-cell-r">
				<select name="PAYMENT[' . $index . '][OPERATION_ID]" id="OPERATION_ID_' . $index . '" class="adm-bus-select">
					<option value="RETURN">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_ACCOUNT') . '</option>
				</select>
			</td>
		</tr>
		<tr ' . $return . ' class="return">
			<td colspan="2" style="text-align: center">' . $note . '</td>
		</tr>
		<tr ' . $notPaidBlock . ' class="not_paid">
			<td class="adm-detail-content-cell-l" width="40%"><br>' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_NUM') . ':</td>
			<td class="adm-detail-content-cell-r tal">
				<br>
				<input type="text" class="adm-bus-input" name="PAYMENT[' . $index . '][PAY_RETURN_NUM]" id="PAYMENT_RETURN_NUM_' . $index . '" value="' . htmlspecialcharsbx($post['PAY_RETURN_NUM'] ? $post['PAY_RETURN_NUM'] : $data['PAY_RETURN_NUM']) . '" maxlength="20">
			</td>
		</tr>
		<tr ' . $notPaidBlock . ' class="not_paid">
			<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_DATE') . ':</td>
			<td class="adm-detail-content-cell-r tal">
				<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
					<input type="text" class="adm-input adm-calendar-to" name="PAYMENT[' . $index . '][PAY_RETURN_DATE]" id="PAYMENT_RETURN_DATE_' . $index . '" size="15" value="' . htmlspecialcharsbx($post['PAY_RETURN_DATE'] ? $post['PAY_RETURN_DATE'] : $data['PAY_RETURN_DATE']) . '">
					<span class="adm-calendar-icon" title="' . Loc::getMessage('SALE_ORDER_PAYMENT_CHOOSE_DATE') . '" onclick="BX.calendar({node:this, field:\'PAYMENT_RETURN_DATE_' . $index . '\', form: \'\', bTime: false, bHideTime: false});"></span>
				</div>
			</td>
		</tr>
		<tr ' . $notPaidBlock . ' class="not_paid">
			<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_COMMENT') . ':</td>
			<td class="adm-detail-content-cell-r tal">
				<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
					<textarea name="PAYMENT[' . $index . '][PAY_RETURN_COMMENT]" id="PAYMENT_RETURN_COMMENTS_' . $index . '">' . htmlspecialcharsbx(isset($post['PAY_RETURN_COMMENT']) ? $post['PAY_RETURN_COMMENT'] : $data['PAY_RETURN_COMMENT']) . '</textarea>
				</div>
			</td>
		</tr>';
        $lang = Main\Application::getInstance()->getContext()->getLanguage();
        $title = $id > 0 ? Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_EDIT_PAYMENT_TITLE') . '#' . $id : Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_NEW_PAYMENT_TITLE') . '#' . $index;
        $curFormat = \CCurrencyLang::getCurrencyFormat($data['CURRENCY']);
        $currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
        $disabled = $data['PAID'] == 'Y' ? 'readonly' : '';
        $companyList = OrderEdit::getCompanyList();
        if (!empty($companyList)) {
            $companies = \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml('PAYMENT[' . $index . '][COMPANY_ID]', $companyList, isset($post["COMPANY_ID"]) ? $post["COMPANY_ID"] : $data["COMPANY_ID"], true, array("class" => "adm-bus-select", "id" => "COMPANY_ID"));
        } else {
            $companies = str_replace("#URL#", "/bitrix/admin/sale_company_edit.php?lang=" . $lang, Loc::getMessage('SALE_ORDER_PAYMENT_ADD_COMPANY'));
        }
        $result = '<div>
			<div class="adm-bus-pay" id="payment_container_' . $index . '">
				<input type="hidden" name="PAYMENT[' . $index . '][PAYMENT_ID]" id="payment_id_' . $index . '" value="' . $id . '">
				<input type="hidden" name="PAYMENT[' . $index . '][INDEX]" value="' . $index . '" class="index">
				<input type="hidden" name="PAYMENT[' . $index . '][PAID]" id="PAYMENT_PAID_' . $index . '" value="' . (empty($paid) ? 'N' : $paid) . '">
				<input type="hidden" name="PAYMENT[' . $index . '][IS_RETURN]" id="PAYMENT_IS_RETURN_' . $index . '" value="' . ($post['IS_RETURN'] ? $post['IS_RETURN'] : 'N') . '">
				' . $hiddenPaySystemInnerId . '
				<div class="adm-bus-component-content-container">
					<div class="adm-bus-pay-section">
						<div class="adm-bus-pay-section-title-container">
							<div class="adm-bus-pay-section-title">' . $title . '</div>
							<div class="adm-bus-pay-section-action-block">' . (!isset($data['ID']) || $data['ID'] <= 0 ? '<div class="adm-bus-pay-section-action" id="SECTION_' . $index . '_DELETE">' . Loc::getMessage('SALE_ORDER_PAYMENT_DELETE') . '</div>' : '') . '</div>
						</div>
						<div class="adm-bus-pay-section-content" id="SECTION_' . $index . '">
							<div class="adm-bus-pay-section-sidebar">
								<div class="adm-bus-pay-section-sidebar-service-logo">
									<img id="LOGOTIP_' . $index . '" src="' . $data['PAY_SYSTEM_LOGOTIP'] . '" alt="">
								</div>
							</div>
							<div class="adm-bus-pay-section-right">
								<div class="adm-bus-table-container caption border">
									<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_METHOD') . '</div>
									<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
										<tbody>
											<tr>
												<td class="adm-detail-content-cell-l fwb" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_SYSTEM') . ':</td>
												<td class="adm-detail-content-cell-r">' . self::makePaymentSelectHtml('PAYMENT[' . $index . '][PAY_SYSTEM_ID]', self::getPaySystemList(), isset($post['PAY_SYSTEM_ID']) ? $post['PAY_SYSTEM_ID'] : $data['PAY_SYSTEM_ID'], array("class" => "adm-bus-select", "id" => "PAY_SYSTEM_ID_" . $index)) . '</td>
											</tr>
										</tbody>
									</table>
								</div>
								<div class="adm-bus-table-container caption border">
									<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_SUM') . '</div>
									<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
										<tbody>
											<tr>
												<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAYABLE_SUM') . ':</td>
												<td class="adm-detail-content-cell-r tal"><input type="text" class="adm-bus-input-price" name="PAYMENT[' . $index . '][SUM]" id="PAYMENT_SUM_' . $index . '" value="' . round($sum, 2) . '" ' . $disabled . '> ' . $currencyLang . '<br></td>
											</tr>
										</tbody>
									</table>
								</div>
								<div class="adm-bus-table-container caption border" style="padding-top:10px;">
									<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_STATUS') . '</div>
									<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table alternation edit-table" id="PAYMENT_BLOCK_STATUS_' . $index . '">
										<tbody>
											<tr>
												<td class="adm-detail-content-cell-l vat payment-status" width="40%">
													' . $paymentStatus . '
												</td>
												<td class="adm-detail-content-cell-r tal" id="PAYMENT_CHANGE_USER_INFO_' . $index . '">
													' . $data['DATE_PAID'] . '
													<a href="/bitrix/admin/user_edit.php?lang=' . $lang . '&ID=' . $data['EMP_PAID_ID'] . '">' . htmlspecialcharsbx($data['EMP_PAID_ID_NAME']) . ' ' . htmlspecialcharsbx($data['EMP_PAID_ID_LAST_NAME']) . '</a>
												</td>
											</tr>
										</tbody>
									</table>
									<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table" id="PAYMENT_BLOCK_STATUS_INFO_' . $index . '">
										<tbody>
											<tr>
												<td class="adm-detail-content-cell-l" width="40%"><br>' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_VOUCHER_NUM') . ':</td>
												<td class="adm-detail-content-cell-r tal">
													<br>
													<input type="text" class="adm-bus-input" id="PAYMENT_NUM" name="PAYMENT[' . $index . '][PAY_VOUCHER_NUM]" value="' . htmlspecialcharsbx(isset($post['PAY_VOUCHER_NUM']) ? $post['PAY_VOUCHER_NUM'] : $data['PAY_VOUCHER_NUM']) . '" maxlength="20">
												</td>
											</tr>
											<tr>
												<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_VOUCHER_DATE') . ':</td>
												<td class="adm-detail-content-cell-r tal">
													<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
														<input type="text" class="adm-input adm-calendar-to" id="PAYMENT_DATE_' . $index . '" name="PAYMENT[' . $index . '][PAY_VOUCHER_DATE]" size="15" value="' . htmlspecialcharsbx($post['PAY_VOUCHER_DATE'] ? $post['PAY_VOUCHER_DATE'] : $data['PAY_VOUCHER_DATE']) . '">
														<span class="adm-calendar-icon" title="' . Loc::getMessage('SALE_ORDER_PAYMENT_CHOOSE_DATE') . '" onclick="BX.calendar({node:this, field:\'PAYMENT_DATE_' . $index . '\', form: \'\', bTime: false, bHideTime: false});"></span>
													</div>
												</td>
											</tr>
											' . $returnInformation . '
										</tbody>
									</table>
								</div>';
        if (isset($data['PS_STATUS']) && !empty($data['PS_STATUS'])) {
            $result .= '<div class="adm-bus-table-container caption border">
									<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS_TITLE') . '</div>
									<a href="javascript:void(0);" id="PS_INFO_' . $index . '">' . Loc::getMessage('SALE_ORDER_PAYMENT_TOGGLE_DOWN') . '</a>
									<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table" style="display: none">
										<tbody>
										<tr>
											<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS') . ':</td>
											<td class="adm-detail-content-cell-r tal">' . $data['PS_STATUS'] . '</td>
										</tr>
										<tr>
											<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS_CODE') . ':</td>
											<td class="adm-detail-content-cell-r tal">' . $data['PS_STATUS_CODE'] . '</td>
										</tr>
										<tr>
											<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_STATUS_DESCRIPTION') . ':</td>
											<td class="adm-detail-content-cell-r tal">' . $data['PS_STATUS_DESCRIPTION'] . '</td>
										</tr>
										<tr>
											<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_CURRENCY') . ':</td>
											<td class="adm-detail-content-cell-r tal">' . $data['PS_CURRENCY'] . '</td>
										</tr>
										<tr>
											<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_SUM') . ':</td>
											<td class="adm-detail-content-cell-r tal">' . $data['PS_SUM'] . '</td>
										</tr>
										<tr>
											<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PS_DATE') . ':</td>
											<td class="adm-detail-content-cell-r tal">' . $data['PS_RESPONSE_DATE'] . '</td>
										</tr>
										</tbody>
									</table>
								</div>';
        }
        $result .= '
								<div class="adm-bus-table-container caption border">
									<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_COMPANY') . '</div>
									<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
										<tbody>
											<tr>
												<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_COMPANY_BY') . ':</td>
												<td class="adm-detail-content-cell-r">' . $companies . '</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<div class="clb"></div>
					</div>
				</div>
			</div>
		</div>
		</div>';
        $params = array('index' => $index, 'functionOnSave' => 'saveInHiddenFields', 'isPaid' => $data['PAID'] == 'Y', 'viewForm' => false, 'isAvailableChangeStatus' => true);
        $result .= self::initJsPayment($params);
        return $result;
    }
예제 #4
0
    public static function getEditTemplate($data, $index, $formType, $post)
    {
        $index++;
        static $items = null;
        if (is_null($items)) {
            $items = self::getDeliveryServiceList();
        }
        foreach ($items as $i => $dlService) {
            if ($dlService['ID'] <= 0) {
                continue;
            }
            if (!Services\Manager::checkServiceRestriction($dlService['ID'], self::$shipment, '\\Bitrix\\Sale\\Delivery\\Restrictions\\BySite')) {
                unset($items[$i]);
            }
        }
        if (!isset($items[$data['DELIVERY_ID']])) {
            $delivery = self::getDeliveryServiceInfoById($data['DELIVERY_ID']);
            if ($delivery) {
                $items[$delivery['ID']] = $delivery;
            }
        }
        static $deliveries = null;
        if (is_null($deliveries)) {
            $deliveries = self::makeDeliveryServiceTree($items);
        }
        $deliveryId = 0;
        $profileId = 0;
        if (isset($post['DELIVERY_ID'])) {
            if (isset($post['PROFILE'])) {
                $data['DELIVERY_ID'] = $post['PROFILE'];
            } else {
                $data['DELIVERY_ID'] = $post['DELIVERY_ID'];
            }
        }
        if ($data['DELIVERY_ID']) {
            $deliveryId = $data['DELIVERY_ID'];
            $service = Services\Manager::getService($deliveryId);
            if ($service && $service->getParentService()) {
                $profileId = $deliveryId;
                $deliveryId = $service->getParentService()->getId();
            }
        }
        if (isset($post['ALLOW_DELIVERY'])) {
            $data['ALLOW_DELIVERY'] = $post['ALLOW_DELIVERY'];
        }
        if ($data['ALLOW_DELIVERY'] == 'Y') {
            $allowDelivery = '<span id="BUTTON_ALLOW_DELIVERY_' . $index . '">' . Loc::getMessage('SALE_ORDER_SHIPMENT_ALLOW_DELIVERY_YES') . '</span>';
        } else {
            $allowDelivery = '<span id="BUTTON_ALLOW_DELIVERY_' . $index . '" class="notdelivery">' . Loc::getMessage('SALE_ORDER_SHIPMENT_ALLOW_DELIVERY_NO') . '</span>';
        }
        $allowDelivery = '<span>' . $allowDelivery . '<span class="triangle"> &#9662;</span></span>';
        if (isset($post['DEDUCTED'])) {
            $data['DEDUCTED'] = $post['DEDUCTED'];
        }
        if ($data['DEDUCTED'] == 'Y') {
            $deducted = '<span id="BUTTON_DEDUCTED_' . $index . '">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DEDUCTED_YES') . '</span>';
        } else {
            $deducted = '<span id="BUTTON_DEDUCTED_' . $index . '" class="notdeducted">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DEDUCTED_NO') . '</span>';
        }
        $deducted = '<span>' . $deducted . '<span class="triangle"> &#9662;</span></span>';
        $lang = Main\Application::getInstance()->getContext()->getLanguage();
        $map = '';
        $extraServiceHTML = '';
        $extraServiceManager = new \Bitrix\Sale\Delivery\ExtraServices\Manager($data['DELIVERY_ID']);
        $extraServiceManager->setOperationCurrency($data['CURRENCY']);
        if (isset($post['EXTRA_SERVICES'])) {
            $data['EXTRA_SERVICES'] = $post['EXTRA_SERVICES'];
        }
        if (isset($post['EXTRA_SERVICES'])) {
            $data['DELIVERY_STORE_ID'] = $post['DELIVERY_STORE_ID'];
        }
        if ($data['EXTRA_SERVICES']) {
            $extraServiceManager->setValues($data['EXTRA_SERVICES']);
        }
        $extraService = $extraServiceManager->getItems();
        if ($extraService) {
            $extraServiceHTML = self::getExtraServiceEditControl($extraService, $index);
        }
        if ($data['DELIVERY_ID'] > 0) {
            $map = self::getMap($data['DELIVERY_ID'], $index, $data['DELIVERY_STORE_ID']);
        }
        $title = $data['ID'] > 0 ? Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_EDIT_SHIPMENT_TITLE') . $data['ID'] : Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_NEW_SHIPMENT_TITLE') . $index;
        $curFormat = \CCurrencyLang::getCurrencyFormat($data['CURRENCY']);
        $currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
        $customPriceDelivery = isset($post['CUSTOM_PRICE_DELIVERY']) ? $post['CUSTOM_PRICE_DELIVERY'] : $data['CUSTOM_PRICE_DELIVERY'];
        $basePriceDelivery = round(isset($post['BASE_PRICE_DELIVERY']) ? $post['BASE_PRICE_DELIVERY'] : $data['BASE_PRICE_DELIVERY'], 2);
        $priceDelivery = round(isset($post['PRICE_DELIVERY']) ? $post['PRICE_DELIVERY'] : $data['PRICE_DELIVERY'], 2);
        $blockProfiles = '';
        if ($profileId > 0) {
            $profiles = self::getDeliveryServiceProfiles($deliveryId);
            $profiles = self::checkProfilesRestriction($profiles, self::$shipment);
            $profilesTemplate = self::getProfileEditControl($profiles, $index, $profileId);
            $blockProfiles = '
				<tr id="BLOCK_PROFILES_' . $index . '">
					<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_SERVICE_PROFILE') . ':</td>
					<td class="adm-detail-content-cell-r" id="PROFILE_SELECT_' . $index . '">' . $profilesTemplate . '</td>
				</tr>';
        }
        $id = isset($post['ID']) ? $post['SHIPMENT_ID'] : $data['ID'];
        $companyList = OrderEdit::getCompanyList();
        if (!empty($companyList)) {
            $companies = \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml('SHIPMENT[' . $index . '][COMPANY_ID]', $companyList, isset($post["COMPANY_ID"]) ? $post["COMPANY_ID"] : $data["COMPANY_ID"], true, array("class" => "adm-bus-select", "id" => "OFFICE_SHIPMENT" . $index));
        } else {
            $companies = str_replace("#URL#", "/bitrix/admin/sale_company_edit.php?lang=" . $lang, Loc::getMessage('SALE_ORDER_SHIPMENT_ADD_COMPANY'));
        }
        if (isset($items[$data['DELIVERY_ID']]['LOGOTIP']['MAIN'])) {
            $logo = $items[$data['DELIVERY_ID']]['LOGOTIP']['MAIN'];
        } else {
            $logo = '/bitrix/images/sale/logo-default-d.gif';
        }
        $result = '
		<div class="adm-bus-pay" id="shipment_container_' . $index . '">
			<input type="hidden" name="SHIPMENT[' . $index . '][SHIPMENT_ID]" id="SHIPMENT_ID_' . $index . '" value="' . $id . '">
			<input type="hidden" name="SHIPMENT[' . $index . '][CUSTOM_PRICE_DELIVERY]" id="CUSTOM_PRICE_DELIVERY_' . $index . '" value="' . $customPriceDelivery . '">
			<input type="hidden" name="SHIPMENT[' . $index . '][CUSTOM_PRICE]" id="CUSTOM_PRICE_' . $index . '" value="' . (isset($post['CUSTOM_PRICE']) ? $post['CUSTOM_PRICE'] : $data['CUSTOM_PRICE']) . '">
			<input type="hidden" name="SHIPMENT[' . $index . '][DEDUCTED]" id="STATUS_DEDUCTED_' . $index . '" value="' . ($data['DEDUCTED'] == "" ? "N" : $data['DEDUCTED']) . '">
			<input type="hidden" name="SHIPMENT[' . $index . '][ALLOW_DELIVERY]" id="STATUS_ALLOW_DELIVERY_' . $index . '" value="' . ($data['ALLOW_DELIVERY'] == "" ? "N" : $data['ALLOW_DELIVERY']) . '">
			<div class="adm-bus-component-content-container">
				<div class="adm-bus-pay-section">
					<div class="adm-bus-pay-section-title-container">
						<div class="adm-bus-pay-section-title">' . $title . '</div>
					</div>
					<div class="adm-bus-pay-section-content">
						<div class="adm-bus-pay-section-sidebar">
							<div style="background: url(\'' . $logo . '\')" id="delivery_service_logo_' . $index . '" class="adm-shipment-block-logo"></div>
							<div id="section_map_' . $index . '">' . $map . '</div>
						</div>
						<div class="adm-bus-pay-section-right">
							<div class="adm-bus-table-container caption border">
								<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_SERVICE') . '</div>
								<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
									<tbody>
										<tr id="BLOCK_DELIVERY_SERVICE_' . $index . '">
											<td class="adm-detail-content-cell-l fwb" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_SERVICE') . ':</td>
											<td class="adm-detail-content-cell-r">
												' . self::getDeliverySelectHtml($deliveries, $deliveryId, $index) . '
											</td>
										</tr>
										' . $blockProfiles . '
									</tbody>
								</table>
							</div>
							<div class="adm-bus-table-container caption border">
								<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_BLOCK_PRICE') . '</div>
								<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
									<tbody>
										<tr>
											<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_SUM_PRICE') . ':</td>
											<td class="adm-detail-content-cell-r tal"><input type="text" class="adm-bus-input-price" name="SHIPMENT[' . $index . '][BASE_PRICE_DELIVERY]" id="BASE_PRICE_DELIVERY_' . $index . '" value="' . $basePriceDelivery . '"> ' . $currencyLang . '<br></td>
										</tr>
										<tr id="sale-order-shipment-discounts-row-' . $index . '" style="display: none;">
											<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DISCOUNT') . ':</td>
											<td class="adm-detail-content-cell-r tal" id="sale-order-shipment-discounts-container-' . $index . '"></td>
										</tr>
										<tr style="display: none;">
											<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_SUM_DISCOUNT_PRICE') . ':</td>
											<td class="adm-detail-content-cell-r tal"><span id="PRICE_DELIVERY_' . $index . '">' . $priceDelivery . '</span> ' . $currencyLang . '</td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="adm-bus-table-container caption border">
								<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_SHIPMENT') . '</div>
								<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
									<tbody>
										<tr>
											<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_OFFICE') . ':</td>
											<td class="adm-detail-content-cell-r">' . $companies . '</td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="adm-bus-table-container caption border">
								<div class="adm-bus-moreInfo_part1">
									<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_STATUS') . '</div>
									<table class="adm-detail-content-table edit-table" border="0" width="100%" cellpadding="0" cellspacing="0">
										<tbody>
											<tr>
												<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_ALLOW_DELIVERY') . ':</td>
												<td class="adm-detail-content-cell-r delivery-status">' . $allowDelivery . '</td>
											</tr>
											' . (!empty($data['EMP_ALLOW_DELIVERY_ID']) ? '
											<tr>
												<td class="adm-detail-content-cell-l vat" width="40%"></td>
												<td class="adm-detail-content-cell-r">
													<div>' . Loc::getMessage('SALE_ORDER_SHIPMENT_MODIFY_BY') . ': <span style="color: #66878F" id="order_additional_info_date_responsible">' . htmlspecialcharsbx($data['DATE_ALLOW_DELIVERY']) . '</span>  <a href="/bitrix/admin/user_edit.php?lang=' . $lang . '&ID=' . $data['EMP_ALLOW_DELIVERY_ID'] . '" id="order_additional_info_emp_responsible">' . htmlspecialcharsbx($data['EMP_ALLOW_DELIVERY_ID_LAST_NAME']) . ' ' . htmlspecialcharsbx($data['EMP_ALLOW_DELIVERY_ID_NAME']) . '</a></div>
												</td>
											</tr>
											' : '') . '
											<tr>
												<td class="adm-detail-content-cell-l vat" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DEDUCTED') . ':</td>
												<td class="adm-detail-content-cell-r deducted-status">' . $deducted . '</td>
											</tr>
											' . (!empty($data['EMP_DEDUCTED_ID']) ? '
											<tr>
												<td class="adm-detail-content-cell-l fwb vat" width="40%"></td>
												<td class="adm-detail-content-cell-r">
													<div>' . Loc::getMessage('SALE_ORDER_SHIPMENT_MODIFY_BY') . ': <span style="color: #66878F" id="order_additional_info_date_responsible">' . htmlspecialcharsbx($data['DATE_DEDUCTED']) . '</span>  <a href="/bitrix/admin/user_edit.php?lang=' . $lang . '&ID=' . $data['EMP_DEDUCTED_ID'] . '" id="order_additional_info_emp_responsible">' . htmlspecialcharsbx($data['EMP_DEDUCTED_ID_LAST_NAME']) . ' ' . htmlspecialcharsbx($data['EMP_DEDUCTED_ID_NAME']) . '</a></div>
												</td>
											</tr>
											' : '') . '
										</tbody>
									</table>
								</div>
							</div>
							<div class="adm-bus-table-container caption border">
								<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_DELIVERY_INFO') . '</div>
								<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
									<tbody>
										<tr>
											<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_TRACKING_NUMBER') . ':</td>
											<td class="adm-detail-content-cell-r tal"><input type="text" class="adm-bus-input" name="SHIPMENT[' . $index . '][TRACKING_NUMBER]" value="' . htmlspecialcharsbx(isset($post['TRACKING_NUMBER']) ? $post['TRACKING_NUMBER'] : $data['TRACKING_NUMBER']) . '"><br></td>
										</tr>
										<tr>
											<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_DOC_NUM') . ':</td>
											<td class="adm-detail-content-cell-r tal"><input type="text" class="adm-bus-input" name="SHIPMENT[' . $index . '][DELIVERY_DOC_NUM]" value="' . htmlspecialcharsbx(isset($post['DELIVERY_DOC_NUM']) ? $post['DELIVERY_DOC_NUM'] : $data['DELIVERY_DOC_NUM']) . '"><br></td>
										</tr>
										<tr>
											<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_DOC_DATE') . ':</td>
											<td class="adm-detail-content-cell-r tal">
												<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
													<input type="text" class="adm-input adm-calendar-to" id="DELIVERY_DOC_DATE" name="SHIPMENT[' . $index . '][DELIVERY_DOC_DATE]" size="15" value="' . htmlspecialcharsbx(isset($post['DELIVERY_DOC_DATE']) ? $post['DELIVERY_DOC_DATE'] : $data['DELIVERY_DOC_DATE']) . '">
													<span class="adm-calendar-icon" title="' . Loc::getMessage('SALE_ORDER_SHIPMENT_DELIVERY_CHOOSE_DATE') . '" onclick="BX.calendar({node:this, field:\'DELIVERY_DOC_DATE\', form: \'\', bTime: false, bHideTime: false});"></span>
												</div>
											</td>
										</tr>
									</tbody>
								</table>
								<div id="DELIVERY_INFO_' . $index . '">' . $extraServiceHTML . '
								</div>
							</div>
						</div>
						<div class="clb"></div>
					</div>
				</div>
			</div>
		</div>';
        $srcList = self::getImgDeliveryServiceList($items);
        $params = array('index' => $index, 'isAjax' => false, 'src_list' => $srcList, 'active' => true, 'discounts' => $data["DISCOUNTS"], 'discountsMode' => $formType == "edit" ? "view" : "edit", 'templateType' => 'edit');
        $params['base_price_delivery'] = $data['BASE_PRICE_DELIVERY'];
        if ($customPriceDelivery == 'Y') {
            $params['base_price_delivery'] = $data['CUSTOM_PRICE'];
        }
        $result .= self::initJsShipment($params);
        return $result;
    }
예제 #5
0
    public static function getEditSimple($userId, $fieldName, $status)
    {
        return '
			<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
				<tbody>
					<tr>
						<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage("SALE_ORDER_STATUS") . ':' . '</td>
						<td class="adm-detail-content-cell-r">' . \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml($fieldName, self::getStatusesList($userId, $status), $status, false, array("class" => "adm-bus-select", "id" => "STATUS_ID")) . '</td>
					</tr>
				</tbody>
			</table>';
    }
예제 #6
0
    public static function getProductEditDialogHtml($currency, $objName)
    {
        return '
			<input id="FORM_BASKET_PRODUCT_ID" name="BASKET_PRODUCT_ID" value="" type="hidden">
			<input id="FORM_PROD_BASKET_CUSTOM_PRICE" name="BASKET_CUSTOM_PRICE" value="Y" type="hidden">
			<table class="edit-table">
				<tr>
					<td width="40%">&nbsp;</td>
					<td align="left" width="60%">
					<div id="basketError" style="display:none;">
						<table class="message message-error" border="0" cellpadding="0" cellspacing="0" style="border:2px solid #FF0000;color:#FF0000">
							<tr>
								<td>
									<table class="content" border="0" cellpadding="0" cellspacing="0" style="margin:4px;">
										<tr>
											<td valign="top"><div class="icon-error"></div></td>
											<td>
												<span class="message-title" style="font-weight:bold;">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ERROR") . '</span><br>
												<div class="empty" style="height: 5px;"></div><div id="basketErrorText"></div>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</div></td>
				</tr>
				<tr id="FORM_NEWPROD_CODE">
					<td class="adm-detail-content-cell-l" width="30%">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_ID") . ':</td>
					<td  width="70%"><input size="10" id="FORM_PROD_BASKET_OFFER_ID" name="FORM_PROD_BASKET_OFFER_ID" type="text" value="" tabindex="1"></td>
				</tr>
				<tr class="adm-detail-required-field">
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_NAME") . ':</td>
					<td><input size="40" id="FORM_PROD_BASKET_NAME" name="FORM_PROD_BASKET_NAME" type="text" value="" tabindex="2" onkeyup="' . $objName . '.productEditDialog.disableButton();"></td>
				</tr>
				<tr>
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_PATH") . ':</td>
					<td><input id="FORM_PROD_BASKET_DETAIL_PAGE_URL" name="FORM_PROD_BASKET_DETAIL_PAGE_URL" value="" size="40" type="text" tabindex="3"></td>
				</tr>
				<tr>
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_CATALOG_XML") . ':</td>
					<td><input id="FORM_PROD_BASKET_CATALOG_XML_ID" name="FORM_PROD_BASKET_CATALOG_XML_ID" value="" size="40" type="text" tabindex="4"></td>
				</tr>
				<tr>
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_PRODUCT_XML") . ':</td>
					<td><input id="FORM_PROD_BASKET_PRODUCT_XML_ID" name="FORM_PROD_BASKET_PRODUCT_XML_ID" value="" size="40" type="text" tabindex="5"></td>
				</tr>
				<tr>
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_NOTES") . ':</td>
					<td><input name="FORM_PROD_BASKET_NOTES" id="FORM_PROD_BASKET_NOTES" size="40" maxlength="250" value="" type="text" tabindex="6"></td>
				</tr>
				<tr>
					<td class="adm-detail-content-cell-l" valign="top" width="40%">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_PROPS") . ':</td>
					<td width="60%">
						<table id="BASKET_PROP_TABLE" class="internal" border="0" cellpadding="3" cellspacing="1" style="width: 521px; margin-top: 20px;">
							<tr class="heading" style="border-collapse:collapse;background-color:#E7EAF5;color:#525355;">
								<td align="center">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_IP_NAME") . '</td>
								<td align="center">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_IP_VALUE") . '</td>
								<td align="center">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_IP_CODE") . '</td>
								<td align="center">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_IP_SORT") . '</td>
							</tr>
							<tr id="FORM_PROD_BASKET_EMPTY_PROP_ROW">
								<td colspan="4" style="text-align: center;">
									' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_EMPTY_PROP_ROW") . '
								</td>
							</tr>
						</table>
						<div width="100%" style="text-align: right;">
							<input value="' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_PROPERTY_MORE") . '" onclick="' . $objName . '.productEditDialog.addPropRow();" type="button" style="margin-top: 10px;">
						</div>
					</td>
				</tr>
				<tr class="adm-detail-required-field">
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_QUANTITY") . ':</td>
					<td>
						<input name="FORM_PROD_BASKET_QUANTITY" id="FORM_PROD_BASKET_QUANTITY" size="10" maxlength="20" value="" type="text" tabindex="7" onkeyup="' . $objName . '.productEditDialog.disableButton();">&nbsp;
						' . OrderEdit::makeSelectHtml('FORM_PROD_BASKET_MEASURE_CODE', self::getCatalogMeasures(), '', true, array('id' => 'FORM_PROD_BASKET_MEASURE_CODE')) . '
					</td>
				</tr>
				<tr  class="adm-detail-required-field">
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_PRICE") . ':</td>
					<td><input name="FORM_PROD_BASKET_PRICE" id="FORM_PROD_BASKET_PRICE" size="10" maxlength="20" value="" type="text" tabindex="8" onkeyup="' . $objName . '.productEditDialog.disableButton();"> (' . \CUtil::JSEscape($currency) . ')</td>
				</tr>
				<tr>
					<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_WEIGHT") . ':</td>
					<td><input name="FORM_PROD_BASKET_WEIGHT" id="FORM_PROD_BASKET_WEIGHT" size="10" maxlength="20" value="" type="text" tabindex="9"> (' . Loc::getMessage("SALE_ORDER_BASKET_PROD_EDIT_ITEM_GRAMM") . ')</td>
				</tr>
			</table>';
    }