mirror of
https://github.com/anna-sara/filament_inventory
synced 2025-12-24 03:17:14 +01:00
Fixes with retured date
This commit is contained in:
parent
3076fae039
commit
d987b621c3
1 changed files with 2 additions and 2 deletions
|
|
@ -25,13 +25,13 @@ class EditReserveditem extends EditRecord
|
|||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
|
||||
if ($data['delivered'])
|
||||
if ($data['delivered'] && !$data['returned'])
|
||||
{
|
||||
$data['delivered_date'] = Carbon::now();
|
||||
$data['return_date'] = Carbon::now()->addMonths(1);
|
||||
}
|
||||
|
||||
if ($data['returned'])
|
||||
if ($data['returned'] && $data['delivered'])
|
||||
{
|
||||
$data['returned_date'] = Carbon::now();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue