var gridRow;
workspace.value.on("change:total", done);
- workspace.$.invoiceLineItemBox.newItem();
- gridRow = workspace.$.invoiceLineItemBox.$.editableGridRow;
+ workspace.$.lineItemBox.newItem();
+ gridRow = workspace.$.lineItemBox.$.editableGridRow;
// TODO
//gridRow.$.itemSiteWidget.doValueChange({value: {item: submodels.itemModel,
//site: submodels.siteModel}});
"XV.InvoiceListItem", function () {
XT.session.privileges.attributes.ViewMiscInvoices = false;
XT.session.privileges.attributes.MaintainMiscInvoices = false;
+ XT.session.privileges.attributes.ViewPersonalCRMAccounts = false;
assert.isFalse(XM.InvoiceListItem.canRead());
XT.session.privileges.attributes.ViewMiscInvoices = true;
assert.isTrue(XM.InvoiceListItem.canRead());
XT.session.privileges.attributes.ViewMiscInvoices = true;
+ XT.session.privileges.attributes.ViewPersonalCRMAccounts = true;
});
it("XM.InvoiceListItem is not editable", function () {
assert.isFalse(XM.InvoiceListItem.canCreate());
@description When currency or invoice date is changed outstanding credit should be
recalculated.
*/
- it.skip("When currency or invoice date is changed outstanding credit should be recalculated",
+ it("When currency or invoice date is changed outstanding credit should be recalculated",
function (done) {
- // frustratingly nondeterministic
+
this.timeout(9000);
var outstandingCreditChanged = function () {
if (invoiceModel.get("outstandingCredit")) {
@description The InvoiceList should be printable
*/
it("XV.InvoiceList should be printable", function () {
- var list = new XV.InvoiceList();
- assert.isTrue(list.getAllowPrint());
+ var list = new XV.InvoiceList(),
+ actions = list.actions;
+ assert.include(_.pluck(actions, 'name'), 'print');
+ assert.include(_.pluck(actions, 'name'), 'email');
});
});
.prototype.model.prototype.recordType;
assert.equal(attrModel, widgetModel);
});
+ /**
+ @member Buttons
+ @memberof Invoice
+ @description The InvoiceWorkspace should be printable
+ */
+ it("XV.InvoiceWorkspace should be printable", function () {
+ var workspace = new XV.InvoiceWorkspace(),
+ actions = workspace.actions;
+ assert.include(_.pluck(actions, 'name'), 'print');
+ assert.include(_.pluck(actions, 'name'), 'email');
+ });
/**
@member Navigation
@memberof Invoice
enyo.platform.touch = true;
workspace = new XV.InvoiceWorkspace();
- assert.equal(workspace.$.invoiceLineItemBox.kind, "XV.InvoiceLineItemBox");
+ assert.equal(workspace.$.lineItemBox.kind, "XV.InvoiceLineItemBox");
enyo.platform.touch = false;
workspace = new XV.InvoiceWorkspace();
- assert.equal(workspace.$.invoiceLineItemBox.kind, "XV.InvoiceLineItemGridBox");
+ assert.equal(workspace.$.lineItemBox.kind, "XV.InvoiceLineItemGridBox");
});
/**
@member Navigation
exports.spec = spec;
exports.additionalTests = additionalTests;
-
-
/*
-***** CHANGES MADE BY INVENTORY EXTENSION ******
-
-* XM.InvoiceLine will include:
- > Boolean "updateInventory"
-* The updateInventory attribute is readOnly unless all the following are true
- > The invoice is unposted.
- > A valid item is selected.
- > The item and site do not resolve to an item site that is job cost
- > There is no associated salesOrderLine (attr added by sales extension)
-
-* XM.InvoiceListItem will include:
- > String "shipDate"
- > String "shipToName"
-* XM.InvoiceListItem will extend the post function to include inventory information
- * For each line item where "updateInventory" is true, issue materials to the invoice
- * Capture distribution detail (trace and location) where applicable
-#HINT: This will likely require creating an alternate dispatchable "post" function that
- accepts an invoice id _and_ inventory data.
-
-* XM.Invoice will include:
- > Date "shipDate" default today
- > CustomerShiptoRelation "shipto"
- > String "shiptoName"
- > String "shiptoAddress1"
- > String "shiptoAddress2"
- > String "shiptoAddress3"
- > String "shiptoCity"
- > String "shiptoState"
- > String "shiptoPostalCode"
- > String "shiptoCountry"
- > String "shiptoPhone"
- > ShipCharge "shipCharge"
- > ShipZone "shipZone"
- > String "incoterms" // HINT: This is the "invchead_fob" field
- > String "shipVia" (The preferred Ship Via method for the Customer will appear in the field. You may change the Ship Via using the list.)
- > Money "freight" required, default 0
-* When the customer changes will copy the following attributes from the customer model:
- > shipCharge
- > shipto (If a default customer shipto exists)
- > The following fields will be set to read only if the customer does not allow free
- form shipnto:
- - shiptoName
- - shiptoAddress1
- - shiptoAddress2
- - shiptoAddress3
- - shiptoCity
- - shiptoState
- - shiptoPostalCode
- - shiptoCountry
- - shiptoPhone
-* The inventory extension adds a function to XM.Invoice "copyBilltoToShipto" that
-does the following
- > Clears the shipto
- > Copies billto name, address fields and phone number to shipto equivilants.
- > Sets the invoice tax zone to the customer tax zone.
-* When an invoice is loaded where "isPosted" is true, then the following attributes
-will be made read only:
- > lineItems
- > number
- > invoiceDate
- > terms
- > salesrep
- > commission
- > taxZone
- > shipCharges
- > project
- > freight
- > shipZone
- > saleType
-
-* If the shipto changes to a value, the following fields should be set based on information
-from the shipto:
- - shiptoName (= customer.shipto.name)
- - shiptoAddress1
- - shiptoAddress2
- - shiptoAddress3
- - shiptoCity
- - shiptoState
- - shiptoPostalCode
- - shiptoCountry (< ^ should be populated by the default customer.shipto.address).
- - shiptoPhone
- - salesRep
- - commission
- - taxZone
- - shipCharge
- - shipZone
-* if the shipto is cleared these fields should be unset
- - shiptoName
- - shiptoAddress1
- - shiptoAddress2
- - shiptoAddress3
- - shiptoCity
- - shiptoState
- - shiptoPostalCode
- - shiptoCountry
- - shiptoPhone
-* If any of the above listed shipto attributes are manually altered, the shipto is unset.
-
-* Freight should be read only and zero when the "isCustomerPay" property is false on the ship
-charge associated with the invoice.
-
-* totalTax should be recalculated when freight changes.
-
-* Add the following to the invoice workspace:
- > When the customer is changed on the XV.InvoiceWorkspace model:
- - customer should be set on shipto relation so that it will search on and select from that
- customer's shipto addresses.
- - The bill to address should be supplimented with a "Shipto" button that when clicked runs
- the copyToShipto function ()
- - The copy ship to button should be disabled if the customer does not allow free-form shiptos.
- > The shipto addresses available when searching addresses sholud filter on the addresses
- associated with the customer's account record by default.
-
***** CHANGES MADE BY MANUFACTURING EXTENSION ******
* A nested only model should be created according to convention for many-to-many document