|
@@ -106,6 +106,8 @@ class RecordIN extends Component
|
|
|
|
|
|
|
|
public $fromCourse = false;
|
|
public $fromCourse = false;
|
|
|
|
|
|
|
|
|
|
+ public $backToRates = false;
|
|
|
|
|
+
|
|
|
protected $rules = [
|
|
protected $rules = [
|
|
|
'member_id' => 'required',
|
|
'member_id' => 'required',
|
|
|
'payment_method_id' => 'required',
|
|
'payment_method_id' => 'required',
|
|
@@ -258,6 +260,7 @@ class RecordIN extends Component
|
|
|
$this->parent = '';
|
|
$this->parent = '';
|
|
|
$this->courseId = 0;
|
|
$this->courseId = 0;
|
|
|
$this->rateId = 0;
|
|
$this->rateId = 0;
|
|
|
|
|
+ $this->backToRates = false;
|
|
|
$this->months = array();
|
|
$this->months = array();
|
|
|
$this->rows = array();
|
|
$this->rows = array();
|
|
|
$this->rows[] = array('causal_id' => isset($_GET["causalId"]) ? $_GET["causalId"] : null, 'when' => array(array('month' => date("n"), 'year' => date("Y"), 'period' => '')), 'amount' => null, 'vat_id' => null, 'note' => '', 'commercial' => 0, 'sconto' => 0);
|
|
$this->rows[] = array('causal_id' => isset($_GET["causalId"]) ? $_GET["causalId"] : null, 'when' => array(array('month' => date("n"), 'year' => date("Y"), 'period' => '')), 'amount' => null, 'vat_id' => null, 'note' => '', 'commercial' => 0, 'sconto' => 0);
|
|
@@ -388,6 +391,9 @@ class RecordIN extends Component
|
|
|
if (isset($_GET["rateId"])) {
|
|
if (isset($_GET["rateId"])) {
|
|
|
$this->rateId = $_GET["rateId"];
|
|
$this->rateId = $_GET["rateId"];
|
|
|
}
|
|
}
|
|
|
|
|
+ if (isset($_GET["backToRates"])) {
|
|
|
|
|
+ $this->backToRates = true;
|
|
|
|
|
+ }
|
|
|
if (isset($_GET["months"]) && $_GET["months"] != '') {
|
|
if (isset($_GET["months"]) && $_GET["months"] != '') {
|
|
|
|
|
|
|
|
$this->fromCourse = true;
|
|
$this->fromCourse = true;
|
|
@@ -681,10 +687,15 @@ class RecordIN extends Component
|
|
|
$rate->save();
|
|
$rate->save();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if ($this->backToRates) {
|
|
|
|
|
+ return redirect()->to("/rates?member_id={$this->member_id}&member_course_id={$this->courseId}");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
session()->flash('success', 'Movimento creato');
|
|
session()->flash('success', 'Movimento creato');
|
|
|
$this->resetFields();
|
|
$this->resetFields();
|
|
|
$this->add = false;
|
|
$this->add = false;
|
|
|
$this->isDuplicate = false;
|
|
$this->isDuplicate = false;
|
|
|
|
|
+
|
|
|
$this->emit('setEdit', false);
|
|
$this->emit('setEdit', false);
|
|
|
} catch (\Exception $ex) {
|
|
} catch (\Exception $ex) {
|
|
|
Log::error("Error in store method: " . $ex->getMessage());
|
|
Log::error("Error in store method: " . $ex->getMessage());
|
|
@@ -965,6 +976,11 @@ class RecordIN extends Component
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
session()->flash('success', 'Movimento aggiornato');
|
|
session()->flash('success', 'Movimento aggiornato');
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->backToRates) {
|
|
|
|
|
+ return redirect()->to("/rates?member_id={$this->member_id}&member_course_id={$this->courseId}");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$this->resetFields();
|
|
$this->resetFields();
|
|
|
$this->update = false;
|
|
$this->update = false;
|
|
|
$this->isDuplicate = false;
|
|
$this->isDuplicate = false;
|