diff --git a/src/components/CreateNewPayment.vue b/src/components/CreateNewPayment.vue new file mode 100644 index 000000000..2267d5643 --- /dev/null +++ b/src/components/CreateNewPayment.vue @@ -0,0 +1,333 @@ + + + + + (companyOptions = data)" + auto-load + url="Companies" + /> + (bankOptions = data)" + auto-load + url="Accountings" + /> + (initialData.email = email)" + auto-load + url="Clients/findOne" + /> + + + + + + + {{ t('New payment') }} + + + + + + + setPaymentType(value, options) + " + :emit-value="false" + > + + + + + {{ scope.opt.id }}: {{ scope.opt.bank }} + + + + + + + + + + {{ t('Compensation') }} + + + + + + + + + {{ t('Cash') }} + + + + + + + + + + + + + + + + + + + +es: + New payment: Añadir pago + Date: Fecha + Company: Empresa + Bank: Caja + Amount: Importe + Reference: Referencia + Cash: Efectivo + Delivered amount: Cantidad entregada + Amount to return: Cantidad a devolver + View recipt: Ver recibido + Send email: Enviar correo + Compensation: Compensación + Compensation account: Cuenta para compensar + Supplier Compensation Reference: ({supplierId}) Ntro Proveedor {supplierName} + Client Compensation Reference: ({clientId}) Ntro Cliente {clientName} + There is no assigned email for this client: No hay correo asignado para este cliente + Amount exceeded: Según ley contra el fraude no se puede recibir cobros por importe igual o superior a {maxAmount} + diff --git a/src/composables/getRisk.js b/src/composables/getRisk.js new file mode 100644 index 000000000..6c7f75ad2 --- /dev/null +++ b/src/composables/getRisk.js @@ -0,0 +1,22 @@ +import axios from 'axios'; + +export async function getClientRisk(_filter) { + const filter = { + ..._filter, + include: { relation: 'company', scope: { fields: ['code'] } }, + }; + + return await axios(`ClientRisks`, { + params: { filter: JSON.stringify(filter) }, + }); +} +export async function getSupplierRisk(_filter) { + const filter = { + ..._filter, + include: { relation: 'company', scope: { fields: ['code'] } }, + }; + + return await axios(`ClientRisks`, { + params: { filter: JSON.stringify(filter) }, + }); +} diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index f6fc3eed2..a45ebc778 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -5,7 +5,7 @@ import { useRoute } from 'vue-router'; import { useAcl } from 'src/composables/useAcl'; import axios from 'axios'; import { useQuasar } from 'quasar'; -import { getClientRisk } from '../composables/getClientRisk'; +import { getClientRisk } from 'src/composables/getRisk'; import { toCurrency, toDate, toDateHourMin } from 'src/filters'; import { useState } from 'composables/useState'; diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue index 291f28642..2267d5643 100644 --- a/src/pages/Customer/components/CustomerNewPayment.vue +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -3,7 +3,7 @@ import { onBeforeMount, reactive, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import axios from 'axios'; -import { getClientRisk } from '../composables/getClientRisk'; +import { getClientRisk } from 'src/composables/getRisk'; import { useDialogPluginComponent } from 'quasar'; import { usePrintService } from 'composables/usePrintService'; diff --git a/src/pages/Supplier/composables/getSupplierRisk.js b/src/pages/Supplier/composables/getSupplierRisk.js new file mode 100644 index 000000000..ebaf545ee --- /dev/null +++ b/src/pages/Supplier/composables/getSupplierRisk.js @@ -0,0 +1,12 @@ +import axios from 'axios'; + +export async function getClientRisk(_filter) { + const filter = { + ..._filter, + include: { relation: 'company', scope: { fields: ['code'] } }, + }; + + return await axios(`ClientRisks`, { + params: { filter: JSON.stringify(filter) }, + }); +}