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\Http\Request;
use Illuminate\Routing\Controller;
use Modules\DailySalePaymentReportModule\Entities\PaymentOption;
class DailySalePaymentReportModuleController extends Controller
{
@@ -14,7 +15,13 @@ class DailySalePaymentReportModuleController extends Controller
*/
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

@@ -1,28 +1,28 @@
@extends('backend.layout.main')
@section('content')
@if ($errors->has('title'))
<div class="alert alert-danger alert-dismissible text-center">
@if ($errors->has('title'))
<div class="alert alert-danger alert-dismissible text-center">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
aria-hidden="true">&times;</span></button>{{ $errors->first('title') }}
</div>
@endif
@if (session()->has('message'))
<div class="alert alert-success alert-dismissible text-center">
</div>
@endif
@if (session()->has('message'))
<div class="alert alert-success alert-dismissible text-center">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>{{ session()->get('message') }}
</div>
@endif
@if (session()->has('not_permitted'))
<div class="alert alert-danger alert-dismissible text-center">
</div>
@endif
@if (session()->has('not_permitted'))
<div class="alert alert-danger alert-dismissible text-center">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>{{ session()->get('not_permitted') }}
</div>
@endif
</div>
@endif
<section>
<section>
<div class="container-fluid">
<div style="border-radius: 30px;" class="card pb-4 ">
<link rel="stylesheet" href="{{ asset('public/css/cloudma.css') }}">
@@ -124,28 +124,22 @@
<th>Cashier</th>
<th>Customer</th>
<th>Grand Total</th>
<th>Cash</th>
<th>Card 1</th>
<th>Card 2</th>
<th>Card 3</th>
<th>Online Transfer</th>
<th>Link Pay</th>
@foreach ($paymentOptions as $option)
<th>{{ $option->name }}</th>
@endforeach
<th>Due Amount</th>
</tr>
</thead>
<tbody>
{{-- @foreach ($credit_data as $credit) --}}
<!-- Data rows will come here -->
{{-- @endforeach --}}
</tbody>
<tfoot style="background-color: #cdd4da; font-weight: bold;">
<tr>
<td colspan="4" class="text-right">Total</td>
<td>0.00</td>
@foreach ($paymentOptions as $option)
<td>0.00</td>
<td>0.00</td>
<td>0.00</td>
<td>0.00</td>
<td>0.00</td>
@endforeach
<td>0.00</td>
</tr>
</tfoot>
@@ -217,9 +211,9 @@
</table>
</div>
</div>
</section>
</section>
<style>
<style>
.bootstrap-select.form-control,
.form-control,
.input-group-text {
@@ -242,12 +236,12 @@
table {
border-collapse: collapse !important;
}
</style>
</style>
@endsection
@push('scripts')
<script type="text/javascript">
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
@@ -264,5 +258,5 @@
window.location.href = exportUrl;
}
</script>
</script>
@endpush