case 4504
This commit is contained in:
@@ -48,7 +48,44 @@
|
||||
@input="fieldValueChanged('subsite')"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||
<v-text-field
|
||||
ref="regTo"
|
||||
v-model="obj.regTo"
|
||||
dense
|
||||
:readonly="formState.readOnly"
|
||||
:label="$sock.t('LicenseRegTo')"
|
||||
:rules="[form().required(this, 'regTo')]"
|
||||
:error-messages="form().serverErrors(this, 'regTo')"
|
||||
data-cy="regTo"
|
||||
@input="fieldValueChanged('regTo')"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||
<gz-email
|
||||
ref="fetchEmail"
|
||||
v-model="obj.fetchEmail"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$sock.t('LicenseFetchEmail')"
|
||||
data-cy="fetchEmail"
|
||||
:error-messages="form().serverErrors(this, 'fetchEmail')"
|
||||
@input="fieldValueChanged('fetchEmail')"
|
||||
></gz-email>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||
<v-text-field
|
||||
ref="dbId"
|
||||
v-model="obj.dbId"
|
||||
dense
|
||||
:readonly="formState.readOnly"
|
||||
:label="$sock.t('DatabaseID')"
|
||||
:rules="[form().required(this, 'dbId')]"
|
||||
:error-messages="form().serverErrors(this, 'dbId')"
|
||||
data-cy="dbId"
|
||||
@input="fieldValueChanged('dbId')"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<!-- ################################ SUBSCRIPTION ITEMS LIST ############################### -->
|
||||
|
||||
<v-col cols="12" class="mb-6">
|
||||
@@ -440,6 +477,9 @@ export default {
|
||||
pGroup: null,
|
||||
active: true,
|
||||
subsite: "main",
|
||||
regTo: null,
|
||||
fetchEmail: null,
|
||||
dbId: null,
|
||||
items: [],
|
||||
notes: null,
|
||||
tags: []
|
||||
@@ -532,12 +572,14 @@ export default {
|
||||
"menu-enable-item",
|
||||
FORM_KEY + ":duplicate"
|
||||
);
|
||||
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":license");
|
||||
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":new");
|
||||
} else {
|
||||
window.$gz.eventBus.$emit(
|
||||
"menu-disable-item",
|
||||
FORM_KEY + ":duplicate"
|
||||
);
|
||||
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":license");
|
||||
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":new");
|
||||
}
|
||||
},
|
||||
@@ -880,6 +922,153 @@ async function clickHandler(menuItem) {
|
||||
}
|
||||
break;
|
||||
|
||||
case "license":
|
||||
{
|
||||
if (!m.vm.canDuplicate()) {
|
||||
alert("Save this record first");
|
||||
return;
|
||||
}
|
||||
|
||||
//generate license from subscription values here
|
||||
//copied from biz-license default record values
|
||||
var l = {
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
created: window.$gz.locale.nowUTC8601String(),
|
||||
active: false, //here, active means it's ready for pickup
|
||||
customerId: null,
|
||||
pGroup: 1, //default v7 since manually probably most common
|
||||
regTo: null,
|
||||
key: null,
|
||||
fetchCode: null,
|
||||
fetchEmail: null,
|
||||
fetchedOn: null, //here, non null fetchedOn is read only
|
||||
dbId: null,
|
||||
licenseExpire: null, //what it is in v8, "lockdate" in v7
|
||||
maintenanceExpire: null,
|
||||
notificationSent: false,
|
||||
wiki: null,
|
||||
tags: [],
|
||||
trialMode: false,
|
||||
renewal: false,
|
||||
//dto only props
|
||||
customerUsers: 250,
|
||||
maxDataGB: 20,
|
||||
users: 1,
|
||||
wbi: false,
|
||||
wbiExpires: null,
|
||||
mbi: false,
|
||||
mbiExpires: null,
|
||||
ri: false,
|
||||
riExpires: null,
|
||||
qbi: false,
|
||||
qbiExpires: null,
|
||||
qboi: false,
|
||||
qboiExpires: null,
|
||||
pti: false,
|
||||
ptiExpires: null,
|
||||
quickNotification: false,
|
||||
quickNotificationExpires: null,
|
||||
exportToXLS: false,
|
||||
exportToXLSExpires: null,
|
||||
outlookSchedule: false,
|
||||
outlookScheduleExpires: null,
|
||||
oli: false,
|
||||
oliExpires: null,
|
||||
importExportCSVDuplicate: false,
|
||||
importExportCSVDuplicateExpires: null
|
||||
};
|
||||
|
||||
/*
|
||||
public enum ProductGroup
|
||||
{
|
||||
Misc = 0,
|
||||
AyaNova7 = 1,
|
||||
RavenPerpetual = 2,
|
||||
RavenSubscription = 3,
|
||||
NotSet = 4
|
||||
}
|
||||
|
||||
*/
|
||||
switch (m.vm.obj.pGroup) {
|
||||
case 0:
|
||||
case 4:
|
||||
throw new Error("Invalid PGroup");
|
||||
case 1: //v7
|
||||
{
|
||||
l = {};
|
||||
}
|
||||
break;
|
||||
case 2: //Raven perpetual
|
||||
{
|
||||
// var v = {
|
||||
// data: {
|
||||
// id: 0,
|
||||
// created: window.$gz.locale.nowUTC8601String(),
|
||||
// active: false,
|
||||
// notificationSent: false,
|
||||
// customerId: m.vm.obj.customerId,
|
||||
// customerViz: null,
|
||||
// pGroup: 2,
|
||||
// regTo: "Vicom Australia",
|
||||
// key: null,
|
||||
// fetchCode: null,
|
||||
// fetchEmail: "mparsons@vicom.com.au",
|
||||
// fetchedOn: null,
|
||||
// dbId: "mZaliiy+/TsHF9rcMpIGWO20Q5FhPD1ZdnWO2cMKMW8=",
|
||||
// licenseExpire: "5555-01-02T00:00:00Z",
|
||||
// maintenanceExpire: "2024-03-21T07:00:00Z",
|
||||
// renewal: true,
|
||||
// trialMode: false,
|
||||
// customerUsers: null,
|
||||
// maxDataGB: null,
|
||||
// users: 19,
|
||||
// wbi: false,
|
||||
// wbiExpires: null,
|
||||
// mbi: false,
|
||||
// mbiExpires: null,
|
||||
// ri: false,
|
||||
// riExpires: null,
|
||||
// qbi: false,
|
||||
// qbiExpires: null,
|
||||
// qboi: false,
|
||||
// qboiExpires: null,
|
||||
// pti: false,
|
||||
// ptiExpires: null,
|
||||
// quickNotification: false,
|
||||
// quickNotificationExpires: null,
|
||||
// exportToXLS: false,
|
||||
// exportToXLSExpires: null,
|
||||
// outlookSchedule: false,
|
||||
// outlookScheduleExpires: null,
|
||||
// oli: false,
|
||||
// oliExpires: null,
|
||||
// importExportCSVDuplicate: false,
|
||||
// importExportCSVDuplicateExpires: null,
|
||||
// wiki: null,
|
||||
// tags: []
|
||||
// }
|
||||
// };
|
||||
l = {};
|
||||
}
|
||||
break;
|
||||
case 3: //RavenSubscription
|
||||
{
|
||||
l = {};
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
this.$router.push({
|
||||
name: "license-edit",
|
||||
params: {
|
||||
recordid: 0,
|
||||
obj: l
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -963,6 +1152,16 @@ function generateMenu(vm) {
|
||||
}
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
if (vm.rights.change && vm.$route.params.recordid != 0 && vm.canDuplicate()) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "Generate license",
|
||||
notrans: true,
|
||||
icon: "$sockiHandHoldingWater",
|
||||
key: FORM_KEY + ":license",
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
@@ -995,7 +1194,10 @@ async function fetchTranslatedText() {
|
||||
"PurchaseExpireDate",
|
||||
"SubscriptionItemList",
|
||||
"OriginalOrderNumber",
|
||||
"OriginalOrderDate"
|
||||
"OriginalOrderDate",
|
||||
"LicenseRegTo",
|
||||
"LicenseFetchEmail",
|
||||
"LicenseDBID"
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user