Merged in feature/imbangduga-backup (pull request #192)
Feature/imbangduga backup
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Reports;
|
||||
|
||||
use App\Cawangan;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\imbangdugabackup;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BalanceSheetsController extends Controller
|
||||
{
|
||||
|
||||
public function getBalanceSheetsList(Request $request){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||
|
||||
$list_imbangan = imbangdugabackup::on($cawangan['mysql'])
|
||||
->where([['tarikh','>=',$request->mula],['tarikh','<=',$request->hingga]])
|
||||
->paginate(5);
|
||||
|
||||
return json_encode($list_imbangan);
|
||||
}
|
||||
}
|
||||
@@ -469,7 +469,12 @@ class OnePercentService
|
||||
}
|
||||
|
||||
private function filterCollection($collection,$type,$sumtype) : Float{
|
||||
return $collection->filter(function ($item) use($type) {
|
||||
|
||||
$array_type = ['T','S','P','AT'];
|
||||
return $collection->filter(function ($item) use($type,$array_type) {
|
||||
if($type == 'T')
|
||||
return in_array($type, $array_type);
|
||||
|
||||
return $item->trans_type === $type;
|
||||
})->sum($sumtype);
|
||||
}
|
||||
|
||||
@@ -25,5 +25,7 @@ $router->group(['prefix' => 'api/reports'], function () use ($router) {
|
||||
$router->get('getTotalCurrentProfit/{kod_cawangan}', ['uses' => 'OnePercentController@getCurrentProfit']);
|
||||
|
||||
$router->get('stokaudit/get',['uses' => 'OnePercentController@getStokAuditBackdate']);
|
||||
|
||||
$router->get('balancesheets/get',['uses' => 'BalanceSheetsController@getBalanceSheetsList']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user