diff --git a/app/Models/BankTransaction.php b/app/Models/BankTransaction.php index f67e75a9d6..2772e0d146 100644 --- a/app/Models/BankTransaction.php +++ b/app/Models/BankTransaction.php @@ -59,7 +59,6 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction query() * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() - * @method static \Illuminate\Database\Eloquent\Account withTrashed() * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction withoutTrashed() * @property-read \App\Models\Payment|null $payment * @mixin \Eloquent @@ -137,12 +136,12 @@ class BankTransaction extends BaseModel public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo { - return $this->belongsTo(Vendor::class); + return $this->belongsTo(Vendor::class)->withTrashed(); } public function expense(): \Illuminate\Database\Eloquent\Relations\BelongsTo { - return $this->belongsTo(Expense::class); + return $this->belongsTo(Expense::class)->withTrashed(); } public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo diff --git a/app/Repositories/Migration/PaymentMigrationRepository.php b/app/Repositories/Migration/PaymentMigrationRepository.php index 762944609f..00bf928ae3 100644 --- a/app/Repositories/Migration/PaymentMigrationRepository.php +++ b/app/Repositories/Migration/PaymentMigrationRepository.php @@ -156,7 +156,7 @@ class PaymentMigrationRepository extends BaseRepository $payment->credits->each(function ($cre) use ($credit_totals) { $cre->pivot->amount = $credit_totals; - $cre->pivot->save(); + $cre->pivot->save(); $cre->paid_to_date += $credit_totals; $cre->balance -= $credit_totals; diff --git a/app/Transformers/BankTransactionTransformer.php b/app/Transformers/BankTransactionTransformer.php index 5d941dbefe..e128d9b986 100644 --- a/app/Transformers/BankTransactionTransformer.php +++ b/app/Transformers/BankTransactionTransformer.php @@ -63,7 +63,7 @@ class BankTransactionTransformer extends EntityTransformer 'description' => (string) $bank_transaction->description ?: '', 'base_type' => (string) $bank_transaction->base_type ?: '', 'invoice_ids' => (string) $bank_transaction->invoice_ids ?: '', - 'expense_id'=> (string) $bank_transaction->expense_id ?: '', + 'expense_id'=> (string) $this->encodePrimaryKey($bank_transaction->expense_id) ?: '', 'payment_id'=> (string) $this->encodePrimaryKey($bank_transaction->payment_id) ?: '', 'vendor_id'=> (string) $this->encodePrimaryKey($bank_transaction->vendor_id) ?: '', 'bank_transaction_rule_id' => (string) $this->encodePrimaryKey($bank_transaction->bank_transaction_rule_id) ?: '',