|
|
@@ -615,25 +615,38 @@ Route::get('/get_record_in', function () {
|
|
|
if ($_GET["filterCausals"] != "null")
|
|
|
$causals = explode(",", $_GET["filterCausals"]);
|
|
|
|
|
|
+ $count = 0;
|
|
|
$aIds = [];
|
|
|
foreach ($y->get() as $r) {
|
|
|
|
|
|
if (!in_array($r->payment_method_id, $moneys)) {
|
|
|
- //if ((!in_array($r->member_id, $exclude_from_records) || in_array($r->causal_id, $moneysCausal)) && (!$r->deleted || $r->deleted == null) && (!in_array($r->causal_id, $excludeCausals) || in_array($r->causal_id, $moneysCausal)) && (!$r->financial_movement || $r->financial_movement == null) && (!$r->corrispettivo_fiscale || $r->corrispettivo_fiscale == null) && !$r->commercial) {
|
|
|
- //if ((!in_array($r->member_id, $exclude_from_records) || in_array($r->causal_id, $moneysCausal)) && (!$r->deleted || $r->deleted == null) && (!in_array($r->causal_id, $excludeCausals) || in_array($r->causal_id, $moneysCausal)) && (!$r->financial_movement || $r->financial_movement == null)) {
|
|
|
- if ((!in_array($r->member_id, $exclude_from_records) || in_array($r->causal_id, $moneysCausal)) && (!$r->deleted || $r->deleted == null) && (!in_array($r->causal_id, $excludeCausals) || in_array($r->causal_id, $moneysCausal)) && (!$r->financial_movement || $r->financial_movement == null) && (!$r->corrispettivo_fiscale || $r->corrispettivo_fiscale == null)) {
|
|
|
- if (sizeof($causals) == 0 || in_array($r->causal_id, $causals)) {
|
|
|
+
|
|
|
+ if (
|
|
|
+ (!in_array($r->member_id, $exclude_from_records) || in_array($r->causal_id, $moneysCausal))
|
|
|
+ &&
|
|
|
+ (!$r->deleted || $r->deleted == null)
|
|
|
+ &&
|
|
|
+ (!in_array($r->causal_id, $excludeCausals) || in_array($r->causal_id, $moneysCausal))
|
|
|
+ &&
|
|
|
+ (!$r->financial_movement || $r->financial_movement == null)
|
|
|
+ &&
|
|
|
+ (!$r->corrispettivo_fiscale || $r->corrispettivo_fiscale == null)
|
|
|
+ ) {
|
|
|
+ // if (sizeof($causals) == 0 || in_array($r->causal_id, $causals)) {
|
|
|
$total += $r->amount;
|
|
|
if ($r->vat_id > 0)
|
|
|
$total += getVatValue($r->amount, $r->vat_id);
|
|
|
|
|
|
- $aIds[] = array('id' => $r->record_id, 'amount' => $r->amount);
|
|
|
- }
|
|
|
+ //$aIds[] = array('id' => $r->record_id, 'amount' => $r->amount);
|
|
|
+ $aIds[] = $r->record_id;
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ $count += 1;
|
|
|
}
|
|
|
+ //print $count;
|
|
|
+ //print implode(",",$aIds);
|
|
|
|
|
|
$count = $x->count();
|
|
|
|
|
|
@@ -1663,3 +1676,29 @@ Route::get('/send_sms', function () {
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+
|
|
|
+Route::get('/fix', function () {
|
|
|
+ $datas = \App\Models\MemberCourse::whereNotNull('date_from')->get();
|
|
|
+ foreach($datas as $data)
|
|
|
+ {
|
|
|
+ $data->date_from = date("Y-m-d", strtotime($data->created_at));
|
|
|
+ $date_to = '';
|
|
|
+ $months = json_decode($data->months);
|
|
|
+ foreach($months as $m)
|
|
|
+ {
|
|
|
+ if ($m->m >= 9)
|
|
|
+ {
|
|
|
+ $check = "2025-" . $m->m . "-01";
|
|
|
+ $date_to = date("Y-m-t", strtotime($check));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $check = "2026-" . $m->m . "-01";
|
|
|
+ $date_to = date("Y-m-t", strtotime($check));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $data->date_to = $date_to;
|
|
|
+ $data->save();
|
|
|
+
|
|
|
+ }
|
|
|
+});
|