mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
fix Supplier delivery order
This commit is contained in:
@@ -210,6 +210,10 @@ class CreateInvoiceTransactionProcessor
|
||||
|
||||
$booking_currency_average_rate = $this->calculatesBookingCurrencyAverageRate->execute($booking, TransactionType::BILL);
|
||||
|
||||
$transaction = $booking->transactions()
|
||||
->where('type', TransactionType::BILL)
|
||||
->first();
|
||||
|
||||
$transaction_object = new TransactionObject(
|
||||
$billNumber,
|
||||
TransactionType::SUPPLIER_DELIVER,
|
||||
|
||||
+14
-6
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Booking;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -87,10 +88,17 @@ Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsP
|
||||
return $exportsProducts->download('products.csv', Excel::CSV, ['Content-Type' => 'text/csv']);
|
||||
})->name('products.random');
|
||||
|
||||
Route::get('/fix_bills', function () {
|
||||
Auth()->login(User::find(1));
|
||||
$supplierDo = Transaction::where('type', TransactionType::SUPPLIER_DELIVER)->where('issuer', 1)->withTrashed()->get();
|
||||
foreach ($supplierDo as $do){
|
||||
$bill = $do->owner->transactions()
|
||||
->where('type', TransactionType::BILL)
|
||||
->first();
|
||||
$do->issuer = $bill->issuer;
|
||||
$do->receiver = $bill->receiver;
|
||||
$do->save();
|
||||
}
|
||||
|
||||
//Route::get('/duplicated_bills', function (Request $request) {
|
||||
// Auth()->login(User::find(1));
|
||||
// $bookings = Booking::whereIn('id', [10391, 10275, 10109, 10108, 10070, 10066, 10063, 9801, 9166, 8895, 8790, 8544, 8264, 6957, 5409, 4717])->with('transactions')->pluck('marking');
|
||||
// dd($bookings);
|
||||
//
|
||||
//})->name('x2.data');
|
||||
|
||||
})->name('products.random');
|
||||
Reference in New Issue
Block a user