Luca Parisio před 11 měsíci
rodič
revize
429943681b

+ 2 - 2
resources/views/livewire/records_in.blade.php

@@ -41,7 +41,7 @@
                 <div class="col-md-2">
                     <div class="row">
                         <div class="col-md-12" style="margin-bottom:10px;">
-                            <b>Periodo</b>
+                            <b>Data di pagamento</b>
                         </div>
                         <div class="col-12 mb-2">
                             <input id="dateFrom" type="date" class="form-control filterFrom">
@@ -131,7 +131,7 @@
                 <thead>
                     <tr>
                         <!--<th scope="col"></th>-->
-                        <th scope="col">Data</th>
+                        <th scope="col">Data di pagamento</th>
                         <th scope="col">Importo</th>
                         <th scope="col">Cognome</th>
                         <th scope="col">Nome</th>

+ 1 - 1
resources/views/receipt.blade.php

@@ -20,7 +20,7 @@
 <body>
     <img src="{{public_path() . env('LOGO')}}" width="200">
     <br><br><br>
-    <div align="right"><b>RICEVUTA DI PAGAMENTO N. {{$receipt->number . "/" . $receipt->year}} del {{date("d/m/Y", strtotime($receipt->date))}}</b></div><br><br>
+    <div align="right"><b>RICEVUTA DI PAGAMENTO N. {{$receipt->number . "/" . $receipt->year}} del {{date("d/m/Y", strtotime($receipt->created_at))}}</b></div><br><br>
     @if($receipt->status == 99)
         <div align="right"><b style="color:red">ANNULLATA</b></div><br><br>
     @endif

+ 7 - 7
routes/web.php

@@ -393,7 +393,7 @@ Route::group(['middleware' => 'auth'],function(){
                 ->leftJoin('receipts', 'records.id', '=', 'receipts.record_id')
                 ->where('records.type', 'IN');
 
-        $y = \App\Models\Record::select('records_rows.amount', 'records.member_id', 'records.corrispettivo_fiscale', 'records.deleted', 'records.financial_movement', 'records_rows.causal_id', \DB::raw('members.first_name as first_name'), \DB::raw('members.last_name as last_name')) // , \DB::raw('SUM(records.id) As total'))
+        $y = \App\Models\Record::select('records_rows.amount', 'records.member_id', 'records.corrispettivo_fiscale', 'records.deleted', 'records.financial_movement', 'records_rows.causal_id', 'records.payment_method_id', \DB::raw('members.first_name as first_name'), \DB::raw('members.last_name as last_name')) // , \DB::raw('SUM(records.id) As total'))
         ->leftJoin('members', 'records.member_id', '=', 'members.id')
         ->leftJoin('records_rows', 'records.id', '=', 'records_rows.record_id')
         //->leftJoin('receipts', 'records.id', '=', 'receipts.record_id')
@@ -489,14 +489,14 @@ Route::group(['middleware' => 'auth'],function(){
             if ($_GET["filterFrom"] != '')
             {
                 $hasFilter = true;
-                $x = $x->where('records.date', '>=', $_GET["filterFrom"]);
-                $y = $y->where('date', '>=', $_GET["filterFrom"]);
+                $x = $x->where('records.date', '>=', $_GET["filterFrom"] . " 00:00:00");
+                $y = $y->where('records.date', '>=', $_GET["filterFrom"] . " 00:00:00");
             }
             if ($_GET["filterTo"] != '')
             {
                 $hasFilter = true;
-                $x = $x->where('records.date', '<=', $_GET["filterTo"]);
-                $y = $y->where('date', '<=', $_GET["filterTo"]);
+                $x = $x->where('records.date', '<=', $_GET["filterTo"] . " 23:59:59");
+                $y = $y->where('records.date', '<=', $_GET["filterTo"] . " 23:59:59");
             }
 
         //});
@@ -592,7 +592,7 @@ Route::group(['middleware' => 'auth'],function(){
 
             $datas[] = array(
                 //'id' => $r->id,
-                'date' => $r->date,
+                'date' => date("y-m-d", strtotime($r->date)),
                 //'date' => $r->receipt_date != null ? $r->receipt_date : "",
                 'total' => formatPrice($r->getTotal()),
                 'first_name' => $r->first_name,
@@ -1452,7 +1452,7 @@ Route::group(['middleware' => 'auth'],function(){
                 'last_name' => $r->member->last_name,
                 'first_name' => $r->member->first_name,
                 'status' => $r->status,
-                'date' => date("d/m/Y", strtotime($r->date)),
+                'date' => date("d/m/Y", strtotime($r->created_at)),
                 'totals' => formatPrice($r->rows->sum('amount')),
                 'action' => $ids
             );