diff --git a/BudgetMasterServer/src/main/resources/static/js/transactions.js b/BudgetMasterServer/src/main/resources/static/js/transactions.js index 9a09d15f9876345fad4674989de5808f892ecef6..cfdcc2c4e4c277cf986e02934241d5ed2444e13e 100644 --- a/BudgetMasterServer/src/main/resources/static/js/transactions.js +++ b/BudgetMasterServer/src/main/resources/static/js/transactions.js @@ -385,7 +385,8 @@ function convertDateWithoutDots(dateString) function validateForm(isSaveAndContinue = false, allowEmptyAmount = false, skipKeywordCheck = false) { // name (keyword check) - if(!skipKeywordCheck) + let isExpenditure = document.getElementById('input-isPayment').value === "1"; + if(!skipKeywordCheck && isExpenditure) { let nameContainsKeywords = checkNameForKeywords(isSaveAndContinue); if(nameContainsKeywords) diff --git a/BudgetMasterServer/src/main/resources/templates/transactions/transactionNameKeywordWarningModal.ftl b/BudgetMasterServer/src/main/resources/templates/transactions/transactionNameKeywordWarningModal.ftl index 06d14e0c06541e1477d8cd5ee9499b8d8274c9b8..173e58c629b6b7afb49f778d2da30ca74dd5ae4a 100644 --- a/BudgetMasterServer/src/main/resources/templates/transactions/transactionNameKeywordWarningModal.ftl +++ b/BudgetMasterServer/src/main/resources/templates/transactions/transactionNameKeywordWarningModal.ftl @@ -16,13 +16,13 @@ <div class="row"> <div class="col s12"> - <@header.buttonLink url='/settings' icon='rule_folder' localizationKey='transaction.warning.name.keyword.button.edit' color='background-blue' id='buttonChangeTransactionType' classes='text-white' target='_blank'/> + <@header.buttonLink url='/settings' icon='rule_folder' localizationKey='transaction.warning.name.keyword.button.edit' color='background-blue' classes='text-white' target='_blank'/> </div> </div> </div> <div class="modal-footer background-color"> <@header.buttonLink id='keyword-warning-button-ignore' url='' icon='save' localizationKey='transaction.warning.name.keyword.button.ignore' color='red' classes='text-white' noUrl=true/> - <@header.buttonLink url='' icon='edit' localizationKey='transaction.warning.name.keyword.button.cancel' color='green' id='buttonChangeTransactionType' classes='modal-action modal-close text-white' noUrl=true/> + <@header.buttonLink id='keyword-warning-button-cancel' url='' icon='edit' localizationKey='transaction.warning.name.keyword.button.cancel' color='green' classes='modal-action modal-close text-white' noUrl=true/> </div> </div>