{kind: "onyx.GroupboxHeader", content: "_notes".loc()},
{kind: "XV.TextArea", attr: "DatabaseComments"}
]}
+ ]},
+ {kind: "XV.Groupbox",
+ title: "_commandCenter".loc(), name: "commandPanel", components: [
+ {kind: "XV.ScrollableGroupbox",
+ classes: "in-panel", components: [
+ {kind: "onyx.GroupboxHeader", content: "_installExtension".loc()},
+ {kind: "XV.InputWidget", name: "extensionName", label: "_extensionName".loc()},
+ {kind: "FittableColumns", classes: "xv-buttons center", components: [
+ {kind: "onyx.Button", name: "extensionButton", classes: "icon-ok", ontap: "installExtension"},
+ ]},
+ ]}
]}
]}
- ]
+ ],
+ create: function () {
+ this.inherited(arguments);
+ var hasPriv = XT.session.privileges.get("InstallExtension");
+ this.$.extensionName.setDisabled(!hasPriv);
+ this.$.extensionButton.setDisabled(!hasPriv);
+ },
+ installExtension: function () {
+ var that = this,
+ callback = function (response) {
+ if (!response.answer) {
+ return;
+ }
+
+ XT.dataSource.callRoute("install-extension",
+ {
+ extensionName: that.$.extensionName.getValue()
+ },
+ {
+ success: function (message) {
+ that.doNotify({message: message && message.loc()});
+ },
+ error: function (error) {
+ that.doNotify({message: error.message ? error.message() : error});
+ }
+ }
+ );
+ };
+
+ if (!this.$.extensionName.getValue()) {
+ this.doNotify({
+ type: XM.Model.WARNING,
+ message: "_attributeIsRequired".loc().replace("{attr}", "_extensionName".loc())
+ });
+ return;
+ }
+
+ this.doNotify({
+ type: XM.Model.QUESTION,
+ message: "_installExtensionWarning".loc() + "_confirmAction".loc(),
+ callback: callback
+ });
+ }
});
enyo.kind({
{kind: "XV.InputWidget", attr: "CCLogin",
label: "_login".loc()},
{kind: "XV.InputWidget", attr: "CCPassword",
- label: "_password".loc()},
+ label: "_transactionKey".loc()},
{kind: "XV.ToggleButtonWidget", attr: "CCTest",
label: "_testMode".loc()},
{kind: "XV.ToggleButtonWidget", attr: "CCRequireCCV",
{kind: "onyx.GroupboxHeader", content: "_overview".loc()},
{kind: "XV.ScrollableGroupbox", name: "mainGroup",
classes: "in-panel", components: [
- {kind: "XV.InputWidget", attr: "abbreviation"},
+ {kind: "XV.InputWidget", attr: "abbreviation", maxlength: 2},
{kind: "XV.InputWidget", attr: "name"},
{kind: "XV.InputWidget", attr: "currencyName"},
{kind: "XV.InputWidget", attr: "currencySymbol"},
- {kind: "XV.InputWidget", attr: "currencyAbbreviation"},
- {kind: "XV.InputWidget", attr: "currencyNumber"}
+ {kind: "XV.InputWidget", attr: "currencyAbbreviation", maxlength: 3},
+ {kind: "XV.InputWidget", attr: "currencyNumber", maxlength: 3}
]}
]}
]}
classes: "in-panel", components: [
{kind: "XV.InputWidget", attr: "abbreviation"},
{kind: "XV.InputWidget", attr: "name"},
- {kind: "XV.InputWidget", attr: "symbol"}
+ {kind: "XV.InputWidget", attr: "symbol"},
+ {kind: "XV.CheckboxWidget", attr: "isBase", name: "isBase"}
]}
]}
]}
label: "_print".loc(),
privilege: "PrintInvoices",
prerequisite: "isReadyClean"
+ },
+ {
+ name: "email",
+ isViewMethod: true,
+ label: "_email".loc(),
+ privilege: "PrintInvoices",
+ prerequisite: "isReadyClean"
}],
components: [
{kind: "Panels", arrangerKind: "CarouselArranger",
city: "billtoCity", state: "billtoState",
postalCode: "billtoPostalCode", country: "billtoCountry"}
},
- {kind: "onyx.GroupboxHeader", content: "_notes".loc()},
+ {kind: "onyx.GroupboxHeader", content: "_notes".loc(), name: "notesHeader"},
{kind: "XV.TextArea", attr: "notes", fit: true}
]}
]}
this.inherited(arguments);
if (enyo.platform.touch) {
this.$.panels.createComponents([
- {kind: "XV.InvoiceLineItemBox", name: "invoiceLineItemBox", attr: "lineItems",
+ {kind: "XV.InvoiceLineItemBox", name: "lineItemBox", attr: "lineItems",
title: "_lineItems".loc(), addBefore: this.$.settingsPanel, classes: "medium-panel"}
], {owner: this});
} else {
this.$.panels.createComponents([
- {kind: "XV.InvoiceLineItemGridBox", name: "invoiceLineItemBox", title: "_lineItems".loc(),
+ {kind: "XV.InvoiceLineItemGridBox", name: "lineItemBox", title: "_lineItems".loc(),
attr: "lineItems", addBefore: this.$.settingsPanel}
], {owner: this});
}
this.inherited(arguments);
if (enyo.platform.touch) {
this.$.panels.createComponents([
- {kind: "XV.ReturnLineItemBox", name: "returnLineItemBox",
+ {kind: "XV.ReturnLineItemBox", name: "lineItemBox",
attr: "lineItems", title: "_lineItems".loc(),
addBefore: this.$.settingsPanel, classes: "medium-panel"}
], {owner: this});
} else {
this.$.panels.createComponents([
- {kind: "XV.ReturnLineItemGridBox", name: "returnLineItemBox",
+ {kind: "XV.ReturnLineItemGridBox", name: "lineItemBox",
title: "_lineItems".loc(), attr: "lineItems", addBefore: this.$.settingsPanel}
], {owner: this});
}
onPaymentPosted: 'handlePaymentPosted',
},
model: "XM.SalesOrder",
+ printOnSaveSetting: "DefaultPrintPOOnSave",
+ actions: [{
+ name: "print",
+ isViewMethod: true,
+ label: "_print".loc(),
+ privilege: "ViewSalesOrders",
+ prerequisite: "isReadyClean"
+ },
+ {name: "email",
+ isViewMethod: true,
+ label: "_email".loc(),
+ privilege: "ViewSalesOrders",
+ prerequisite: "isReadyClean"
+ }],
components: [
{kind: "Panels", arrangerKind: "CarouselArranger",
fit: true, components: [
{kind: "XV.DateWidget", attr: "packDate"},
{kind: "XV.InputWidget", attr: "formatStatus",
label: "_status".loc()},
+ {kind: "XV.CheckboxWidget", attr: "printOnSaveSetting",
+ label: "_printOnSave".loc()},
{kind: "onyx.GroupboxHeader", content: "_billTo".loc()},
{kind: "XV.SalesCustomerWidget", attr: "customer",
name: "customerWidget", showAddress: true,
{kind: "XV.SalesOrderDocumentsBox", attr: "documents"}
]}
],
+ /**
+ * When the printOnSaveSetting checkbox is changed,
+ * also change the workspace setting.
+ */
+ controlValueChanged: function (inSender, inEvent) {
+ this.inherited(arguments);
+ if (inEvent.originator.attr === 'printOnSaveSetting') {
+ this.printOnSaveSetting = inEvent.originator.value;
+ }
+ },
/**
* @listens onPaymentPosted
*/
{kind: "onyx.GroupboxHeader", content: "_overview".loc()},
{kind: "XV.ScrollableGroupbox", name: "mainGroup", fit: true,
classes: "in-panel", components: [
- {kind: "XV.InputWidget", attr: "code"},
- {kind: "XV.CheckboxWidget", attr: "isActive"},
- {kind: "XV.SiteTypePicker", attr: "siteType"},
- {kind: "XV.InputWidget", attr: "description"},
- {kind: "XV.ContactWidget", attr: "contact"},
- {kind: "XV.AddressWidget", attr: "address"},
- {kind: "XV.TaxZonePicker", attr: "taxZone"},
- {kind: "XV.InputWidget", attr: "incoterms"},
- {kind: "onyx.GroupboxHeader", content: "_notes".loc()},
- {kind: "XV.TextArea", attr: "notes", fit: true}
+ {name: "mainSubgroup", components: [ // not a scroller, so we can addBefore
+ {kind: "XV.InputWidget", attr: "code"},
+ {kind: "XV.CheckboxWidget", attr: "isActive"},
+ {kind: "XV.SiteTypePicker", attr: "siteType"},
+ {kind: "XV.InputWidget", attr: "description"},
+ {kind: "XV.ContactWidget", attr: "contact", name: "contactWidget"},
+ {kind: "XV.AddressWidget", attr: "address"}
+ ]}
]}
]},
- {kind: "XV.SiteCommentBox", attr: "comments"}
+ {kind: "XV.SiteCommentBox", attr: "comments", name: "commentsPanel"}
]}
]
});
XV.registerModelWorkspace("XM.UserAccountRoleRelation", "XV.UserAccountRoleWorkspace");
XV.registerModelWorkspace("XM.UserAccountRoleListItem", "XV.UserAccountRoleWorkspace");
-
}());