where aropen_cust_id = $1
and aropen_open
--and aropen_posted = false
- group by aropen_id
+ group by aropen_id, aropen_cust_id, aropen_curr_id, aropen_amount
) unalloc;
$$ language sql;
-select xt.add_report_definition('XM.Invoice', 0, $${
+select xt.add_report_definition('XM.Invoice', 0, $${
"settings": {
"detailAttribute": "lineItems",
"defaultFontSize": 12,
},
{"element": "bandLine", "size": 2},
{
+ "element": "band",
"definition": [
- {"attr": "subtotal", "label": true},
- {"attr": "taxTotal", "label": true},
- {"attr": "total", "label": true}
+ {"text": "_subtotal", "label": true, "width": 70, "align": "left"},
+ {"attr": "subtotal", "width": 100, "align": "right"}
],
- "options": {"width": 525, "align": "right"}
+ "options": {"border": 0, "x": 360}
+ },
+ {
+ "element": "band",
+ "definition": [
+ {"text": "_taxTotal", "label": true, "width": 70, "align": "left"},
+ {"attr": "taxTotal", "width": 100, "align": "right"}
+ ],
+ "options": {"border": 0, "x": 360}
+ },
+ {
+ "element": "band",
+ "definition": [
+ {"text": "_total", "label": true, "width": 70, "align": "left"},
+ {"attr": "total", "width": 100, "align": "right"}
+ ],
+ "options": {"border": 0, "x": 360}
+ },
+ {
+ "definition": []
}
],
"pageFooterElements": [
RETURN createPurchaseToSale(pCoitemId, pItemSourceId, pDropShip, NULL, NULL, NULL);
END;
-$$ LANGUAGE 'plpgsql';
+$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION createPurchaseToSale(INTEGER, INTEGER, BOOLEAN, NUMERIC) RETURNS INTEGER AS $$
RETURN createPurchaseToSale(pCoitemId, pItemSourceId, pDropShip, NULL, NULL, pPrice);
END;
-$$ LANGUAGE 'plpgsql';
+$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION createPurchaseToSale(INTEGER, INTEGER, BOOLEAN, NUMERIC, DATE, NUMERIC) RETURNS INTEGER AS $$
RETURN createPurchaseToSale(pCoitemId, pItemSourceId, pDropShip, pQty, pDueDate, pPrice, NULL);
END;
-$$ LANGUAGE 'plpgsql';
+$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION createPurchaseToSale(INTEGER, INTEGER, BOOLEAN, NUMERIC, DATE, NUMERIC, INTEGER) RETURNS INTEGER AS $$
FROM pohead
WHERE ( (pohead_status = 'U')
AND (pohead_vend_id = _i.itemsrc_vend_id)
- AND (pohead_shiptoname = COALESCE(_s.cohead_shiptoname, _s.shipto_name, ''))
- AND (pohead_shiptoaddress1 = COALESCE(_s.cohead_shiptoaddress1, _s.addr_line1, ''))
- AND (pohead_shiptoaddress2 = COALESCE(_s.cohead_shiptoaddress2, _s.addr_line2, ''))
- AND (pohead_shiptoaddress3 = COALESCE(_s.cohead_shiptoaddress3, _s.addr_line3, ''))
- AND (pohead_shiptocity = COALESCE(_s.cohead_shiptocity, _s.addr_city, ''))
- AND (pohead_shiptostate = COALESCE(_s.cohead_shiptostate, _s.addr_state, ''))
- AND (pohead_shiptozipcode = COALESCE(_s.cohead_shiptozipcode, _s.addr_postalcode, ''))
- AND (pohead_shiptocountry = COALESCE(_s.cohead_shiptocountry, _s.addr_country, ''))
+ AND (COALESCE(pohead_shiptoname, '') = COALESCE(_s.cohead_shiptoname, _s.shipto_name, ''))
+ AND (COALESCE(pohead_shiptoaddress1, '') = COALESCE(_s.cohead_shiptoaddress1, _s.addr_line1, ''))
+ AND (COALESCE(pohead_shiptoaddress2, '') = COALESCE(_s.cohead_shiptoaddress2, _s.addr_line2, ''))
+ AND (COALESCE(pohead_shiptoaddress3, '') = COALESCE(_s.cohead_shiptoaddress3, _s.addr_line3, ''))
+ AND (COALESCE(pohead_shiptocity, '') = COALESCE(_s.cohead_shiptocity, _s.addr_city, ''))
+ AND (COALESCE(pohead_shiptostate, '') = COALESCE(_s.cohead_shiptostate, _s.addr_state, ''))
+ AND (COALESCE(pohead_shiptozipcode, '') = COALESCE(_s.cohead_shiptozipcode, _s.addr_postalcode, ''))
+ AND (COALESCE(pohead_shiptocountry, '') = COALESCE(_s.cohead_shiptocountry, _s.addr_country, ''))
AND ((pohead_id=pPoheadId) OR (pPoheadid IS NULL)) );
ELSE
SELECT COALESCE(pohead_id, -1) INTO _temp
FROM pohead
WHERE ( (pohead_status = 'U')
AND (pohead_vend_id = _i.itemsrc_vend_id)
- AND (pohead_shiptoaddress1 = COALESCE(_w.addr_line1, ''))
- AND (pohead_shiptoaddress2 = COALESCE(_w.addr_line2, ''))
- AND (pohead_shiptoaddress3 = COALESCE(_w.addr_line3, ''))
- AND (pohead_shiptocity = COALESCE(_w.addr_city, ''))
- AND (pohead_shiptostate = COALESCE(_w.addr_state, ''))
- AND (pohead_shiptozipcode = COALESCE(_w.addr_postalcode, ''))
- AND (pohead_shiptocountry = COALESCE(_w.addr_country, ''))
+ AND (COALESCE(pohead_shiptoaddress1, '') = COALESCE(_w.addr_line1, ''))
+ AND (COALESCE(pohead_shiptoaddress2, '') = COALESCE(_w.addr_line2, ''))
+ AND (COALESCE(pohead_shiptoaddress3, '') = COALESCE(_w.addr_line3, ''))
+ AND (COALESCE(pohead_shiptocity, '') = COALESCE(_w.addr_city, ''))
+ AND (COALESCE(pohead_shiptostate, '') = COALESCE(_w.addr_state, ''))
+ AND (COALESCE(pohead_shiptozipcode, '') = COALESCE(_w.addr_postalcode, ''))
+ AND (COALESCE(pohead_shiptocountry, '') = COALESCE(_w.addr_country, ''))
AND ((pohead_id=pPoheadId) OR (pPoheadid IS NULL)) );
END IF;
RETURN _poitemid;
END;
-$$ LANGUAGE 'plpgsql' VOLATILE;
+$$ LANGUAGE plpgsql VOLATILE;
select xt.create_table('bankrecimport', 'public');
select xt.add_column('bankrecimport','bankrecimport_id', 'SERIAL', 'PRIMARY KEY', 'public');
-select xt.add_column('bankrecimport','bankrecimport_reference', 'TEXT', 'NOT NULL', 'public');
-select xt.add_column('bankrecimport','bankrecimport_descrip', 'TEXT', 'NOT NULL', 'public');
-select xt.add_column('bankrecimport','bankrecimport_comment', 'TEXT', 'NOT NULL', 'public');
-select xt.add_column('bankrecimport','bankrecimport_debit_amount', 'NUMERIC', 'NOT NULL', 'public');
-select xt.add_column('bankrecimport','bankrecimport_credit_amount', 'NUMERIC', 'NOT NULL', 'public');
-select xt.add_column('bankrecimport','bankrecimport_effdate', 'DATE', 'NOT NULL', 'public');
-select xt.add_column('bankrecimport','bankrecimport_curr_rate', 'NUMERIC', 'NOT NULL', 'public');
+select xt.add_column('bankrecimport','bankrecimport_reference', 'TEXT', NULL, 'public');
+select xt.add_column('bankrecimport','bankrecimport_descrip', 'TEXT', NULL, 'public');
+select xt.add_column('bankrecimport','bankrecimport_comment', 'TEXT', NULL, 'public');
+select xt.add_column('bankrecimport','bankrecimport_debit_amount', 'NUMERIC', NULL, 'public');
+select xt.add_column('bankrecimport','bankrecimport_credit_amount', 'NUMERIC', NULL, 'public');
+select xt.add_column('bankrecimport','bankrecimport_effdate', 'DATE', NULL, 'public');
+select xt.add_column('bankrecimport','bankrecimport_curr_rate', 'NUMERIC', NULL, 'public');
},
fetchSuccess = function (model, result) {
var sendExtensions = function (res, extensions) {
+ var filteredExtensions;
+ if (req.query.extensions) {
+ // the user is requesting to only see a certain set of extensions
+ filteredExtensions = JSON.parse(req.query.extensions);
+ extensions = extensions.filter(function (ext) {
+ return _.contains(filteredExtensions, ext.name);
+ });
+ }
+
extensions.sort(function (ext1, ext2) {
if (ext1.loadOrder !== ext2.loadOrder) {
return ext1.loadOrder - ext2.loadOrder;
function (req, res, next) {
var pathName = "/app";
if (req && req.session && !req.session.oauth2 && req.session.passport && req.session.passport.user && req.session.passport.user.organization) {
+ if (req.body.extensions) {
+ pathName = pathName + "?extensions=" + req.body.extensions;
+ }
if (req.body.hash && req.body.hash.charAt(0) === "#") {
pathName = pathName + req.body.hash;
}
}
},
"xtuple-linguist": {
- "version": "0.1.0",
- "from": "xtuple-linguist@0.1.x",
- "resolved": "https://registry.npmjs.org/xtuple-linguist/-/xtuple-linguist-0.1.0.tgz"
+ "version": "0.1.1",
+ "from": "xtuple-linguist@0.1.x"
},
"xtuple-query": {
"version": "1.0.2",
@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")) {