- newsletter: prende la lista utenti (flag news_on)
- Abilita a Tutti la Newsletter news_on - isCommerciale - JobsInProgress - PCB: Corretto Totali che era a zero
This commit is contained in:
@@ -312,14 +312,26 @@ export const useProducts = defineStore('Products', {
|
||||
return mystr;
|
||||
},
|
||||
|
||||
getTotaleOrdineByOrdId: (state: IProductsState) => (idOrdine: string, idGasordine: string, mostra_solo_ordini_produttore: boolean): number => {
|
||||
getTotaleOrdineByOrdId: (state: IProductsState) => (idOrdine: string, idGasordine: string, totale: boolean, mostra_solo_ordini_produttore: boolean, status: number): number => {
|
||||
|
||||
const arrprod = state.orders.filter((rec: IOrderCart) => {
|
||||
if (idGasordine && !rec.items?.some(item => item.order && item.order.idGasordine === idGasordine) || (rec._id !== idOrdine)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
let arrprod = []
|
||||
|
||||
if (totale) {
|
||||
arrprod = state.orders.filter((rec: IOrderCart) => {
|
||||
if (idGasordine && !rec.items?.some(item => item.order && item.order.idGasordine === idGasordine) || (rec.status !== status)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
} else {
|
||||
arrprod = state.orders.filter((rec: IOrderCart) => {
|
||||
if (idGasordine && !rec.items?.some(item => item.order && item.order.idGasordine === idGasordine) || (rec._id !== idOrdine)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let subtotalPrice = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user