Conto Comunitario all'interno di un Circuito

This commit is contained in:
Surya Paolo
2023-01-21 19:02:26 +01:00
parent 42d68eb4b8
commit 98c0218ef7
18 changed files with 117 additions and 42 deletions

View File

@@ -620,6 +620,31 @@ export const colmyMovement = [
noshowlabel: true,
}),
AddCol({
name: 'groupfrom.groupname',
label_trans: 'groups.groupname',
field: 'groupfrom',
subfield: 'groupname',
foredit: false,
tipovisu: costanti.TipoVisu.LINK,
fieldtype: costanti.FieldType.username_chip,
link: '/my/groupfrom.groupname',
noshowlabel: true,
extrafield: 'movement.from',
}),
AddCol({
name: 'groupto.groupname',
label_trans: 'groups.groupname',
field: 'groupto',
subfield: 'groupname',
foredit: false,
tipovisu: costanti.TipoVisu.LINK,
fieldtype: costanti.FieldType.username_chip,
link: '/my/groupto.groupname',
extrafield: 'movement.to',
noshowlabel: true,
}),
AddCol({
name: 'amount', label_trans: 'movement.amount',
fieldtype: costanti.FieldType.currency, required: true, tipovisu: costanti.TipoVisu.TESTO_BORDATO
@@ -632,7 +657,9 @@ export const colmyMovementTable = [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'transactionDate', label_trans: 'movement.transactionDate', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'userfrom.username', field: 'userfrom', subfield: 'username', label_trans: 'movement.accountFromId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({ name: 'groupfrom.groupname', field: 'groupfrom', subfield: 'groupname', label_trans: 'movement.accountFromComId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({ name: 'userto.username', field: 'userto', subfield: 'username', label_trans: 'movement.accountToId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({ name: 'groupto.groupname', field: 'groupto', subfield: 'groupname', label_trans: 'movement.accountToComId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({
name: 'amount', label_trans: 'movement.amount',

View File

@@ -5653,7 +5653,11 @@ export const tools = {
acceptCoins($q: any, username: string, notif: any) {
const userStore = useUserStore()
const notifStore = useNotifStore()
notif.extrarec.notifId = notif._id
notif.extrarec.lastdr = notifStore.getLastDataRead(username)
userStore.setCircuitCmd($q, t, username, notif.extrarec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_ACCEPT, 0, notif.extrarec)
.then((res: any) => {
if (res) {
@@ -5671,7 +5675,10 @@ export const tools = {
refuseCoins($q: any, username: string, notif: any) {
const userStore = useUserStore()
const notifStore = useNotifStore()
notif.extrarec.notifId = notif._id
notif.extrarec.lastdr = notifStore.getLastDataRead(username)
userStore.setCircuitCmd($q, t, username, notif.extrarec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REFUSE, 0, notif.extrarec)
.then((res: any) => {
if (res && res.result) {
@@ -7306,9 +7313,13 @@ export const tools = {
let type = costanti.TypeMov.Nessuno
if (rec && rec.userfrom) {
const userStore = useUserStore()
if (userStore.my.username === rec.userfrom.username) {
if (rec.userfrom && userStore.my.username === rec.userfrom.username) {
type = costanti.TypeMov.Uscita
} else if (userStore.my.username === rec.userto.username) {
} else if (rec.userto && userStore.my.username === rec.userto.username) {
type = costanti.TypeMov.Entrata
} else if (rec.groupfrom && tools.isUserAdminGroup(rec.groupfrom.groupname, userStore.my.username)) {
type = costanti.TypeMov.Uscita
} else if (rec.groupto && tools.isUserAdminGroup(rec.groupto.groupname, userStore.my.username)) {
type = costanti.TypeMov.Entrata
}
}