fix imbang duga wb and als
This commit is contained in:
@@ -17,6 +17,7 @@ use App\Vault;
|
||||
use App\Tunai;
|
||||
use App\Denominasi;
|
||||
use App\HapusKira;
|
||||
use App\GlCode;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -249,4 +250,26 @@ class LaporanController extends Controller
|
||||
|
||||
return response()->json($hapuskira);
|
||||
}
|
||||
|
||||
public function CalcXtra($kodcaw,Request $request)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$upahsimpan = GlCode::on($cawangan['mysql'])
|
||||
->where('glcode','=','5000/413')
|
||||
->sum('amaun');
|
||||
|
||||
$bakilelongxtra = GlCode::on($cawangan['mysql'])
|
||||
->where('glcode','=','7000/190')
|
||||
->sum('amaun');
|
||||
|
||||
$untungrugiterkumpul = GlCode::on($cawangan['mysql'])
|
||||
->where('glcode','=','7000/201')
|
||||
->sum('amaun');
|
||||
|
||||
$arrayxtra = ['upahsimpan' => floatval($upahsimpan), 'bakilelong' => floatval($bakilelongxtra), 'untungrugiterkumpul' => floatval($untungrugiterkumpul)];
|
||||
|
||||
return response()->json($arrayxtra);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ use App\WTD;
|
||||
use App\GlCode;
|
||||
use App\imbangdugalama;
|
||||
use App\AnsRugi;
|
||||
use App\SerahBaki;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
@@ -381,6 +382,18 @@ class LelongController extends Controller
|
||||
return response()->json($wtd,200);
|
||||
}
|
||||
|
||||
public function calculationserahbaki($kodcaw,Request $request)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
|
||||
$serahbaki = SerahBaki::on($cawangan['mysql'])
|
||||
->where('tarikh','<=', $request->tarikh)
|
||||
->sum('baki');
|
||||
|
||||
return response()->json($serahbaki,200);
|
||||
}
|
||||
|
||||
public function cajlelongcalculation($kodcaw,Request $request)
|
||||
{
|
||||
$current = Carbon::now();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SerahBaki extends Model
|
||||
{
|
||||
protected $table = 'serahbaki';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'norujukan',
|
||||
'batchno',
|
||||
'hargajual',
|
||||
'pinjaman',
|
||||
'upah',
|
||||
'cajlel',
|
||||
'gst_cl',
|
||||
'gst_hj',
|
||||
'baki',
|
||||
'tarikh',
|
||||
't_jual',
|
||||
'nopelanggan',
|
||||
'aktif'
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $hidden = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
}
|
||||
@@ -370,11 +370,13 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('CalculationPanjar/{kodcaw}',['uses'=>'PanjarController@calculationpanjar']); //panjar
|
||||
$router->get('BakiLelongCalculation/{kodcaw}',['uses'=>'LelongController@BakiLelongCalculation']); //baki lelong & Rugi lelong
|
||||
$router->get('WTD/{kodcaw}',['uses'=>'LelongController@calculationwtd']); //wang tak dituntut
|
||||
$router->get('SerahBaki/{kodcaw}',['uses'=>'LelongController@calculationserahbaki']); //wang tak dituntut
|
||||
$router->get('cajlelong/{kodcaw}',['uses'=>'LelongController@cajlelongcalculation']); //caj lelong by tahun
|
||||
$router->get('KeuntunganSebenar/{kodcaw}',['uses'=>'TebusController@calculationKeuntunganSebenar']); //Keuntungan Sebenar
|
||||
$router->get('UntungRugiTerkumpul/{kodcaw}',['uses'=>'TebusController@calculationUntungRugiTerkumpul']); //caj lelong by tahun
|
||||
$router->get('cajperkhidmatanterkumpul/{kodcaw}',['uses'=>'LelongController@cajperkhidmatancalculation']); //caj lelong by tahun
|
||||
$router->get('CalculationHapusKira/{kodcaw}',['uses'=>'LaporanController@CalcHapusKira']); //Hapus Kira
|
||||
$router->get('Xtra/{kodcaw}',['uses'=>'LaporanController@CalcXtra']); //Hapus Kira
|
||||
|
||||
|
||||
//-- Untung Rugi --//
|
||||
|
||||
Reference in New Issue
Block a user