mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'yodlee' of https://github.com/turbo124/invoiceninja into yodlee
This commit is contained in:
commit
1745899525
@ -41,12 +41,11 @@ class StoreBankTransactionRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
if(array_key_exists('bank_integration_id', $input) && strlen($input['bank_integration_id']) > 1)
|
||||
$input['bank_integration_id'] = $this->decodePrimaryKey($input['bank_integration_id']);
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -67,6 +67,9 @@ class UpdateBankTransactionRequest extends Request
|
||||
if(array_key_exists('ninja_category_id', $input) && strlen($input['ninja_category_id']) > 1)
|
||||
$input['ninja_category_id'] = $this->decodePrimaryKey($input['ninja_category_id']);
|
||||
|
||||
if(array_key_exists('bank_integration_id', $input) && strlen($input['bank_integration_id']) > 1)
|
||||
$input['bank_integration_id'] = $this->decodePrimaryKey($input['bank_integration_id']);
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ class ProfitLossRequest extends Request
|
||||
'start_date' => 'string|date',
|
||||
'end_date' => 'string|date',
|
||||
'is_income_billed' => 'required|bail|bool',
|
||||
'is_expense_billed' => 'required|bail|bool',
|
||||
'is_expense_billed' => 'bool',
|
||||
'include_tax' => 'required|bail|bool',
|
||||
'date_range' => 'sometimes|string',
|
||||
'send_email' => 'bool',
|
||||
|
@ -175,9 +175,11 @@ class MatchBankTransactions implements ShouldQueue
|
||||
$expense->payment_date = Carbon::parse($this->bt->date);
|
||||
$expense->transaction_reference = $this->bt->description;
|
||||
$expense->transaction_id = $this->bt->id;
|
||||
$expense->vendor_id = array_key_exists('vendor_id', $this->input) ? $this->input['vendor_id'] : null;
|
||||
$expense->save();
|
||||
|
||||
$this->bt->expense_id = $expense->id;
|
||||
$this->bt->vendor_id = array_key_exists('vendor_id', $this->input) ? $this->input['vendor_id'] : null;
|
||||
$this->bt->status_id = BankTransaction::STATUS_CONVERTED;
|
||||
$this->bt->save();
|
||||
|
||||
@ -293,8 +295,11 @@ class MatchBankTransactions implements ShouldQueue
|
||||
|
||||
private function resolveCategory() :?int
|
||||
{
|
||||
if(array_key_exists('ninja_category_id', $this->input))
|
||||
return $this->input['ninja_category_id'];
|
||||
if(array_key_exists('ninja_category_id', $this->input)){
|
||||
$this->bt->ninja_category_id = $this->input['ninja_category_id'];
|
||||
$this->bt->save();
|
||||
return (int)$this->input['ninja_category_id'];
|
||||
}
|
||||
|
||||
$category = $this->categories->firstWhere('highLevelCategoryId', $this->bt->category_id);
|
||||
|
||||
|
@ -18,6 +18,15 @@ class BankIntegration extends BaseModel
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'bank_account_name',
|
||||
'provider_name',
|
||||
'bank_account_number',
|
||||
'bank_account_status',
|
||||
'bank_account_type',
|
||||
'balance',
|
||||
'currency',
|
||||
'nickname',
|
||||
'from_date',
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
|
@ -32,6 +32,8 @@ class BankTransaction extends BaseModel
|
||||
'date',
|
||||
'description',
|
||||
'base_type',
|
||||
'expense_id',
|
||||
'vendor_id'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
|
@ -21,7 +21,7 @@ use App\Models\TaskStatus;
|
||||
class BankIntegrationRepository extends BaseRepository
|
||||
{
|
||||
|
||||
public function store($data, BankIntegration $bank_integration)
|
||||
public function save($data, BankIntegration $bank_integration)
|
||||
{
|
||||
|
||||
//stub to store
|
||||
|
@ -103,7 +103,7 @@ class ExpenseTransformer extends EntityTransformer
|
||||
'private_notes' => (string) $expense->private_notes ?: '',
|
||||
'public_notes' => (string) $expense->public_notes ?: '',
|
||||
'transaction_reference' => (string) $expense->transaction_reference ?: '',
|
||||
'transaction_id' => (string) $expense->transaction_id ?: '',
|
||||
'transaction_id' => (string) $this->decodePrimaryKey($expense->transaction_id) ?: '',
|
||||
'date' => $expense->date ?: '',
|
||||
'number' => (string)$expense->number ?: '',
|
||||
'payment_date' => $expense->payment_date ?: '',
|
||||
|
@ -79,7 +79,7 @@ class PaymentTransformer extends EntityTransformer
|
||||
'refunded' => (float) $payment->refunded,
|
||||
'applied' => (float) $payment->applied,
|
||||
'transaction_reference' => $payment->transaction_reference ?: '',
|
||||
'transaction_id' => $payment->transaction_id ?: '',
|
||||
'transaction_id' => $this->decodePrimaryKey($payment->transaction_id) ?: '',
|
||||
'date' => $payment->date ?: '',
|
||||
'is_manual' => (bool) $payment->is_manual,
|
||||
'created_at' => (int) $payment->created_at,
|
||||
|
Loading…
x
Reference in New Issue
Block a user