Merged in release/autopendahuluan (pull request #287)
Release/autopendahuluan
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ApprovalWithdrawal extends Model
|
||||
{
|
||||
protected $table = 'approval_withdrawal';
|
||||
public $timestamps = true;
|
||||
protected $primaryKey = 'id';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'kodcaw',
|
||||
'pc_name',
|
||||
'operasi_name',
|
||||
'amount',
|
||||
'approval_status',
|
||||
'updated_serahan_v2',
|
||||
'updated_pendahuluan_v3',
|
||||
'denopendser_id_v2',
|
||||
'gldetail_id_v2',
|
||||
'denopendser_id_v3',
|
||||
'gldetail_id_v3',
|
||||
'action',
|
||||
'approval_timestamp',
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CloneDatabase extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'migrate:clone';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Generate Laravel migrations from an existing database';
|
||||
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$tables = DB::connection('mysql7')->select("SHOW TABLES");
|
||||
|
||||
$namedatabase = DB::connection('mysql7')->getDatabaseName();
|
||||
|
||||
if (empty($tables)) {
|
||||
$this->error("No tables found in database");
|
||||
return;
|
||||
}
|
||||
|
||||
$boolreject = false;
|
||||
$list_of_rejected = ($boolreject) ? $this->rejected_table() : [];
|
||||
// Get table names
|
||||
$tableNames = array_map(fn($table) => is_array($table) ? array_values($table) : $table, $tables);
|
||||
$tableString = collect($tables)->pluck('Tables_in_' .$namedatabase)->reject(fn($table) => in_array($table, $list_of_rejected))->implode(',');
|
||||
// Run migration generator
|
||||
Artisan::call("migrate:generate --path=database/migrations --tables=" .$tableString);
|
||||
// Artisan::call("migrate:status");
|
||||
|
||||
$this->info("Migrations generated successfully for database");
|
||||
}
|
||||
|
||||
protected function rejected_table() : Array{
|
||||
return [
|
||||
'alert','auditbarcode','auditdaftar',
|
||||
'auditrekodsemakan','audtrail','bakipelanggan',
|
||||
'bandar','batchlel_xtra','bayaranpenebusan','belian',
|
||||
'brand','checker','configkaunter','gadaisimulasi','gadaitemp',
|
||||
'gadaixtra','hapusgadaionline','hargaemasbeli',
|
||||
'hargaemasjual','imbangan','inoutmarxtra',
|
||||
'jemas00', 'jemasbeli','jemasxtra',
|
||||
'jenisakaun','jualan','jualemas','jumlahtebus',
|
||||
'karat','karatbeli','karatjual','karatxtra',
|
||||
'ku_nm', 'ku_nmbaru', 'ku_nmxtra', 'kumpulan',
|
||||
'kurangxtra', 'lapringkasan', 'laptebus', 'lapterkumpul',
|
||||
'lapterkumpulharian','lelkarat','lelmarhun_xtra', 'marhunbeli',
|
||||
'marhunjual', 'marhunsimulasi', 'marhunxtra', 'model',
|
||||
'outmarhun', 'outmarhunxtra', 'palsu', 'pemeriksaan',
|
||||
'pengesahangadai', ' peratusan', 'percentonline',
|
||||
'polisxtra','product','ramalan', 'rekodtangguh', 'sahabat',
|
||||
'simpanan', 'simulasi_batchlel', 'simulasi_batchlelxtra',
|
||||
'simulasi_lelmarhun', 'simulasi_lelong', 'simulasi_lelongxtra',
|
||||
'tagpelanggan', 'tangguhlelong', 'taraf',
|
||||
'tebus_xtra', 'tebuslelong', 'temp_ic', 'tempimbang',
|
||||
'tempnosiri', 'tempnosirixtra', 'temppwd', 'temptarikhaging',
|
||||
'tunaigadteb', 'tuntutbakixtra', 'ubs_code', 'ugama',
|
||||
'updateserver', 'zparameter', 'zparameterxtra','ZPARAMETER1'];
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -23,7 +23,8 @@ class GlDetail extends Model
|
||||
'amaun',
|
||||
'pendahuluan',
|
||||
'serahan',
|
||||
'teller'
|
||||
'teller',
|
||||
'date_created'
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,9 @@ use App\Vault;
|
||||
use App\Cawangan;
|
||||
use App\Tunai;
|
||||
use App\AddTunai;
|
||||
use App\ApprovalWithdrawal;
|
||||
use App\Audit;
|
||||
use App\DenoPendSer;
|
||||
use App\GlDetail;
|
||||
use App\imbangdugalama;
|
||||
use App\GlCode;
|
||||
@@ -13,6 +15,7 @@ use App\Panjar;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class VaultController extends Controller
|
||||
{
|
||||
@@ -313,7 +316,8 @@ class VaultController extends Controller
|
||||
'ktacct' => $request->ktacct,
|
||||
'descpt' => $request->keterangan,
|
||||
'pendahuluan' => $request->amaun,
|
||||
'teller' => $request->teller
|
||||
'teller' => $request->teller,
|
||||
'date_created' => $current->toDateTimeString()
|
||||
]);
|
||||
}else if($request->jenisgldetail == 'serahan')
|
||||
{
|
||||
@@ -324,7 +328,9 @@ class VaultController extends Controller
|
||||
'ktacct' => $request->ktacct,
|
||||
'descpt' => $request->keterangan,
|
||||
'serahan' => $request->amaun,
|
||||
'teller' => $request->teller
|
||||
'teller' => $request->teller,
|
||||
'date_created' => $current->toDateTimeString()
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -716,6 +722,4 @@ class VaultController extends Controller
|
||||
return response()->json($vault);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateApprovalWithdrawal extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('approval_withdrawal', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->char('kodcaw', 20);
|
||||
$table->string('action', 50);
|
||||
$table->string('pc_name', 100);
|
||||
$table->string('operasi_name', 100)->nullable();
|
||||
$table->decimal('amount', 10, 2)->default(0);
|
||||
$table->string('approval_status',20);
|
||||
$table->timestamp('approval_timestamp')->nullable();
|
||||
$table->integer('gldetail_id_v3')->nullable()->default(0);
|
||||
$table->integer('denopendser_id_v3')->nullable()->default(0);
|
||||
$table->integer('gldetail_id_v2')->nullable()->default(0);
|
||||
$table->integer('denopendser_id_v2')->nullable()->default(0);
|
||||
$table->boolean('updated_serahan_v2')->default(false);
|
||||
$table->boolean('updated_pendahuluan_v3')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('approval_withdrawal');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AddTimestampToGldetailTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function getActiveDB(){
|
||||
$config_db = array_keys(config("database.connections"));
|
||||
|
||||
$db_connection = array_filter($config_db,function($connection){
|
||||
try{
|
||||
if($connection == 'mysql7')
|
||||
return false;
|
||||
|
||||
$db = DB::connection($connection)->getPdo();
|
||||
return true;
|
||||
} catch(\Exception $e){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return $db_connection;
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$db_connection = $this->getActiveDB();
|
||||
|
||||
foreach($db_connection as $dbase){
|
||||
Schema::connection($dbase)->table('gldetail', function (Blueprint $table) use($dbase) {
|
||||
|
||||
$dateCreated = Schema::connection($dbase)->hasColumn('gldetail', 'date_created');
|
||||
|
||||
|
||||
if (!$dateCreated) {
|
||||
$table->timestamp('date_created');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -678,6 +678,19 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
/* Endpoint for Account Statements */
|
||||
$router->get('record/accountstatement/{kodcaw}',['uses'=>'TunaiController@getAccStatement']);
|
||||
|
||||
/* Endpoint for Auto Serahan */
|
||||
$router->get('autoserahan/list',['uses'=>'AutoSerahanController@getAutoSerahan']);
|
||||
$router->put('autoserahan/approve',['uses'=>'AutoSerahanController@autoSerahanApproval']);
|
||||
$router->post('autoserahan/delete',['uses'=>'AutoSerahanController@deleteAutoSerahan']);
|
||||
$router->post('autoserahan/create',['uses'=>'AutoSerahanController@createAutoSerahan']);
|
||||
$router->post('autoserahan/delete',['uses'=>'AutoSerahanController@deleteAutoSerahan']);
|
||||
$router->put('autoserahan/pendahuluan',['uses'=>'AutoSerahanController@pendahuluanAutoSerahan']);
|
||||
$router->put('autoserahan/serahan',['uses'=>'AutoSerahanController@serahanAutoSerahan']);
|
||||
$router->put('autoserahan/delete/pendahuluan',['uses'=>'AutoSerahanController@removeAutoPendahuluan']);
|
||||
$router->put('autoserahan/delete/serahan',['uses'=>'AutoSerahanController@removeAutoSerahan']);
|
||||
$router->put('autoserahan/setapproval',['uses'=>'AutoSerahanController@SetApprovalWithdrawal']);
|
||||
$router->get('autoserahan/get',['uses'=>'AutoSerahanController@getAutoSerahanApproval']);
|
||||
$router->get('autoserahan/checkapproval',['uses'=>'AutoSerahanController@checkProsesApproval']);
|
||||
});
|
||||
|
||||
$router->group(['prefix'=>'e-arrahn'], function () use ($router){
|
||||
|
||||
Reference in New Issue
Block a user