|
|
@@ -285,6 +285,7 @@ class RecordIN extends Component
|
|
|
$this->commercial = 0;
|
|
|
$this->corrispettivo_fiscale = false;
|
|
|
$this->date = date("Y-m-d");
|
|
|
+ $this->year = date("Y");
|
|
|
$this->type = 'IN';
|
|
|
$this->deleted = false;
|
|
|
$this->financial_movement = false;
|
|
|
@@ -668,6 +669,7 @@ class RecordIN extends Component
|
|
|
'commercial' => $this->commercial,
|
|
|
'corrispettivo_fiscale' => $this->corrispettivo_fiscale,
|
|
|
'date' => $this->date,
|
|
|
+ 'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'amount' => $price,
|
|
|
'financial_movement' => $this->financial_movement,
|
|
|
@@ -780,6 +782,7 @@ class RecordIN extends Component
|
|
|
'commercial' => $this->commercial,
|
|
|
'corrispettivo_fiscale' => $this->corrispettivo_fiscale,
|
|
|
'date' => $this->date,
|
|
|
+ 'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'amount' => $totalNet,
|
|
|
'prediscount_amount' => $totalGross,
|
|
|
@@ -935,6 +938,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->year = $record->year;
|
|
|
$this->type = $record->type;
|
|
|
$this->deleted = $record->deleted;
|
|
|
$this->financial_movement = $record->financial_movement;
|
|
|
@@ -1119,6 +1123,7 @@ class RecordIN extends Component
|
|
|
'commercial' => $this->commercial,
|
|
|
'corrispettivo_fiscale' => $this->corrispettivo_fiscale,
|
|
|
'date' => date("Y-m-d", strtotime($this->date)),
|
|
|
+ 'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'financial_movement' => $this->financial_movement,
|
|
|
'deleted' => $this->deleted,
|
|
|
@@ -1376,7 +1381,7 @@ class RecordIN extends Component
|
|
|
|
|
|
if ($create) {
|
|
|
$number = 1;
|
|
|
- $exist = \App\Models\Receipt::where('year', date("Y"))->orderBy('number', 'DESC')->first();
|
|
|
+ $exist = \App\Models\Receipt::where('year', $this->year)->orderBy('number', 'DESC')->first();
|
|
|
if ($exist != null)
|
|
|
$number = $exist->number + 1;
|
|
|
|
|
|
@@ -1399,7 +1404,7 @@ class RecordIN extends Component
|
|
|
'payment_method_id' => $this->payment_method_id,
|
|
|
'number' => $number,
|
|
|
'date' => $this->date,
|
|
|
- 'year' => date("Y"),
|
|
|
+ 'year' => $this->year,
|
|
|
'type' => $this->type,
|
|
|
'parent' => $this->parent,
|
|
|
'status' => 1,
|
|
|
@@ -1431,7 +1436,7 @@ class RecordIN extends Component
|
|
|
|
|
|
sendReceiptEmail($receipt);
|
|
|
|
|
|
- session()->flash('receipt', "Ricevuta " . $number . "/" . date("Y") . " creata correttamente");
|
|
|
+ session()->flash('receipt', "Ricevuta " . $number . "/" . $this->year . " creata correttamente");
|
|
|
|
|
|
$this->emit('showReceipt', $this->currentReceip->id);
|
|
|
}
|