create nad update gadai table migration and add services class for one percent
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use App\Services\OnePercentServices;
|
||||
|
||||
class TestOnePercent extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'onepercent:test';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Update JBG for every active gadai';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
protected $onepercentserv;
|
||||
public function __construct(OnePercentServices $onepercentserv)
|
||||
{
|
||||
$this->onepercentserv = $onepercentserv;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$pemb = $this->ask('Pembiayaan?');
|
||||
$nm = $this->ask('Nilaimarhun?');
|
||||
$ku = $this->ask('Kadarujrah?');
|
||||
$marg = $this->ask('Margin?');
|
||||
|
||||
$test = $this->onepercentserv->kiraanKeuntunganSebenar($pemb,$nm,$ku,$marg);
|
||||
|
||||
dd($test);
|
||||
return $test;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected $commands = [
|
||||
Commands\DailyGadai::class,
|
||||
Commands\TestOnePercent::class,
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user