komuditi
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\User;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class resetRoleDaily extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'reset:dailyrole';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Reset Daily Role';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$all_user = User::get();
|
||||
foreach($all_user as $index=>$user_kaunter){
|
||||
User::where('id','=',$user_kaunter['id'])->update(['role_harian'=>null]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
//
|
||||
Commands\resetRoleDaily::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
$schedule->command('reset:dailyrole')->daily()->timezone('Asia/Kuala_Lumpur')->at('00:00');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -226,6 +226,7 @@ class PenebusanController extends Controller
|
||||
//////////////////////
|
||||
/// MAKING NEW SAG////
|
||||
/////////////////////
|
||||
|
||||
$gadai_transaction = Http::get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
if($gadai_transaction){
|
||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
||||
@@ -249,11 +250,14 @@ class PenebusanController extends Controller
|
||||
////Update SAG BARU///
|
||||
/////////////////////
|
||||
|
||||
$keuntungan_sebln = $request->keuntungan_sebulan;
|
||||
$keuntungan_sebln = str_replace(',','',$keuntungan_sebln);
|
||||
|
||||
$total_nilai_marhun = $request->nilai_marhun;
|
||||
$margin_pinjaman = $request->pinjaman / $total_nilai_marhun;
|
||||
$kadarupah = $request->kadarkeuntungan * 100;
|
||||
$keuntungan6bulan = $request->keuntungan_6bln;
|
||||
$keuntungan12bulan = $request->keuntungan_sebulan*12;
|
||||
$keuntungan6bulan = $keuntungan_sebln * 6;
|
||||
$keuntungan12bulan = $keuntungan_sebln * 12;
|
||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||
|
||||
|
||||
@@ -272,6 +276,13 @@ class PenebusanController extends Controller
|
||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||
])->json();
|
||||
|
||||
$komuditi = Http::put(config('api.url').'/api/komuditi/transaksi',[
|
||||
'unit_komuditi' => round($request->pinjaman, 2),
|
||||
'norujukan' => $norujukanbaru,
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'teller' => $auth_user['name']
|
||||
]);
|
||||
|
||||
////////////////////////////
|
||||
////Update History Gadaian///
|
||||
////////////////////////////
|
||||
@@ -296,8 +307,7 @@ class PenebusanController extends Controller
|
||||
array_push($arraymarhunbaru, ["bil" => $marhunloop['bil'],"marhun" => $marhunloop['marhun'],"nota" => $marhunloop['nota'],"karat" => $marhunloop['karat'], "berat" => $marhunloop['berat'], "harga" => $marhunloop['harga'], "n_marhun" => $marhunloop['n_marhun']]);
|
||||
}
|
||||
|
||||
foreach($arraymarhunbaru as $array1)
|
||||
{
|
||||
foreach($arraymarhunbaru as $array1){
|
||||
$updatemarhun = Http::post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'marhun' => $array1['marhun'],
|
||||
@@ -307,9 +317,7 @@ class PenebusanController extends Controller
|
||||
'harga' => $array1['harga'],
|
||||
'nilai_marhun' => $array1['n_marhun']
|
||||
])->json();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -371,12 +379,14 @@ class PenebusanController extends Controller
|
||||
//////////////////////
|
||||
////Update SAG BARU///
|
||||
/////////////////////
|
||||
$keuntungan_sebln = $request->keuntungan_sebulan;
|
||||
$keuntungan_sebln = str_replace(',','',$keuntungan_sebln);
|
||||
|
||||
$total_nilai_marhun = $request->total_nilai_marhun;
|
||||
$margin_pinjaman = $request->pinjaman / $total_nilai_marhun;
|
||||
$kadarupah = $request->kadarkeuntungan * 100;
|
||||
$keuntungan6bulan = $request->keuntungan_6bln;
|
||||
$keuntungan12bulan = $request->keuntungan_sebulan*12;
|
||||
$keuntungan6bulan = $keuntungan_sebln * 6;
|
||||
$keuntungan12bulan = $keuntungan_sebln * 12;
|
||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||
|
||||
|
||||
@@ -395,6 +405,13 @@ class PenebusanController extends Controller
|
||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||
])->json();
|
||||
|
||||
$komuditi = Http::put(config('api.url').'/api/komuditi/transaksi',[
|
||||
'unit_komuditi' => round($request->pinjaman, 2),
|
||||
'norujukan' => $norujukanbaru,
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'teller' => $auth_user['name']
|
||||
]);
|
||||
|
||||
////////////////////////////
|
||||
////Update History Gadaian///
|
||||
////////////////////////////
|
||||
@@ -449,7 +466,6 @@ class PenebusanController extends Controller
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
|
||||
$getfirstwakil = Http::get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'])->json();
|
||||
|
||||
if(sizeof($getfirstwakil) != 0)
|
||||
|
||||
@@ -778,8 +778,7 @@ let teller = "{{ Auth::user()->name }}";
|
||||
function bayaransemua()
|
||||
{
|
||||
|
||||
if($('#sltjenistebus').find(":selected").val() == 'T')
|
||||
{
|
||||
if($('#sltjenistebus').find(":selected").val() == 'T'){
|
||||
let jenisbayarantebus = '';
|
||||
if(tarikhgadai < tarikhtawarruq)
|
||||
{
|
||||
@@ -849,9 +848,7 @@ function bayaransemua()
|
||||
//End File//
|
||||
///////////
|
||||
|
||||
}
|
||||
else if($('#sltjenistebus').find(":selected").val() == 'A')
|
||||
{
|
||||
}else if($('#sltjenistebus').find(":selected").val() == 'A'){
|
||||
let jenisbayarantebus = '';
|
||||
let hadbayaransuran = (parseFloat("{{ $gadai['nilaimarhun']}}") * 0.1);
|
||||
|
||||
@@ -1013,9 +1010,7 @@ function bayaransemua()
|
||||
//End File//
|
||||
////////////
|
||||
|
||||
}
|
||||
else if($('#sltjenistebus').find(":selected").val() == 'S')
|
||||
{
|
||||
}else if($('#sltjenistebus').find(":selected").val() == 'S'){
|
||||
let jenisbayarantebus = '';
|
||||
if(tarikhgadai < tarikhtawarruq)
|
||||
{
|
||||
@@ -1030,11 +1025,7 @@ function bayaransemua()
|
||||
|
||||
if($('#perludibayar').val() < (parseFloat($('#bayaran').val()) + parseFloat($('#jumlahupah').val())))
|
||||
{
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Jumlah bayaran kurang daripada jumlah yang perlu dibayar!',
|
||||
'error'
|
||||
)
|
||||
Swal.fire('Amaran!','Jumlah bayaran kurang daripada jumlah yang perlu dibayar!','error');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user