api lejer dan imbang duga

This commit is contained in:
hafifierahman
2021-03-11 09:04:31 +08:00
parent 4991277855
commit ad161ea2d0
17 changed files with 1055 additions and 4 deletions
+13
View File
@@ -532,4 +532,17 @@ class TebusController extends Controller
return response()->json($create_advansur ,201);
}
public function calculationKeuntunganSebenar($kodcaw,Request $request)
{
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$keuntungan = Tebus::on($cawangan['mysql'])
->where('t_tebus','<=',$request->tarikh)
// ->where('sttebus','=','')
->whereNotNull('rebate')
->sum('rebate');
return response()->json($keuntungan,200);
}
}