Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 6f9e552

Browse files
author
Steven C. Buttgereit
committed
Merge branch 'release/MUSESUPERCHAR_2.2.0'
2 parents a81b485 + a3d6b30 commit 6f9e552

File tree

9 files changed

+283
-17
lines changed

9 files changed

+283
-17
lines changed

CONTRIBUTORS.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
Contributors to the Muse Systems Super Characteristics for xTuple ERP Project
2-
=============================================================================
1+
# Contributors to the Muse Systems Super Characteristics for xTuple ERP Project
2+
33
This is a list of those individuals and companies that have contributed to this project.
44

5-
Contributor Name | Contributor Company/Affiliation | Notes
6-
---------------------|---------------------------------|------------------------
7-
Steven C. Buttgereit | Muse Systems | Primary Maintainer
5+
| Contributor Name | Contributor Company/Affiliation | Notes |
6+
| -------------------- | ------------------------------- | ------------------ |
7+
| Steven C. Buttgereit | Muse Systems | Primary Maintainer |
8+
| Thomas A. Plick | | |

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Muse Systems Super Characteristics for xTuple ERP
2-
Copyright (C) 2017-2019 Lima Buttgereit Holdings LLC (d/b/a Muse Systems)
2+
Copyright (C) 2017-2020 Lima Buttgereit Holdings LLC (d/b/a Muse Systems)
33

44
This product includes software developed at Muse Systems (https://muse.systems/)
55

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Muse Systems Super Characteristics for xTuple ERP v2.1.1
1+
# Muse Systems Super Characteristics for xTuple ERP v2.2.0
Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
// File: accountNumber.js
2+
// Location: musesuperchar/client/scripts/forms/xtuple
3+
// Project: Muse Systems Super Characteristics for xTuple ERP
4+
//
5+
// Licensed to Lima Buttgereit Holdings LLC (d/b/a Muse Systems) under one or
6+
// more agreements. Muse Systems licenses this file to you under the Apache
7+
// License, Version 2.0.
8+
//
9+
// See the LICENSE file in the project root for license terms and conditions.
10+
// See the NOTICE file in the project root for copyright ownership information.
11+
//
12+
// muse.information@musesystems.com :: https://muse.systems
13+
14+
try {
15+
//////////////////////////////////////////////////////////////////////////
16+
// Namespace Definition
17+
//////////////////////////////////////////////////////////////////////////
18+
19+
if (typeof MuseSuperChar === "undefined") {
20+
MuseSuperChar = {};
21+
}
22+
23+
if (typeof MuseSuperChar.LedgerAccountNumber === "undefined") {
24+
MuseSuperChar.LedgerAccountNumber = {};
25+
}
26+
27+
//////////////////////////////////////////////////////////////////////////
28+
// Imports
29+
//////////////////////////////////////////////////////////////////////////
30+
31+
if (typeof MuseUtils === "undefined") {
32+
include("museUtils");
33+
}
34+
35+
MuseUtils.loadMuseUtils([
36+
MuseUtils.MOD_EXCEPTION,
37+
MuseUtils.MOD_JSPOLYFILL,
38+
MuseUtils.MOD_JS,
39+
MuseUtils.MOD_CONFIG
40+
]);
41+
42+
if (typeof MuseSuperChar.Loader === "undefined") {
43+
include("museScLoader");
44+
}
45+
} catch (e) {
46+
if (
47+
typeof MuseUtils !== "undefined" &&
48+
(MuseUtils.isMuseUtilsExceptionLoaded === true ? true : false)
49+
) {
50+
var error = new MuseUtils.ScriptException(
51+
"musesuperchar",
52+
"We encountered a script level issue while processing MuseSuperChar.LedgerAccountNumber.",
53+
"MuseSuperChar.LedgerAccountNumber",
54+
{ thrownError: e },
55+
MuseUtils.LOG_FATAL
56+
);
57+
58+
MuseUtils.displayError(error, mainwindow);
59+
} else {
60+
QMessageBox.critical(
61+
mainwindow,
62+
"MuseSuperChar.LedgerAccountNumber Script Error",
63+
"We encountered a script level issue while processing MuseSuperChar.LedgerAccountNumber."
64+
);
65+
}
66+
}
67+
68+
//////////////////////////////////////////////////////////////////////////
69+
// Module Defintion
70+
//////////////////////////////////////////////////////////////////////////
71+
72+
(function(pPublicApi, pGlobal) {
73+
try {
74+
//--------------------------------------------------------------------
75+
// Constants and Module State
76+
//--------------------------------------------------------------------
77+
// Constants
78+
var ENTITY_DATA_TABLE = "public_accnt";
79+
80+
// Mutable state
81+
var preSaveAccntId = null;
82+
var scWidget = null;
83+
84+
//--------------------------------------------------------------------
85+
// Get Object References From Screen Definitions
86+
//--------------------------------------------------------------------
87+
88+
//--------------------------------------------------------------------
89+
// Custom Screen Objects and Starting GUI Manipulation
90+
//--------------------------------------------------------------------
91+
92+
//--------------------------------------------------------------------
93+
// Private Functional Logic
94+
//--------------------------------------------------------------------
95+
var getAccntIdIfNecessary = function() {
96+
var get_param = function(name, property) {
97+
return mywindow.findChild(name)[property || "currentText"];
98+
};
99+
100+
if (!preSaveAccntId) {
101+
var params = {};
102+
params.number = get_param("_number", "text");
103+
params.profit = get_param("_profit");
104+
params.sub = get_param("_sub");
105+
params.company = get_param("_company");
106+
107+
var query = MuseUtils.executeQuery(
108+
"SELECT accnt_id " +
109+
"FROM accnt " +
110+
"WHERE accnt_number = <? value('number') ?> " +
111+
" AND accnt_profit = <? value('profit') ?> " +
112+
" AND accnt_sub = <? value('sub') ?> " +
113+
" AND accnt_company = <? value('company') ?> ",
114+
params
115+
);
116+
117+
if (query.first()) {
118+
preSaveAccntId = query.value("accnt_id");
119+
} else {
120+
throw new MuseUtils.NotFoundException(
121+
"musesuperchar",
122+
"We encountered an error while loading the new account record.",
123+
"MuseSuperChar.LedgerAccountNumber.getAccntIdIfNecessary",
124+
{
125+
params: params
126+
},
127+
MuseUtils.LOG_CRITICAL
128+
);
129+
}
130+
}
131+
};
132+
133+
var myPostSave = function() {
134+
getAccntIdIfNecessary();
135+
136+
try {
137+
if (
138+
!MuseUtils.isValidId(preSaveAccntId) ||
139+
MuseUtils.realNull(scWidget) === null
140+
) {
141+
return;
142+
}
143+
144+
scWidget.save(preSaveAccntId);
145+
preSaveAccntId = null;
146+
} catch (e) {
147+
var error = new MuseUtils.FormException(
148+
"musesuperchar",
149+
"We found problems while trying to save Super Characteristic data.",
150+
"MuseSuperChar.LedgerAccountNumber.myPostSave",
151+
{ thrownError: e },
152+
MuseUtils.LOG_CRITICAL
153+
);
154+
MuseUtils.displayError(error, mywindow);
155+
}
156+
};
157+
158+
var initSuperChar = function(pMode, pParentId) {
159+
if (MuseUtils.realNull(scWidget) === null) {
160+
return;
161+
}
162+
scWidget.initWidget(pMode, pParentId);
163+
};
164+
165+
//--------------------------------------------------------------------
166+
// Public Interface -- Slots
167+
//--------------------------------------------------------------------
168+
169+
//--------------------------------------------------------------------
170+
// Public Interface -- Functions
171+
//--------------------------------------------------------------------
172+
pPublicApi.getCurrentScWidget = function() {
173+
return scWidget;
174+
};
175+
176+
/**
177+
* Form startup initialization. Standard part of the xTuple ERP
178+
* startup process.
179+
* @param {Object} pParams An associative array of values passed from
180+
* the xTuple C++ forms which contain context
181+
* setting information.
182+
*/
183+
pPublicApi.set = function(pParams) {
184+
var myMode = pParams.mode.toString();
185+
preSaveAccntId = pParams.accnt_id;
186+
187+
if (["new", "edit", "view"].includes(myMode)) {
188+
if (scWidget === null) {
189+
scWidget = MuseSuperChar.Loader.getSuperCharWidget(
190+
ENTITY_DATA_TABLE
191+
);
192+
}
193+
194+
if (scWidget !== null) {
195+
mywindow.layout().addWidget(scWidget, 10, 0, 1, 5);
196+
} else {
197+
return;
198+
}
199+
200+
initSuperChar(myMode, preSaveAccntId);
201+
} else {
202+
return;
203+
}
204+
};
205+
206+
//--------------------------------------------------------------------
207+
// Definition Timed Connects/Disconnects
208+
//--------------------------------------------------------------------
209+
// MuseUtils.LedgerAccountNumber.addPreSaveHookFunc(myPreSave);
210+
MuseUtils.LedgerAccountNumber.addPostSaveHookFunc(myPostSave);
211+
212+
//--------------------------------------------------------------------
213+
// Foreign Script "Set" Handling
214+
//--------------------------------------------------------------------
215+
216+
// "Set" handling base on suggestion of Gil Moskowitz/xTuple.
217+
var foreignSetFunc;
218+
219+
// Lower graded scripts should be loaded prior to our call and as such we
220+
// should be able to intercept their set functions.
221+
if (typeof pGlobal.set === "function") {
222+
foreignSetFunc = pGlobal.set;
223+
} else {
224+
foreignSetFunc = function() {};
225+
}
226+
227+
pGlobal.set = function(pParams) {
228+
var funcParams = { pParams: pParams };
229+
230+
var myParams = MuseUtils.parseParams(pParams || {});
231+
232+
try {
233+
foreignSetFunc(myParams);
234+
pPublicApi.set(myParams);
235+
} catch (e) {
236+
var error = new MuseUtils.ModuleException(
237+
"musesuperchar",
238+
"We enountered an error while initializing the form.",
239+
"global.set",
240+
{
241+
params: funcParams,
242+
thrownError: e,
243+
context: {
244+
parsedParams: myParams
245+
}
246+
},
247+
MuseUtils.LOG_FATAL
248+
);
249+
MuseUtils.displayError(error, mywindow);
250+
mywindow.close();
251+
}
252+
};
253+
} catch (e) {
254+
var error = new MuseUtils.ModuleException(
255+
"musesuperchar",
256+
"We enountered a MuseSuperChar.LedgerAccountNumber module error that wasn't otherwise caught and handled.",
257+
"MuseSuperChar.LedgerAccountNumber",
258+
{ thrownError: e },
259+
MuseUtils.LOG_FATAL
260+
);
261+
MuseUtils.displayError(error, mainwindow);
262+
}
263+
})(MuseSuperChar.LedgerAccountNumber, this);

client/scripts/libraries/museScLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ try {
294294
var dataRecId;
295295

296296
try {
297-
if (pParentRecId !== null) {
297+
if (MuseUtils.realNull(pParentRecId) !== null) {
298298
dataRecId = pEntityObject.initFormData(
299299
pEntityObject.getDataRecIdByParentId(pParentRecId)
300300
);

database/functions/get_qt_data_js_template.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION musesuperchar.get_qt_data_js_template()
2424
$JS$
2525
// File: %7$s%5$s
2626
// Project: Muse Systems Super Characteristics for xTuple ERP
27-
// Version: 2.1.1
27+
// Version: 2.2.0
2828
// Created: %4$s Script Automatically Generated On %8$s
2929
//
3030
// Licensed to Lima Buttgereit Holdings LLC (d/b/a Muse Systems) under one or

database/functions/get_qt_form_js_template.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ CREATE OR REPLACE FUNCTION musesuperchar.get_qt_form_js_template()
2525
$JS$
2626
// File: %8$s%2$s
2727
// Project: Muse Systems Super Characteristics for xTuple ERP
28-
// Version: 2.1.1
28+
// Version: 2.2.0
2929
// Created: %9$s Script Automatically Generated On %10$s
3030
//
3131
// Licensed to Lima Buttgereit Holdings LLC (d/b/a Muse Systems) under one or

database/misc/entities_seed_data.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
--,('public','prjtask','prjtask_id','Project Task',true)
4444
,('public','tohead','tohead_id','Transfer Order',true)
4545
,('public','toitem','toitem_id','Transfer Order Item',true)
46+
,('public','accnt','accnt_id', 'General Ledger Account',true)
4647
)
4748
AS q( entity_schema
4849
,entity_table

package.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name="musesuperchar"
33
developer="Muse Systems"
44
descrip="A package to provide an enhanced, more broadly functional user defined field functionality."
5-
version="2.1.1"
5+
version="2.2.0"
66
updater="2.5.2">
77

88
<pkgnotes>
@@ -12,10 +12,10 @@
1212
<message>
1313
&lt;p>
1414
Muse Systems Super Characteristics for xTuple ERP (musesuperchar) &lt;br/>
15-
Version 2.1.1
15+
Version 2.2.0
1616
&lt;/p>
1717
&lt;p>
18-
Copyright (C) 2017-2019 &lt;br/>
18+
Copyright (C) 2017-2020 &lt;br/>
1919
Lima Buttgereit Holdings LLC (d/b/a Muse Systems)&lt;br/>
2020
All Rights Reserved
2121
&lt;/p>
@@ -57,13 +57,13 @@ See the NOTICE file in the project root for full copyright ownership information
5757
WHERE pkghead_name = 'musextputils'
5858
)
5959
SELECT
60-
(major_version = 6 AND minor_version = 0 AND patch_version >= 0)
61-
OR (major_version = 6 AND minor_version > 0)
60+
(major_version = 6 AND minor_version = 1 AND patch_version >= 0)
61+
OR (major_version = 6 AND minor_version > 1)
6262
OR (major_version > 6)
6363
FROM version;
6464
</query>
6565
<message>
66-
This package requires that the Muse Systems xTuple Utilities version 6.0.0 or any higher version 4 series is installed prior to installation of this package.
66+
This package requires that the Muse Systems xTuple Utilities version 6.1.0 or any higher version 6 series is installed prior to installation of this package.
6767
</message>
6868
</prerequisite>
6969
<loadpriv name="maintainSuperCharateristics" module="Muse Systems Super Characteristics">
@@ -200,6 +200,7 @@ See the NOTICE file in the project root for full copyright ownership information
200200
<loadappscript file="client/scripts/forms/xtuple/purchaseOrder.js" name="purchaseOrder" order="8">Muse Super Characteristics Purchase Order Form Loader.</loadappscript>
201201
<loadappscript file="client/scripts/forms/xtuple/purchaseOrderItem.js" name="purchaseOrderItem" order="8">Muse Super Characteristics Purchase Order Item Form Loader.</loadappscript>
202202
<loadappscript file="client/scripts/forms/xtuple/shipTo.js" name="shipTo" order="8">Muse Super Characteristics Customer Ship-To Form Loader</loadappscript>
203+
<loadappscript file="client/scripts/forms/xtuple/accountNumber.js" name="accountNumber" order="8">Muse Super Characteristics Ledger Account Number Form Loader.</loadappscript>
203204
<loadappscript file="client/scripts/forms/muse_ext/museRequestForQuote.js" name="museRequestForQuote" order="8">Muse Super Characteristics Muse Request for Quote Form Loader</loadappscript>
204205
<loadappscript file="client/scripts/forms/muse_ext/museRequestForQuoteItem.js" name="museRequestForQuoteItem" order="8">Muse Super Characteristics Muse Request for Quote Item Form Loader</loadappscript>
205206
<loadappscript file="client/scripts/forms/muse_ext/museRequestForQuoteVendItem.js" name="museRequestForQuoteVendItem" order="8">Muse Super Characteristics Muse Request for Quote Vendor Item Form Loader</loadappscript>
@@ -212,4 +213,4 @@ See the NOTICE file in the project root for full copyright ownership information
212213
<finalscript file="database/misc/delete_internal_names_maint_priv.sql" />
213214
<finalscript file="database/misc/update_autogenerated_scripts.sql" />
214215

215-
</package>
216+
</package>

0 commit comments

Comments
 (0)