Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function update_gl2(){
//$affected_date = $request->date;
$affected_date = '2021-03-22';
$methods = DB::table('daily_ledger')->select('ledger_account_id')->distinct()->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->get();
foreach($methods as $row){
$ledger_id = $row->ledger_account_id;
$count = DB::table('general_ledger')->where('ledger_account_id',$ledger_id)->where('date',$affected_date)->where('how',0)->where('branch_id',Session::get('user')['branch_id'])->count();
$sumcr = DB::table('daily_ledger')->where('cr_dr','credit')->where('ledger_account_id',$row->ledger_account_id)->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->sum('amount');
$sumdr = DB::table('daily_ledger')->where('cr_dr','debit')->where('ledger_account_id',$row->ledger_account_id)->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->sum('amount');
$sum = $sumcr-$sumdr;
$sum_zero = $sumcr-$sumdr;
if($sum_zero==0 || $ledger_id==0){
continue;
}
//insert daily transanctions to GL
$data = array(
'branch_id'=>Session::get('user')['branch_id'],
'ledger_account_id'=>$ledger_id,
'total_cr'=>$sumcr,
'total_dr'=>$sumdr,
'date'=>$affected_date,
'time'=>date('H:i:s'),
'closed_by'=>Auth::id(),
);
if($count>0){
DB::table('general_ledger')->where('ledger_account_id',$ledger_id)->where('how',0)->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->update($data);
}else{
DB::table('general_ledger')->insert($data);
}
echo $ledger_id.' - Cr:'.$sumcr.' : Dr:'.$sumdr.' - Date:'.$affected_date.'
';
}
}
public function update_glr(){
//$affected_date = $request->date;
$affected_date = '2021-03-23';
$methods = DB::table('daily_ledger')->select('ledger_account_id')->distinct()->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->get();
foreach($methods as $row){
$ledger_id = $row->ledger_account_id;
$count = DB::table('general_ledger')->where('ledger_account_id',$ledger_id)->where('date',$affected_date)->where('how',0)->where('branch_id',Session::get('user')['branch_id'])->count();
$sumcr = DB::table('daily_ledger')->where('cr_dr','credit')->where('ledger_account_id',$row->ledger_account_id)->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->sum('amount');
$sumdr = DB::table('daily_ledger')->where('cr_dr','debit')->where('ledger_account_id',$row->ledger_account_id)->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->sum('amount');
$sum = $sumcr-$sumdr;
$sum_zero = $sumcr-$sumdr;
if($sum_zero==0 || $ledger_id==0){
continue;
}
//insert daily transanctions to GL
$data = array(
'branch_id'=>Session::get('user')['branch_id'],
'ledger_account_id'=>$ledger_id,
'total_cr'=>$sumcr,
'total_dr'=>$sumdr,
'date'=>$affected_date,
'time'=>date('H:i:s'),
'closed_by'=>Auth::id(),
);
if($count>0){
DB::table('general_ledger')->where('ledger_account_id',$ledger_id)->where('how',0)->where('date',$affected_date)->where('branch_id',Session::get('user')['branch_id'])->update($data);
}else{
DB::table('general_ledger')->insert($data);
}
echo $ledger_id.' - Cr:'.$sumcr.' : Dr:'.$sumdr.' - Date:'.$affected_date.'
';
}
$lastDate = app('App\Http\Controllers\Settings')->load_equity();
//return redirect('/settings/close_daily_transactions');
}
public function update_gl(){
#function ya kuupdate registration fee, shares amount, savings na general ledger...
$i=0;
$methods = DB::table('borrowers')->get();
foreach($methods as $row){
$b = $row->branch_id;
$id = $row->id;
//get minimum shares...
$methods3 = DB::table('shareSettings')->where('branch_id',$b)->orderBy('id','desc')->limit(1)->get();
foreach($methods3 as $row3){
$shares = $row3->nominalprice;
$sharesLedger_id = $row3->ledger_id;
}
$methods2 = DB::table('registration_fee_settings')->where('branch_id',5)->orderBy('id','desc')->limit(1)->get();
foreach($methods2 as $row2){
$i++;
$registration_fee = array(
'paid'=>$row2->amount,
);
DB::table('registration_fee')->where('borrower_id',$id)->update($registration_fee);
//print_r($registration_fee);
//check and deduct fro savings
$sum = $sumcr=$sumdr=0;
$p = DB::table('savingaccount')->where('borrower_id',$id)->where('branch_id',$b)->orderBy('id','desc')->limit(1)->get();
foreach($p as $pr){
$accId=$pr->id;
$accNo=$pr->savingAccount;
$sumcr = DB::table('savingtransactions')->where('debitCredit','credit')->where('account_id',$accId)->sum('amount');
$sumdr = DB::table('savingtransactions')->where('debitCredit','debit')->where('account_id',$accId)->sum('amount');
$sum = $sumcr-$sumdr;
//echo $i.'. '.$id.' '.$accNo.': Balance: '.$sum.' Fee: '.$row2->amount.'
';
}
//check and deduct fro shares
$ps = DB::table('shareaccount')->where('borrower_id',$id)->where('branch_id',$b)->orderBy('id','desc')->limit(1)->get();
foreach($ps as $prs){
$accIds=$prs->id;
$accNo=$pr->savingAccount;
$sump = DB::table('shareholders')->where('purchase_sell','purchase')->where('account_id',$accIds)->sum('amount');
$sums = DB::table('shareholders')->where('purchase_sell','sell')->where('account_id',$accIds)->sum('amount');
$sums = $sump-$sums;
echo $i.'. '.$id.'Savings: '.$sum.': Shares: '.number_format($sums).' Fee: '.$shares.'
';
}
}
}
}
}