+
@@ -18,6 +18,9 @@
&:not(.wrap) {
flex-direction: column;
}
+ &[fixed] {
+ flex-direction: row;
+ }
}
}
diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue
index dc6d4751c..da2d370fe 100644
--- a/src/components/ui/VnSearchbar.vue
+++ b/src/components/ui/VnSearchbar.vue
@@ -45,7 +45,7 @@ const props = defineProps({
},
limit: {
type: Number,
- default: 10,
+ default: 20,
},
userParams: {
type: Object,
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js
index 9348793d2..ac0c1da08 100644
--- a/src/composables/useArrayData.js
+++ b/src/composables/useArrayData.js
@@ -75,18 +75,10 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
limit: store.limit,
};
- let exprFilter;
let userParams = { ...store.userParams };
- if (store?.exprBuilder) {
- const where = buildFilter(userParams, (param, value) => {
- const res = store.exprBuilder(param, value);
- if (res) delete userParams[param];
- return res;
- });
- exprFilter = where ? { where } : null;
- }
- Object.assign(filter, store.userFilter, exprFilter);
+ Object.assign(filter, store.userFilter);
+
let where;
if (filter?.where || store.filter?.where)
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
@@ -96,11 +88,28 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
Object.assign(params, userParams);
params.filter.skip = store.skip;
- if (store.order && store.order.length) params.filter.order = store.order;
+ if (store?.order && typeof store?.order == 'string') store.order = [store.order];
+ if (store.order?.length) params.filter.order = [...store.order];
else delete params.filter.order;
+ store.currentFilter = JSON.parse(JSON.stringify(params));
+ delete store.currentFilter.filter.include;
+ store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
+
+ let exprFilter;
+ if (store?.exprBuilder) {
+ exprFilter = buildFilter(params, (param, value) => {
+ if (param == 'filter') return;
+ const res = store.exprBuilder(param, value);
+ if (res) delete params[param];
+ return res;
+ });
+ }
+
+ if (params.filter.where || exprFilter)
+ params.filter.where = { ...params.filter.where, ...exprFilter };
params.filter = JSON.stringify(params.filter);
- store.currentFilter = params;
+
store.isLoading = true;
const response = await axios.get(store.url, {
signal: canceller.signal,
@@ -271,7 +280,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
const pushUrl = { path: to };
if (to.endsWith('/list') || to.endsWith('/'))
pushUrl.query = newUrl.query;
- destroy();
+ else destroy();
return router.push(pushUrl);
}
}
diff --git a/src/filters/getParamWhere.js b/src/filters/getParamWhere.js
index 22dd69af1..ef00a93ae 100644
--- a/src/filters/getParamWhere.js
+++ b/src/filters/getParamWhere.js
@@ -9,7 +9,7 @@ function parseJSON(str, fallback) {
}
export default function (route, param) {
// catch route query params
- const params = parseJSON(route?.query?.params, {});
+ const params = parseJSON(route?.query?.table, {});
// extract and parse filter from params
const { filter: filterStr = '{}' } = params;
diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml
index ae7007c32..1729af9aa 100644
--- a/src/i18n/locale/en.yml
+++ b/src/i18n/locale/en.yml
@@ -506,6 +506,7 @@ invoiceOut:
invoiceWithFutureDate: Exists an invoice with a future date
noTicketsToInvoice: There are not tickets to invoice
criticalInvoiceError: 'Critical invoicing error, process stopped'
+ invalidSerialTypeForAll: The serial type must be global when invoicing all clients
table:
addressId: Address id
streetAddress: Street
@@ -857,6 +858,7 @@ components:
downloadFile: Download file
openCard: View
openSummary: Summary
+ viewSummary: Summary
cardDescriptor:
mainList: Main list
summary: Summary
diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml
index eb0978ddd..7d594b303 100644
--- a/src/i18n/locale/es.yml
+++ b/src/i18n/locale/es.yml
@@ -509,6 +509,7 @@ invoiceOut:
invoiceWithFutureDate: Existe una factura con una fecha futura
noTicketsToInvoice: No existen tickets para facturar
criticalInvoiceError: Error crítico en la facturación proceso detenido
+ invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
table:
addressId: Id dirección
streetAddress: Dirección fiscal
diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue
index 9e7f1b10a..cbaaf8e26 100644
--- a/src/pages/Account/AccountList.vue
+++ b/src/pages/Account/AccountList.vue
@@ -104,7 +104,7 @@ const exprBuilder = (param, value) => {
{
/>
-
+
{
(states = data)" auto-load />
-
+
{{ t(`params.${tag.label}`) }}:
diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue
index e46d2cb29..0753bee9e 100644
--- a/src/pages/Customer/Card/CustomerDescriptor.vue
+++ b/src/pages/Customer/Card/CustomerDescriptor.vue
@@ -37,6 +37,9 @@ const entityId = computed(() => {
const data = ref(useCardDescription());
const setData = (entity) => (data.value = useCardDescription(entity?.name, entity?.id));
+const debtWarning = computed(() => {
+ return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';
+});
@@ -117,7 +120,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
v-if="customer.debt > customer.credit"
name="vn:risk"
size="xs"
- color="primary"
+ :color="debtWarning"
>
{{ t('customer.card.hasDebt') }}
diff --git a/src/pages/Customer/Card/CustomerSummary.vue b/src/pages/Customer/Card/CustomerSummary.vue
index 46861d75e..95a162670 100644
--- a/src/pages/Customer/Card/CustomerSummary.vue
+++ b/src/pages/Customer/Card/CustomerSummary.vue
@@ -4,7 +4,7 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
-import { toCurrency, toPercentage, toDate } from 'src/filters';
+import { toCurrency, toPercentage, toDate, dashOrCurrency } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue';
import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue';
@@ -27,21 +27,16 @@ const $props = defineProps({
const entityId = computed(() => $props.id || route.params.id);
const customer = computed(() => summary.value.entity);
const summary = ref();
-const clientUrl = ref();
-
-onMounted(async () => {
- clientUrl.value = (await getUrl('client/')) + entityId.value + '/';
-});
-
+const defaulterAmount = computed(() => customer.value.defaulters[0]?.amount);
const balanceDue = computed(() => {
- return (
- customer.value &&
- customer.value.defaulters.length &&
- customer.value.defaulters[0].amount
- );
+ const amount = defaulterAmount.value;
+ if (!amount || amount < 0) {
+ return null;
+ }
+ return amount;
});
-const balanceDueWarning = computed(() => (balanceDue.value ? 'negative' : ''));
+const balanceDueWarning = computed(() => (defaulterAmount.value ? 'negative' : ''));
const claimRate = computed(() => {
return customer.value.claimsRatio?.claimingRate ?? 0;
@@ -305,7 +300,7 @@ const sumRisk = ({ clientRisks }) => {
diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue
index c3f4d52e8..79d48a667 100644
--- a/src/pages/Customer/CustomerFilter.vue
+++ b/src/pages/Customer/CustomerFilter.vue
@@ -11,10 +11,24 @@ defineProps({
required: true,
},
});
+const handleSalesModelValue = (val) => ({
+ or: [
+ { id: val },
+ { name: val },
+ { nickname: { like: '%' + val + '%' } },
+ { code: { like: `${val}%` } },
+ ],
+});
+
+const exprBuilder = (param, value) => {
+ return {
+ and: [{ active: { neq: false } }, handleSalesModelValue(value)],
+ };
+};
-
+
{{ t(`params.${tag.label}`) }}:
@@ -52,14 +66,18 @@ defineProps({
+ :input-debounce="0"
+ >
+
+
+
+ {{ opt.name }}
+
+ {{ opt.nickname }},{{ opt.code }}
+
+
+
+
diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue
index fefa7d15f..3cb17332c 100644
--- a/src/pages/Customer/CustomerList.vue
+++ b/src/pages/Customer/CustomerList.vue
@@ -394,16 +394,16 @@ function handleLocation(data, location) {
-
+
diff --git a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue
index e85f1f44c..3fd3104bf 100644
--- a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue
+++ b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue
@@ -183,7 +183,7 @@ onMounted(async () => {
en:
invoiceDate: Invoice date
- maxShipped: Max date
+ maxShipped: Max date ticket
allClients: All clients
oneClient: One client
company: Company
@@ -195,7 +195,7 @@ en:
es:
invoiceDate: Fecha de factura
- maxShipped: Fecha límite
+ maxShipped: Fecha límite ticket
allClients: Todos los clientes
oneClient: Un solo cliente
company: Empresa
diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue
index 91477e1a4..9facb35dc 100644
--- a/src/pages/InvoiceOut/InvoiceOutList.vue
+++ b/src/pages/InvoiceOut/InvoiceOutList.vue
@@ -6,15 +6,19 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
-import { usePrintService } from 'composables/usePrintService';
-import VnTable from 'components/VnTable/VnTable.vue';
+import { usePrintService } from 'src/composables/usePrintService';
+import VnTable from 'src/components/VnTable/VnTable.vue';
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
import { toCurrency, toDate } from 'src/filters/index';
import { useStateStore } from 'stores/useStateStore';
import { QBtn } from 'quasar';
-import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
+import axios from 'axios';
import RightMenu from 'src/components/common/RightMenu.vue';
import InvoiceOutFilter from './InvoiceOutFilter.vue';
+import VnRow from 'src/components/ui/VnRow.vue';
+import VnRadio from 'src/components/common/VnRadio.vue';
+import VnInput from 'src/components/common/VnInput.vue';
+import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
const { t } = useI18n();
const stateStore = useStateStore();
@@ -26,99 +30,86 @@ const selectedRows = ref([]);
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
const MODEL = 'InvoiceOuts';
const { openReport } = usePrintService();
+const addressOptions = ref([]);
+const selectedOption = ref('ticket');
+async function fetchClientAddress(id) {
+ const { data } = await axios.get(
+ `Clients/${id}/addresses?filter[order]=isActive DESC`
+ );
+ addressOptions.value = data;
+}
+
+const exprBuilder = (_, value) => {
+ return {
+ or: [{ code: value }, { description: { like: `%${value}%` } }],
+ };
+};
const columns = computed(() => [
{
align: 'center',
name: 'id',
label: t('invoiceOutList.tableVisibleColumns.id'),
- chip: {
- condition: () => true,
- },
+ chip: { condition: () => true },
isId: true,
- columnFilter: {
- name: 'search',
- },
+ columnFilter: { name: 'search' },
},
{
align: 'left',
name: 'ref',
- label: t('invoiceOutList.tableVisibleColumns.ref'),
+ label: t('globals.reference'),
isTitle: true,
component: 'select',
- attrs: {
- url: MODEL,
- optionLabel: 'ref',
- optionValue: 'id',
- },
- columnField: {
- component: null,
- },
+ attrs: { url: MODEL, optionLabel: 'ref', optionValue: 'id' },
+ columnField: { component: null },
},
{
align: 'left',
- name: 'Issued',
- label: t('invoiceOutList.tableVisibleColumns.issued'),
+ name: 'issued',
+ label: t('invoiceOut.summary.issued'),
component: 'date',
format: (row) => toDate(row.issued),
- columnField: {
- component: null,
- },
+ columnField: { component: null },
},
{
align: 'left',
name: 'clientFk',
- label: t('invoiceOutModule.customer'),
+ label: t('globals.client'),
cardVisible: true,
component: 'select',
- attrs: {
- url: 'Clients',
- fields: ['id', 'name'],
- },
- columnField: {
- component: null,
- },
+ attrs: { url: 'Clients', fields: ['id', 'name'] },
+ columnField: { component: null },
},
{
align: 'left',
name: 'companyCode',
- label: t('invoiceOutModule.company'),
+ label: t('globals.company'),
cardVisible: true,
component: 'select',
- attrs: {
- url: 'Companies',
- optionLabel: 'code',
- optionValue: 'id',
- },
- columnField: {
- component: null,
- },
+ attrs: { url: 'Companies', optionLabel: 'code', optionValue: 'id' },
+ columnField: { component: null },
},
{
align: 'left',
name: 'amount',
- label: t('invoiceOutModule.amount'),
+ label: t('globals.amount'),
cardVisible: true,
format: (row) => toCurrency(row.amount),
},
{
align: 'left',
name: 'created',
- label: t('invoiceOutList.tableVisibleColumns.created'),
+ label: t('globals.created'),
component: 'date',
- columnField: {
- component: null,
- },
+ columnField: { component: null },
format: (row) => toDate(row.created),
},
{
align: 'left',
name: 'dued',
- label: t('invoiceOutList.tableVisibleColumns.dueDate'),
+ label: t('invoiceOut.summary.dued'),
component: 'date',
- columnField: {
- component: null,
- },
+ columnField: { component: null },
format: (row) => toDate(row.dued),
},
{
@@ -128,11 +119,12 @@ const columns = computed(() => [
{
title: t('components.smartCard.viewSummary'),
icon: 'preview',
+ isPrimary: true,
action: (row) => viewSummary(row.id, InvoiceOutSummary),
},
{
- title: t('DownloadPdf'),
- icon: 'vn:ticket',
+ title: t('globals.downloadPdf'),
+ icon: 'cloud_download',
isPrimary: true,
action: (row) => openPdf(row.id),
},
@@ -181,12 +173,12 @@ watchEffect(selectedRows);
-
+
@@ -197,21 +189,19 @@ watchEffect(selectedRows);
@click="downloadPdf()"
:disable="!hasSelectedCards"
>
- {{ t('globals.downloadPdf') }}
+ {{ t('downloadPdf') }}
-
-
-
-
-
- #{{ scope.opt?.id }}
- {{ scope.opt?.nickname }}
-
-
-
-
-
O
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #{{ scope.opt?.id }} -
+ {{ scope.opt?.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ `${
+ !scope.opt?.isActive
+ ? t('inactive')
+ : ''
+ } `
+ }}
+
+ {{
+ scope.opt?.nickname
+ }}
+ , {{ scope.opt?.street }},
+ {{ scope.opt?.city }},
+ {{
+ scope.opt?.province?.name
+ }}
+ -
+ {{
+ scope.opt?.agencyMode
+ ?.name
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.opt?.code }} -
+ {{ scope.opt?.description }}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
-en:
- searchInvoice: Search issued invoice
- fileDenied: Browser denied file download...
- fileAllowed: Successful download of CSV file
- youCanSearchByInvoiceReference: You can search by invoice reference
- createInvoice: Make invoice
- Create manual invoice: Create manual invoice
-es:
- searchInvoice: Buscar factura emitida
- fileDenied: El navegador denegó la descarga de archivos...
- fileAllowed: Descarga exitosa de archivo CSV
- youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
- createInvoice: Crear factura
- Create manual invoice: Crear factura manual
+ en:
+ invoiceId: Invoice ID
+ youCanSearchByInvoiceReference: You can search by invoice reference
+ createManualInvoice: Create Manual Invoice
+ inactive: (Inactive)
+
+ es:
+ invoiceId: ID de factura
+ youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
+ createManualInvoice: Crear factura manual
+ inactive: (Inactivo)
diff --git a/src/pages/InvoiceOut/locale/en.yml b/src/pages/InvoiceOut/locale/en.yml
index 5ad92ed09..8cefe8bdc 100644
--- a/src/pages/InvoiceOut/locale/en.yml
+++ b/src/pages/InvoiceOut/locale/en.yml
@@ -2,6 +2,7 @@ invoiceOutModule:
customer: Client
amount: Amount
company: Company
+ address: Address
invoiceOutList:
tableVisibleColumns:
id: ID
@@ -15,11 +16,11 @@ invoiceOutList:
DownloadPdf: Download PDF
InvoiceOutSummary: Summary
negativeBases:
- country: Country
- clientId: Client ID
- base: Base
- ticketId: Ticket
- active: Active
- hasToInvoice: Has to invoice
- verifiedData: Verified data
- commercial: Commercial
\ No newline at end of file
+ country: Country
+ clientId: Client ID
+ base: Base
+ ticketId: Ticket
+ active: Active
+ hasToInvoice: Has to invoice
+ verifiedData: Verified data
+ commercial: Commercial
diff --git a/src/pages/InvoiceOut/locale/es.yml b/src/pages/InvoiceOut/locale/es.yml
index 192f5b26f..bf5126641 100644
--- a/src/pages/InvoiceOut/locale/es.yml
+++ b/src/pages/InvoiceOut/locale/es.yml
@@ -4,6 +4,7 @@ invoiceOutModule:
customer: Cliente
amount: Importe
company: Empresa
+ address: Consignatario
invoiceOutList:
tableVisibleColumns:
id: ID
diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue
index 4205d8344..a444d587b 100644
--- a/src/pages/Item/ItemFixedPrice.vue
+++ b/src/pages/Item/ItemFixedPrice.vue
@@ -64,8 +64,7 @@ const columns = computed(() => [
},
{
label: t('globals.name'),
- field: 'name',
- name: 'description',
+ name: 'name',
...defaultColumnAttrs,
create: true,
cardVisible: true,
@@ -426,7 +425,7 @@ function handleOnDataSave({ CrudModelRef }) {
:default-save="false"
data-key="ItemFixedPrices"
url="FixedPrices/filter"
- :order="['description DESC']"
+ :order="['itemFk DESC', 'name DESC']"
save-url="FixedPrices/crud"
:user-params="{ warehouseFk: user.warehouseFk }"
ref="tableRef"
@@ -480,7 +479,7 @@ function handleOnDataSave({ CrudModelRef }) {
-
+
{{ row.name }}
diff --git a/src/pages/Item/ItemFixedPriceFilter.vue b/src/pages/Item/ItemFixedPriceFilter.vue
index 84eefaed3..a8f7d0c5f 100644
--- a/src/pages/Item/ItemFixedPriceFilter.vue
+++ b/src/pages/Item/ItemFixedPriceFilter.vue
@@ -17,21 +17,6 @@ const props = defineProps({
});
const itemTypeWorkersOptions = ref([]);
-const exprBuilder = (param, value) => {
- switch (param) {
- case 'name':
- return { 'i.name': { like: `%${value}%` } };
- case 'itemFk':
- case 'warehouseFk':
- case 'rate2':
- case 'rate3':
- param = `fp.${param}`;
- return { [param]: value };
- case 'minPrice':
- param = `i.${param}`;
- return { [param]: value };
- }
-};
@@ -66,7 +51,7 @@ const exprBuilder = (param, value) => {
url="Warehouses"
auto-load
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
- :label="t('components.itemsFilterPanel.warehouseFk')"
+ :label="t('globals.warehouse')"
v-model="params.warehouseFk"
option-label="name"
option-value="id"
diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue
index 758639f69..319025119 100644
--- a/src/pages/Order/Card/OrderCatalogFilter.vue
+++ b/src/pages/Order/Card/OrderCatalogFilter.vue
@@ -166,6 +166,7 @@ onMounted(() => {
:expr-builder="exprBuilder"
:custom-tags="['tagGroups', 'categoryFk']"
:redirect="false"
+ search-url="params"
>
diff --git a/src/pages/Order/Card/OrderCreateDialog.vue b/src/pages/Order/Card/OrderCreateDialog.vue
index b9b232115..e4806e96c 100644
--- a/src/pages/Order/Card/OrderCreateDialog.vue
+++ b/src/pages/Order/Card/OrderCreateDialog.vue
@@ -1,6 +1,6 @@
@@ -194,7 +191,7 @@ onMounted(() => {
urlCreate: 'Orders/new',
title: t('module.cerateOrder'),
onDataSaved: (url) => {
- tableRef.redirect(url);
+ tableRef.redirect(`${url}/catalog`);
},
formInitialData: {
active: true,
diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
index 8c6d454c0..1fc54f486 100644
--- a/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
+++ b/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
@@ -16,12 +16,9 @@ import { useAcl } from 'src/composables/useAcl';
import { useValidator } from 'src/composables/useValidator';
import { toTimeFormat } from 'filters/date.js';
-const $props = defineProps({
- formData: {
- type: Object,
- required: true,
- default: () => ({}),
- },
+const formData = defineModel({
+ type: Object,
+ required: true,
});
const emit = defineEmits(['updateForm']);
@@ -40,7 +37,6 @@ const agenciesOptions = ref([]);
const zonesOptions = ref([]);
const addresses = ref([]);
const zoneSelectRef = ref();
-const formData = ref($props.formData);
watch(
() => formData.value,
@@ -69,47 +65,28 @@ const zoneWhere = computed(() => {
: {};
});
-const getLanded = async (params) => {
- try {
- const validParams =
- shipped.value && addressId.value && agencyModeId.value && warehouseId.value;
- if (!validParams) return;
+async function getLanded(params) {
+ getDate(`Agencies/getLanded`, params);
+}
- formData.value.zoneFk = null;
- zonesOptions.value = [];
- const { data } = await axios.get(`Agencies/getLanded`, { params });
- if (data) {
- formData.value.zoneFk = data.zoneFk;
- formData.value.landed = data.landed;
- formData.value.shipped = params.shipped;
- }
- } catch (error) {
- console.error(error);
- notify(t('basicData.noDeliveryZoneAvailable'), 'negative');
+async function getShipped(params) {
+ getDate(`Agencies/getShipped`, params);
+}
+
+async function getDate(query, params) {
+ for (const param in params) {
+ if (!params[param]) return;
}
-};
-const getShipped = async (params) => {
- try {
- const validParams =
- landed.value && addressId.value && agencyModeId.value && warehouseId.value;
- if (!validParams) return;
+ formData.value.zoneFk = null;
+ zonesOptions.value = [];
+ const { data } = await axios.get(query, { params });
+ if (!data) return notify(t('basicData.noDeliveryZoneAvailable'), 'negative');
- formData.value.zoneFk = null;
- zonesOptions.value = [];
- const { data } = await axios.get(`Agencies/getShipped`, { params });
- if (data) {
- formData.value.zoneFk = data.zoneFk;
- formData.value.landed = params.landed;
- formData.value.shipped = data.shipped;
- } else {
- notify(t('basicData.noDeliveryZoneAvailable'), 'negative');
- }
- } catch (error) {
- console.error(error);
- notify(t('basicData.noDeliveryZoneAvailable'), 'negative');
- }
-};
+ formData.value.zoneFk = data.zoneFk;
+ if (data.landed) formData.value.landed = data.landed;
+ if (data.shipped) formData.value.shipped = data.shipped;
+}
const onChangeZone = async (zoneId) => {
formData.value.agencyModeFk = null;
@@ -177,18 +154,26 @@ const clientId = computed({
},
});
-const landed = computed({
- get: () => formData.value?.landed,
- set: (val) => {
- formData.value.landed = val;
- getShipped({
- landed: val,
+function addDateParams(obj) {
+ return {
+ ...obj,
+ ...{
addressFk: formData.value?.addressFk,
agencyModeFk: formData.value?.agencyModeFk,
warehouseFk: formData.value?.warehouseFk,
- });
- },
-});
+ },
+ };
+}
+
+async function setLanded(landed) {
+ if (!landed) return;
+ getShipped(addDateParams({ landed }));
+}
+
+async function setShipped(shipped) {
+ if (!shipped) return;
+ getLanded(addDateParams({ shipped }));
+}
const agencyModeId = computed({
get: () => formData.value.agencyModeFk,
@@ -236,21 +221,6 @@ const warehouseId = computed({
},
});
-const shipped = computed({
- get: () => formData.value?.shipped,
- set: (val) => {
- if (new Date(formData.value?.shipped).toDateString() != val.toDateString())
- val.setHours(0, 0, 0, 0);
- formData.value.shipped = val;
- getLanded({
- shipped: val,
- addressFk: formData.value?.addressFk,
- agencyModeFk: formData.value?.agencyModeFk,
- warehouseFk: formData.value?.warehouseFk,
- });
- },
-});
-
const onFormModelInit = () => {
if (formData.value?.clientFk) clientAddressesList(formData.value?.clientFk);
};
@@ -451,18 +421,21 @@ async function getZone(options) {
v-model="formData.shipped"
:required="true"
:rules="validate('ticketList.shipped')"
+ @update:model-value="setShipped"
/>
diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue
index fb7881403..851593bff 100644
--- a/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue
+++ b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue
@@ -158,7 +158,7 @@ onBeforeMount(async () => await getTicketData());
(formData = $event)"
- :form-data="formData"
+ v-model="formData"
/>
diff --git a/src/pages/Ticket/Card/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue
index bf4a1efb4..f1d30b1bd 100644
--- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue
+++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue
@@ -1,9 +1,9 @@
@@ -396,8 +397,6 @@ async function uploadDocuware(force) {
[
},
{
align: 'left',
- label: t('ticketList.id'),
+ label: t('globals.id'),
name: 'itemFk',
},
{
align: 'left',
- label: t('basicData.quantity'),
+ label: t('globals.quantity'),
name: 'quantity',
format: (row) => toCurrency(row.quantity),
},
{
align: 'left',
- label: t('basicData.item'),
+ label: t('globals.item'),
name: 'item',
format: (row) => row?.item?.name,
columnClass: 'expand',
},
{
align: 'left',
- label: t('basicData.price'),
+ label: t('globals.size'),
+ name: 'size',
+ format: (row) => row?.item?.size,
+ columnClass: 'expand',
+ },
+ {
+ align: 'left',
+ label: t('globals.price'),
name: 'price',
format: (row) => toCurrency(row.price),
},
@@ -124,7 +131,7 @@ const columns = computed(() => [
},
{
align: 'left',
- label: t('ticketList.amount'),
+ label: t('globals.amount'),
name: 'amount',
format: (row) => parseInt(row.amount * row.quantity),
},
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index d3847cc46..b55043b17 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -20,6 +20,7 @@ import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
+import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
const route = useRoute();
const { notify } = useNotify();
@@ -116,24 +117,36 @@ function toTicketUrl(section) {
{{ entity.nickname }}
-
-
-
-
+
+
+
+
+
+
+
+ {{ t('components.cardDescriptor.moreOptions') }}
+
+
+
+
+
+
+
+
diff --git a/src/pages/Ticket/TicketFilter.vue b/src/pages/Ticket/TicketFilter.vue
index 7f72f9862..6f1cac83b 100644
--- a/src/pages/Ticket/TicketFilter.vue
+++ b/src/pages/Ticket/TicketFilter.vue
@@ -47,7 +47,7 @@ const getGroupedStates = (data) => {
/>
(agencies = data)" auto-load />
(warehouses = data)" auto-load />
-
+
{{ t(`params.${tag.label}`) }}:
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 0685217ac..aae6f80a7 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -1,7 +1,7 @@