|
|
@@ -88,6 +88,8 @@ class RecordOUT extends Component
|
|
|
|
|
|
public $vats = array();
|
|
|
|
|
|
+ public $numero_fattura;
|
|
|
+
|
|
|
|
|
|
protected $rules = [
|
|
|
'supplier_id' => 'required',
|
|
|
@@ -129,6 +131,7 @@ class RecordOUT extends Component
|
|
|
$this->date = date("Y-m-d");
|
|
|
$this->data_pagamento = date("Y-m-d");
|
|
|
//$this->attachment = null;
|
|
|
+ $this->numero_fattura = null;
|
|
|
$this->type = 'OUT';
|
|
|
$this->commercial = 1;
|
|
|
$this->rows = array();
|
|
|
@@ -370,9 +373,9 @@ class RecordOUT extends Component
|
|
|
$this->attachment->storeAs('public', $name);
|
|
|
} */
|
|
|
|
|
|
- $invoiceNumber = null;
|
|
|
-
|
|
|
- $invoiceNumber = 'USC-' . date('YmdHis');
|
|
|
+ if($this->numero_fattura == null || $this->numero_fattura == '') {
|
|
|
+ $this->numero_fattura = 'USC-' . date('Ymd');
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if (empty($this->data_pagamento) || $this->data_pagamento == '1970-01-01') {
|
|
|
@@ -396,7 +399,7 @@ class RecordOUT extends Component
|
|
|
'type' => $this->type,
|
|
|
'amount' => $this->currencyToDouble($this->amount),
|
|
|
'commercial' => $this->commercial,
|
|
|
- 'numero_fattura' => $invoiceNumber,
|
|
|
+ 'numero_fattura' => $this->numero_fattura,
|
|
|
'is_paid' => $is_paid,
|
|
|
]);
|
|
|
Log::info("Record data being inserted: " . json_encode($record));
|
|
|
@@ -470,6 +473,7 @@ class RecordOUT extends Component
|
|
|
$this->date = date("Y-m-d", strtotime($record->date));
|
|
|
$this->data_pagamento = $record->data_pagamento;
|
|
|
$this->type = $record->type;
|
|
|
+ $this->numero_fattura = $record->numero_fattura;
|
|
|
//$attachment = $record->attachment;
|
|
|
$this->commercial = $record->commercial;
|
|
|
$this->dataId = $record->id;
|
|
|
@@ -554,6 +558,7 @@ class RecordOUT extends Component
|
|
|
'type' => $this->type,
|
|
|
'commercial' => $this->commercial,
|
|
|
'is_paid' => $is_paid,
|
|
|
+ 'numero_fattura' => $this->numero_fattura,
|
|
|
//'attachment' => $this->attachment,
|
|
|
]);
|
|
|
|