diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index a78403b5c..dc6d4751c 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -108,6 +108,7 @@ async function search() { ...Object.fromEntries(staticParams), search: searchText.value, }, + ...{ filter: props.filter }, }; if (props.whereFilter) { diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index af0ba0996..20a612a82 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -50,6 +50,7 @@ globals: summary: basicData: Basic data daysOnward: Days onward + daysAgo: Days ago today: Today yesterday: Yesterday dateFormat: en-GB @@ -289,8 +290,8 @@ globals: createInvoiceIn: Create invoice in myAccount: My account noOne: No one - maxTemperature: Maximum Temperature - minTemperature: Minimum Temperatura + maxTemperature: Max + minTemperature: Min params: clientFk: Client id salesPersonFk: Sales person diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f56cd6761..ae0274415 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -49,6 +49,7 @@ globals: summary: basicData: Datos básicos daysOnward: Días adelante + daysAgo: Días atras today: Hoy yesterday: Ayer dateFormat: es-ES @@ -293,8 +294,8 @@ globals: createInvoiceIn: Crear factura recibida myAccount: Mi cuenta noOne: Nadie - maxTemperature: Temperatura máxima - minTemperature: Temperatura mínima + maxTemperature: Máx + minTemperature: Mín params: clientFk: Id cliente salesPersonFk: Comercial diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue index d698596b9..1beac0d0b 100644 --- a/src/pages/Account/AccountList.vue +++ b/src/pages/Account/AccountList.vue @@ -9,7 +9,9 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog'; const { t } = useI18n(); const { viewSummary } = useSummaryDialog(); const tableRef = ref(); - +const filter = { + include: { relation: 'role', scope: { fields: ['id', 'name'] } }, +}; const columns = computed(() => [ { align: 'left', @@ -29,7 +31,22 @@ const columns = computed(() => [ }, { align: 'left', - name: 'username', + name: 'roleFk', + label: t('role'), + columnFilter: { + component: 'select', + name: 'roleFk', + attrs: { + url: 'VnRoles', + optionValue: 'id', + optionLabel: 'name', + }, + }, + format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name), + }, + { + align: 'left', + name: 'nickname', label: t('Nickname'), isTitle: true, component: 'input', @@ -104,12 +121,13 @@ const exprBuilder = (param, value) => { :expr-builder="exprBuilder" :label="t('account.search')" :info="t('account.searchInfo')" + :filter="filter" /> - diff --git a/src/pages/Entry/locale/en.yml b/src/pages/Entry/locale/en.yml index a9faa814b..b4d7c33bc 100644 --- a/src/pages/Entry/locale/en.yml +++ b/src/pages/Entry/locale/en.yml @@ -6,9 +6,15 @@ entryFilter: filter: search: General search reference: Reference -landed: Landed -shipped: Shipped -fromShipped: Shipped(from) -toShipped: Shipped(to) -printLabels: Print stickers -viewLabel: View sticker +myEntries: + id: ID + landed: Landed + shipped: Shipped + fromShipped: Shipped(from) + toShipped: Shipped(to) + printLabels: Print stickers + viewLabel: View sticker + wareHouseIn: Warehouse in + warehouseInFk: Warehouse in + daysOnward: Days onward + daysAgo: Days ago diff --git a/src/pages/Entry/locale/es.yml b/src/pages/Entry/locale/es.yml index eb1e3f88a..2dfd601b1 100644 --- a/src/pages/Entry/locale/es.yml +++ b/src/pages/Entry/locale/es.yml @@ -9,10 +9,15 @@ entryFilter: filter: search: Búsqueda general reference: Referencia - -landed: F. llegada -shipped: F. salida -fromShipped: F. salida(desde) -toShipped: F. salida(hasta) -printLabels: Imprimir etiquetas -viewLabel: Ver etiqueta +myEntries: + id: ID + landed: F. llegada + shipped: F. salida + fromShipped: F. salida(desde) + toShipped: F. salida(hasta) + printLabels: Imprimir etiquetas + viewLabel: Ver etiqueta + wareHouseIn: Alm. entrada + warehouseInFk: Alm. entrada + daysOnward: Días adelante + daysAgo: Días atras diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index 774b42478..1ea19033c 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -9,6 +9,7 @@ import { useArrayData } from 'src/composables/useArrayData'; import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue'; import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue'; import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue'; +import VnInputDate from 'components/common/VnInputDate.vue'; const { t } = useI18n(); const tableRef = ref(); @@ -64,7 +65,8 @@ const columns = computed(() => [ cardVisible: true, attrs: { url: 'Clients', - fields: ['id', 'name'], + optionLabel: 'socialName', + optionValue: 'socialName', }, columnField: { component: null, @@ -192,10 +194,33 @@ const downloadCSV = async () => { + + + + es: Download as CSV: Descargar como CSV + params: + from: Desde + to: Hasta +en: + params: + from: From + to: To diff --git a/src/pages/Ticket/Card/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue index 12e03551b..73104fe27 100644 --- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue +++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue @@ -277,13 +277,14 @@ async function createRefund(withWarehouse) { const params = { ticketsIds: [parseInt(ticketId)], withWarehouse: withWarehouse, + negative: true, }; - const { data } = await axios.post(`Tickets/refund`, params); + const { data } = await axios.post(`Tickets/cloneAll`, params); if (data) { - const refundTicket = data; - - push({ name: 'TicketSale', params: { id: refundTicket[0].id } }); + const [refundTicket] = data; + notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive'); + push({ name: 'TicketSale', params: { id: refundTicket.id } }); } } diff --git a/src/pages/Ticket/Card/TicketSaleMoreActions.vue b/src/pages/Ticket/Card/TicketSaleMoreActions.vue index 94db67be2..2ec519d2d 100644 --- a/src/pages/Ticket/Card/TicketSaleMoreActions.vue +++ b/src/pages/Ticket/Card/TicketSaleMoreActions.vue @@ -44,7 +44,7 @@ const props = defineProps({ }, }); -const router = useRouter(); +const { push } = useRouter(); const { t } = useI18n(); const { dialog } = useQuasar(); const { notify } = useNotify(); @@ -142,7 +142,7 @@ const onCreateClaimAccepted = async () => { try { const params = { ticketId: ticket.value.id, sales: props.sales }; const { data } = await axios.post(`Claims/createFromSales`, params); - router.push({ name: 'ClaimBasicData', params: { id: data.id } }); + push({ name: 'ClaimBasicData', params: { id: data.id } }); } catch (error) { console.error('Error creating claim: ', error); } @@ -169,7 +169,7 @@ const createRefund = async (withWarehouse) => { const { data } = await axios.post('Tickets/cloneAll', params); const [refundTicket] = data; notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive'); - router.push({ name: 'TicketSale', params: { id: refundTicket.id } }); + push({ name: 'TicketSale', params: { id: refundTicket.id } }); } catch (error) { console.error(error); } diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 829eb3a17..4be198493 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -121,6 +121,20 @@ const thermographsTableColumns = computed(() => { name: 'temperatureFk', align: 'left', }, + { + label: t('globals.maxTemperature'), + field: 'maxTemperature', + name: 'maxTemperature', + align: 'left', + format: (val) => (val ? `${val}°` : ''), + }, + { + label: t('globals.minTemperature'), + field: 'minTemperature', + name: 'minTemperature', + align: 'left', + format: (val) => (val ? `${val}°` : ''), + }, { label: t('travel.thermographs.state'), field: 'result', @@ -133,7 +147,7 @@ const thermographsTableColumns = computed(() => { name: 'destination', align: 'left', format: (val) => - warehouses.value.find((warehouse) => warehouse.id === val).name, + warehouses.value.find((warehouse) => warehouse.id === val)?.name, }, { label: t('travel.thermographs.created'), diff --git a/src/pages/Travel/Card/TravelThermographs.vue b/src/pages/Travel/Card/TravelThermographs.vue index 38b9125b1..e308243e3 100644 --- a/src/pages/Travel/Card/TravelThermographs.vue +++ b/src/pages/Travel/Card/TravelThermographs.vue @@ -52,12 +52,14 @@ const TableColumns = computed(() => { field: 'maxTemperature', name: 'maxTemperature', align: 'left', + format: (val) => (val ? `${val}°` : ''), }, { label: t('globals.minTemperature'), field: 'minTemperature', name: 'minTemperature', align: 'left', + format: (val) => (val ? `${val}°` : ''), }, { label: t('travel.thermographs.state'), @@ -219,6 +221,4 @@ es: Thermograph removed: Termógrafo eliminado Are you sure you want to remove the thermograph?: ¿Seguro que quieres quitar el termógrafo? No results: Sin resultados - Max Temperature: Temperatura máxima - Min Temperature: Temperatura mínima diff --git a/src/pages/Travel/TravelFilter.vue b/src/pages/Travel/TravelFilter.vue new file mode 100644 index 000000000..96298853f --- /dev/null +++ b/src/pages/Travel/TravelFilter.vue @@ -0,0 +1,157 @@ + + + + (states = data)" auto-load /> + + + + {{ t(`params.${tag.label}`) }}: + {{ formatFn(tag.value) }} + + + + + + + + + + + + + + + + + + + + + + +en: + travel: + Id: Contains + ref: Reference + agency: Agency + warehouseInFk: W. In + shipped: Shipped + shipmentHour: Shipment Hour + warehouseOut: W. Out + landed: Landed + landingHour: Landing Hour + totalEntries: Σ +es: + travel: + Id: Id + ref: Referencia + agency: Agencia + warehouseInFk: Alm.Salida + shipped: F.Envío + shipmentHour: Hora de envío + warehouseOut: Alm.Entrada + landed: F.Entrega + landingHour: Hora de entrega + totalEntries: Σ + diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index e56f5d2ff..05d2e5eda 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -9,6 +9,8 @@ import TravelSummary from './Card/TravelSummary.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; import { toDate } from 'src/filters'; import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js'; +import RightMenu from 'src/components/common/RightMenu.vue'; +import TravelFilter from './TravelFilter.vue'; const { viewSummary } = useSummaryDialog(); const router = useRouter(); @@ -24,6 +26,7 @@ const $props = defineProps({ }); const entityId = computed(() => $props.id || route.params.id); +const travelFilterRef = ref(); onMounted(async () => { stateStore.rightDrawer = true; }); @@ -201,6 +204,11 @@ const columns = computed(() => [ :label="t('Search travel')" data-key="TravelList" /> + + + + + [ editorFk: entityId, }, }" + :right-search="false" :user-params="{ daysOnward: 7 }" order="landed DESC" :columns="columns" @@ -220,7 +229,6 @@ const columns = computed(() => [ redirect="travel" :is-editable="false" :use-model="true" - chip-locale="travel.travelList.tableVisibleColumns" > {