diff --git a/public/css/app.css b/public/css/app.css index 33820d6f1..0f477b5a2 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -54051,6 +54051,7 @@ html[dir='rtl'] .el-scrollbar__wrap { } .collapse-sub{ + display: block; height: 0px; overflow: hidden; opacity: 0; @@ -56327,10 +56328,6 @@ body{ right: -2rem; } -[dir="rtl"] .rtl\:float-left{ - float: left; -} - [dir="rtl"] .rtl\:m-0{ margin: 0px; } diff --git a/resources/assets/js/views/common/documents.js b/resources/assets/js/views/common/documents.js index f94c05ba1..cb77d4739 100644 --- a/resources/assets/js/views/common/documents.js +++ b/resources/assets/js/views/common/documents.js @@ -114,7 +114,10 @@ const app = new Vue({ onRefFocus(ref) { let index = this.form.items.length - 1; - this.$refs['items-' + index + '-' + ref][0].focus(); + if (this.$refs['items-' + index + '-' + ref] != undefined) { + let first_ref = this.$refs['items-' + index + '-' + ref]; + first_ref != undefined ? first_ref[0].focus() : this.$refs[Object.keys(this.$refs)[0]][0].focus(); + } }, onCalculateTotal() { @@ -811,15 +814,20 @@ const app = new Vue({ watch: { 'form.discount': function (newVal, oldVal) { - if (newVal != '' && newVal.search('^(?=.*?[0-9])[0-9.,]+$') !== 0) { + if (newVal > 99) { + newVal = oldVal; + return; + } + + if (newVal != '' && newVal.search('^[-+]?([0-9]|[1-9][0-9]|100)*\.?[0-9]+$') !== 0) { this.form.discount = oldVal; - this.form.discount = this.form.discount.replace(',', '.'); + this.form.discount = this.form.discount ? this.form.discount.replace(',', '.') : ''; return; } for (let item of this.regex_condition) { - if (this.form.discount.includes(item)) { + if (this.form.discount && this.form.discount.includes(item)) { const removeLastChar = newVal.length - 1; const inputShown = newVal.slice(0, removeLastChar); @@ -827,7 +835,7 @@ const app = new Vue({ } } - this.form.discount = this.form.discount.replace(',', '.'); + this.form.discount = this.form.discount ? this.form.discount.replace(',', '.') : ''; }, 'form.loading': function (newVal, oldVal) { diff --git a/resources/assets/sass/app.css b/resources/assets/sass/app.css index ca2906ef9..4a8f6dd02 100644 --- a/resources/assets/sass/app.css +++ b/resources/assets/sass/app.css @@ -561,7 +561,7 @@ html[dir='rtl'] .el-scrollbar__wrap { } .collapse-sub { - @apply opacity-0 h-0 overflow-hidden; + @apply block opacity-0 h-0 overflow-hidden; } .collapse-sub-report.collapse-sub {