|
@@ -142,7 +142,7 @@ class Member extends Component
|
|
|
public $filterCertAgonistic = 0;
|
|
public $filterCertAgonistic = 0;
|
|
|
public $filterCertScaduto = 0;
|
|
public $filterCertScaduto = 0;
|
|
|
public $filterCertInScadenza = 0;
|
|
public $filterCertInScadenza = 0;
|
|
|
-
|
|
|
|
|
|
|
+ public $already_existing = false;
|
|
|
protected $rules = [
|
|
protected $rules = [
|
|
|
'first_name' => 'required',
|
|
'first_name' => 'required',
|
|
|
'last_name' => 'required',
|
|
'last_name' => 'required',
|
|
@@ -211,6 +211,7 @@ class Member extends Component
|
|
|
$this->age = '';
|
|
$this->age = '';
|
|
|
|
|
|
|
|
$this->error_fc = false;
|
|
$this->error_fc = false;
|
|
|
|
|
+ $this->already_existing = false;
|
|
|
|
|
|
|
|
$this->isSaving = false;
|
|
$this->isSaving = false;
|
|
|
|
|
|
|
@@ -473,7 +474,7 @@ class Member extends Component
|
|
|
|
|
|
|
|
$this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->get(), 0);
|
|
$this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->get(), 0);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// $this->getCourses(\App\Models\Course::select('id', 'name')->where('parent_id', null)->get(), 0);
|
|
// $this->getCourses(\App\Models\Course::select('id', 'name')->where('parent_id', null)->get(), 0);
|
|
|
|
|
|
|
@@ -740,11 +741,11 @@ class Member extends Component
|
|
|
// Carico gli abbonamenti e i mesi
|
|
// Carico gli abbonamenti e i mesi
|
|
|
$period = \Carbon\CarbonPeriod::create($c->date_from, '1 month', $c->date_to);
|
|
$period = \Carbon\CarbonPeriod::create($c->date_from, '1 month', $c->date_to);
|
|
|
$this->course_months_list = [];
|
|
$this->course_months_list = [];
|
|
|
- foreach ($period as $dt)
|
|
|
|
|
|
|
+ foreach ($period as $dt)
|
|
|
{
|
|
{
|
|
|
$this->course_months_list[] = $dt->format("m");
|
|
$this->course_months_list[] = $dt->format("m");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$this->course_price_list = [];
|
|
$this->course_price_list = [];
|
|
|
if ($c->prices != null)
|
|
if ($c->prices != null)
|
|
|
{
|
|
{
|
|
@@ -865,7 +866,7 @@ class Member extends Component
|
|
|
|
|
|
|
|
$existingMember = \App\Models\Member::where('fiscal_code', $this->fiscal_code)->first();
|
|
$existingMember = \App\Models\Member::where('fiscal_code', $this->fiscal_code)->first();
|
|
|
if ($existingMember) {
|
|
if ($existingMember) {
|
|
|
- $this->addError('fiscal_code', 'Codice fiscale già presente.');
|
|
|
|
|
|
|
+ $this->already_existing = true;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1879,7 +1880,7 @@ class Member extends Component
|
|
|
foreach ($record->rows as $row)
|
|
foreach ($record->rows as $row)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if ($row->causal_id == $c->causal_id && !str_contains(strtolower($row->note), 'iscrizione'))
|
|
if ($row->causal_id == $c->causal_id && !str_contains(strtolower($row->note), 'iscrizione'))
|
|
|
{
|
|
{
|
|
|
$tot = sizeof(json_decode($row->when));
|
|
$tot = sizeof(json_decode($row->when));
|
|
@@ -1968,7 +1969,7 @@ class Member extends Component
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if ($mm->status == "2")
|
|
if ($mm->status == "2")
|
|
|
$this->suspendedMonths[] = $m;
|
|
$this->suspendedMonths[] = $m;
|
|
|
}
|
|
}
|