Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/inikoo/aiku into main
Browse files Browse the repository at this point in the history
  • Loading branch information
itzArtha committed Jan 20, 2025
2 parents f25e3a2 + bd76f53 commit 3b2aad2
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/Actions/Fulfilment/Pallet/AttachPalletsToReturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public function handle(PalletReturn $palletReturn, array $modelData): PalletRetu

Pallet::whereIn('id', $palletsToSelect)->update([
'pallet_return_id' => $palletReturn->id,
'status' => PalletStatusEnum::STORING,
'state' => PalletStateEnum::IN_PROCESS
'status' => PalletStatusEnum::RETURNING,
'state' => PalletStateEnum::REQUEST_RETURN
]);

$pallets = Pallet::findOrFail($palletsToSelect);
Expand Down
29 changes: 29 additions & 0 deletions app/Actions/Fulfilment/Pallet/UI/IndexPalletsInCustomer.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,36 @@ public function htmlResponse(LengthAwarePaginator $pallets, ActionRequest $reque

$actions = [];

if($this->parent->number_pallets_status_storing)
{
$actions[] = [
'type' => 'button',
'style' => 'create',
'tooltip' => $this->parent->items_storage ? __('Create new return (whole pallet)') : __('Create new return'),
'label' => $this->parent->items_storage ? __('Return (whole pallet)') : __('Return'),
'fullLoading' => true,
'route' => [
'method' => 'post',
'name' => 'grp.models.fulfilment-customer.pallet-return.store',
'parameters' => [$this->parent->id]
]
];
}
if ($this->parent->items_storage) {

$actions[] = [
'type' => 'button',
'style' => 'create',
'tooltip' => __('Create new return (stored items)'),
'label' => __('Return (Stored items)'),
'fullLoading' => true,
'route' => [
'method' => 'post',
'name' => 'grp.models.fulfilment-customer.pallet-return-stored-items.store',
'parameters' => [$this->parent->id]
]
];

$openStoredItemAudit = $this->parent->storedItemAudits()->where('state', StoredItemAuditStateEnum::IN_PROCESS)->first();

if ($openStoredItemAudit) {
Expand Down
6 changes: 3 additions & 3 deletions app/Actions/Fulfilment/PalletReturn/UI/IndexPalletReturns.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ public function htmlResponse(LengthAwarePaginator $customers, ActionRequest $req
$this->parent->number_pallets_status_storing ? [
'type' => 'button',
'style' => 'create',
'tooltip' => !$this->parent->number_stored_items_status_storing ? __('Create new return (whole pallet)') : __('Create new return'),
'label' => !$this->parent->number_stored_items_status_storing ? __('Return (whole pallet)') : __('Return'),
'tooltip' => $this->parent->items_storage ? __('Create new return (whole pallet)') : __('Create new return'),
'label' => $this->parent->items_storage ? __('Return (whole pallet)') : __('Return'),
'fullLoading' => true,
'route' => [
'method' => 'post',
Expand All @@ -259,7 +259,7 @@ public function htmlResponse(LengthAwarePaginator $customers, ActionRequest $req
},
match (class_basename($this->parent)) {
'FulfilmentCustomer' =>
!$this->parent->number_stored_items_status_storing ? [
$this->parent->items_storage ? [
'type' => 'button',
'style' => 'create',
'tooltip' => __('Create new return (stored items)'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class AttachRetinaPalletsToReturn extends RetinaAction

public function handle(PalletReturn $palletReturn, array $modelData): PalletReturn
{


$selectedPalletIds = Arr::get($modelData, 'pallets', []);

if (count($selectedPalletIds) === 0) {
Expand All @@ -53,8 +55,8 @@ public function handle(PalletReturn $palletReturn, array $modelData): PalletRetu

Pallet::whereIn('id', $palletsToSelect)->update([
'pallet_return_id' => $palletReturn->id,
'status' => PalletStatusEnum::STORING,
'state' => PalletStateEnum::IN_PROCESS
'status' => PalletStatusEnum::RETURNING,
'state' => PalletStateEnum::REQUEST_RETURN
]);

$pallets = Pallet::findOrFail($palletsToSelect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ public function tableStructure(

$table
->column(key: 'state', label: ['fal', 'fa-yin-yang'], type: 'icon')
->column(key: 'reference', label: __('Reference'), canBeHidden: false, sortable: true, searchable: true);
->column(key: 'reference', label: __('Reference'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'number_audited_pallets', label: __('Audited Pallets'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'number_audited_stored_items', label: __('Audited Stored Items'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'number_audited_stored_items_with_additions', label: __('Audited Stored Items(with additions)'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'number_audited_stored_items_with_with_subtractions', label: __('Audited Stored Items(with subtractions)'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'number_audited_stored_items_with_with_stock_checked', label: __('Audited Stored Items(with stock checked)'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'number_associated_stored_items', label: __('Associated Stored Items'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'number_created_stored_items', label: __('Created Stored Items'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'created_at', label: __('Created At'), canBeHidden: false, sortable: true, searchable: true);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ const stateStoredItemEdited = reactive<StoredItemsQuantity>({})
const edit_block = (audit_type: string, is_edit: boolean) => {
return audit_type === 'no_change' ? 'checked' : is_edit ? 'edit' : false
return audit_type === 'no_change' ? 'checked' : audit_type || is_edit ? 'edit' : false
}
</script>

Expand Down Expand Up @@ -303,9 +303,9 @@ const edit_block = (audit_type: string, is_edit: boolean) => {

<!-- Column: Customer SKUS -->
<template #cell(stored_items)="{ proxyItem, item }">
pallet id: {{ item.id }} <br />
<!-- pallet id: {{ item.id }} <br />
item.stored_item_audit_id: {{ item.stored_item_audit_id }} <br />
route store: {{ props.route_list?.stored_item_audit_delta?.store.name }} <br />
route store: {{ props.route_list?.stored_item_audit_delta?.store.name }} <br /> -->

<DataTable v-if="proxyItem.stored_items?.length || proxyItem.new_stored_items?.length"
:value="[...proxyItem.stored_items, ...proxyItem.new_stored_items]">
Expand All @@ -327,12 +327,12 @@ const edit_block = (audit_type: string, is_edit: boolean) => {


<template #body="{ data }">
<pre>{{ data }}</pre>
<!-- <pre>{{ data }}</pre>
stored_item_audit_id: {{ data.stored_item_audit_id || '-' }} <br />
stored_item_id: {{ data.stored_item_id || '-' }} <br />
audit_type: {{ data.audit_type || '-' }} <br />
stored_item_audit_delta_id: {{ data.stored_item_audit_delta_id || '-' }} <br />
edit_block: {{ edit_block(data.audit_type, data.is_edit) }}
edit_block: {{ edit_block(data.audit_type, data.is_edit) }} -->

<!-- <pre>{{ props.route_list?.stored_item_audit_delta?.store }}</pre> -->
<!-- <pre>{{ data }}</pre> -->
Expand Down Expand Up @@ -387,7 +387,7 @@ const edit_block = (audit_type: string, is_edit: boolean) => {
<div class="text-center tabular-nums border border-transparent hover:border-dashed hover:border-gray-300 group-focus:border-dashed group-focus:border-gray-300">

<InputNumber
:modelValue="data.stored_item_audit_delta_id ? data.audited_quantity : data.quantity"
:modelValue="data.stored_item_audit_delta_id ? data.audited_quantity : data.quantity || edit_block(data.audit_type, data.is_edit) =='edit' "
@update:modelValue="(e) => debounceChangeQuantity(item.rowIndex, data.stored_item_audit_delta_id, e)"
buttonLayout="horizontal" :min="0" style="width: 100%"
:inputStyle="{
Expand Down

0 comments on commit 3b2aad2

Please sign in to comment.