tambah condition tagujrah masa nak export data
This commit is contained in:
@@ -182,22 +182,40 @@ class LelongController extends Controller
|
||||
->where('status_payment_opt', '=', 3)
|
||||
->where('kodcaw', '=', $cawanganLelong->cawangan->caw_code)
|
||||
->sum('total_payment');
|
||||
// dd($cawanganLelong->cawangan->caw_code, $request->tarikh_lelong, $lelongDetails->masamula_lelong, $lelongDetails->masatamat_lelong, $lelongBidMaster->toArray(), $lelongbidmarhun->toArray(), floatval($paymentOnline), floatval($paymentTunai), floatval($paymentCdm));
|
||||
//dd($cawanganLelong->cawangan->caw_code, $request->tarikh_lelong, $lelongDetails->masamula_lelong, $lelongDetails->masatamat_lelong, $lelongBidMaster->toArray(), $lelongbidmarhun->toArray(), floatval($paymentOnline), floatval($paymentTunai), floatval($paymentCdm));
|
||||
|
||||
if($cawanganLelong->tagujrah == 0){
|
||||
$exportData = Http::withOptions(['verify' => config('app.api_verify')])->post(
|
||||
config('app.api_url') . 'exportLelong',
|
||||
[
|
||||
'kodcaw' => $cawanganLelong->cawangan->caw_code,
|
||||
'tarikh' => $request->tarikh_lelong,
|
||||
'masadari' => $lelongDetails->masamula_lelong,
|
||||
'masahingga' => $lelongDetails->masatamat_lelong,
|
||||
'lelongbid' => $lelongBidMaster->toArray(),
|
||||
'lelongbidmarhun' => $lelongbidmarhun->toArray(),
|
||||
'gldetail' => floatval($paymentOnline),
|
||||
'tunai' => floatval($paymentTunai),
|
||||
'gldetailcdm' => floatval($paymentCdm),
|
||||
]
|
||||
)->json();
|
||||
}elseif($cawanganLelong->tagujrah == 1){
|
||||
$exportData = Http::withOptions(['verify' => config('app.api_verify')])->post(
|
||||
config('app.api_ujrah_url') . 'exportLelong',
|
||||
[
|
||||
'kodcaw' => $cawanganLelong->cawangan->caw_code,
|
||||
'tarikh' => $request->tarikh_lelong,
|
||||
'masadari' => $lelongDetails->masamula_lelong,
|
||||
'masahingga' => $lelongDetails->masatamat_lelong,
|
||||
'lelongbid' => $lelongBidMaster->toArray(),
|
||||
'lelongbidmarhun' => $lelongbidmarhun->toArray(),
|
||||
'gldetail' => floatval($paymentOnline),
|
||||
'tunai' => floatval($paymentTunai),
|
||||
'gldetailcdm' => floatval($paymentCdm),
|
||||
]
|
||||
)->json();
|
||||
}
|
||||
|
||||
$exportData = Http::withOptions(['verify' => config('app.api_verify')])->post(
|
||||
config('app.api_url') . 'exportLelong',
|
||||
[
|
||||
'kodcaw' => $cawanganLelong->cawangan->caw_code,
|
||||
'tarikh' => $request->tarikh_lelong,
|
||||
'masadari' => $lelongDetails->masamula_lelong,
|
||||
'masahingga' => $lelongDetails->masatamat_lelong,
|
||||
'lelongbid' => $lelongBidMaster->toArray(),
|
||||
'lelongbidmarhun' => $lelongbidmarhun->toArray(),
|
||||
'gldetail' => floatval($paymentOnline),
|
||||
'tunai' => floatval($paymentTunai),
|
||||
'gldetailcdm' => floatval($paymentCdm),
|
||||
]
|
||||
)->json();
|
||||
|
||||
$cawanganLelong->export_data_sts = "SUCCESS";
|
||||
$cawanganLelong->update();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTagUjrahInLelongbidxlaku extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('lelongbid_xlaku', function (Blueprint $table) {
|
||||
$table->integer('tagujrah')->default(0);
|
||||
$table->decimal('ujrah', 5, 2);
|
||||
$table->decimal('onepercent', 5, 2);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('lelongbid_xlaku', function (Blueprint $table) {
|
||||
$table->dropColumn('tagujrah');
|
||||
$table->dropColumn('ujrah');
|
||||
$table->dropColumn('onepercent');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user