diff --git a/src/components/ui/VnToSummary.vue b/src/components/ui/VnToSummary.vue new file mode 100644 index 000000000..1c7d6cf01 --- /dev/null +++ b/src/components/ui/VnToSummary.vue @@ -0,0 +1,33 @@ + + + + + + + diff --git a/src/components/ui/VnUsesMana.vue b/src/components/ui/VnUsesMana.vue new file mode 100644 index 000000000..891de5f63 --- /dev/null +++ b/src/components/ui/VnUsesMana.vue @@ -0,0 +1,55 @@ + + + + + + + + diff --git a/src/pages/Entry/Card/EntrySummary.vue b/src/pages/Entry/Card/EntrySummary.vue index 58a5c2e1b..c2f1e6b57 100644 --- a/src/pages/Entry/Card/EntrySummary.vue +++ b/src/pages/Entry/Card/EntrySummary.vue @@ -11,6 +11,7 @@ import { toDate, toCurrency } from 'src/filters'; import { getUrl } from 'src/composables/getUrl'; import axios from 'axios'; import FetchedTags from 'src/components/ui/FetchedTags.vue'; +import VnToSummary from 'src/components/ui/VnToSummary.vue'; const route = useRoute(); const { t } = useI18n(); @@ -163,14 +164,12 @@ const fetchEntryBuys = async () => { data-key="EntrySummary" > - - - + :route-name="'EntrySummary'" + :entity-id="entityId" + :url="entryUrl" + /> {{ entry.id }} - {{ entry.supplier.nickname }} diff --git a/src/pages/ItemType/Card/ItemTypeSummary.vue b/src/pages/ItemType/Card/ItemTypeSummary.vue index 62d1c74ab..c51d59e13 100644 --- a/src/pages/ItemType/Card/ItemTypeSummary.vue +++ b/src/pages/ItemType/Card/ItemTypeSummary.vue @@ -6,6 +6,7 @@ import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.v import CardSummary from 'components/ui/CardSummary.vue'; import VnLv from 'src/components/ui/VnLv.vue'; +import VnToSummary from 'src/components/ui/VnToSummary.vue'; onUpdated(() => summaryRef.value.fetch()); @@ -55,6 +56,11 @@ async function setItemTypeData(data) { > + diff --git a/src/pages/Ticket/Card/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue index 73104fe27..834fced87 100644 --- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue +++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue @@ -3,7 +3,7 @@ import axios from 'axios'; import { ref, toRefs } from 'vue'; import { useQuasar } from 'quasar'; import { useI18n } from 'vue-i18n'; -import { useRouter } from 'vue-router'; +import { useRoute, useRouter } from 'vue-router'; import { usePrintService } from 'composables/usePrintService'; import SendEmailDialog from 'components/common/SendEmailDialog.vue'; import VnConfirm from 'components/ui/VnConfirm.vue'; @@ -23,6 +23,7 @@ const props = defineProps({ required: true, }, }); +const route = useRoute(); const { push, currentRoute } = useRouter(); const { dialog, notify } = useQuasar(); @@ -40,6 +41,8 @@ const isEditable = ref(); const hasInvoicing = useAcl('invoicing'); const hasPdf = ref(); const weight = ref(); +const hasDocuwareFile = ref(); +const quasar = useQuasar(); const actions = { clone: async () => { const opts = { message: t('Ticket cloned'), type: 'positive' }; @@ -331,10 +334,49 @@ async function handleInvoiceOutData() { }); hasPdf.value = data[0]?.hasPdf; } + +async function docuwareDownload() { + await axios.get(`Tickets/${ticketId}/docuwareDownload`); +} + +async function hasDocuware() { + const { data } = await axios.post(`Docuwares/${ticketId}/checkFile`, { + fileCabinet: 'deliveryNote', + signed: true, + }); + hasDocuwareFile.value = data; +} + +async function uploadDocuware(force) { + console.log('force: ', force); + if (!force) + return quasar + .dialog({ + component: VnConfirm, + componentProps: { + title: t('Send PDF to tablet'), + message: t('Are you sure you want to replace this delivery note?'), + }, + }) + .onOk(async () => { + uploadDocuware(true); + }); + + const { data } = await axios.post(`Docuwares/upload`, { + fileCabinet: 'deliveryNote', + ticketIds: [parseInt(ticketId)], + }); + + if (data) notify({ message: t('PDF sent!'), type: 'positive' }); +} @@ -452,7 +494,13 @@ async function handleInvoiceOutData() { - + {{ t('as PDF') }} @@ -460,6 +508,14 @@ async function handleInvoiceOutData() { {{ t('as PDF without prices') }} + + {{ t('as PDF signed') }} + - + {{ t('Send PDF') }} - + {{ t('Send PDF to tablet') }} diff --git a/src/pages/Ticket/Card/TicketEditMana.vue b/src/pages/Ticket/Card/TicketEditMana.vue index 428e5e8c2..3d5b04a41 100644 --- a/src/pages/Ticket/Card/TicketEditMana.vue +++ b/src/pages/Ticket/Card/TicketEditMana.vue @@ -1,8 +1,8 @@ @@ -99,6 +105,14 @@ function toTicketUrl(section) { :url="`Tickets/${entityId}/summary`" data-key="TicketSummary" > + + + Ticket #{{ entity.id }} - {{ entity.client?.name }} ({{ @@ -108,23 +122,37 @@ function toTicketUrl(section) { - - - + + + + + + + + + + diff --git a/src/pages/Ticket/TicketFilter.vue b/src/pages/Ticket/TicketFilter.vue index 6d72de764..7f72f9862 100644 --- a/src/pages/Ticket/TicketFilter.vue +++ b/src/pages/Ticket/TicketFilter.vue @@ -20,11 +20,31 @@ const provinces = ref([]); const states = ref([]); const agencies = ref([]); const warehouses = ref([]); +const groupedStates = ref([]); + +const getGroupedStates = (data) => { + for (const state of data) { + groupedStates.value.push({ + id: state.id, + name: t(`${state.code}`), + code: state.code, + }); + } +}; (provinces = data)" auto-load /> (states = data)" auto-load /> + { + getGroupedStates(data); + } + " + auto-load + /> (agencies = data)" auto-load /> (warehouses = data)" auto-load /> @@ -90,12 +110,35 @@ const warehouses = ref([]); option-label="name" emit-value map-options + use-input dense outlined rounded /> + + + + + + + + + + + + + + + + + + @@ -245,6 +309,11 @@ en: provinceFk: Province agencyModeFk: Agency warehouseFk: Warehouse + FREE: Free + ON_PREPARATION: On preparation + PACKED: Packed + DELIVERED: Delivered + ON_PREVIOUS: ON_PREVIOUS es: params: search: Contiene @@ -278,4 +347,12 @@ es: Yes: Si No: No Days onward: Días adelante + Grouped state: Estado agrupado + FREE: Libre + ON_PREPARATION: En preparación + PACKED: Encajado + DELIVERED: Servido + ON_PREVIOUS: ON_PREVIOUS + Collection: Colección + Nickname: Nombre mostrado diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index fe9667bea..c8687ed5f 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -550,7 +550,7 @@ function setReference(data) { - {{ dashIfEmpty(row.salesPerson) }} + {{ dashIfEmpty(row.userName) }}