+
@@ -18,6 +18,9 @@
&:not(.wrap) {
flex-direction: column;
}
+ &[fixed] {
+ flex-direction: row;
+ }
}
}
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js
index 269231797..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,
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/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 f1b4902f2..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,7 +173,7 @@ watchEffect(selectedRows);
@@ -197,7 +189,7 @@ watchEffect(selectedRows);
@click="downloadPdf()"
:disable="!hasSelectedCards"
>
- {{ t('globals.downloadPdf') }}
+ {{ t('downloadPdf') }}
@@ -207,11 +199,9 @@ watchEffect(selectedRows);
:url="`${MODEL}/filter`"
:create="{
urlCreate: 'InvoiceOuts/createManualInvoice',
- title: t('Create manual invoice'),
+ title: t('createManualInvoice'),
onDataSaved: ({ id }) => tableRef.redirect(id),
- formInitialData: {
- active: true,
- },
+ formInitialData: { active: true },
}"
:right-search="false"
v-model:selected="selectedRows"
@@ -231,74 +221,203 @@ watchEffect(selectedRows);
-
-
-
-
-
- #{{ 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/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 @@