James Cole
2020-08-09 08:56:41 +02:00
parent 10c9118f49
commit c6e8a63f7c
6 changed files with 31 additions and 17 deletions

View File

@@ -223,6 +223,8 @@
<div class="btn-group">
<button class="btn btn-success" id="submitButton" @click="submit">{{ $t('firefly.submit') }}</button>
</div>
<p class="text-success" v-html="success_message"></p>
<p class="text-danger" v-html="error_message"></p>
</div>
</div>
</div>
@@ -680,8 +682,10 @@ export default {
this.setDefaultErrors();
this.error_message = "";
if (typeof errors.errors === 'undefined') {
this.success_message = '';
this.error_message = errors.message;
} else {
this.success_message = '';
this.error_message = this.$t('firefly.errors_submission');
}
let transactionIndex;

View File

@@ -394,11 +394,11 @@ export default {
newTags.push({text: transaction.tags[key], tiClasses: []});
}
}
console.log('source allowed types for a ' + transaction.type);
// console.log('source allowed types for a ' + transaction.type);
//console.log(window.expectedSourceTypes.source[transaction.type]);
console.log(window.expectedSourceTypes.source[this.ucFirst(transaction.type)]);
console.log('destination allowed types for a ' + transaction.type);
console.log(window.expectedSourceTypes.destination[this.ucFirst(transaction.type)]);
// console.log(window.expectedSourceTypes.source[this.ucFirst(transaction.type)]);
// console.log('destination allowed types for a ' + transaction.type);
// console.log(window.expectedSourceTypes.destination[this.ucFirst(transaction.type)]);
this.transactions.push({
transaction_journal_id: transaction.transaction_journal_id,
@@ -538,6 +538,16 @@ export default {
destId = row.destination_account.id;
destName = row.destination_account.name;
// depends on the transaction type, where we get the currency.
if('withdrawal' === transactionType || 'transfer' === transactionType) {
row.currency_id = row.source_account.currency_id;
console.log('Overruled currency ID to ' + row.currency_id);
}
if('deposit' === transactionType) {
row.currency_id = row.destination_account.currency_id;
console.log('Overruled currency ID to ' + row.currency_id);
}
date = row.date;
if (index > 0) {
date = this.transactions[0].date;
@@ -927,7 +937,7 @@ export default {
this.transactions[transactionIndex].errors[fieldName] = errors.errors[key];
break;
case 'external_uri':
console.log('Found ext error in field "' + fieldName + '": ' + errors.errors[key]);
//console.log('Found ext error in field "' + fieldName + '": ' + errors.errors[key]);
this.transactions[transactionIndex].errors.custom_errors[fieldName] = errors.errors[key];
break;
case 'source_name':