Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into rate-history-refactored

This commit is contained in:
edmondlang
2023-02-16 23:16:29 +08:00
13 changed files with 225 additions and 22 deletions
+1
View File
@@ -9,6 +9,7 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
Route::put('/update/{id}', 'UpdateCompanyController@update')->name('update');
Route::put('update/{id}/status', 'UpdateCompanyStatusController@update')->name('status.update');
Route::delete('/delete/{id}', 'DeleteCompanyController@destroy')->name('delete');
Route::put('/name-and-debtor/update/{id}', 'UpdateCompanyNameAndDebtorController@update')->name('update.nameAndDebtor');
Route::put('/update/debtor/{id}', 'UpdateCompanyDebtorController@update')->name('delete');
+12 -12
View File
@@ -457,18 +457,18 @@ Route::get('/1688/fix/{reference}', function($reference){
Route::get('/po/manual/fix', function(){
$bookings = Booking::whereIn('company_id', [199, 510])->whereHas('documents', function($query){
return $query->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER);
})->get();
foreach ($bookings as $booking){
$booking->status = ApprovalStatus::APPROVED;
$booking->save();
$booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::INVOICE, DocumentType::SUPPLIER_DELIVER_ORDER])->delete();
$booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->update(['status' => ApprovalStatus::PENDING_SUBMISSION]);
}
// $bookings = Booking::whereIn('company_id', [199, 510])->whereHas('documents', function($query){
// return $query->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER);
// })->get();
//
// foreach ($bookings as $booking){
// $booking->status = ApprovalStatus::APPROVED;
// $booking->save();
//
// $booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::INVOICE, DocumentType::SUPPLIER_DELIVER_ORDER])->delete();
// $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->update(['status' => ApprovalStatus::PENDING_SUBMISSION]);
//
// }
})->name('ecommerce.fix');