- corretto la gestione degli Sconti
- Duplicare un Catalogo
This commit is contained in:
@@ -22,4 +22,34 @@ $heightBtn: 100%;
|
||||
.strong {
|
||||
color: #d9534f; /* Rosso */
|
||||
font-weight: bold; /* Testo in grassetto */
|
||||
}
|
||||
}
|
||||
|
||||
.sconto-label{
|
||||
font-weight: bold;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.sconto-text{
|
||||
font-weight: bold;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin: auto;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.table td {
|
||||
padding: 8px;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 1.2em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ export default defineComponent({
|
||||
const oldrec = ref(<any[string]>[]);
|
||||
const note = ref('');
|
||||
const codice_sconto = ref('');
|
||||
const descr_sconto = ref('');
|
||||
const endload = ref(false);
|
||||
const caricamentodati = ref(false);
|
||||
const recOrderCart = ref(<IOrderCart>{});
|
||||
@@ -82,16 +83,16 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function getItemsCart() {
|
||||
const getItemsCart = computed(() => {
|
||||
const cart = getOrdersCart();
|
||||
return cart.items || null;
|
||||
}
|
||||
});
|
||||
|
||||
function getNumItems(): number {
|
||||
const getNumItems = computed((): number => {
|
||||
const cart = getOrdersCart();
|
||||
if (cart.items) return cart.items.length || 0;
|
||||
else return 0;
|
||||
}
|
||||
});
|
||||
|
||||
function getCart(): ICart {
|
||||
return getOrdersCart();
|
||||
@@ -116,21 +117,37 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function myTotalPrice(): string {
|
||||
const myTotalPrice = computed((): string => {
|
||||
if (productStore.cart && productStore.cart.totalPrice) {
|
||||
return productStore.cart.totalPrice.toFixed(2);
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function myTotalQty(): number {
|
||||
const myTotalPriceCalc = computed((): string => {
|
||||
if (productStore.cart && productStore.cart.totalPriceCalc) {
|
||||
return productStore.cart.totalPriceCalc.toFixed(2);
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
});
|
||||
const totalPriceIntero = computed((): string => {
|
||||
if (productStore.cart && productStore.cart.totalPriceIntero) {
|
||||
return productStore.cart.totalPriceIntero.toFixed(2);
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
});
|
||||
|
||||
const myTotalQty = computed((): number => {
|
||||
if (productStore.cart) {
|
||||
return productStore.cart.totalQty!;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
async function aggiornaCarrello() {
|
||||
if (mycart.value) {
|
||||
recOrderCart.value = await productStore.CreateOrdersCart({
|
||||
@@ -197,7 +214,7 @@ export default defineComponent({
|
||||
|
||||
function completeOrder() {
|
||||
$q.dialog({
|
||||
message: t('ecomm.conferma_acq', { qty: myTotalQty() }),
|
||||
message: t('ecomm.conferma_acq', { qty: myTotalQty }),
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: true,
|
||||
@@ -294,7 +311,7 @@ export default defineComponent({
|
||||
csvRows.push(headers);
|
||||
|
||||
let index = 1
|
||||
for (const itemorder of getItemsCart()) {
|
||||
for (const itemorder of getItemsCart.value) {
|
||||
const productCode = itemorder.order.product?.productInfo.code || '';
|
||||
const productName = itemorder.order.product?.productInfo.name || '';
|
||||
const quantity = itemorder.order.quantity + itemorder.order.quantitypreordered;
|
||||
@@ -306,8 +323,8 @@ export default defineComponent({
|
||||
index++;
|
||||
}
|
||||
|
||||
const totalQuantity = getItemsCart().reduce((sum, itemorder) => sum + itemorder.order.quantity + itemorder.order.quantitypreordered, 0);
|
||||
const totalAmount = getItemsCart().reduce((sum, itemorder) => sum + parseFloat((itemorder.order.price * (itemorder.order.quantity + itemorder.order.quantitypreordered)).toFixed(2)), 0);
|
||||
const totalQuantity = getItemsCart.value.reduce((sum, itemorder) => sum + itemorder.order.quantity + itemorder.order.quantitypreordered, 0);
|
||||
const totalAmount = getItemsCart.value.reduce((sum, itemorder) => sum + parseFloat((itemorder.order.price * (itemorder.order.quantity + itemorder.order.quantitypreordered)).toFixed(2)), 0);
|
||||
|
||||
const totalRow = `${sep}${sep}Totale${sep}${totalQuantity}${sep}${sep}${totalAmount.toFixed(2)}\n`;
|
||||
csvRows.push(totalRow);
|
||||
@@ -341,12 +358,16 @@ export default defineComponent({
|
||||
tools.showNegativeNotif($q, `${rissconto.errmsg}`);
|
||||
}
|
||||
codice_sconto.value = '';
|
||||
if (rissconto.mycart) recOrderCart.value = rissconto.mycart;
|
||||
descr_sconto.value = '';
|
||||
if (rissconto.mycart) {
|
||||
recOrderCart.value = rissconto.mycart
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('error ApplicaSconto', error);
|
||||
tools.showNegativeNotif($q, `Sconto Non Applicato! ${error.message}`);
|
||||
codice_sconto.value = '';
|
||||
descr_sconto.value = '';
|
||||
} finally {
|
||||
caricamentodati.value = false;
|
||||
}
|
||||
@@ -381,6 +402,8 @@ export default defineComponent({
|
||||
completeOrder,
|
||||
getNumItems,
|
||||
myTotalPrice,
|
||||
myTotalPriceCalc,
|
||||
totalPriceIntero,
|
||||
getItemsCart,
|
||||
getNote,
|
||||
change_field,
|
||||
@@ -397,6 +420,7 @@ export default defineComponent({
|
||||
isfinishLoading,
|
||||
esportaCsv,
|
||||
codice_sconto,
|
||||
descr_sconto,
|
||||
confermaCodiceSconto,
|
||||
rimuoviCodiceSconto,
|
||||
caricamentodati,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="container">
|
||||
<div
|
||||
class="q-pa-sm col items-start q-gutter-xs"
|
||||
v-for="(itemorder, index) in getItemsCart()"
|
||||
v-for="(itemorder, index) in getItemsCart"
|
||||
:key="index"
|
||||
>
|
||||
<CSingleCart
|
||||
@@ -30,73 +30,77 @@
|
||||
</div>
|
||||
<q-separator></q-separator>
|
||||
<div
|
||||
class="col-6 q-mr-sm"
|
||||
style="text-align: right"
|
||||
v-if="totalPriceIntero"
|
||||
class="q-mr-sm"
|
||||
>
|
||||
<span class="text-grey q-mr-xs">{{ $t('ecomm.totale') }}:</span>
|
||||
<span class="text-subtitle1 q-mr-sm">€ {{ myTotalPrice() }}</span>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label">{{ $t('ecomm.prezzointero') }}:</td>
|
||||
<td
|
||||
class="value text-subtitle1"
|
||||
:class="{ 'text-strike': myTotalPrice !== totalPriceIntero }"
|
||||
>
|
||||
€ {{ totalPriceIntero }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="recOrderCart.codice_sconto">
|
||||
<td class="label">{{ $t('ecomm.sconto_appl') }}:</td>
|
||||
<td>
|
||||
<div class="column items-center">
|
||||
<q-chip
|
||||
square
|
||||
color="orange"
|
||||
text-color="white"
|
||||
size="md"
|
||||
icon="fas fa-tag"
|
||||
>
|
||||
<span class="sconto-text">{{ recOrderCart.descr_sconto }}</span>
|
||||
</q-chip>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
icon="fas fa-times"
|
||||
color="negative"
|
||||
@click="rimuoviCodiceSconto"
|
||||
>Rimuovi</q-btn
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<q-separator />
|
||||
<tr v-if="!recOrderCart.codice_sconto">
|
||||
<td class="label">{{ $t('ecomm.codice_sconto') }}:</td>
|
||||
<td>
|
||||
<q-input
|
||||
v-model="codice_sconto"
|
||||
:label="$t('ecomm.codice_sconto')"
|
||||
style="width: 200px"
|
||||
filled
|
||||
dense
|
||||
@keyup.enter="confermaCodiceSconto"
|
||||
/>
|
||||
<q-btn
|
||||
:disabled="!codice_sconto || codice_sconto.trim() === ''"
|
||||
:label="$t('ecomm.applica_sconto')"
|
||||
icon="fas fa-check-circle"
|
||||
color="primary"
|
||||
class="q-mt-sm self-center"
|
||||
@click="confermaCodiceSconto"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<div
|
||||
v-if="getNumItems() > 0"
|
||||
style="max-width: 500px"
|
||||
class="row items-center q-gutter-x-xs"
|
||||
>
|
||||
<div class="column items-center q-gutter-x-xs">
|
||||
<div
|
||||
v-if="recOrderCart.codice_sconto"
|
||||
class="row items-center q-gutter-x-xs"
|
||||
>
|
||||
<div
|
||||
class="text-subtitle1 q-mr-sm q-pa-xs"
|
||||
style="background-color: #f0f0f0; border-radius: 4px"
|
||||
>
|
||||
{{ $t('ecomm.sconto_appl') }}
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
icon="fas fa-times"
|
||||
color="negative"
|
||||
@click="rimuoviCodiceSconto"
|
||||
>
|
||||
Rimuovi {{ recOrderCart.codice_sconto }}
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!recOrderCart.codice_sconto" class="row">
|
||||
<q-input
|
||||
v-model="codice_sconto"
|
||||
:label="$t('ecomm.codice_sconto')"
|
||||
style="width: 200px"
|
||||
filled
|
||||
dense
|
||||
@keyup.enter="confermaCodiceSconto"
|
||||
/>
|
||||
<q-btn
|
||||
:disabled="!codice_sconto || codice_sconto.trim() === ''"
|
||||
:label="$t('ecomm.applica_sconto')"
|
||||
icon="fas fa-check-circle"
|
||||
color="primary"
|
||||
class="q-mt-sm"
|
||||
@click="confermaCodiceSconto"
|
||||
/>
|
||||
</div>
|
||||
<!--<q-btn
|
||||
v-if="recOrderCart.codice_sconto"
|
||||
:label="$t('ecomm.rimuovi_sconto')"
|
||||
icon="fas fa-times-circle"
|
||||
color="negative"
|
||||
class="q-mt-sm"
|
||||
@click="rimuoviCodiceSconto"
|
||||
/>-->
|
||||
<tr>
|
||||
<td class="label">{{ $t('ecomm.totale_scontato') }}:</td>
|
||||
<td class="ordine_scontato_nuovo">€ {{ myTotalPrice }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<q-input
|
||||
v-if="getNumItems() > 0"
|
||||
v-if="getNumItems > 0"
|
||||
v-model="note"
|
||||
style="min-width: 400px"
|
||||
class="q-mt-md"
|
||||
@@ -116,18 +120,6 @@
|
||||
></div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<q-btn
|
||||
v-if="
|
||||
recOrderCart &&
|
||||
recOrderCart.status < shared_consts.OrderStatus.CHECKOUT_SENT
|
||||
"
|
||||
icon="fas fa-file-csv"
|
||||
flat
|
||||
filled
|
||||
:label="$t('ecomm.esporta_csv')"
|
||||
class="q-mb-sm"
|
||||
@click="esportaCsv()"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
recOrderCart &&
|
||||
@@ -138,10 +130,11 @@
|
||||
color="green"
|
||||
:label="$t('ecomm.completa_ord')"
|
||||
class="q-mb-sm"
|
||||
:disabled="myTotalQty() < 1"
|
||||
:disabled="myTotalQty < 1"
|
||||
@click="completeOrder()"
|
||||
></q-btn>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="center-text">
|
||||
<br />
|
||||
|
||||
@@ -152,6 +145,20 @@
|
||||
{{ globalStore.site.ecomm.NoteExtraOnCart }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-mt-md row justify-center">
|
||||
<q-btn
|
||||
v-if="
|
||||
recOrderCart &&
|
||||
recOrderCart.status < shared_consts.OrderStatus.CHECKOUT_SENT
|
||||
"
|
||||
icon="fas fa-file-csv"
|
||||
flat
|
||||
filled
|
||||
:label="$t('ecomm.esporta_csv')"
|
||||
class="q-mb-sm"
|
||||
@click="esportaCsv()"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
|
||||
@@ -2506,6 +2506,12 @@ export default defineComponent({
|
||||
|
||||
if (cmd === costanti.CMD_CLONE) {
|
||||
const myarr = serverData.value.find((rec: any) => rec._id === id)
|
||||
if (myarr) {
|
||||
mycolumns.value.forEach((col: IColGridTable) => {
|
||||
if (col.dont_clone)
|
||||
delete myarr[col.name]
|
||||
})
|
||||
}
|
||||
newRecord.value = myarr
|
||||
newRecord.value._id = 0
|
||||
newRecordBool.value = true
|
||||
|
||||
@@ -48,8 +48,9 @@
|
||||
<q-btn
|
||||
v-if="existsOrders()"
|
||||
rounded
|
||||
outline
|
||||
icon="fas fa-clipboard-list"
|
||||
color="positive"
|
||||
style="color: green;"
|
||||
:label="t('ecomm.btn_ordini')"
|
||||
class="q-mb-sm"
|
||||
@click="globalStore.rightCartOpen = false"
|
||||
|
||||
@@ -207,13 +207,13 @@
|
||||
:label="$t('reg.elimina')"
|
||||
icon="fas fa-trash-alt"
|
||||
/>
|
||||
<!--<q-fab-action
|
||||
v-if="tools.canModifyThisRec(myrec, table) || tools.isManager() || editOn"
|
||||
@click="cmdExt(costanti.CMD_CLONE, myrec._id, null)"
|
||||
color="accent"
|
||||
:label="$t('event.duplicate')"
|
||||
icon="fas fa-copy"
|
||||
/>-->
|
||||
<q-fab-action
|
||||
v-if="tools.canModifyThisRec(myrec, table) || tools.isManager() || editOn"
|
||||
@click="cmdExt(costanti.CMD_CLONE, myrec._id, null)"
|
||||
color="accent"
|
||||
:label="$t('event.duplicate')"
|
||||
icon="fas fa-copy"
|
||||
/>
|
||||
<q-fab-action
|
||||
v-if="tools.canModifyThisRec(myrec, table) || editOn"
|
||||
:disable="!pagina_collegata"
|
||||
|
||||
@@ -22,15 +22,7 @@
|
||||
.barrato {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.ordine_scontato_nuovo{
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ordine_scritta_sconto{
|
||||
font-style: italic;
|
||||
color: green;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.gasordine {
|
||||
font-style: italic;
|
||||
color: blue;
|
||||
@@ -105,14 +97,15 @@
|
||||
}
|
||||
|
||||
.quantity-display {
|
||||
min-width: 60px;
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
font-size: 1.4rem;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
background: #f8fafc;
|
||||
border-radius: 12px;
|
||||
padding: 12px 16px;
|
||||
padding: 4px 8px;
|
||||
margin: 4px;
|
||||
border: 2px solid #e2e8f0;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
@@ -241,4 +234,17 @@
|
||||
.remove-btn {
|
||||
margin: 16px auto 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.myval_sconto{
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
color: green;
|
||||
}
|
||||
|
||||
.myperc_sconto{
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
color: green;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CCopyBtn } from '../CCopyBtn';
|
||||
import type { IOrder } from '@src/model';
|
||||
import { IOperators, IProduct } from '@src/model';
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, toRef, ref, watch, onMounted } from 'vue';
|
||||
import { defineComponent, toRef, ref, watch, onMounted, computed } from 'vue';
|
||||
import { CTitleBanner } from '@src/components/CTitleBanner';
|
||||
import { useProducts } from '@store/Products';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -59,6 +59,10 @@ export default defineComponent({
|
||||
const enableQtyPreordered = ref(false);
|
||||
const enableChangeTotalPrice = ref(false);
|
||||
|
||||
watch(props.order, (newVal: any) => {
|
||||
order.value = { ...newVal };
|
||||
});
|
||||
|
||||
watch(orderQuantity, (newValue: any) => {
|
||||
if (!newValue) order.value.quantity = 0;
|
||||
else order.value.quantity = parseFloat(newValue);
|
||||
@@ -151,15 +155,17 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
|
||||
function isApplicatoSconto() {
|
||||
const isApplicatoSconto = computed(() => {
|
||||
const totalipotetico =
|
||||
order.value.product!.price *
|
||||
(order.value.quantity + order.value.quantitypreordered);
|
||||
if (totalipotetico.toFixed(2) > order.value.TotalPriceProduct.toFixed(2)) {
|
||||
const totalipoteticoNum = parseFloat(totalipotetico.toFixed(2));
|
||||
const totalpriceNum = parseFloat(order.value.TotalPriceProduct.toFixed(2));
|
||||
if (totalipoteticoNum > totalpriceNum) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
function removeFromCard() {
|
||||
$q.dialog({
|
||||
@@ -197,12 +203,21 @@ export default defineComponent({
|
||||
mounted();
|
||||
}
|
||||
|
||||
function getRisparmio(): string {
|
||||
const getRisparmio = computed((): string => {
|
||||
return (
|
||||
order.value.product!.price * order.value.quantity -
|
||||
order.value.TotalPriceProduct
|
||||
).toFixed(2);
|
||||
}
|
||||
});
|
||||
const getRispPerc = computed((): string => {
|
||||
const risparmioPerc = parseFloat(
|
||||
(
|
||||
(getRisparmio.value / (order.value.product!.price * order.value.quantity)) *
|
||||
100
|
||||
).toFixed(2)
|
||||
);
|
||||
return risparmioPerc.toFixed(0);
|
||||
});
|
||||
|
||||
function mounted() {
|
||||
endload.value = false;
|
||||
@@ -248,6 +263,7 @@ export default defineComponent({
|
||||
orderTotalPriceProduct,
|
||||
endload,
|
||||
qtyInCart,
|
||||
getRispPerc,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -106,9 +106,9 @@
|
||||
size="sm"
|
||||
class="quantity-btn"
|
||||
data-gradiente="negative"
|
||||
:icon="qtyInCart() === 1 ? 'fas fa-trash': 'fas fa-minus'"
|
||||
:icon="qtyInCart() === 1 ? 'fas fa-trash' : 'fas fa-minus'"
|
||||
:color="products.enableSubQty(order) ? undefined : 'grey'"
|
||||
@click="qtyInCart() === 1 ? removeFromCard(): addsubqty(false, true)"
|
||||
@click="qtyInCart() === 1 ? removeFromCard() : addsubqty(false, true)"
|
||||
rounded
|
||||
></q-btn>
|
||||
<div v-if="editmode">
|
||||
@@ -195,27 +195,12 @@
|
||||
{{ order.quantity + order.quantitypreordered }} x €
|
||||
{{ order.price ? order.price : 0 }}
|
||||
</span>
|
||||
<span :class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''">
|
||||
= €
|
||||
=
|
||||
<span :class="isApplicatoSconto ? 'ordine_scontato_nuovo' : ''">
|
||||
€
|
||||
{{ order.TotalPriceProduct ? order.TotalPriceProduct.toFixed(2) : 0 }}
|
||||
</span>
|
||||
<span
|
||||
v-if="
|
||||
tools.isManager() &&
|
||||
order.TotalPriceProduct.toFixed(2) !==
|
||||
order.TotalPriceProductCalc.toFixed(2)
|
||||
"
|
||||
:class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''"
|
||||
>
|
||||
(Calc: €
|
||||
{{
|
||||
order.TotalPriceProductCalc
|
||||
? order.TotalPriceProductCalc.toFixed(2)
|
||||
: 0
|
||||
}})
|
||||
</span>
|
||||
|
||||
<span v-if="isApplicatoSconto()">
|
||||
<span v-if="isApplicatoSconto">
|
||||
<span class="ordine_scontato"
|
||||
>(<span class="barrato"
|
||||
>€
|
||||
@@ -228,11 +213,17 @@
|
||||
>)</span
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
v-if="isApplicatoSconto() && !editmode"
|
||||
<div
|
||||
v-if="isApplicatoSconto && !editmode"
|
||||
class="ordine_scritta_sconto"
|
||||
>{{ $t('ecomm.sconto_applicato', { risparmio: getRisparmio() }) }}</span
|
||||
v-html="
|
||||
$t('ecomm.sconto_applicato', {
|
||||
risparmio: getRisparmio,
|
||||
perc: getRispPerc,
|
||||
})
|
||||
"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
@@ -411,7 +411,7 @@ h3 {
|
||||
.my-card-prod {
|
||||
transition: box-shadow 0.3s ease, transform 0.3s ease;
|
||||
/* Add a transition for a smooth effect */
|
||||
box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
|
||||
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
padding: 0.5rem 0.5rem;
|
||||
@@ -1994,8 +1994,10 @@ h3 {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 56.25%;
|
||||
max-width: 800px; /* Limita la larghezza massima */
|
||||
margin: 0 auto; /* Centra il video orizzontalmente */
|
||||
max-width: 800px;
|
||||
/* Limita la larghezza massima */
|
||||
margin: 0 auto;
|
||||
/* Centra il video orizzontalmente */
|
||||
|
||||
/* 16:9 Aspect Ratio */
|
||||
}
|
||||
@@ -2006,7 +2008,8 @@ h3 {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none; /* Rimuovi eventuali bordi */
|
||||
border: none;
|
||||
/* Rimuovi eventuali bordi */
|
||||
}
|
||||
|
||||
.fake-link {
|
||||
@@ -2604,9 +2607,48 @@ body.body--dark {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(255, 255, 255, 0.7); /* Sfondo semi-trasparente */
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
/* Sfondo semi-trasparente */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.text-strike {
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
|
||||
.product-price-discount {
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
font-size: 1rem;
|
||||
color: #f60;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.ordine_scontato_nuovo {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
color: green;
|
||||
background-color: #fff5ee; /* seashell color background */
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ordine_scritta_sconto {
|
||||
font-size: 1.1rem;
|
||||
color:red;
|
||||
background-color: #fff5ee; /* seashell color background */
|
||||
padding: 4px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.center-button {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -1049,6 +1049,7 @@ export interface IColGridTable {
|
||||
tablesel?: string
|
||||
notsave?: boolean
|
||||
isadvanced_field?: boolean
|
||||
dont_clone?: boolean
|
||||
showWhen?: number
|
||||
maxlength?: number
|
||||
minlength?: number
|
||||
|
||||
@@ -442,6 +442,7 @@ export interface IOrderCart {
|
||||
created_at?: Date
|
||||
note: string
|
||||
codice_sconto?: string
|
||||
descr_sconto?: string
|
||||
note_per_gestore: string
|
||||
note_per_admin: string
|
||||
note_ordine_gas: string
|
||||
|
||||
@@ -1870,6 +1870,8 @@ const msg_it = {
|
||||
created: 'Sito Installato [IdApp = {idapp}] !',
|
||||
},
|
||||
ecomm: {
|
||||
totale_scontato: 'Totale scontato',
|
||||
prezzointero: 'Prezzo Intero',
|
||||
already_in_cart: 'Questo prodotto è stato già aggiunto al Carrello',
|
||||
area_personale: 'Per poter fare un Ordine occorre essere Registrati ed accedere con le proprie credenziali (username e password)',
|
||||
codice_sconto: 'Aggiungi il Codice Sconto',
|
||||
@@ -1907,7 +1909,7 @@ const msg_it = {
|
||||
carrello_di: 'Carrello di {user}',
|
||||
settings: 'Impostazioni',
|
||||
qta_in_attesa: '(Ordinati In attesa {qty})',
|
||||
sconto_applicato: 'Risparmi {risparmio} € !',
|
||||
sconto_applicato: 'Risparmi <span class="myval_sconto">{risparmio}</span> € <span class="myperc_sconto">({perc}%)</span> !',
|
||||
codice: 'Codice',
|
||||
subcat: 'Cat',
|
||||
code_o_text_search: 'Inserisci il codice o il testo da cercare',
|
||||
|
||||
@@ -106,6 +106,7 @@ function AddCol(params: IColGridTable) {
|
||||
isadvanced_field: (params.isadvanced_field === undefined) ? false : params.isadvanced_field,
|
||||
path: (params.path === undefined) ? '' : params.path,
|
||||
onlyforAdmin: (params.onlyforAdmin === undefined) ? false : params.onlyforAdmin,
|
||||
dont_clone: (params.dont_clone === undefined) ? false : params.dont_clone,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,6 +171,8 @@ export const colTableRaccoltaCataloghi = [
|
||||
AddCol(DeleteRec),
|
||||
]
|
||||
|
||||
// exclude field with dont_clone: true in the fieldstable colTableCatalogList
|
||||
|
||||
export const colTableCatalogList = [
|
||||
AddCol({ name: 'active', label_trans: 'myelems.pubblica_online', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'title', label_trans: 'gallery.title' }),
|
||||
@@ -192,6 +195,7 @@ export const colTableCatalogList = [
|
||||
label_trans: 'cataloglist.idPageAssigned',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
jointable: 'mypages_id',
|
||||
dont_clone: true,
|
||||
}),
|
||||
AddCol({ name: 'isCatalogoGenerale', label_trans: 'cataloglist.isCatalogoGenerale', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({
|
||||
@@ -259,11 +263,13 @@ export const colTableCatalogList = [
|
||||
AddCol({
|
||||
name: 'pdf_generato',
|
||||
label_trans: 'cataloglist.pdf_generato',
|
||||
dont_clone: true,
|
||||
}),
|
||||
// AddCol({ name: 'data_generato', label_trans: 'dataloglist.data_generato', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({
|
||||
name: 'pdf_online',
|
||||
label_trans: 'cataloglist.pdf_online',
|
||||
dont_clone: true,
|
||||
}),
|
||||
|
||||
AddCol({
|
||||
@@ -286,11 +292,13 @@ export const colTableCatalogList = [
|
||||
AddCol({
|
||||
name: 'pdf_generato_stampa',
|
||||
label_trans: 'cataloglist.pdf_generato_stampa',
|
||||
dont_clone: true,
|
||||
}),
|
||||
// AddCol({ name: 'data_generato', label_trans: 'dataloglist.data_generato', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({
|
||||
name: 'pdf_online_stampa',
|
||||
label_trans: 'cataloglist.pdf_online_stampa',
|
||||
dont_clone: true,
|
||||
}),
|
||||
// AddCol({ name: 'data_online', label_trans: 'dataloglist.data_online', fieldtype: costanti.FieldType.date }),
|
||||
|
||||
@@ -697,6 +705,7 @@ export const getcolorderscart = [
|
||||
AddCol({ name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users' }),
|
||||
AddCol({ name: 'note', label_trans: 'order.note' }),
|
||||
AddCol({ name: 'codice_sconto', label_trans: 'order.codice_sconto' }),
|
||||
AddCol({ name: 'descr_sconto', label_trans: 'order.descr_sconto' }),
|
||||
AddCol({ name: 'confermato', label_trans: 'order.confermato', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'date_confermato', label_trans: 'order.date_confermato', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'consegnato', label_trans: 'order.consegnato', fieldtype: costanti.FieldType.boolean }),
|
||||
@@ -888,6 +897,7 @@ export const colTableGasordine = [
|
||||
AddCol(DuplicateRec),
|
||||
]
|
||||
export const colTableScontistica = [
|
||||
AddCol({ name: 'attivo', label_trans: 'scontistica.attivo', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'code', label_trans: 'scontistica.code' }),
|
||||
AddCol({ name: 'description', label_trans: 'scontistica.description' }),
|
||||
AddCol({ name: 'qta', label_trans: 'scontistica.qta', fieldtype: costanti.FieldType.number }),
|
||||
@@ -2734,6 +2744,7 @@ export const colTableOrdersCart = [
|
||||
AddCol({ name: 'totalQtyPreordered', label_trans: 'orderscart.totalQtyPreordered', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'totalPrice', label_trans: 'orderscart.totalPrice', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'totalPriceCalc', label_trans: 'orderscart.totalPriceCalc', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'totalPriceIntero', label_trans: 'orderscart.totalPriceIntero', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'status', label_trans: 'orderscart.status', fieldtype: costanti.FieldType.number }),
|
||||
]
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ function getRecordOrdersCartEmpty(): IOrderCart {
|
||||
note: '',
|
||||
note_per_gestore: '',
|
||||
codice_sconto:'',
|
||||
descr_sconto: '',
|
||||
note_per_admin: '',
|
||||
note_ordine_gas: '',
|
||||
};
|
||||
@@ -611,8 +612,10 @@ export const useProducts = defineStore('Products', {
|
||||
state.orders = res.data.orders;
|
||||
}
|
||||
|
||||
if (res && res.data.mycart) {
|
||||
state.cart = res.data.mycart;
|
||||
}
|
||||
if (res && res.data.cart) {
|
||||
// console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories)
|
||||
state.cart = res.data.cart;
|
||||
}
|
||||
},
|
||||
@@ -1391,6 +1394,8 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
let ris = null;
|
||||
|
||||
console.log('/cart/' + this.userActive._id + '/createorderscart', cart_id);
|
||||
|
||||
ris = await Api.SendReq(
|
||||
'/cart/' + this.userActive._id + '/createorderscart',
|
||||
'POST',
|
||||
|
||||
@@ -402,6 +402,7 @@ export default defineComponent({
|
||||
// Add other properties as needed
|
||||
totalPrice: orderscart.reduce((total: number, rec: any) => total + rec.totalPrice, 0),
|
||||
totalPriceCalc: orderscart.reduce((total: number, rec: any) => total + rec.totalPriceCalc, 0),
|
||||
totalPriceIntero: orderscart.reduce((total: number, rec: any) => total + rec.totalPriceIntero, 0),
|
||||
};
|
||||
|
||||
let rowsWithTotals: any = [...orderscart];
|
||||
|
||||
@@ -233,6 +233,11 @@
|
||||
caption
|
||||
>{{ props.row.totalPriceCalc }} €</q-item-label
|
||||
>
|
||||
<q-item-label
|
||||
v-else-if="col.name === 'totalPriceIntero'"
|
||||
caption
|
||||
>{{ props.row.totalPriceIntero }} €</q-item-label
|
||||
>
|
||||
<q-item-label
|
||||
v-else-if="col.name === 'status'"
|
||||
caption
|
||||
|
||||
Reference in New Issue
Block a user