This commit is contained in:
SUM2046
2026-07-03 12:37:30 +05:30
parent f2ad6093d2
commit 7fba009978
3 changed files with 272 additions and 244 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace Modules\DailySalePaymentReportModule\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class PaymentOption extends Model
{
use HasFactory;
protected $fillable = [
'name',
'account_id',
'is_active',
'percentage',
'type',
'status',
'approved_by',
'approved_at'
];
protected static function newFactory()
{
return \Modules\DailySalePaymentReportModule\Database\factories\PaymentOptionFactory::new();
}
}

View File

@@ -5,6 +5,7 @@ namespace Modules\DailySalePaymentReportModule\Http\Controllers;
use Illuminate\Contracts\Support\Renderable; use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Modules\DailySalePaymentReportModule\Entities\PaymentOption;
class DailySalePaymentReportModuleController extends Controller class DailySalePaymentReportModuleController extends Controller
{ {
@@ -14,7 +15,13 @@ class DailySalePaymentReportModuleController extends Controller
*/ */
public function index() public function index()
{ {
return view('dailysalepaymentreportmodule::index'); $paymentOptions = PaymentOption::where('is_active', 1)
->orderBy('id')
->get(['id', 'name']);
return view('dailysalepaymentreportmodule::index', [
'paymentOptions' => $paymentOptions,
]);
} }
/** /**

View File

@@ -124,28 +124,22 @@
<th>Cashier</th> <th>Cashier</th>
<th>Customer</th> <th>Customer</th>
<th>Grand Total</th> <th>Grand Total</th>
<th>Cash</th> @foreach ($paymentOptions as $option)
<th>Card 1</th> <th>{{ $option->name }}</th>
<th>Card 2</th> @endforeach
<th>Card 3</th> <th>Due Amount</th>
<th>Online Transfer</th>
<th>Link Pay</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{-- @foreach ($credit_data as $credit) --}}
<!-- Data rows will come here -->
{{-- @endforeach --}}
</tbody> </tbody>
<tfoot style="background-color: #cdd4da; font-weight: bold;"> <tfoot style="background-color: #cdd4da; font-weight: bold;">
<tr> <tr>
<td colspan="4" class="text-right">Total</td> <td colspan="4" class="text-right">Total</td>
<td>0.00</td> <td>0.00</td>
@foreach ($paymentOptions as $option)
<td>0.00</td> <td>0.00</td>
<td>0.00</td> @endforeach
<td>0.00</td>
<td>0.00</td>
<td>0.00</td>
<td>0.00</td> <td>0.00</td>
</tr> </tr>
</tfoot> </tfoot>