|
@@ -407,10 +407,10 @@ class RecordIN extends Component
|
|
|
$this->rows[0]["amount"] = formatPrice($price);
|
|
$this->rows[0]["amount"] = formatPrice($price);
|
|
|
foreach ($months as $idx => $m) {
|
|
foreach ($months as $idx => $m) {
|
|
|
$this->rows[0]["when"][$idx]["month"] = $m;
|
|
$this->rows[0]["when"][$idx]["month"] = $m;
|
|
|
- if ($m > date("M"))
|
|
|
|
|
- $this->rows[0]["when"][$idx]["year"] = $m < env('FISCAL_YEAR_MONTH_FROM', 1) ? (date("Y") + 1) : date("Y");
|
|
|
|
|
|
|
+ if ($m >= date("m"))
|
|
|
|
|
+ $this->rows[0]["when"][$idx]["year"] = date("Y");
|
|
|
else
|
|
else
|
|
|
- $this->rows[0]["when"][$idx]["year"] = $m > env('FISCAL_YEAR_MONTH_TO', 1) ? (date("Y") - 1) : date("Y");
|
|
|
|
|
|
|
+ $this->rows[0]["when"][$idx]["year"] = date("Y") + 1;
|
|
|
|
|
|
|
|
if ($idx > 0) {
|
|
if ($idx > 0) {
|
|
|
if ($this->rows[0]["when"][$idx - 1]["year"] != $this->rows[0]["when"][$idx]["year"])
|
|
if ($this->rows[0]["when"][$idx - 1]["year"] != $this->rows[0]["when"][$idx]["year"])
|
|
@@ -681,10 +681,15 @@ class RecordIN extends Component
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ($this->rateId > 0) {
|
|
if ($this->rateId > 0) {
|
|
|
- $rate = \App\Models\Rate::findOrFail($this->rateId);
|
|
|
|
|
- $rate->status = 1;
|
|
|
|
|
- $rate->record_id = $record->id;
|
|
|
|
|
- $rate->save();
|
|
|
|
|
|
|
+ $rates = explode(",", $this->rateId);
|
|
|
|
|
+ foreach($rates as $rid)
|
|
|
|
|
+ {
|
|
|
|
|
+ $rate = \App\Models\Rate::findOrFail($rid);
|
|
|
|
|
+ $rate->status = 1;
|
|
|
|
|
+ $rate->record_id = $record->id;
|
|
|
|
|
+ $rate->save();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ($this->backToRates) {
|
|
if ($this->backToRates) {
|