#7936 improve InvoiceIn #1004

Merged
jorgep merged 55 commits from 7936-improveInvoiceIn into dev 2024-12-18 09:22:09 +00:00
5 changed files with 48 additions and 5 deletions
Showing only changes of commit 44cbabfc7e - Show all commits

View File

@ -4,6 +4,7 @@ import VnInput from 'src/components/common/VnInput.vue';
defineProps({
step: { type: Number, default: 0.01 },
decimalPlaces: { type: Number, default: 2 },
positive: { type: Boolean, default: true },
});
const model = defineModel({ type: [Number, String] });
@ -17,6 +18,7 @@ const model = defineModel({ type: [Number, String] });
@input="
(evt) => {
const val = evt.target.value;
if (positive && val < 0) return (model = 0);
Review

Me he dado cuenta de que se podían poner números negativos, esto en la mayoría de casos no se quiere.

Me he dado cuenta de que se podían poner números negativos, esto en la mayoría de casos no se quiere.
Review

Tanto codigo lo sacaria a una funcion en js

Tanto codigo lo sacaria a una funcion en js
const [, decimal] = val.split('.');
if (val && decimal?.length > decimalPlaces)
model = parseFloat(val).toFixed(decimalPlaces);

View File

@ -94,6 +94,10 @@ const $props = defineProps({
type: String,
default: null,
},
isOutlined: {
type: Boolean,
default: false,
},
});
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
@ -108,6 +112,15 @@ const noOneOpt = ref({
[optionValue.value]: false,
[optionLabel.value]: noOneText,
});
const styleAttrs = computed(() => {
return $props.isOutlined
? {
dense: true,
outlined: true,
rounded: true,
}
: {};
});
const isLoading = ref(false);
const useURL = computed(() => $props.url);
const value = computed({
@ -267,7 +280,7 @@ defineExpose({ opts: myOptions });
:options="myOptions"
:option-label="optionLabel"
:option-value="optionValue"
v-bind="$attrs"
jorgep marked this conversation as resolved Outdated

No hace nada.

No hace nada.
Outdated
Review

Esto se quita?? Si es algo nuevo que habian pedido

Esto se quita?? Si es algo nuevo que habian pedido
v-bind="{ ...$attrs, ...styleAttrs }"
@filter="filterHandler"
:emit-value="nullishToTrue($attrs['emit-value'])"
:map-options="nullishToTrue($attrs['map-options'])"

View File

@ -341,6 +341,7 @@ globals:
awbCode: AWB
correctedFk: Rectified
correctingFk: Rectificative
daysOnward: Days onward
changePass: Change password
deleteConfirmTitle: Delete selected elements
changeState: Change state

View File

@ -343,6 +343,7 @@ globals:
serial: Serie
amount: Importe
awbCode: AWB
daysOnward: Días adelante
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado

View File

@ -4,12 +4,28 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import { dateRange } from 'src/filters';
import { date } from 'quasar';
defineProps({ dataKey: { type: String, required: true } });
const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
function handleDaysAgo(params, daysAgo) {
const [from, to] = dateRange(Date.vnNew());
if (!daysAgo && daysAgo !== 0) {
Object.assign(params, { from: undefined, to: undefined });
} else {
from.setDate(from.getDate() - daysAgo);
Object.assign(params, {
from: date.formatDate(from, dateFormat),
to: date.formatDate(to, dateFormat),
});
}
}
</script>
<template>
<VnFilterPanel :data-key="dataKey" :search-button="true">
<VnFilterPanel :data-key="dataKey" :search-button="true" :hidden-tags="['daysAgo']">
<template #tags="{ tag, formatFn, getLocale }">
<div class="q-gutter-x-xs">
<strong>{{ getLocale(tag.label) }}: </strong>
@ -35,6 +51,18 @@ defineProps({ dataKey: { type: String, required: true } });
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputNumber
:label="$t('globals.daysAgo')"
v-model="params.daysAgo"
is-outlined
:step="0"
@update:model-value="(val) => handleDaysAgo(params, val)"
@remove="(val) => handleDaysAgo(params, val)"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
@ -116,9 +144,7 @@ defineProps({ dataKey: { type: String, required: true } });
url="Companies"
option-label="code"
:fields="['id', 'code']"
dense
outlined
rounded
is-outlined
/>
</QItemSection>
</QItem>