!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/jiff/app/Http/Controllers/   drwxr-xr-x
Free 13.23 GB of 57.97 GB (22.82%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     SettlementController.php (2.19 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Http\Controllers;
use 
Illuminate\Http\Request;
use 
App\Models\VendorBill;
use 
App\Models\BillInvoice;
use 
App\Models\SaleFee;

use 
Illuminate\Support\Facades\DB;


class 
SettlementController extends Controller
{
    function 
create(Request $req)  {
        try {
            if (!
auth()->user()) {
                return 
response()->json("Unauthorized",401);
            }
            
$vendor_id =auth()->user()->id;
            
$bill_noVendorBill::select("bill_no")->orderBy("id","desc")->first();
            
$bill_no=$bill_no ==""10000 $bill_no->bill_no+1;
            
$sale_idsexplode(",",$req->input("sale_ids"));
            
// $sales=SaleFee::select("sale_id",DB::raw('sum(grand_total) as grand_total'))->whereIn("sale_id",$sale_ids)->groupBy("sale_id")->get();
            
$sales=DB::select("select sum(grand_total) as order_amount,sum(total_fee) as total_charge,
            sum(vendor_payable) as vendor_payable,sum(vendor_receivable) as vendor_receivable from sale_fees where sale_id in ("
.implode(",",$sale_ids).")");
            
$VendorBill=VendorBill::create([
                
'bill_no'=>$bill_no,
                
'shop_id'=>$req->input('shop_id'),
                
'vendor_id'=>$vendor_id,
                
'total_invoices'=>count($sale_ids),
                
'order_amount'=>$sales[0]->order_amount,
                
'total_charge'=>$sales[0]->total_charge,
                
'vendor_payable'=>$sales[0]->vendor_payable,
                
'vendor_receivable'=>$sales[0]->vendor_receivable,
                
'grand_total'=>$sales[0]->vendor_receivable-$sales[0]->vendor_payable,
                
'status'=>1,
                
'paid'=>0,
                
'payment_status'=>0
            
]);
            
$sales=SaleFee::select("sale_id")->whereIn("sale_id",$sale_ids)->update([
                
"settlement_status"=>1,
                
"bill_id"=>$VendorBill->id
            
]);
            return 
response()->json(['message' => "Successfully Requested",'data' => $VendorBill]);
        } catch (
\Exception $exception) {
            
DB::rollback();
            return 
response()->json(['error' => 'true''message' =>$exception->getMessage()],500);
        }

    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0058 ]--