mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
enhance import invoice mapping conditions
This commit is contained in:
@@ -129,7 +129,7 @@ class BankStatementController extends Controller
|
||||
->download($statement->date_from->format('Y-m-d') . '_' . $statement->date_to->format('Y-m-d') . '_statement.csv');
|
||||
}
|
||||
|
||||
public function fetch(Request $request, ListBankStatementDetailsLogic $logic): JsonResponse
|
||||
public function fetch(Request $request, ListBankStatementTransactionsLogic $logic): JsonResponse
|
||||
{
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
@@ -140,8 +140,14 @@ class ImportStatementInvoiceController
|
||||
$transactions = Transaction::where('original_amount', $row['net_total'])->whereRaw("DATE(created_at) = '$date'")
|
||||
->whereHas('receiverCompany', function($q) use($row) {
|
||||
$q->where('debtor',$row['debtor_code']);
|
||||
})
|
||||
->get();
|
||||
})->get();
|
||||
|
||||
if ($transactions && $transactions->count() == 0) {
|
||||
$transactions = Transaction::where(DB::raw('FLOOR(original_amount)'), floor($row['net_total']))->whereRaw("DATE(created_at) = '$date'")
|
||||
->whereHas('receiverCompany', function($q) use($row) {
|
||||
$q->where('debtor',$row['debtor_code']);
|
||||
})->get();
|
||||
}
|
||||
|
||||
if ($transactions && $transactions->count() == 1) {
|
||||
foreach ($transactions as $key => $transaction) {
|
||||
|
||||
Reference in New Issue
Block a user