update
This commit is contained in:
@@ -1006,8 +1006,8 @@ return [
|
||||
],
|
||||
],
|
||||
'order_statuses' => [
|
||||
'title' => 'Statusy zamowien',
|
||||
'description' => 'Mapowanie statusow zamowien pomiedzy orderPRO i shopPRO.',
|
||||
'title' => 'Wysylka statusow (orderPRO → shopPRO)',
|
||||
'description' => 'Okresl, jaki status shopPRO ma otrzymac zamowienie po zmianie statusu w orderPRO.',
|
||||
'integration' => 'Integracja shopPRO',
|
||||
'no_integrations' => 'Brak aktywnych integracji shopPRO z kluczem API.',
|
||||
'empty' => 'Brak statusow shopPRO do zmapowania.',
|
||||
@@ -1039,6 +1039,14 @@ return [
|
||||
'saved' => 'Mapowanie statusow zostalo zapisane.',
|
||||
'save_failed' => 'Nie udalo sie zapisac mapowania statusow.',
|
||||
],
|
||||
'pull' => [
|
||||
'title' => 'Mapowanie przy imporcie (shopPRO → orderPRO)',
|
||||
'description' => 'Okresl, jaki status orderPRO ma otrzymac zamowienie importowane z danym statusem shopPRO.',
|
||||
'save' => 'Zapisz mapowanie importu',
|
||||
'saved' => 'Mapowanie importu zapisane.',
|
||||
'save_failed' => 'Blad zapisu mapowania importu.',
|
||||
'no_shoppro_statuses' => 'Brak statusow shopPRO. Zsynchronizuj statusy przyciskiem powyzej.',
|
||||
],
|
||||
],
|
||||
'cron' => [
|
||||
'title' => 'Harmonogram',
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
@use "modules/shipment-presets";
|
||||
@use "modules/delivery-status";
|
||||
@use "modules/delivery-status-mappings";
|
||||
@use "modules/global-search";
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
|
||||
92
resources/scss/modules/_global-search.scss
Normal file
92
resources/scss/modules/_global-search.scss
Normal file
@@ -0,0 +1,92 @@
|
||||
.global-search {
|
||||
flex: 1;
|
||||
max-width: 500px;
|
||||
position: relative;
|
||||
margin: 0 16px;
|
||||
}
|
||||
|
||||
.global-search__input {
|
||||
width: 100%;
|
||||
padding: 6px 12px;
|
||||
font-size: 13px;
|
||||
border: 1px solid var(--c-border);
|
||||
border-radius: 4px;
|
||||
background: var(--c-bg);
|
||||
color: var(--c-text);
|
||||
outline: none;
|
||||
transition: border-color 0.15s;
|
||||
|
||||
&::placeholder {
|
||||
color: var(--c-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
border-color: var(--c-primary, #3b82f6);
|
||||
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
.global-search__results {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
background: var(--c-surface, #fff);
|
||||
border: 1px solid var(--c-border);
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.global-search__item {
|
||||
display: block;
|
||||
padding: 8px 12px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
color: var(--c-text);
|
||||
border-bottom: 1px solid var(--c-border);
|
||||
transition: background-color 0.1s;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&.is-highlighted {
|
||||
background: var(--c-bg, #f1f5f9);
|
||||
}
|
||||
}
|
||||
|
||||
.global-search__item-title {
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.global-search__item-details {
|
||||
font-size: 11px;
|
||||
color: var(--c-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.global-search__empty {
|
||||
padding: 12px;
|
||||
text-align: center;
|
||||
color: var(--c-text-muted, #94a3b8);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.global-search {
|
||||
max-width: none;
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.global-search__input {
|
||||
font-size: 12px;
|
||||
padding: 5px 8px;
|
||||
}
|
||||
}
|
||||
@@ -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