+
{
val="one"
:label="t('oneClient')"
:dark="true"
+ class="q-mb-sm"
/>
{
+ is-outlined
+ />
+ is-outlined
+ />
-import { onMounted, ref, reactive } from 'vue';
+import { ref, computed, onBeforeMount } from 'vue';
import { useI18n } from 'vue-i18n';
-import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
-import invoiceOutService from 'src/services/invoiceOut.service';
-import { toCurrency } from 'src/filters';
import { QCheckbox, QBtn } from 'quasar';
+
+import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
+import InvoiceOutNegativeFilter from './InvoiceOutNegativeBasesFilter.vue';
+import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+
+import { toCurrency } from 'src/filters';
import { useInvoiceOutGlobalStore } from 'src/stores/invoiceOutGlobal.js';
-import VnInputDate from 'components/common/VnInputDate.vue';
+import { useStateStore } from 'stores/useStateStore';
+import { useArrayData } from 'composables/useArrayData';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
const invoiceOutGlobalStore = useInvoiceOutGlobalStore();
-
-const rows = ref([]);
+const stateStore = useStateStore();
const { t } = useI18n();
-const dateRange = reactive({
- from: Date.vnFirstDayOfMonth().toISOString(),
- to: Date.vnLastDayOfMonth().toISOString(),
+const arrayData = ref(null);
+
+function exprBuilder(param, value) {
+ switch (param) {
+ case 'from':
+ case 'to':
+ return;
+ default:
+ return { [param]: value };
+ }
+}
+
+onBeforeMount(async () => {
+ const defaultParams = {
+ from: Date.vnFirstDayOfMonth().toISOString(),
+ to: Date.vnLastDayOfMonth().toISOString(),
+ };
+ arrayData.value = useArrayData('InvoiceOutNegative', {
+ url: 'InvoiceOuts/negativeBases',
+ limit: 0,
+ userParams: defaultParams,
+ exprBuilder: exprBuilder,
+ });
+ await arrayData.value.fetch({ append: false });
+
+ stateStore.rightDrawer = true;
});
+const rows = computed(() => arrayData.value.store.data);
+
const selectedCustomerId = ref(0);
const selectedWorkerId = ref(0);
-const filter = ref({
- company: null,
- country: null,
- clientId: null,
- client: null,
- amount: null,
- base: null,
- ticketId: null,
- active: null,
- hasToInvoice: null,
- verifiedData: null,
- comercial: null,
-});
-
const tableColumnComponents = {
company: {
component: 'span',
@@ -103,70 +117,70 @@ const tableColumnComponents = {
},
};
-const columns = ref([
+const columns = computed(() => [
{
- label: 'company',
+ label: t('invoiceOut.negativeBases.company'),
field: 'company',
name: 'company',
align: 'left',
},
{
- label: 'country',
+ label: t('invoiceOut.negativeBases.country'),
field: 'country',
name: 'country',
align: 'left',
},
{
- label: 'clientId',
+ label: t('invoiceOut.negativeBases.clientId'),
field: 'clientId',
name: 'clientId',
align: 'left',
},
{
- label: 'client',
+ label: t('invoiceOut.negativeBases.client'),
field: 'clientSocialName',
name: 'client',
align: 'left',
},
{
- label: 'amount',
+ label: t('invoiceOut.negativeBases.amount'),
field: 'amount',
name: 'amount',
align: 'left',
format: (value) => toCurrency(value),
},
{
- label: 'base',
+ label: t('invoiceOut.negativeBases.base'),
field: 'taxableBase',
name: 'base',
align: 'left',
},
{
- label: 'ticketId',
+ label: t('invoiceOut.negativeBases.ticketId'),
field: 'ticketFk',
name: 'ticketId',
align: 'left',
},
{
- label: 'active',
+ label: t('invoiceOut.negativeBases.active'),
field: 'isActive',
name: 'active',
align: 'left',
},
{
- label: 'hasToInvoice',
+ label: t('invoiceOut.negativeBases.hasToInvoice'),
field: 'hasToInvoice',
name: 'hasToInvoice',
align: 'left',
},
{
- label: 'verifiedData',
+ label: t('invoiceOut.negativeBases.verifiedData'),
field: 'isTaxDataChecked',
name: 'verifiedData',
align: 'left',
},
{
- label: 'comercial',
+ label: t('invoiceOut.negativeBases.comercial'),
field: 'comercialName',
name: 'comercial',
align: 'left',
@@ -174,8 +188,7 @@ const columns = ref([
]);
const downloadCSV = async () => {
- const params = filter.value;
-
+ const params = {}; // filter.value;
const filterParams = {
limit: 20,
where: {
@@ -187,57 +200,12 @@ const downloadCSV = async () => {
}
await invoiceOutGlobalStore.getNegativeBasesCsv(
- dateRange.from,
- dateRange.to,
- JSON.stringify(filterParams)
+ arrayData.value.store.userParams.from,
+ arrayData.value.store.userParams.to,
+ params
);
};
-const search = async () => {
- const and = [];
- Object.keys(filter.value).forEach((key) => {
- if (filter.value[key]) {
- and.push({
- [key]: filter.value[key],
- });
- }
- });
- const searchFilter = {
- limit: 20,
- };
-
- if (and.length) {
- searchFilter.where = {
- and,
- };
- }
-
- const params = {
- ...dateRange,
- filter: JSON.stringify(searchFilter),
- };
- rows.value = await invoiceOutService.getNegativeBases(params);
-};
-
-const refresh = () => {
- dateRange.from = Date.vnFirstDayOfMonth().toISOString();
- dateRange.to = Date.vnLastDayOfMonth().toISOString();
- filter.value = {
- company: null,
- country: null,
- clientId: null,
- client: null,
- amount: null,
- base: null,
- ticketId: null,
- active: null,
- hasToInvoice: null,
- verifiedData: null,
- comercial: null,
- };
- search();
-};
-
const selectCustomerId = (id) => {
selectedCustomerId.value = id;
};
@@ -245,86 +213,29 @@ const selectCustomerId = (id) => {
const selectWorkerId = (id) => {
selectedWorkerId.value = id;
};
-
-onMounted(() => refresh());
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- {{ rows.length }} {{ t('results') }}
-
-
-
-
-
-
-
-
-
- {{ t(`invoiceOut.negativeBases.${col.label}`) }}
-
-
-
-
-
refresh());
diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue
new file mode 100644
index 000000000..028246aeb
--- /dev/null
+++ b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+ {{ t(`params.${tag.label}`) }}:
+ {{ formatFn(tag.value) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ params:
+ from: From
+ to: To
+ company: Company
+ country: Country
+ clientId: Client Id
+ clientSocialName: Client
+ amount: Amount
+ comercialName: Comercial
+es:
+ params:
+ from: Desde
+ to: Hasta
+ company: Empresa
+ country: País
+ clientId: Id cliente
+ clientSocialName: Cliente
+ amount: Importe
+ comercialName: Comercial
+ Date is required: La fecha es requerida
+
+
diff --git a/src/pages/Login/LoginMain.vue b/src/pages/Login/LoginMain.vue
index 2e4fd91ca..e2ccdac16 100644
--- a/src/pages/Login/LoginMain.vue
+++ b/src/pages/Login/LoginMain.vue
@@ -3,12 +3,13 @@ import { ref } from 'vue';
import { Notify, useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
-import axios from 'axios';
import { useSession } from 'src/composables/useSession';
import { useLogin } from 'src/composables/useLogin';
import VnLogo from 'components/ui/VnLogo.vue';
+import VnInput from 'src/components/common/VnInput.vue';
+import axios from 'axios';
const quasar = useQuasar();
const session = useSession();
@@ -68,13 +69,14 @@ async function onSubmit() {
-
-
{{ t('twoFactor.insert') }}
-
-
+
+import LeftMenu from 'components/LeftMenu.vue';
+import { useStateStore } from 'stores/useStateStore';
+import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
+import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+
+const stateStore = useStateStore();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue
new file mode 100644
index 000000000..c325a9b05
--- /dev/null
+++ b/src/pages/Order/Card/OrderCatalogFilter.vue
@@ -0,0 +1,471 @@
+
+
+
+
+
+
+
+ {{ t(selectedCategory?.name || '') }}
+
+
+ {{ t(selectedType?.name || '') }}
+
+
+ {{ t(`params.${tag.label}`) }}:
+ {{ formatFn(tag.value) }}
+
+
+
+
+
+
+ {{ JSON.parse(chip).tagSelection?.name }}:
+ {{
+ (JSON.parse(chip).values || [])
+ .map((item) => item.value)
+ .join(' | ')
+ }}
+
+
+
+
+
+
+
+
+
+
+ {{ t(category.name) }}
+
+
+
+
+
+
+ {
+ selectedTypeFk = value;
+ searchFn();
+ }
+ "
+ >
+
+
+
+ {{ opt.name }}
+
+ {{ opt.categoryName }}
+
+
+
+
+
+
+
+
+
+
+ onOrderChange(value, params, searchFn)
+ "
+ />
+
+
+
+
+ onOrderFieldChange(value, params, searchFn)
+ "
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+ (tagOptions = data)"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ params:
+ type: Type
+ orderBy: Order By
+ tag: Tag
+ value: Value
+ order: Order
+es:
+ params:
+ type: Tipo
+ orderBy: Ordenar por
+ tag: Etiqueta
+ value: Valor
+ order: Orden
+ Plant: Planta
+ Flower: Flor
+ Handmade: Confección
+ Green: Verde
+ Accessories: Complemento
+ Fruit: Fruta
+
diff --git a/src/pages/Order/Card/OrderCatalogItem.vue b/src/pages/Order/Card/OrderCatalogItem.vue
new file mode 100644
index 000000000..140a4c349
--- /dev/null
+++ b/src/pages/Order/Card/OrderCatalogItem.vue
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
{{ item.name }}
+
{{ item.subName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+es:
+ to: to
+ price-kg: Precio por Kg
+en:
+ to: hasta
+ price-kg: Price per Kg
+
diff --git a/src/pages/Order/Card/OrderCatalogItemDialog.vue b/src/pages/Order/Card/OrderCatalogItemDialog.vue
new file mode 100644
index 000000000..d5464ed1a
--- /dev/null
+++ b/src/pages/Order/Card/OrderCatalogItemDialog.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+ {{ item.warehouse }}
+ |
+
+ {
+ item.quantity += item.grouping;
+ }
+ "
+ >
+ {{ item.grouping }}
+
+ x {{ toCurrency(item.price) }}
+ |
+
+
+ |
+
+
+
+
+
+ {{ t('globals.add') }}
+
+
+
+
+
+
+
diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue
new file mode 100644
index 000000000..1c770194a
--- /dev/null
+++ b/src/pages/Order/Card/OrderDescriptor.vue
@@ -0,0 +1,139 @@
+
+
+
+ (total = response)"
+ auto-load
+ />
+
+
+
+
+
+
+
+
+
+ {{ entity?.client?.salesPersonUser?.name || '-' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('order.summary.orderTicketList') }}
+
+
+ {{ t('claim.card.customerSummary') }}
+
+
+
+
+
diff --git a/src/pages/Order/Card/OrderDescriptorMenu.vue b/src/pages/Order/Card/OrderDescriptorMenu.vue
new file mode 100644
index 000000000..2e36aa3c5
--- /dev/null
+++ b/src/pages/Order/Card/OrderDescriptorMenu.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ {{ t('deleteOrder') }}
+
+
+
+
+en:
+ deleteOrder: Delete order
+ confirmDeletion: Confirm deletion
+ confirmDeletionMessage: Are you sure you want to delete this order?
+
+es:
+ deleteOrder: Eliminar pedido
+ confirmDeletion: Confirmar eliminación
+ confirmDeletionMessage: Seguro que quieres eliminar este pedido?
+
+
diff --git a/src/pages/Order/Card/OrderFilter.vue b/src/pages/Order/Card/OrderFilter.vue
new file mode 100644
index 000000000..b49f0b115
--- /dev/null
+++ b/src/pages/Order/Card/OrderFilter.vue
@@ -0,0 +1,265 @@
+
+
+
+ (agencyList = data)"
+ />
+ (salesPersonList = data)"
+ :params="{ departmentCodes: ['VT'] }"
+ auto-load
+ />
+ (sourceList = data)"
+ auto-load
+ />
+
+
+
+ {{ t(`params.${tag.label}`) }}:
+ {{ formatFn(tag.value) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ opt.name }}
+
+ {{ opt.nickname }},{{ opt.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ params:
+ search: Includes
+ clientFk: Client
+ agencyModeFk: Agency
+ salesPersonFk: Sales Person
+ from: From
+ to: To
+ orderFk: Order
+ sourceApp: Application
+ myTeam: My Team
+ isConfirmed: Is Confirmed
+ showEmpty: Show Empty
+ customerId: Customer ID
+ agency: Agency
+ salesPerson: Sales Person
+ fromLanded: From Landed
+ toLanded: To Landed
+ orderId: Order ID
+ application: Application
+ myTeam: My Team
+ isConfirmed: Order Confirmed
+ showEmpty: Show Empty
+es:
+ params:
+ search: Búsqueda
+ clientFk: Cliente
+ agencyModeFk: Agencia
+ salesPersonFk: Comercial
+ from: Desde
+ to: Hasta
+ orderFk: Cesta
+ sourceApp: Aplicación
+ myTeam: Mi Equipo
+ isConfirmed: Confirmado
+ showEmpty: Mostrar vacías
+ customerId: ID Cliente
+ agency: Agencia
+ salesPerson: Comercial
+ fromLanded: Desde F. entrega
+ toLanded: Hasta F. entrega
+ orderId: ID Cesta
+ application: Aplicación
+ myTeam: Mi Equipo
+ isConfirmed: Confirmado
+ showEmpty: Mostrar vacías
+
diff --git a/src/pages/Order/Card/OrderForm.vue b/src/pages/Order/Card/OrderForm.vue
new file mode 100644
index 000000000..42aee7640
--- /dev/null
+++ b/src/pages/Order/Card/OrderForm.vue
@@ -0,0 +1,208 @@
+
+
+
+ (clientList = data)"
+ :filter="{ fields: ['id', 'name', 'defaultAddressFk'] }"
+ auto-load
+ />
+
+
+
+
+
+
+ fetchAddressList(client.defaultAddressFk)
+ "
+ >
+
+
+
+
+ {{ `${scope.opt.id}: ${scope.opt.name}` }}
+
+
+
+
+
+
+
+ fetchAgencyList(data.landed, data.addressFk)
+ "
+ >
+
+
+
+
+ {{
+ `${scope.opt.nickname}: ${scope.opt.street},${scope.opt.city}`
+ }}
+
+
+
+
+
+
+
+
+
+ fetchAgencyList(data.landed, data.addressFk)
+ "
+ />
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Order/Card/OrderSearchbar.vue b/src/pages/Order/Card/OrderSearchbar.vue
new file mode 100644
index 000000000..a768768a5
--- /dev/null
+++ b/src/pages/Order/Card/OrderSearchbar.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+es:
+ Search order: Buscar orden
+ You can search orders by reference: Puedes buscar por referencia de la orden
+
diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue
new file mode 100644
index 000000000..9b26891a1
--- /dev/null
+++ b/src/pages/Order/Card/OrderSummary.vue
@@ -0,0 +1,255 @@
+
+
+
+
+
+
+
+
+
+
+ {{ t('order.summary.basket') }} #{{ entity?.id }} -
+ {{ entity?.client?.name }} ({{ entity?.clientFk }})
+
+
+
+
+
+
+
+ {{ dashIfEmpty(entity?.address?.nickname) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dashIfEmpty(entity?.address?.phone) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ entity?.note }}
+
+
+
+
+
+ {{ t('order.summary.subtotal') }}
+
+
+ {{
+ toCurrency(entity?.subTotal)
+ }}
+
+
+
+
+ {{ t('order.summary.vat') }}
+
+
+ {{ toCurrency(entity?.VAT) }}
+
+
+
+
+ {{ t('order.summary.total') }}
+
+
+ {{ toCurrency(entity?.total) }}
+
+
+
+
+
+
+
+
+ {{ t('order.summary.item') }}
+ {{ t('order.summary.description') }}
+ {{ t('order.summary.quantity') }}
+ {{ t('order.summary.price') }}
+ {{ t('order.summary.amount') }}
+
+
+
+
+
+ {{ props.row.item?.id }}
+
+
+
+ {{ props.row.item.name }}
+
+ {{ props.row.item.subName }}
+
+
+
+
+
+ {{ props.row.quantity }}
+
+
+ {{ props.row.price }}
+
+
+ {{
+ toCurrency(props.row?.quantity * props.row?.price)
+ }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Order/Card/OrderSummaryDialog.vue b/src/pages/Order/Card/OrderSummaryDialog.vue
new file mode 100644
index 000000000..ebe891f4a
--- /dev/null
+++ b/src/pages/Order/Card/OrderSummaryDialog.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Order/OrderCatalog.vue b/src/pages/Order/OrderCatalog.vue
new file mode 100644
index 000000000..55f5e7da1
--- /dev/null
+++ b/src/pages/Order/OrderCatalog.vue
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+ {{ t('globals.collapseMenu') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('globals.noResults') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Order/OrderLines.vue b/src/pages/Order/OrderLines.vue
new file mode 100644
index 000000000..0dce70831
--- /dev/null
+++ b/src/pages/Order/OrderLines.vue
@@ -0,0 +1,295 @@
+
+
+
+ (order = data)"
+ auto-load
+ />
+ (orderSummary.total = data)"
+ auto-load
+ />
+ (orderSummary.vat = data)"
+ auto-load
+ />
+
+
+
+ {{ t('globals.noResults') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row?.item?.name }}
+
+
+ {{ t('ID') }}: {{ row.id }}
+
+
+
+
+
+
+ {{ row.item.subName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('confirm') }}
+
+
+
+
+
+
+
+en:
+ summary: Summary
+ subtotal: Subtotal
+ VAT: VAT
+ total: Total
+ item: Item
+ warehouse: Warehouse
+ shipped: Shipped
+ quantity: Quantity
+ price: Price
+ amount: Amount
+ remove: Remove
+ confirmDeletion: Confirm deletion,
+ confirmDeletionMessage: Are you sure you want to delete this item?
+ confirm: Confirm
+es:
+ summary: Resumen
+ subtotal: Subtotal
+ VAT: IVA
+ total: Total
+ item: Artículo
+ warehouse: Almacén
+ shipped: F. envío
+ quantity: Cantidad
+ price: Precio
+ amount: Importe
+ remove: Eliminar
+ confirmDeletion: Confirmar eliminación,
+ confirmDeletionMessage: Seguro que quieres eliminar este artículo?
+ confirm: Confirmar
+
diff --git a/src/pages/Order/OrderList.vue b/src/pages/Order/OrderList.vue
new file mode 100644
index 000000000..362a68b4d
--- /dev/null
+++ b/src/pages/Order/OrderList.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('globals.collapseMenu') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row?.name || '-' }}
+
+
+
+
+
+
+
+ {{ row?.clientName || '-' }}
+
+
+
+
+
+
+
+
+
+ {{ toDate(row?.landed) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('order.list.newOrder') }}
+
+
+
+
+
+
+
diff --git a/src/pages/Order/OrderMain.vue b/src/pages/Order/OrderMain.vue
new file mode 100644
index 000000000..66ce78f23
--- /dev/null
+++ b/src/pages/Order/OrderMain.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Order/OrderVolume.vue b/src/pages/Order/OrderVolume.vue
new file mode 100644
index 000000000..4f4c269f6
--- /dev/null
+++ b/src/pages/Order/OrderVolume.vue
@@ -0,0 +1,161 @@
+
+
+
+ (volumeSummary = data)"
+ auto-load
+ />
+
+
+
+ {{ t('globals.noResults') }}
+
+
+
+
+
+
+
loadVolumes(data)"
+ >
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.item.subName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ summary: Summary
+ total: Total
+ boxes: Boxes
+ item: Item
+ subName: Subname
+ quantity: Quantity
+ volume: m³ per quantity
+es:
+ summary: Resumen
+ total: Total
+ boxes: Cajas
+ item: Artículo
+ subName: Subname
+ quantity: Cantidad
+ volume: m³ por cantidad
+
diff --git a/src/pages/Route/Cmr/CmrFilter.vue b/src/pages/Route/Cmr/CmrFilter.vue
index bab300672..a5bf5513b 100644
--- a/src/pages/Route/Cmr/CmrFilter.vue
+++ b/src/pages/Route/Cmr/CmrFilter.vue
@@ -1,9 +1,11 @@
-
+
+
+
-
-
-
-
-
+
+
diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue
index ad4659b11..3bc5f0584 100644
--- a/src/pages/Travel/Card/TravelSummary.vue
+++ b/src/pages/Travel/Card/TravelSummary.vue
@@ -2,15 +2,17 @@
import { onMounted, ref, computed, onUpdated } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
+
+import { QCheckbox, QIcon } from 'quasar';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
-import { getUrl } from 'src/composables/getUrl';
-import { toDate } from 'src/filters';
-import travelService from 'src/services/travel.service';
-import { QCheckbox, QIcon } from 'quasar';
-import { toCurrency } from 'filters/index';
import VnRow from 'components/ui/VnRow.vue';
+import travelService from 'src/services/travel.service';
+import { toDate, toCurrency } from 'src/filters';
+import { getUrl } from 'src/composables/getUrl';
+import axios from 'axios';
+
onUpdated(() => summaryRef.value.fetch());
const route = useRoute();
@@ -40,9 +42,17 @@ const cloneTravel = () => {
redirectToCreateView(stringifiedTravelData);
};
+const cloneTravelWithEntries = () => {
+ try {
+ axios.post(`Travels/${$props.id}/cloneWithEntries`);
+ } catch (err) {
+ console.err('Error cloning travel with entries');
+ }
+};
+
const headerMenuOptions = [
{ name: t('travel.summary.cloneShipping'), action: cloneTravel },
- { name: t('travel.summary.CloneTravelAndEntries'), action: null },
+ { name: t('travel.summary.CloneTravelAndEntries'), action: cloneTravelWithEntries },
{ name: t('travel.summary.AddEntry'), action: null },
];
@@ -185,7 +195,7 @@ const openEntryDescriptor = () => {};
>
diff --git a/src/pages/Travel/ExtraCommunity.vue b/src/pages/Travel/ExtraCommunity.vue
index cef3ed998..62292f115 100644
--- a/src/pages/Travel/ExtraCommunity.vue
+++ b/src/pages/Travel/ExtraCommunity.vue
@@ -8,6 +8,7 @@ import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorP
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import ExtraCommunityFilter from './ExtraCommunityFilter.vue';
+import VnInput from 'src/components/common/VnInput.vue';
import { useStateStore } from 'stores/useStateStore';
import { toCurrency } from 'src/filters';
@@ -102,111 +103,109 @@ const tableColumnComponents = {
},
};
-const columns = computed(() => {
- return [
- {
- label: 'id',
- field: 'id',
- name: 'id',
- align: 'left',
- showValue: true,
- },
- {
- label: t('supplier.pageTitles.supplier'),
- field: 'cargoSupplierNickname',
- name: 'cargoSupplierNickname',
- align: 'left',
- showValue: true,
- },
- {
- label: t('globals.agency'),
- field: 'agencyModeName',
- name: 'agencyModeName',
- align: 'left',
- showValue: true,
- },
- {
- label: t('globals.amount'),
- name: 'invoiceAmount',
- field: 'entries',
- align: 'left',
- showValue: true,
- format: (value) =>
- toCurrency(
- value
- ? value.reduce((sum, entry) => {
- return sum + (entry.invoiceAmount || 0);
- }, 0)
- : 0
- ),
- },
- {
- label: t('globals.reference'),
- field: 'ref',
- name: 'ref',
- align: 'left',
- showValue: false,
- },
- {
- label: t('globals.packages'),
- field: 'stickers',
- name: 'stickers',
- align: 'left',
- showValue: true,
- },
- {
- label: t('kg'),
- field: 'kg',
- name: 'kg',
- align: 'left',
- showValue: true,
- },
- {
- label: t('physicKg'),
- field: 'loadedKg',
- name: 'loadedKg',
- align: 'left',
- showValue: true,
- },
- {
- label: 'KG Vol.',
- field: 'volumeKg',
- name: 'volumeKg',
- align: 'left',
- showValue: true,
- },
- {
- label: t('globals.wareHouseOut'),
- field: 'warehouseOutName',
- name: 'warehouseOutName',
- align: 'left',
- showValue: true,
- },
- {
- label: t('shipped'),
- field: 'shipped',
- name: 'shipped',
- align: 'left',
- format: (value) => toDate(value.substring(0, 10)),
- showValue: true,
- },
- {
- label: t('globals.wareHouseIn'),
- field: 'warehouseInName',
- name: 'warehouseInName',
- align: 'left',
- showValue: true,
- },
- {
- label: t('landed'),
- field: 'landed',
- name: 'landed',
- align: 'left',
- format: (value) => toDate(value.substring(0, 10)),
- showValue: true,
- },
- ];
-});
+const columns = computed(() => [
+ {
+ label: 'id',
+ field: 'id',
+ name: 'id',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('supplier.pageTitles.supplier'),
+ field: 'cargoSupplierNickname',
+ name: 'cargoSupplierNickname',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('globals.agency'),
+ field: 'agencyModeName',
+ name: 'agencyModeName',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('globals.amount'),
+ name: 'invoiceAmount',
+ field: 'entries',
+ align: 'left',
+ showValue: true,
+ format: (value) =>
+ toCurrency(
+ value
+ ? value.reduce((sum, entry) => {
+ return sum + (entry.invoiceAmount || 0);
+ }, 0)
+ : 0
+ ),
+ },
+ {
+ label: t('globals.reference'),
+ field: 'ref',
+ name: 'ref',
+ align: 'left',
+ showValue: false,
+ },
+ {
+ label: t('globals.packages'),
+ field: 'stickers',
+ name: 'stickers',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('kg'),
+ field: 'kg',
+ name: 'kg',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('physicKg'),
+ field: 'loadedKg',
+ name: 'loadedKg',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: 'KG Vol.',
+ field: 'volumeKg',
+ name: 'volumeKg',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('globals.wareHouseOut'),
+ field: 'warehouseOutName',
+ name: 'warehouseOutName',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('shipped'),
+ field: 'shipped',
+ name: 'shipped',
+ align: 'left',
+ format: (value) => toDate(value.substring(0, 10)),
+ showValue: true,
+ },
+ {
+ label: t('globals.wareHouseIn'),
+ field: 'warehouseInName',
+ name: 'warehouseInName',
+ align: 'left',
+ showValue: true,
+ },
+ {
+ label: t('landed'),
+ field: 'landed',
+ name: 'landed',
+ align: 'left',
+ format: (value) => toDate(value.substring(0, 10)),
+ showValue: true,
+ },
+]);
async function getData() {
await arrayData.fetch({ append: false });
@@ -314,7 +313,7 @@ onMounted(async () => {
label-set="Save"
label-cancel="Close"
>
- {
diff --git a/src/pages/Travel/TravelFilter.vue b/src/pages/Travel/TravelFilter.vue
index 2c2d80488..52a755c34 100644
--- a/src/pages/Travel/TravelFilter.vue
+++ b/src/pages/Travel/TravelFilter.vue
@@ -1,9 +1,12 @@
+
+
+ onFetchWorkerConfig(data)"
+ :filter="workerConfigFilter"
+ auto-load
+ />
+ (postcodesOptions = data)"
+ auto-load
+ />
+ (provincesOptions = data)"
+ :filter="provincesFilter"
+ auto-load
+ />
+ (townsOptions = data)"
+ :filter="townsFilter"
+ auto-load
+ />
+ (companiesOptions = data)"
+ auto-load
+ />
+ (workersOptions = data)"
+ auto-load
+ />
+ (payMethodsOptions = data)"
+ auto-load
+ />
+ (bankEntitiesOptions = data)"
+ auto-load
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.opt.code }}
+ {{ scope.opt.code }} -
+ {{ scope.opt.town.name }} ({{
+ scope.opt.town.province.name
+ }},
+ {{
+ scope.opt.town.province.country.country
+ }})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.opt.name }}
+ {{ scope.opt.name }},
+ {{ scope.opt.province.name }} ({{
+ scope.opt.province.country.country
+ }})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.opt.name }}
+ {{ scope.opt.nickname }},
+ {{ scope.opt.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.opt.bic }}
+ {{ scope.opt.name }}
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Worker/WorkerDepartment.vue b/src/pages/Worker/WorkerDepartment.vue
new file mode 100644
index 000000000..3c0e5fdd0
--- /dev/null
+++ b/src/pages/Worker/WorkerDepartment.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+es:
+ Search worker: Buscar trabajador
+ You can search by worker id or name: Puedes buscar por id o nombre del trabajador
+
diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue
index 079905c4f..680a17937 100644
--- a/src/pages/Worker/WorkerFilter.vue
+++ b/src/pages/Worker/WorkerFilter.vue
@@ -1,8 +1,10 @@
@@ -101,6 +105,12 @@ function viewSummary(id) {
+
+
+
+ {{ t('worker.list.newWorker') }}
+
+
diff --git a/src/router/modules/Supplier.js b/src/router/modules/Supplier.js
index 198a9581e..6ce1a7688 100644
--- a/src/router/modules/Supplier.js
+++ b/src/router/modules/Supplier.js
@@ -11,7 +11,17 @@ export default {
redirect: { name: 'SupplierMain' },
menus: {
main: ['SupplierList'],
- card: [],
+ card: [
+ 'SupplierBasicData',
+ 'SupplierFiscalData',
+ 'SupplierBillingData',
+ 'SupplierLog',
+ 'SupplierAccounts',
+ 'SupplierContacts',
+ 'SupplierAddresses',
+ 'SupplierConsumption',
+ 'SupplierAgencyTerm',
+ ],
},
children: [
{
@@ -55,6 +65,95 @@ export default {
component: () =>
import('src/pages/Supplier/Card/SupplierSummary.vue'),
},
+ {
+ path: 'basic-data',
+ name: 'SupplierBasicData',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierBasicData.vue'),
+ },
+ {
+ path: 'fiscal-data',
+ name: 'SupplierFiscalData',
+ meta: {
+ title: 'fiscalData',
+ icon: 'vn:dfiscales',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierFiscalData.vue'),
+ },
+ {
+ path: 'billing-data',
+ name: 'SupplierBillingData',
+ meta: {
+ title: 'billingData',
+ icon: 'vn:payment',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierBillingData.vue'),
+ },
+ {
+ path: 'log',
+ name: 'SupplierLog',
+ meta: {
+ title: 'log',
+ icon: 'vn:History',
+ },
+ component: () => import('src/pages/Supplier/Card/SupplierLog.vue'),
+ },
+ {
+ path: 'account',
+ name: 'SupplierAccounts',
+ meta: {
+ title: 'accounts',
+ icon: 'vn:account',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierAccounts.vue'),
+ },
+ {
+ path: 'contact',
+ name: 'SupplierContacts',
+ meta: {
+ title: 'contacts',
+ icon: 'contact_phone',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierContacts.vue'),
+ },
+ {
+ path: 'address',
+ name: 'SupplierAddresses',
+ meta: {
+ title: 'addresses',
+ icon: 'vn:delivery',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierAddresses.vue'),
+ },
+ {
+ path: 'consumption',
+ name: 'SupplierConsumption',
+ meta: {
+ title: 'consumption',
+ icon: 'show_chart',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierConsumption.vue'),
+ },
+ {
+ path: 'agency-term',
+ name: 'SupplierAgencyTerm',
+ meta: {
+ title: 'agencyTerm',
+ icon: 'vn:agency-term',
+ },
+ component: () =>
+ import('src/pages/Supplier/Card/SupplierAgencyTerm.vue'),
+ },
],
},
],
diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js
index b8be4f3ac..3c8445f42 100644
--- a/src/router/modules/customer.js
+++ b/src/router/modules/customer.js
@@ -10,8 +10,29 @@ export default {
component: RouterView,
redirect: { name: 'CustomerMain' },
menus: {
- main: ['CustomerList', 'CustomerPayments'],
- card: ['CustomerBasicData', 'CustomerSms'],
+ main: [
+ 'CustomerList',
+ 'CustomerPayments',
+ 'CustomerExtendedList',
+ 'CustomerNotifications',
+ 'CustomerDefaulter',
+ ],
+ card: [
+ 'CustomerBasicData',
+ 'CustomerFiscalData',
+ 'CustomerBillingData',
+ 'CustomerConsignees',
+ 'CustomerNotes',
+ 'CustomerCredits',
+ 'CustomerGreuges',
+ 'CustomerBalance',
+ 'CustomerRecoveries',
+ 'CustomerWebAccess',
+ 'CustomerLog',
+ 'CustomerSms',
+ 'CustomerCreditManagement',
+ 'CustomerOthers',
+ ],
},
children: [
{
@@ -29,6 +50,14 @@ export default {
},
component: () => import('src/pages/Customer/CustomerList.vue'),
},
+ {
+ path: 'create',
+ name: 'CustomerCreate',
+ meta: {
+ title: 'create',
+ },
+ component: () => import('src/pages/Customer/CustomerCreate.vue'),
+ },
{
path: 'payments',
name: 'CustomerPayments',
@@ -36,7 +65,42 @@ export default {
title: 'webPayments',
icon: 'vn:onlinepayment',
},
- component: () => import('src/pages/Customer/CustomerPayments.vue'),
+ component: () =>
+ import('src/pages/Customer/Payments/CustomerPayments.vue'),
+ },
+ {
+ path: 'extendedList',
+ name: 'CustomerExtendedList',
+ meta: {
+ title: 'extendedList',
+ icon: 'vn:client',
+ },
+ component: () =>
+ import(
+ 'src/pages/Customer/ExtendedList/CustomerExtendedList.vue'
+ ),
+ },
+ {
+ path: 'notifications',
+ name: 'CustomerNotifications',
+ meta: {
+ title: 'notifications',
+ icon: 'notifications',
+ },
+ component: () =>
+ import(
+ 'src/pages/Customer/Notifications/CustomerNotifications.vue'
+ ),
+ },
+ {
+ path: 'defaulter',
+ name: 'CustomerDefaulter',
+ meta: {
+ title: 'defaulter',
+ icon: 'vn:risk',
+ },
+ component: () =>
+ import('src/pages/Customer/Defaulter/CustomerDefaulter.vue'),
},
],
},
@@ -66,6 +130,104 @@ export default {
component: () =>
import('src/pages/Customer/Card/CustomerBasicData.vue'),
},
+ {
+ path: 'fiscal-data',
+ name: 'CustomerFiscalData',
+ meta: {
+ title: 'fiscalData',
+ icon: 'vn:dfiscales',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerFiscalData.vue'),
+ },
+ {
+ path: 'billing-data',
+ name: 'CustomerBillingData',
+ meta: {
+ title: 'billingData',
+ icon: 'vn:payment',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerBillingData.vue'),
+ },
+ {
+ path: 'consignees',
+ name: 'CustomerConsignees',
+ meta: {
+ title: 'consignees',
+ icon: 'vn:delivery',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerConsignees.vue'),
+ },
+ {
+ path: 'notes',
+ name: 'CustomerNotes',
+ meta: {
+ title: 'notes',
+ icon: 'vn:notes',
+ },
+ component: () => import('src/pages/Customer/Card/CustomerNotes.vue'),
+ },
+ {
+ path: 'credits',
+ name: 'CustomerCredits',
+ meta: {
+ title: 'credits',
+ icon: 'vn:credit',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerCredits.vue'),
+ },
+ {
+ path: 'greuges',
+ name: 'CustomerGreuges',
+ meta: {
+ title: 'greuges',
+ icon: 'vn:greuge',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerGreuges.vue'),
+ },
+ {
+ path: 'balance',
+ name: 'CustomerBalance',
+ meta: {
+ title: 'balance',
+ icon: 'vn:invoice',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerBalance.vue'),
+ },
+ {
+ path: 'recoveries',
+ name: 'CustomerRecoveries',
+ meta: {
+ title: 'recoveries',
+ icon: 'vn:recovery',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerRecoveries.vue'),
+ },
+ {
+ path: 'web-access',
+ name: 'CustomerWebAccess',
+ meta: {
+ title: 'webAccess',
+ icon: 'vn:web',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerWebAccess.vue'),
+ },
+ {
+ path: 'log',
+ name: 'CustomerLog',
+ meta: {
+ title: 'log',
+ icon: 'vn:History',
+ },
+ component: () => import('src/pages/Customer/Card/CustomerLog.vue'),
+ },
{
path: 'sms',
name: 'CustomerSms',
@@ -75,6 +237,25 @@ export default {
},
component: () => import('src/pages/Customer/Card/CustomerSms.vue'),
},
+ {
+ path: 'credit-management',
+ name: 'CustomerCreditManagement',
+ meta: {
+ title: 'creditManagement',
+ icon: 'paid',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerCreditManagement.vue'),
+ },
+ {
+ path: 'others',
+ name: 'CustomerOthers',
+ meta: {
+ title: 'others',
+ icon: 'pending',
+ },
+ component: () => import('src/pages/Customer/Card/CustomerOthers.vue'),
+ },
],
},
],
diff --git a/src/router/modules/department.js b/src/router/modules/department.js
new file mode 100644
index 000000000..aaffc3460
--- /dev/null
+++ b/src/router/modules/department.js
@@ -0,0 +1,46 @@
+import { RouterView } from 'vue-router';
+
+export default {
+ path: '/department',
+ name: 'Department',
+ meta: {
+ title: 'department',
+ icon: 'vn:greuge',
+ },
+ component: RouterView,
+ redirect: { name: 'DepartmentCard' },
+ menus: {
+ main: [],
+ card: ['DepartmentBasicData'],
+ },
+ children: [
+ {
+ name: 'DepartmentCard',
+ path: 'department/:id',
+ component: () => import('src/pages/Department/Card/DepartmentCard.vue'),
+ redirect: { name: 'DepartmentSummary' },
+ children: [
+ {
+ name: 'DepartmentSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () =>
+ import('src/pages/Department/Card/DepartmentSummary.vue'),
+ },
+ {
+ name: 'DepartmentBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () =>
+ import('src/pages/Department/Card/DepartmentBasicData.vue'),
+ },
+ ],
+ },
+ ],
+};
diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js
new file mode 100644
index 000000000..6a1cd6173
--- /dev/null
+++ b/src/router/modules/entry.js
@@ -0,0 +1,61 @@
+import { RouterView } from 'vue-router';
+
+export default {
+ path: '/entry',
+ name: 'Entry',
+ meta: {
+ title: 'entries',
+ icon: 'vn:entry',
+ },
+ component: RouterView,
+ redirect: { name: 'EntryMain' },
+ menus: {
+ main: ['EntryList'],
+ card: [],
+ },
+ children: [
+ {
+ path: '',
+ name: 'EntryMain',
+ component: () => import('src/pages/Entry/EntryMain.vue'),
+ redirect: { name: 'EntryList' },
+ children: [
+ {
+ path: 'list',
+ name: 'EntryList',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ component: () => import('src/pages/Entry/EntryList.vue'),
+ },
+ {
+ path: 'create',
+ name: 'EntryCreate',
+ meta: {
+ title: 'create',
+ },
+ component: () => import('src/pages/Entry/EntryCreate.vue'),
+ },
+ ],
+ },
+ // {
+ // name: 'EntryCard',
+ // path: ':id',
+ // component: () => import('src/pages/Entry/Card/EntryCard.vue'),
+ // redirect: { name: 'EntrySummary' },
+ // children: [
+ // {
+ // name: 'EntrySummary',
+ // path: 'summary',
+ // meta: {
+ // title: 'summary',
+ // icon: 'launch',
+ // },
+ // component: () =>
+ // import('src/pages/Entry/Card/EntrySummary.vue'),
+ // },
+ // ],
+ // },
+ ],
+};
diff --git a/src/router/modules/index.js b/src/router/modules/index.js
index 0ab5bf2b2..cc5034959 100644
--- a/src/router/modules/index.js
+++ b/src/router/modules/index.js
@@ -9,6 +9,9 @@ import Wagon from './wagon';
import Route from './route';
import Supplier from './Supplier';
import Travel from './travel';
+import Order from './order';
+import Department from './department';
+import Entry from './entry';
export default [
Customer,
@@ -21,5 +24,8 @@ export default [
Route,
Supplier,
Travel,
+ Order,
invoiceIn,
+ Department,
+ Entry,
];
diff --git a/src/router/modules/order.js b/src/router/modules/order.js
new file mode 100644
index 000000000..4599394cd
--- /dev/null
+++ b/src/router/modules/order.js
@@ -0,0 +1,96 @@
+import { RouterView } from 'vue-router';
+
+export default {
+ path: '/order',
+ name: 'Order',
+ meta: {
+ title: 'order',
+ icon: 'vn:basket',
+ },
+ component: RouterView,
+ redirect: { name: 'OrderMain' },
+ menus: {
+ main: ['OrderList'],
+ card: ['OrderBasicData', 'OrderCatalog', 'OrderVolume', 'OrderLines'],
+ },
+ children: [
+ {
+ path: '',
+ name: 'OrderMain',
+ component: () => import('src/pages/Order/OrderMain.vue'),
+ redirect: { name: 'OrderList' },
+ children: [
+ {
+ path: 'list',
+ name: 'OrderList',
+ meta: {
+ title: 'orderList',
+ icon: 'view_list',
+ },
+ component: () => import('src/pages/Order/OrderList.vue'),
+ },
+ {
+ path: 'create',
+ name: 'OrderCreate',
+ meta: {
+ title: 'create',
+ },
+ component: () => import('src/pages/Order/Card/OrderForm.vue'),
+ },
+ ],
+ },
+ {
+ name: 'OrderCard',
+ path: ':id',
+ component: () => import('src/pages/Order/Card/OrderCard.vue'),
+ redirect: { name: 'OrderSummary' },
+ children: [
+ {
+ name: 'OrderSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Order/Card/OrderSummary.vue'),
+ },
+ {
+ name: 'OrderBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Order/Card/OrderForm.vue'),
+ },
+ {
+ name: 'OrderCatalog',
+ path: 'catalog',
+ meta: {
+ title: 'catalog',
+ icon: 'vn:basket',
+ },
+ component: () => import('src/pages/Order/OrderCatalog.vue'),
+ },
+ {
+ name: 'OrderVolume',
+ path: 'volume',
+ meta: {
+ title: 'volume',
+ icon: 'vn:volume',
+ },
+ component: () => import('src/pages/Order/OrderVolume.vue'),
+ },
+ {
+ name: 'OrderLines',
+ path: 'line',
+ meta: {
+ title: 'lines',
+ icon: 'vn:lines',
+ },
+ component: () => import('src/pages/Order/OrderLines.vue'),
+ },
+ ],
+ },
+ ],
+};
diff --git a/src/router/modules/travel.js b/src/router/modules/travel.js
index bd0a2067d..43c444ae2 100644
--- a/src/router/modules/travel.js
+++ b/src/router/modules/travel.js
@@ -11,7 +11,7 @@ export default {
redirect: { name: 'TravelMain' },
menus: {
main: ['TravelList', 'ExtraCommunity'],
- card: [],
+ card: ['TravelBasicData', 'TravelHistory', 'TravelThermographs'],
},
children: [
{
@@ -42,7 +42,7 @@ export default {
path: 'create',
name: 'TravelCreate',
meta: {
- title: 'extraCommunity',
+ title: 'travelCreate',
icon: '',
},
component: () => import('src/pages/Travel/TravelCreate.vue'),
@@ -63,6 +63,36 @@ export default {
},
component: () => import('src/pages/Travel/Card/TravelSummary.vue'),
},
+ {
+ name: 'TravelBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ // roles: [],
+ },
+ // component: () => import(),
+ },
+ {
+ name: 'TravelHistory',
+ path: 'history',
+ meta: {
+ title: 'history',
+ icon: 'history',
+ // roles: [],
+ },
+ // component: () => import(),
+ },
+ {
+ name: 'TravelThermographs',
+ path: 'thermographs',
+ meta: {
+ title: 'thermographs',
+ icon: 'vn:thermometer',
+ // roles: [],
+ },
+ // component: () => import(),
+ },
],
},
],
diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js
index e5ee7c1a2..27a6f19a9 100644
--- a/src/router/modules/worker.js
+++ b/src/router/modules/worker.js
@@ -10,8 +10,9 @@ export default {
component: RouterView,
redirect: { name: 'WorkerMain' },
menus: {
- main: ['WorkerList'],
+ main: ['WorkerList', 'WorkerDepartment'],
card: ['WorkerNotificationsManager'],
+ departmentCard: ['BasicData'],
},
children: [
{
@@ -29,6 +30,24 @@ export default {
},
component: () => import('src/pages/Worker/WorkerList.vue'),
},
+ {
+ path: 'department',
+ name: 'WorkerDepartment',
+ meta: {
+ title: 'department',
+ icon: 'vn:greuge',
+ },
+ component: () => import('src/pages/Worker/WorkerDepartment.vue'),
+ },
+ {
+ path: 'create',
+ name: 'WorkerCreate',
+ meta: {
+ title: 'workerCreate',
+ icon: '',
+ },
+ component: () => import('src/pages/Worker/WorkerCreate.vue'),
+ },
],
},
{
diff --git a/src/router/routes.js b/src/router/routes.js
index 550fcf64e..6a2fa6a97 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -8,7 +8,10 @@ import wagon from './modules/wagon';
import supplier from './modules/Supplier';
import route from './modules/route';
import travel from './modules/travel';
+import department from './modules/department';
import shelving from 'src/router/modules/shelving';
+import order from 'src/router/modules/order';
+import entry from 'src/router/modules/entry';
const routes = [
{
@@ -56,9 +59,12 @@ const routes = [
invoiceOut,
invoiceIn,
wagon,
+ order,
route,
supplier,
travel,
+ department,
+ entry,
{
path: '/:catchAll(.*)*',
name: 'NotFound',
diff --git a/src/services/invoiceOut.service.js b/src/services/invoiceOut.service.js
deleted file mode 100644
index 6232f319d..000000000
--- a/src/services/invoiceOut.service.js
+++ /dev/null
@@ -1,49 +0,0 @@
-import axios from 'axios';
-
-const request = async (method, url, params = {}) => {
- try {
- let response;
-
- if (method === 'GET') {
- response = await axios.get(url, { params });
- } else if (method === 'POST') {
- response = await axios.post(url, params);
- }
- return response.data;
- } catch (err) {
- console.error(`Error with ${method} request to ${url}`, err);
- return err.response;
- }
-};
-
-const invoiceOutService = {
- getNegativeBases: async (params) => {
- return await request('GET', 'InvoiceOuts/negativeBases', params);
- },
-
- getNegativeBasesCsv: async (params) => {
- return await request('GET', 'InvoiceOuts/negativeBasesCsv', params);
- },
-
- getInvoiceDate: async (params) => {
- return await request('GET', 'InvoiceOuts/getInvoiceDate', params);
- },
-
- getFindOne: async (params) => {
- return await request('GET', 'InvoiceOutConfigs/findOne', params);
- },
-
- getClientsToInvoice: async (params) => {
- return await request('POST', 'InvoiceOuts/clientsToInvoice', params);
- },
-
- invoiceClient: async (params) => {
- return await request('POST', 'InvoiceOuts/invoiceClient', params);
- },
-
- makePdfAndNotify: async (invoiceId, params) => {
- return await request('POST', `InvoiceOuts/${invoiceId}/makePdfAndNotify`, params);
- },
-};
-
-export default invoiceOutService;
diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js
index 71e4c3537..7151aac5f 100644
--- a/src/stores/invoiceOutGlobal.js
+++ b/src/stores/invoiceOutGlobal.js
@@ -1,8 +1,10 @@
import { defineStore } from 'pinia';
import { useUserConfig } from 'src/composables/useUserConfig';
-import invoiceOutService from 'src/services/invoiceOut.service';
-import useNotify from 'src/composables/useNotify.js';
import { exportFile } from 'quasar';
+import { useArrayData } from 'composables/useArrayData';
+import useNotify from 'src/composables/useNotify.js';
+
+import axios from 'axios';
const { notify } = useNotify();
@@ -60,18 +62,29 @@ export const useInvoiceOutGlobalStore = defineStore({
},
async fetchInvoiceOutConfig(companyFk) {
- this.formInitialData.companyFk = companyFk;
- const params = { companyFk: companyFk };
- const { issued } = await invoiceOutService.getInvoiceDate(params);
- const stringDate = issued.substring(0, 10);
- this.minInvoicingDate = stringDate;
- this.formInitialData.invoiceDate = stringDate;
+ try {
+ this.formInitialData.companyFk = companyFk;
+ const params = { companyFk: companyFk };
+
+ const { data } = await axios.get('InvoiceOuts/getInvoiceDate', {
+ params,
+ });
+
+ const stringDate = data.issued.substring(0, 10);
+ this.minInvoicingDate = stringDate;
+ this.formInitialData.invoiceDate = stringDate;
+ } catch (err) {
+ console.error('Error fetching invoice out global initial data');
+ throw new Error();
+ }
},
async fetchParallelism() {
const filter = { fields: ['parallelism'] };
- const { parallelism } = await invoiceOutService.getFindOne(filter);
- this.parallelism = parallelism;
+ const { data } = await axios.get('InvoiceOutConfigs/findOne', {
+ filter,
+ });
+ this.parallelism = data.parallelism;
},
async makeInvoice(formData, clientsToInvoice) {
@@ -90,11 +103,12 @@ export const useInvoiceOutGlobalStore = defineStore({
if (clientsToInvoice == 'all') params.clientId = undefined;
- const addressesResponse = await invoiceOutService.getClientsToInvoice(
+ const addressesResponse = await await axios.post(
+ 'InvoiceOuts/clientsToInvoice',
params
);
- this.addresses = addressesResponse;
+ this.addresses = addressesResponse.data;
if (!this.addresses || !this.addresses.length > 0) {
notify(
@@ -151,31 +165,45 @@ export const useInvoiceOutGlobalStore = defineStore({
},
async invoiceClient(address, formData) {
- if (this.nRequests === this.parallelism || this.isInvoicing) return;
+ try {
+ if (this.nRequests === this.parallelism || this.isInvoicing) return;
- if (this.status === 'stopping') {
- if (this.nRequests) return;
- this.invoicing = false;
- this.status = 'done';
- return;
- }
+ if (this.status === 'stopping') {
+ if (this.nRequests) return;
+ this.invoicing = false;
+ this.status = 'done';
+ return;
+ }
- const params = {
- clientId: address.clientId,
- addressId: address.id,
- invoiceDate: new Date(formData.invoiceDate),
- maxShipped: new Date(formData.maxShipped),
- companyFk: formData.companyFk,
- };
+ const params = {
+ clientId: address.clientId,
+ addressId: address.id,
+ invoiceDate: new Date(formData.invoiceDate),
+ maxShipped: new Date(formData.maxShipped),
+ companyFk: formData.companyFk,
+ };
- this.status = 'invoicing';
- this.invoicing = true;
+ this.status = 'invoicing';
+ this.invoicing = true;
- const invoiceResponse = await invoiceOutService.invoiceClient(params);
+ const invoiceResponse = await axios.post(
+ 'InvoiceOuts/invoiceClient',
+ params
+ );
- if (invoiceResponse.data.error) {
- if (invoiceResponse.status >= 400 && invoiceResponse.status < 500) {
- this.invoiceClientError(address, invoiceResponse);
+ if (invoiceResponse.data) {
+ this.makePdfAndNotify(invoiceResponse.data, address);
+ }
+
+ this.isInvoicing = false;
+ } catch (err) {
+ if (
+ err &&
+ err.response &&
+ err.response.status >= 400 &&
+ err.response.status < 500
+ ) {
+ this.invoiceClientError(address, err.response);
this.addressIndex++;
return;
} else {
@@ -187,11 +215,6 @@ export const useInvoiceOutGlobalStore = defineStore({
);
throw new Error('Critical invoicing error, process stopped');
}
- } else {
- this.isInvoicing = false;
- if (invoiceResponse.data) {
- this.makePdfAndNotify(invoiceResponse.data, address);
- }
}
},
@@ -200,7 +223,7 @@ export const useInvoiceOutGlobalStore = defineStore({
this.nRequests++;
this.totalPdfs++;
const params = { printerFk: this.printer };
- await invoiceOutService.makePdfAndNotify(invoiceId, params);
+ await axios.post(`InvoiceOuts/${invoiceId}/makePdfAndNotify`, params);
this.nPdfs++;
this.nRequests--;
} catch (err) {
@@ -219,14 +242,18 @@ export const useInvoiceOutGlobalStore = defineStore({
throw err;
},
- async getNegativeBasesCsv(from, to, filter = {}) {
+ async getNegativeBasesCsv() {
try {
- const params = { from: from, to: to, filter };
- const CSVResponse = await invoiceOutService.getNegativeBasesCsv(params);
+ const arrayData = useArrayData('InvoiceOutNegative');
+ const params = arrayData.store.currentFilter;
- if (CSVResponse.data && CSVResponse.data.error) throw new Error();
+ const { data } = await axios.get('InvoiceOuts/negativeBasesCsv', {
+ params,
+ });
- const status = exportFile('negativeBases.csv', CSVResponse, {
+ if (data.data && data.data.error) throw new Error();
+
+ const status = exportFile('negativeBases.csv', data, {
encoding: 'windows-1252',
mimeType: 'text/csv;charset=windows-1252;',
});
@@ -236,6 +263,7 @@ export const useInvoiceOutGlobalStore = defineStore({
}
} catch (err) {
notify('invoiceOut.negativeBases.errors.downloadCsvFailed', 'negative');
+ throw new Error();
}
},
diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js
index 5daa618d5..2eda6f686 100644
--- a/src/stores/useNavigationStore.js
+++ b/src/stores/useNavigationStore.js
@@ -14,10 +14,12 @@ export const useNavigationStore = defineStore('navigationStore', () => {
'invoiceIn',
'worker',
'shelving',
+ 'order',
'wagon',
'route',
'supplier',
'travel',
+ 'entry',
];
const pinnedModules = ref([]);
const role = useRole();
diff --git a/test/cypress/integration/vnSearchBar.spec.js b/test/cypress/integration/vnSearchBar.spec.js
new file mode 100644
index 000000000..d6dea0780
--- /dev/null
+++ b/test/cypress/integration/vnSearchBar.spec.js
@@ -0,0 +1,19 @@
+///
+describe('VnSearchBar', () => {
+ beforeEach(() => {
+ cy.login('developer');
+ cy.visit('/');
+ });
+
+ it('should redirect to new customer', () => {
+ cy.visit('#/customer/1112/basic-data')
+ cy.openLeftMenu();
+ cy.get('.q-item > .q-item__label').should('have.text',' #1112')
+ cy.closeLeftMenu();
+ cy.clearSearchbar();
+ cy.writeSearchbar('1{enter}');
+ cy.openLeftMenu();
+ cy.get('.q-item > .q-item__label').should('have.text',' #1')
+ cy.closeLeftMenu();
+ });
+});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index fc3a593ad..7dc6ffab7 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -163,6 +163,23 @@ Cypress.Commands.add('openRightMenu', (element) => {
cy.get('#actions-append').click();
});
+Cypress.Commands.add('openLeftMenu', (element) => {
+ if (element) cy.waitForElement(element);
+ cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();
+});
+Cypress.Commands.add('closeLeftMenu', (element) => {
+ if (element) cy.waitForElement(element);
+ cy.get('.fullscreen').click();
+});
+
+Cypress.Commands.add('clearSearchbar', (element) => {
+ if (element) cy.waitForElement(element);
+ cy.get('#searchbar > form > label > div:nth-child(1) input').clear();
+});
+
+Cypress.Commands.add('writeSearchbar', (value) => {
+ cy.get('#searchbar > form > label > div:nth-child(1) input').type(value);
+});
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
});
diff --git a/test/vitest/__tests__/components/common/VnSearchBar.spec.js b/test/vitest/__tests__/components/common/VnSearchBar.spec.js
new file mode 100644
index 000000000..fd0a026ef
--- /dev/null
+++ b/test/vitest/__tests__/components/common/VnSearchBar.spec.js
@@ -0,0 +1,53 @@
+import { vi, describe, expect, it, beforeAll, beforeEach, afterEach } from 'vitest';
+import { createWrapper, axios } from 'app/test/vitest/helper';
+import VnSearchbar from 'components/ui/VnSearchbar.vue';
+
+
+describe('VnSearchBar', () => {
+ let vm;
+ let wrapper;
+
+ beforeAll(() => {
+ wrapper = createWrapper(VnSearchbar, {
+ propsData: {
+ dataKey: 'CustomerList',
+ label: 'Search customer',
+ info: 'Info customer',
+ },
+ });
+ vm = wrapper.vm;
+ vm.route.matched = [
+ {
+ path: '/',
+ },
+ {
+ path: '/customer',
+ },
+ {
+ path: '/customer/:id',
+ },
+ {
+ path: '/customer/:id/basic-data',
+ },
+ ];
+ });
+
+ afterEach(() => {
+ vi.clearAllMocks();
+ });
+ it('should be defined', async () => {
+ expect(vm.searchText).toBeDefined();
+ expect(vm.searchText).toEqual('');
+ });
+ it('should redirect', async () => {
+ vi.spyOn(vm.router,'push');
+ vm.searchText = '1';
+ await vm.search();
+ expect(vm.router.push).toHaveBeenCalledWith('/customer/1/basic-data');
+ vm.searchText = '1112';
+ expect(vm.searchText).toEqual('1112');
+ vi.spyOn(vm.router,'push');
+ await vm.search();
+ expect(vm.router.push).toHaveBeenCalledWith('/customer/1112/basic-data');
+ });
+});
diff --git a/test/vitest/__tests__/pages/Customer/CustomerPayments.spec.js b/test/vitest/__tests__/pages/Customer/CustomerPayments.spec.js
index 5d096f113..13293f596 100644
--- a/test/vitest/__tests__/pages/Customer/CustomerPayments.spec.js
+++ b/test/vitest/__tests__/pages/Customer/CustomerPayments.spec.js
@@ -1,11 +1,10 @@
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
-import CustomerPayments from 'pages/Customer/CustomerPayments.vue';
+import CustomerPayments from 'src/pages/Customer/Payments/CustomerPayments.vue';
describe('CustomerPayments', () => {
let vm;
-
beforeAll(() => {
vm = createWrapper(CustomerPayments, {
global: {
@@ -13,7 +12,7 @@ describe('CustomerPayments', () => {
mocks: {
fetch: vi.fn(),
},
- }
+ },
}).vm;
});
@@ -28,11 +27,10 @@ describe('CustomerPayments', () => {
await vm.confirmTransaction({ id: 1 });
-
expect(vm.quasar.notify).toHaveBeenCalledWith(
expect.objectContaining({
message: 'Payment confirmed',
- type: 'positive'
+ type: 'positive',
})
);
});