diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue
index 8cca2ef23..12173727f 100644
--- a/src/pages/Customer/Card/CustomerGreuges.vue
+++ b/src/pages/Customer/Card/CustomerGreuges.vue
@@ -2,101 +2,86 @@
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
-import { QBtn } from 'quasar';
-import { useStateStore } from 'src/stores/useStateStore';
import { toCurrency } from 'src/filters';
import { toDateTimeFormat } from 'src/filters/date';
-import FetchData from 'components/FetchData.vue';
-import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
+import VnTable from 'components/VnTable/VnTable.vue';
const { t } = useI18n();
const route = useRoute();
-const stateStore = computed(() => useStateStore());
const rows = ref([]);
const totalAmount = ref();
-
-const filter = {
- include: [
- {
- relation: 'greugeType',
- scope: {
- fields: ['id', 'name'],
+const tableRef = ref();
+const filter = computed(() => {
+ return {
+ include: [
+ {
+ relation: 'greugeType',
+ scope: {
+ fields: ['id', 'name'],
+ },
},
- },
- {
- relation: 'user',
- scope: {
- fields: ['id', 'name'],
+ {
+ relation: 'user',
+ scope: {
+ fields: ['id', 'name'],
+ },
},
+ ],
+ where: {
+ clientFk: route.params.id,
},
- ],
- order: 'shipped DESC, amount',
- where: {
- clientFk: `${route.params.id}`,
- },
- limit: 20,
-};
-
-const tableColumnComponents = {
- date: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
- createdBy: {
- component: QBtn,
- props: () => ({ flat: true, color: 'blue', noCaps: true }),
- event: () => {},
- },
- comment: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
- type: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
- amount: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
-};
+ };
+});
const columns = computed(() => [
{
align: 'left',
- field: 'shipped',
label: t('Date'),
- name: 'date',
- format: (value) => toDateTimeFormat(value),
+ name: 'shipped',
+ format: ({ shipped }) => toDateTimeFormat(shipped),
+ create: true,
+ columnCreate: {
+ component: 'date',
+ autofocus: true,
+ },
},
{
align: 'left',
- field: (value) => value?.user?.name,
+ name: 'userFk',
label: t('Created by'),
- name: 'createdBy',
+ component: 'userLink',
+ attrs: ({ row }) => {
+ return {
+ defaultName: true,
+ workerId: row.user?.id,
+ name: row.user?.name,
+ };
+ },
},
{
align: 'left',
- field: 'description',
+ name: 'description',
label: t('Comment'),
- name: 'comment',
+ create: true,
},
{
align: 'left',
- field: (value) => value?.greugeType?.name,
+ name: 'greugeTypeFk',
+ format: ({ greugeType }) => greugeType?.name,
label: t('Type'),
- name: 'type',
+ create: true,
+ columnCreate: {
+ component: 'select',
+ url: 'greugeTypes',
+ limit: 0,
+ },
},
{
align: 'left',
- field: 'amount',
- label: t('Amount'),
name: 'amount',
- format: (value) => toCurrency(value),
+ label: t('Amount'),
+ format: ({ amount }) => toCurrency(amount),
+ create: true,
},
]);
@@ -107,60 +92,33 @@ const setRows = (data) => {
-
-
-
-
- {{ t('Total') }}:
- {{ toCurrency(totalAmount) }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ props.value }}
-
-
-
-
-
-
+ setRows(data)"
+ :create="{
+ urlCreate: `Greuges`,
+ title: t('New credit'),
+ onDataSaved: () => tableRef.reload(),
+ formInitialData: { shipped: new Date(), clientFk: route.params.id },
+ }"
+ auto-load
+ >
+
+
+ {{ t('Total') }}: {{ toCurrency(totalAmount) }}
-
-
-
-
-
-
- {{ t('New greuge') }}
-
-
+
+
-
-
-es:
- New note: Nueva nota
-
diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue
index a82f1fc0e..3a5d18fd9 100644
--- a/src/pages/Customer/CustomerList.vue
+++ b/src/pages/Customer/CustomerList.vue
@@ -106,9 +106,9 @@ const columns = computed(() => [
component: null,
after: {
component: markRaw(VnLinkPhone),
- attrs: (prop) => {
+ attrs: ({ model }) => {
return {
- 'phone-number': prop,
+ 'phone-number': model,
};
},
},
diff --git a/src/pages/Customer/components/CustomerCreditCreate.vue b/src/pages/Customer/components/CustomerCreditCreate.vue
deleted file mode 100644
index 729deb258..000000000
--- a/src/pages/Customer/components/CustomerCreditCreate.vue
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-es:
- Credit: Crédito
-
diff --git a/src/pages/Customer/components/CustomerGreugeCreate.vue b/src/pages/Customer/components/CustomerGreugeCreate.vue
deleted file mode 100644
index 06b1b2124..000000000
--- a/src/pages/Customer/components/CustomerGreugeCreate.vue
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
- (greugeTypes = data)" auto-load url="greugeTypes" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-es:
- Amount: Importe
- Date: Fecha
- Comment: Comentario
- Type: Tipo
-
diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue
index cfa3acea8..877a2c353 100644
--- a/src/pages/Customer/components/CustomerNewPayment.vue
+++ b/src/pages/Customer/components/CustomerNewPayment.vue
@@ -11,12 +11,10 @@ import VnRow from 'components/ui/VnRow.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
-import { useState } from 'src/composables/useState';
+
const { t } = useI18n();
const route = useRoute();
const { dialogRef } = useDialogPluginComponent();
-const state = useState();
-const user = state.getUser();
const $props = defineProps({
companyId: {
@@ -40,7 +38,7 @@ const bankOptions = ref([]);
const clientFindOne = ref([]);
const deliveredAmount = ref(null);
const amountToReturn = ref(null);
-const viewRecipt = ref(true);
+const viewReceipt = ref();
const sendEmail = ref(false);
const isLoading = ref(false);
@@ -57,24 +55,46 @@ const filterClientFindOne = {
id: route.params.id,
},
};
+
const initialData = reactive({
amountPaid: $props.totalCredit,
clientFk: route.params.id,
companyFk: $props.companyId,
email: clientFindOne.value.email,
- bankFk: user.value.localBankFk,
});
onBeforeMount(() => {
urlCreate.value = `Clients/${route.params.id}/createReceipt`;
});
-const setPaymentType = (id) => {
- initialData.payed = '2001-01-01T11:00:00.000Z';
- if (id === 1) initialData.description = 'Credit card';
- if (id === 2) initialData.description = 'Cash';
- if (id === 3 || id === 3117) initialData.description = '';
- if (id === 4) initialData.description = 'Transfer';
+const setPaymentType = (value) => {
+ // if (id === 1) initialData.description = 'Credit card';
+ // if (id === 2) initialData.description = 'Cash';
+ // if (id === 3 || id === 3117) initialData.description = '';
+ // if (id === 4) initialData.description = 'Transfer';
+ // const CASH_CODE = 2;
+ // // const CASH_CODE = 2
+ // if (!value) return;
+ // const accountingType = CASH_CODE;
+ // initialData.description = '';
+ // viewReceipt.value = value == CASH_CODE;
+ // if (accountingType.code == 'compensation') this.receipt.description = '';
+ // else {
+ // if (
+ // accountingType.receiptDescription != null &&
+ // accountingType.receiptDescription != ''
+ // )
+ // this.receipt.description.push(accountingType.receiptDescription);
+ // if (this.originalDescription)
+ // this.receipt.description.push(this.originalDescription);
+ // this.receipt.description = this.receipt.description.join(', ');
+ // }
+ // this.maxAmount = accountingType && accountingType.maxAmount;
+ // this.receipt.payed = Date.vnNew();
+ // if (accountingType.daysInFuture)
+ // this.receipt.payed.setDate(
+ // this.receipt.payed.getDate() + accountingType.daysInFuture
+ // );
};
const calculateFromAmount = (event) => {
@@ -207,7 +227,6 @@ const onDataSaved = async () => {
{{ t('Cash') }}
-
{
v-model="amountToReturn"
/>
-
-
+
-
-import { onMounted, reactive } from 'vue';
-import { useI18n } from 'vue-i18n';
-import { useRoute, useRouter } from 'vue-router';
-
-import FormModel from 'components/FormModel.vue';
-import VnRow from 'components/ui/VnRow.vue';
-
-const { t } = useI18n();
-const route = useRoute();
-const router = useRouter();
-
-const initialData = reactive({});
-
-onMounted(() => {
- initialData.clientFk = `${route.params.id}`;
-});
-
-const toCustomerNotes = () => {
- router.push({
- name: 'CustomerNotes',
- params: {
- id: route.params.id,
- },
- });
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-es:
- Note: Nota
-
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue
index b8e250a57..7c4354b65 100644
--- a/src/pages/Entry/EntryLatestBuys.vue
+++ b/src/pages/Entry/EntryLatestBuys.vue
@@ -18,9 +18,9 @@ const columns = [
name: 'itemFk',
columnField: {
component: VnImg,
- attrs: (id) => {
+ attrs: ({ row }) => {
return {
- id,
+ id: row.id,
size: '50x50',
width: '50px',
};
diff --git a/src/pages/Entry/EntryList.vue b/src/pages/Entry/EntryList.vue
index 4272ce10e..bd5ace677 100644
--- a/src/pages/Entry/EntryList.vue
+++ b/src/pages/Entry/EntryList.vue
@@ -192,7 +192,7 @@ onMounted(async () => {
:filter="entryFilter"
:create="{
urlCreate: 'Entries',
- title: 'Create entry',
+ title: t('Create entry'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
@@ -210,4 +210,5 @@ es:
Virtual entry: Es una redada
Search entries: Buscar entradas
You can search by entry reference: Puedes buscar por referencia de la entrada
+ Create entry: Crear entrada
diff --git a/src/pages/Order/OrderLines.vue b/src/pages/Order/OrderLines.vue
index f361d9898..9814eaf34 100644
--- a/src/pages/Order/OrderLines.vue
+++ b/src/pages/Order/OrderLines.vue
@@ -70,9 +70,9 @@ const columns = computed(() => [
name: 'image',
columnField: {
component: VnImg,
- attrs: (id) => {
+ attrs: ({ row }) => {
return {
- id,
+ id: row.id,
width: '50px',
};
},
diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue
index 61532ee51..d68d18c24 100644
--- a/src/pages/Ticket/TicketWeekly.vue
+++ b/src/pages/Ticket/TicketWeekly.vue
@@ -221,9 +221,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:find="['agencyModeFk', 'agencyModeName']"
v-model="row.agencyModeFk"
@update:model-value="onUpdate(row.ticketFk, 'agencyModeFk', $event)"
- >
- {{ console.log('row: ', row) }}
-
+ />
diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js
index d9d047433..6d697967b 100644
--- a/src/router/modules/customer.js
+++ b/src/router/modules/customer.js
@@ -187,87 +187,32 @@ export default {
},
{
path: 'notes',
- name: 'CustomerNotesCard',
- redirect: { name: 'CustomerNotes' },
- children: [
- {
- path: '',
- name: 'CustomerNotes',
- meta: {
- title: 'notes',
- icon: 'vn:notes',
- },
- component: () =>
- import('src/pages/Customer/Card/CustomerNotes.vue'),
- },
- {
- path: 'create',
- name: 'CustomerNoteCreate',
- meta: {
- title: 'note-create',
- },
- component: () =>
- import(
- 'src/pages/Customer/components/CustomerNoteCreate.vue'
- ),
- },
- ],
+ name: 'CustomerNotes',
+ meta: {
+ title: 'notes',
+ icon: 'vn:notes',
+ },
+ component: () => import('src/pages/Customer/Card/CustomerNotes.vue'),
},
{
path: 'credits',
- name: 'CreditsCard',
- redirect: { name: 'CustomerCredits' },
- children: [
- {
- path: '',
- name: 'CustomerCredits',
- meta: {
- title: 'credits',
- icon: 'vn:credit',
- },
- component: () =>
- import('src/pages/Customer/Card/CustomerCredits.vue'),
- },
- {
- path: 'create',
- name: 'CustomerCreditCreate',
- meta: {
- title: 'credit-create',
- },
- component: () =>
- import(
- 'src/pages/Customer/components/CustomerCreditCreate.vue'
- ),
- },
- ],
+ name: 'CustomerCredits',
+ meta: {
+ title: 'credits',
+ icon: 'vn:credit',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerCredits.vue'),
},
{
path: 'greuges',
- name: 'GreugesCard',
- redirect: { name: 'CustomerGreuges' },
- children: [
- {
- path: '',
- name: 'CustomerGreuges',
- meta: {
- title: 'greuges',
- icon: 'vn:greuge',
- },
- component: () =>
- import('src/pages/Customer/Card/CustomerGreuges.vue'),
- },
- {
- path: 'create',
- name: 'CustomerGreugeCreate',
- meta: {
- title: 'greuge-create',
- },
- component: () =>
- import(
- 'src/pages/Customer/components/CustomerGreugeCreate.vue'
- ),
- },
- ],
+ name: 'CustomerGreuges',
+ meta: {
+ title: 'greuges',
+ icon: 'vn:greuge',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerGreuges.vue'),
},
{
path: 'balance',