update
This commit is contained in:
@@ -126,6 +126,10 @@
|
||||
<line x1="3" y1="18" x2="21" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="global-search" id="js-global-search-wrap">
|
||||
<input type="text" id="js-global-search" class="global-search__input" placeholder="Szukaj zamówień..." autocomplete="off">
|
||||
<div class="global-search__results" id="js-global-search-results"></div>
|
||||
</div>
|
||||
<div>
|
||||
<strong><?= $e((string) (($user['name'] ?? '') !== '' ? $user['name'] : ($user['email'] ?? ''))) ?></strong>
|
||||
</div>
|
||||
@@ -141,6 +145,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/js/modules/jquery-alerts.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/jquery-alerts.js') ?: 0 ?>"></script>
|
||||
<script src="/assets/js/modules/global-search.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/global-search.js') ?: 0 ?>"></script>
|
||||
<script>
|
||||
(function () {
|
||||
var STORAGE_KEY = 'sidebarCollapsed';
|
||||
|
||||
@@ -172,7 +172,6 @@ foreach ($addressesList as $address) {
|
||||
<?php $personalization = trim((string) ($item['personalization'] ?? '')); ?>
|
||||
<?php if ($personalization !== ''): ?>
|
||||
<div class="item-personalization">
|
||||
<span class="item-personalization__label">Personalizacja:</span>
|
||||
<?php foreach (explode("\n", $personalization) as $line): ?>
|
||||
<?php if (trim($line) !== ''): ?>
|
||||
<div class="item-personalization__line"><?= $e(trim($line)) ?></div>
|
||||
@@ -220,12 +219,16 @@ foreach ($addressesList as $address) {
|
||||
$paymentTypeRaw = strtoupper(trim((string) ($orderRow['external_payment_type_id'] ?? '')));
|
||||
$paymentTypeLabels = [
|
||||
'CASH_ON_DELIVERY' => 'Za pobraniem',
|
||||
'COD' => 'Za pobraniem',
|
||||
'POBRANIE' => 'Za pobraniem',
|
||||
'ZA POBRANIEM' => 'Za pobraniem',
|
||||
'PŁATNOŚĆ PRZY ODBIORZE' => 'Za pobraniem',
|
||||
'ONLINE' => 'Platnosc online',
|
||||
'TRANSFER' => 'Przelew',
|
||||
];
|
||||
$paymentTypeLabel = $paymentTypeLabels[$paymentTypeRaw] ?? ($paymentTypeRaw !== '' ? $paymentTypeRaw : '-');
|
||||
?>
|
||||
<?php if ($paymentTypeRaw === 'CASH_ON_DELIVERY'): ?>
|
||||
<?php if (\App\Core\Support\StringHelper::isCodPayment($paymentTypeRaw)): ?>
|
||||
<span class="order-tag is-cod"><?= $e($paymentTypeLabel) ?></span>
|
||||
<?php else: ?>
|
||||
<?= $e($paymentTypeLabel) ?>
|
||||
@@ -576,6 +579,10 @@ foreach ($addressesList as $address) {
|
||||
$paymentTypeLabels = [
|
||||
'ONLINE' => 'Płatność online',
|
||||
'CASH_ON_DELIVERY' => 'Za pobraniem',
|
||||
'COD' => 'Za pobraniem',
|
||||
'POBRANIE' => 'Za pobraniem',
|
||||
'ZA POBRANIEM' => 'Za pobraniem',
|
||||
'PŁATNOŚĆ PRZY ODBIORZE' => 'Za pobraniem',
|
||||
'TRANSFER' => 'Przelew bankowy',
|
||||
];
|
||||
$providerLabels = [
|
||||
@@ -675,7 +682,7 @@ foreach ($addressesList as $address) {
|
||||
<tr>
|
||||
<td class="text-nowrap"><?= $e($payDate !== '' ? $payDate : '—') ?></td>
|
||||
<td>
|
||||
<?php if ($ptRaw === 'CASH_ON_DELIVERY'): ?>
|
||||
<?php if (\App\Core\Support\StringHelper::isCodPayment($ptRaw)): ?>
|
||||
<span class="order-tag is-cod"><?= $e($ptLabel) ?></span>
|
||||
<?php else: ?>
|
||||
<?= $e($ptLabel) ?>
|
||||
|
||||
@@ -192,8 +192,8 @@ foreach ($dmMappings as $dm) {
|
||||
|
||||
<div class="content-tab-panel<?= $activeTab === 'statuses' ? ' is-active' : '' ?>" data-tab-panel="shoppro-tab-statuses">
|
||||
<section class="mt-16">
|
||||
<h3 class="section-title"><?= $e($t('settings.integrations.statuses.title')) ?></h3>
|
||||
<p class="muted mt-12"><?= $e($t('settings.integrations.statuses.description')) ?></p>
|
||||
<h3 class="section-title"><?= $e($t('settings.order_statuses.title')) ?></h3>
|
||||
<p class="muted mt-12"><?= $e($t('settings.order_statuses.description')) ?></p>
|
||||
|
||||
<?php if (!$isEdit && $list === []): ?>
|
||||
<p class="muted mt-12"><?= $e($t('settings.integrations.statuses.select_integration_first')) ?></p>
|
||||
@@ -264,6 +264,74 @@ foreach ($dmMappings as $dm) {
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="mt-24">
|
||||
<h3 class="section-title"><?= $e($t('settings.order_statuses.pull.title')) ?></h3>
|
||||
<p class="muted mt-12"><?= $e($t('settings.order_statuses.pull.description')) ?></p>
|
||||
|
||||
<?php if (!$isEdit && $list === []): ?>
|
||||
<p class="muted mt-12"><?= $e($t('settings.integrations.statuses.select_integration_first')) ?></p>
|
||||
<?php else: ?>
|
||||
<form class="mt-12" action="/settings/integrations/shoppro/statuses/save-pull" method="post">
|
||||
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
||||
<input type="hidden" name="integration_id" value="<?= $e((string) ($formValues['integration_id'] ?? 0)) ?>">
|
||||
<div class="table-wrap mt-12">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $e($t('settings.order_statuses.fields.shoppro_status')) ?></th>
|
||||
<th><?= $e($t('settings.order_statuses.fields.orderpro_status')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($shopproStatuses === []): ?>
|
||||
<tr>
|
||||
<td colspan="2" class="muted"><?= $e($t('settings.order_statuses.pull.no_shoppro_statuses')) ?></td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($shopproStatuses as $extStatus): ?>
|
||||
<?php
|
||||
$extCode = (string) ($extStatus['code'] ?? '');
|
||||
$extName = (string) ($extStatus['name'] ?? $extCode);
|
||||
if ($extCode === '') continue;
|
||||
$pullMapped = $pullMappingIndex[$extCode] ?? null;
|
||||
$selectedOrderproCode = $pullMapped !== null ? (string) ($pullMapped['orderpro_status_code'] ?? '') : '';
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $e($extName) ?> <code class="muted">(<?= $e($extCode) ?>)</code>
|
||||
<input type="hidden" name="shoppro_status_code[]" value="<?= $e($extCode) ?>">
|
||||
<input type="hidden" name="shoppro_status_name[]" value="<?= $e($extName) ?>">
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" name="orderpro_status_code[]">
|
||||
<option value=""><?= $e($t('settings.order_statuses.fields.no_mapping')) ?></option>
|
||||
<?php foreach ($orderproStatuses as $opStatus): ?>
|
||||
<?php
|
||||
$opCode = strtolower(trim((string) ($opStatus['code'] ?? '')));
|
||||
$opName = (string) ($opStatus['name'] ?? $opCode);
|
||||
if ($opCode === '') continue;
|
||||
?>
|
||||
<option value="<?= $e($opCode) ?>"<?= $selectedOrderproCode === $opCode ? ' selected' : '' ?>>
|
||||
<?= $e($opName) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php if ($shopproStatuses !== []): ?>
|
||||
<div class="form-actions mt-12">
|
||||
<button type="submit" class="btn btn--primary"><?= $e($t('settings.order_statuses.pull.save')) ?></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="content-tab-panel<?= $activeTab === 'settings' ? ' is-active' : '' ?>" data-tab-panel="shoppro-tab-settings">
|
||||
|
||||
@@ -38,7 +38,7 @@ $pointId = trim((string) ($receiver['parcel_external_id'] ?? ''));
|
||||
$pointName = trim((string) ($receiver['parcel_name'] ?? ''));
|
||||
$totalWithTax = (float) ($orderRow['total_with_tax'] ?? 0);
|
||||
$currency = strtoupper(trim((string) ($orderRow['currency'] ?? 'PLN')));
|
||||
$isCod = strtoupper(trim((string) ($orderRow['external_payment_type_id'] ?? ''))) === 'CASH_ON_DELIVERY';
|
||||
$isCod = \App\Core\Support\StringHelper::isCodPayment((string) ($orderRow['external_payment_type_id'] ?? ''));
|
||||
$defaultCodAmount = $isCod ? number_format($totalWithTax, 2, '.', '') : '0';
|
||||
?>
|
||||
|
||||
@@ -83,7 +83,7 @@ $defaultCodAmount = $isCod ? number_format($totalWithTax, 2, '.', '') : '0';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="/orders/<?= $e((string) ($orderId ?? 0)) ?>/shipment/create" novalidate>
|
||||
<form id="shipment-form" method="post" action="/orders/<?= $e((string) ($orderId ?? 0)) ?>/shipment/create" novalidate>
|
||||
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
||||
|
||||
<div class="shipment-grid mt-16">
|
||||
@@ -989,6 +989,12 @@ $defaultCodAmount = $isCod ? number_format($totalWithTax, 2, '.', '') : '0';
|
||||
|
||||
// Select delivery service in the correct panel
|
||||
selectDeliveryService(preset);
|
||||
|
||||
// Auto-submit after autofill completes
|
||||
setTimeout(function () {
|
||||
var form = document.getElementById('shipment-form');
|
||||
if (form) form.submit();
|
||||
}, 300);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user