|
|
@@ -63,6 +63,8 @@ class RecordIN extends Component
|
|
|
$date,
|
|
|
$month,
|
|
|
$year,
|
|
|
+ $receipt_date,
|
|
|
+ $data_ricevuta_old = false,
|
|
|
$type,
|
|
|
$deleted,
|
|
|
$financial_movement,
|
|
|
@@ -218,6 +220,12 @@ class RecordIN extends Component
|
|
|
$this->canSave = $this->checkCanSave();
|
|
|
}
|
|
|
|
|
|
+ public function updatedReceiptDate()
|
|
|
+ {
|
|
|
+ $this->year = date("Y", strtotime($this->receipt_date));
|
|
|
+ $this->data_ricevuta_old = \App\Models\Receipt::where('receipt_date', '>', $this->receipt_date)->exists();
|
|
|
+ }
|
|
|
+
|
|
|
public function updatedCommercial($value)
|
|
|
{
|
|
|
$this->emitSelf('refreshMembers');
|
|
|
@@ -285,6 +293,8 @@ class RecordIN extends Component
|
|
|
$this->commercial = 0;
|
|
|
$this->corrispettivo_fiscale = false;
|
|
|
$this->date = date("Y-m-d");
|
|
|
+ $this->receipt_date = date("Y-m-d");
|
|
|
+ $this->data_ricevuta_old = false;
|
|
|
$this->year = date("Y");
|
|
|
$this->type = 'IN';
|
|
|
$this->deleted = false;
|
|
|
@@ -669,6 +679,7 @@ class RecordIN extends Component
|
|
|
'commercial' => $this->commercial,
|
|
|
'corrispettivo_fiscale' => $this->corrispettivo_fiscale,
|
|
|
'date' => $this->date,
|
|
|
+ 'receipt_date' => $this->receipt_date,
|
|
|
'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'amount' => $price,
|
|
|
@@ -782,6 +793,7 @@ class RecordIN extends Component
|
|
|
'commercial' => $this->commercial,
|
|
|
'corrispettivo_fiscale' => $this->corrispettivo_fiscale,
|
|
|
'date' => $this->date,
|
|
|
+ 'receipt_date' => $this->receipt_date,
|
|
|
'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'amount' => $totalNet,
|
|
|
@@ -938,6 +950,7 @@ class RecordIN extends Component
|
|
|
$this->commercial = $record->commercial;
|
|
|
$this->corrispettivo_fiscale = $record->corrispettivo_fiscale;
|
|
|
$this->date = date("Y-m-d", strtotime($record->date));
|
|
|
+ $this->receipt_date = date("Y-m-d", strtotime($record->receipt_date));
|
|
|
$this->year = $record->year;
|
|
|
$this->type = $record->type;
|
|
|
$this->deleted = $record->deleted;
|
|
|
@@ -1123,6 +1136,7 @@ class RecordIN extends Component
|
|
|
'commercial' => $this->commercial,
|
|
|
'corrispettivo_fiscale' => $this->corrispettivo_fiscale,
|
|
|
'date' => date("Y-m-d", strtotime($this->date)),
|
|
|
+ 'receipt_date' => date("Y-m-d", strtotime($this->receipt_date)),
|
|
|
'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'financial_movement' => $this->financial_movement,
|
|
|
@@ -1206,6 +1220,7 @@ class RecordIN extends Component
|
|
|
$record = \App\Models\Record::findOrFail($this->dataId);
|
|
|
$newRecord = $record->replicate();
|
|
|
$newRecord->date = date("Y-m-d");
|
|
|
+ $newRecord->receipt_date = date("Y-m-d");
|
|
|
$newRecord->save();
|
|
|
|
|
|
$recordRows = \App\Models\RecordRow::where('record_id', $this->dataId)->get();
|
|
|
@@ -1404,6 +1419,7 @@ class RecordIN extends Component
|
|
|
'payment_method_id' => $this->payment_method_id,
|
|
|
'number' => $number,
|
|
|
'date' => $this->date,
|
|
|
+ 'receipt_date' => $this->receipt_date,
|
|
|
'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'parent' => $this->parent,
|