pdpa for koperasi
This commit is contained in:
@@ -1038,6 +1038,27 @@ class CustomerController extends Controller
|
|||||||
return response()->json($results);
|
return response()->json($results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateTagPdpa(Request $request)
|
||||||
|
{
|
||||||
|
$tarikh_cetak_pdpa = Carbon::now()->toDateString();
|
||||||
|
|
||||||
|
$no_ic = $request->input('no_ic');
|
||||||
|
|
||||||
|
$customer = Customer::where('kplama', $no_ic)
|
||||||
|
->orWhere('kpbaru', $no_ic)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (!$customer) {
|
||||||
|
return response()->json(['error' => 'Customer not found.'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$customer->tag_pdpa = $request->input('tag_pdpa');
|
||||||
|
$customer->tarikh_cetak_pdpa = $tarikh_cetak_pdpa;
|
||||||
|
$customer->save();
|
||||||
|
|
||||||
|
return response()->json(['message' => 'Customer PDPA updated successfully.'], 200);
|
||||||
|
}
|
||||||
|
|
||||||
// public function createNotaArcc($kodcaw, Request $request)
|
// public function createNotaArcc($kodcaw, Request $request)
|
||||||
// {
|
// {
|
||||||
// $current = Carbon::now();
|
// $current = Carbon::now();
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
$router->get('customer/anggota',['uses'=>'CustomerController@anggotaKoperasi']);
|
$router->get('customer/anggota',['uses'=>'CustomerController@anggotaKoperasi']);
|
||||||
$router->get('customer/eachcawangan/{ic}',['uses'=>'CustomerController@showCustomerByEachCawangan']);
|
$router->get('customer/eachcawangan/{ic}',['uses'=>'CustomerController@showCustomerByEachCawangan']);
|
||||||
$router->put('customers/{noic}/assign-anggota', ['uses' => 'CustomerController@assignAnggota']);
|
$router->put('customers/{noic}/assign-anggota', ['uses' => 'CustomerController@assignAnggota']);
|
||||||
|
$router->post('/customers/update-tag-pdpa', ['uses' => 'CustomerController@updateTagPdpa']);
|
||||||
|
|
||||||
//arcc
|
//arcc
|
||||||
$router->get('customer/searchbyname',['uses'=>'CustomerController@searchByName']);
|
$router->get('customer/searchbyname',['uses'=>'CustomerController@searchByName']);
|
||||||
|
|||||||
Reference in New Issue
Block a user