added sender ID export, edit payment bug fix, profile page bug fix
This commit is contained in:
@@ -110,7 +110,7 @@ class ClientsController extends Controller
|
||||
$voice_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'voice')->get() ?? collect();
|
||||
$sms_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'sms')->get() ?? collect();
|
||||
$ussd_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'ussd')->get() ?? collect();
|
||||
$recent_payments = Models\ClientPayment::where('client_id', $id)->latest('id')->get() ?? collect();
|
||||
$recent_payments = Models\ClientPayment::where('client_id', $id)->latest('updated_at')->get() ?? collect();
|
||||
$showdocuments = Models\ClientFile::where('client_id', $id)->get() ?? collect();
|
||||
|
||||
// Also ensure client attributes are safe arrays
|
||||
@@ -667,7 +667,7 @@ class ClientsController extends Controller
|
||||
'invoice_date' => 'required',
|
||||
'invoice_status' => 'required'
|
||||
]);
|
||||
|
||||
dd($request->all());
|
||||
$auth_user = Auth::user();
|
||||
$payment = Models\ClientPayment::findOrFail($request->payment_id);
|
||||
|
||||
@@ -883,7 +883,7 @@ class ClientsController extends Controller
|
||||
}
|
||||
public function update_payment(Request $request, $id)
|
||||
{
|
||||
// Validate the inputs based on the fields in your edit modal
|
||||
|
||||
$validated = $request->validate([
|
||||
'invoice_number' => 'required|string',
|
||||
'invoice_amount' => 'required|numeric',
|
||||
|
||||
@@ -12,7 +12,6 @@ class ProfileController extends Controller
|
||||
public function index()
|
||||
{
|
||||
$staff = StaffMember::with('dependents')->where('email', auth()->user()->email)->firstOrFail();
|
||||
|
||||
return view('profile.index', compact('staff'));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,15 @@ namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models;
|
||||
use App\Exports\SenderIdsExport;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
|
||||
|
||||
|
||||
class SenderidsController extends Controller
|
||||
{
|
||||
|
||||
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
// Fetch KPI Metrics (Keep your existing counts)
|
||||
@@ -68,6 +72,34 @@ class SenderidsController extends Controller
|
||||
return view('senderids.index', $data);
|
||||
}
|
||||
|
||||
public function exportExcel(Request $request)
|
||||
{
|
||||
return Excel::download(new SenderIdsExport($request), 'Sender_IDs_Export_' . date('Ymd_Hi') . '.xlsx');
|
||||
}
|
||||
|
||||
public function exportPdf(Request $request)
|
||||
{
|
||||
$query = \App\Models\SenderId::query();
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$search = $request->input('search');
|
||||
$query->where('senderid', 'like', "%{$search}%")
|
||||
->orWhere('mno_name', 'like', "%{$search}%")
|
||||
->orWhere('supplier_name', 'like', "%{$search}%");
|
||||
}
|
||||
if ($request->filled('direct_mno')) {
|
||||
$query->where('direct_mno', $request->input('direct_mno'));
|
||||
}
|
||||
if ($request->filled('status')) {
|
||||
$query->where('status', $request->input('status'));
|
||||
}
|
||||
|
||||
$senderIds = $query->orderBy('created_at', 'desc')->get();
|
||||
|
||||
$pdf = Pdf::loadView('senderids.pdf', compact('senderIds'))->setPaper('a4', 'landscape');
|
||||
|
||||
return $pdf->download('Sender_IDs_Export_' . date('Ymd_Hi') . '.pdf');
|
||||
}
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validated = $request->validate([
|
||||
|
||||
Reference in New Issue
Block a user