diff --git a/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml b/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml index 0f8749413fb4927540c598748a39254953e04ae3..1ed165aa2aa0b9b21ad17879742d894e1a621eb6 100644 --- a/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml +++ b/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml @@ -172,6 +172,8 @@ <column name="ORDERTYPE" value="ORDTYPECONF"/> <column name="ORDERSTATUS" valueNumeric="1"/> <column name="CANCELLATION" valueNumeric="0"/> + <column name="PAYMENTTERMS" value="PAYTERM30"/> + <column name="DELIVERYTERMS" value="DELIVEREX"/> <column name="VAT" valueNumeric="79.80"/> <column name="VERSNR" valueNumeric="1"/> </insert> diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 9cc37684ef04edcdc31309c05205f06128151b0c..85a67133c3d4d3d49caa571c91528533331fe9f4 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -817,6 +817,7 @@ <title>Footer text</title> <contentType>LONG_TEXT</contentType> <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/footer/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Offer_entity/entityfields/footer/displayValueProcess.js</displayValueProcess> </entityField> <entityParameter> <name>OfferFooter_param</name> diff --git a/entity/Offer_entity/entityfields/footer/displayValueProcess.js b/entity/Offer_entity/entityfields/footer/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Offer_entity/entityfields/header/valueProcess.js b/entity/Offer_entity/entityfields/header/valueProcess.js index 7cdc3a91214e06e8563c42f3c0fb2b11469cd2e1..a271b33322c83b7cd69b4fd90a81b4fe3174467e 100644 --- a/entity/Offer_entity/entityfields/header/valueProcess.js +++ b/entity/Offer_entity/entityfields/header/valueProcess.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.result"); import("system.vars"); import("system.neon"); @@ -16,5 +17,6 @@ else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) if (vars.get("$field.ChoosenTEXHeader") != "") { var binaryId = db.cell("select ID from ASYS_BINARIES where ROW_ID = '" + vars.get("$field.ChoosenTEXHeader") + "'", "_____SYSTEMALIAS"); + logging.log(binaryId); result.string(util.decodeBase64String(db.getBinaryContent(binaryId, "_____SYSTEMALIAS"))); } \ No newline at end of file diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index 3ad7ade2791b19107c93c1e30602172319fd1255..77b11149e4947d4c22d493562d6af0c54ae5b883 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -89,11 +89,13 @@ <entityField> <name>HEADER</name> <title>Header text</title> + <contentType>LONG_TEXT</contentType> <valueProcess>%aditoprj%/entity/Order_entity/entityfields/header/valueProcess.js</valueProcess> </entityField> <entityField> <name>FOOTER</name> <title>Footer text</title> + <contentType>LONG_TEXT</contentType> <valueProcess>%aditoprj%/entity/Order_entity/entityfields/footer/valueProcess.js</valueProcess> </entityField> <entityConsumer> @@ -873,6 +875,10 @@ <element>PROCESS_SETVALUE</element> </onValueChangeTypes> </entityField> + <entityParameter> + <name>Countitems_param</name> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/countitems_param/valueProcess.js</valueProcess> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Order_entity/entityfields/cancel/stateProcess.js b/entity/Order_entity/entityfields/cancel/stateProcess.js index 60ed19a122506960384cafdc565307923d3e3ac3..d2422a80d005cdfced6f31c546de95c0d0278af7 100644 --- a/entity/Order_entity/entityfields/cancel/stateProcess.js +++ b/entity/Order_entity/entityfields/cancel/stateProcess.js @@ -1,3 +1,5 @@ +import("system.logging"); +import("system.entities"); import("system.vars"); import("system.result"); import("system.db"); @@ -5,12 +7,36 @@ import("Sql_lib"); import("system.neon"); import("Keyword_lib"); import("KeywordRegistry_basic"); - -if(vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$confirmation()||vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$invoice()) + +//var conf = entities.createConfigForLoadingRows() +// .entity("Orderitem_entity") +// .provider("Orderitems") +// .addParameter("ContactId_param", vars.get("$field.CONTACT_ID")); +// +//var count=entities.getRowCount(conf); +// +////var count = vars.get("$param.Countitems_param"); +////count = Number(count); +//logging.log(count); +//if (count>"0"){ + +var itemcount = db.cell(SqlCondition.begin() + .andPrepareVars("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDERID") + .buildSql("select count(*) from SALESORDERITEM", "1=2")); + +if(itemcount == "0") + result.string(neon.COMPONENTSTATE_DISABLED); + + +else if(vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$confirmation()||vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$invoice()) if (vars.get("$field.CANCELLATION")=="0"){ result.string(neon.COMPONENTSTATE_EDITABLE); } else + result.string(neon.COMPONENTSTATE_DISABLED); + +//} + else result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/countitems_param/valueProcess.js b/entity/Order_entity/entityfields/countitems_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..fc714e95d0903906495442940ca974d4be2b1b59 --- /dev/null +++ b/entity/Order_entity/entityfields/countitems_param/valueProcess.js @@ -0,0 +1,15 @@ +//import("system.result"); +//import("system.vars"); +//import("system.neon"); +//import("system.entities"); +// +////var loadingConfig = entities.createConfigForLoadingConsumerRows().consumer("Orderitems"); +////var count = entities.getRowCount(loadingConfig); +// +//var conf = entities.createConfigForLoadingRows() +// .entity("Orderitem_entity") +// .provider("Orderitems") +// .addParameter("ContactId_param", vars.get("$field.CONTACT_ID")); +// +//var count=entities.getRowCount(conf); +//result.string(count); diff --git a/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js b/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js index 1e149a6637cc2036183e47fee37c68d5eab4fcd3..3d6da693a6097d19172ad816dc6465e126fec9a9 100644 --- a/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js +++ b/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js @@ -1,2 +1,2 @@ import("system.result"); -result.string("5") \ No newline at end of file +result.string(5) \ No newline at end of file diff --git a/entity/Order_entity/entityfields/header/valueProcess.js b/entity/Order_entity/entityfields/header/valueProcess.js index 96436bf9899f3155c3ca1a924edcc28556654611..7defd5651e4772bedd18ba5ddeca431ff3e982a3 100644 --- a/entity/Order_entity/entityfields/header/valueProcess.js +++ b/entity/Order_entity/entityfields/header/valueProcess.js @@ -1,14 +1,12 @@ +import("system.logging"); import("system.result"); import("system.vars"); import("system.neon"); import("system.db"); import("system.util"); -if (vars.exists("$param.OrderHeader_param")) -{ +if(vars.exists("$param.OrderHeader_param") && vars.get("$param.OrderHeader_param")) result.string(vars.get("$param.OrderHeader_param")); -} - else if(vars.get("$this.value")) result.string(vars.get("$this.value")); @@ -19,5 +17,6 @@ else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) if (vars.get("$field.ChosenTexHeader") != "") { var binaryId = db.cell("select ID from ASYS_BINARIES where ROW_ID = '" + vars.get("$field.ChosenTexHeader") + "'", "_____SYSTEMALIAS"); + logging.log(binaryId); result.string(util.decodeBase64String(db.getBinaryContent(binaryId, "_____SYSTEMALIAS"))); } \ No newline at end of file diff --git a/entity/Order_entity/entityfields/setdunning/stateProcess.js b/entity/Order_entity/entityfields/setdunning/stateProcess.js index b37d892353ecf34537348473744ca02dd7052bdc..50ba51671b5c75f055d93f88dd5e8cfbd4e15b3b 100644 --- a/entity/Order_entity/entityfields/setdunning/stateProcess.js +++ b/entity/Order_entity/entityfields/setdunning/stateProcess.js @@ -5,8 +5,16 @@ import("Sql_lib"); import("system.neon"); import("Keyword_lib"); import("KeywordRegistry_basic"); + +var itemcount = db.cell(SqlCondition.begin() + .andPrepareVars("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDERID") + .buildSql("select count(*) from SALESORDERITEM", "1=2")); + +if(itemcount == "0") + result.string(neon.COMPONENTSTATE_DISABLED); + -if (vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$invoice()) +else if (vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$invoice()) { if (vars.get("$field.ORDERSTATUS")=="1" && vars.get("$field.CANCELLATION")=="0") diff --git a/entity/Order_entity/entityfields/setpaid/stateProcess.js b/entity/Order_entity/entityfields/setpaid/stateProcess.js index 1c13f702c1eae459d158cae07d485c4c00b6eb24..5f9a54534115990966c267b702d1aeff3ce3f415 100644 --- a/entity/Order_entity/entityfields/setpaid/stateProcess.js +++ b/entity/Order_entity/entityfields/setpaid/stateProcess.js @@ -5,8 +5,16 @@ import("Sql_lib"); import("system.neon"); import("Keyword_lib"); import("KeywordRegistry_basic"); + +var itemcount = db.cell(SqlCondition.begin() + .andPrepareVars("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDERID") + .buildSql("select count(*) from SALESORDERITEM", "1=2")); + +if(itemcount == "0") + result.string(neon.COMPONENTSTATE_DISABLED); + -if (vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$invoice()|| vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$credit()) +else if (vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$invoice()|| vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$credit()) { if (vars.get("$field.ORDERSTATUS")=="1") diff --git a/entity/Order_entity/entityfields/setsent/stateProcess.js b/entity/Order_entity/entityfields/setsent/stateProcess.js index 64f658750d714ff28bc0574cb804f0e631a7ab3d..58fd03d38334ab142b7449b62e3ca49bbc6f333f 100644 --- a/entity/Order_entity/entityfields/setsent/stateProcess.js +++ b/entity/Order_entity/entityfields/setsent/stateProcess.js @@ -3,8 +3,16 @@ import("system.result"); import("system.db"); import("Sql_lib"); import("system.neon"); + +var itemcount = db.cell(SqlCondition.begin() + .andPrepareVars("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDERID") + .buildSql("select count(*) from SALESORDERITEM", "1=2")); + +if(itemcount == "0") + result.string(neon.COMPONENTSTATE_DISABLED); + -if(vars.get("$field.ORDERSTATUS")=="0") +else if(vars.get("$field.ORDERSTATUS")=="0") result.string(neon.COMPONENTSTATE_EDITABLE); else result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/transferdeliverynote/stateProcess.js b/entity/Order_entity/entityfields/transferdeliverynote/stateProcess.js index 91e355b5d4b5b65b38354cf98f534a256271fce7..70dcb91387b497cf5b6d275f9bb4c4b73ff17f12 100644 --- a/entity/Order_entity/entityfields/transferdeliverynote/stateProcess.js +++ b/entity/Order_entity/entityfields/transferdeliverynote/stateProcess.js @@ -5,8 +5,16 @@ import("Sql_lib"); import("system.neon"); import("Keyword_lib"); import("KeywordRegistry_basic"); + +var itemcount = db.cell(SqlCondition.begin() + .andPrepareVars("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDERID") + .buildSql("select count(*) from SALESORDERITEM", "1=2")); + +if(itemcount == "0") + result.string(neon.COMPONENTSTATE_DISABLED); + -if(vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$confirmation()) +else if(vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$confirmation()) result.string(neon.COMPONENTSTATE_EDITABLE); else if (vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$invoice()) { diff --git a/entity/Order_entity/entityfields/transferinvoice/stateProcess.js b/entity/Order_entity/entityfields/transferinvoice/stateProcess.js index 721ff268047c1f123bdecf5fe8b7980c712b352b..bf1ec7bf9d805b22bd5a4f7b0afa3273fae78c55 100644 --- a/entity/Order_entity/entityfields/transferinvoice/stateProcess.js +++ b/entity/Order_entity/entityfields/transferinvoice/stateProcess.js @@ -5,8 +5,16 @@ import("Sql_lib"); import("system.neon"); import("Keyword_lib"); import("KeywordRegistry_basic"); + +var itemcount = db.cell(SqlCondition.begin() + .andPrepareVars("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDERID") + .buildSql("select count(*) from SALESORDERITEM", "1=2")); + +if(itemcount == "0") + result.string(neon.COMPONENTSTATE_DISABLED); + -if(vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$confirmation()) +else if(vars.get("$field.ORDERTYPE")==$KeywordRegistry.orderType$confirmation()) result.string(neon.COMPONENTSTATE_EDITABLE); else result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/neonView/OrderFilter_view/OrderFilter_view.aod b/neonView/OrderFilter_view/OrderFilter_view.aod index ba8978b07a768fa83b2cbee1205540d010d23edd..6792e05db84d8e7163a3808e7934800ce78bbd74 100644 --- a/neonView/OrderFilter_view/OrderFilter_view.aod +++ b/neonView/OrderFilter_view/OrderFilter_view.aod @@ -1,94 +1,98 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>OrderFilter_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="true" /> - <dashletConfigurations> - <neonDashletConfiguration> - <name>AllOrdersDashlet</name> - <title>Receipts</title> - <description>Show all receipts</description> - <fragment>Order/filter</fragment> - <singleton v="true" /> - <requiresConfiguration v="false" /> - <icon>VAADIN:FILE_TEXT_O</icon> - <categories> - <neonDashletCategory> - <name>sales</name> - <title>Sales</title> - </neonDashletCategory> - <neonDashletCategory> - <name>order</name> - <title>Receipt</title> - </neonDashletCategory> - </categories> - </neonDashletConfiguration> - <neonDashletConfiguration> - <name>SendOrdersDashlet</name> - <title>Sent receipts</title> - <description>Show all sent receipts</description> - <fragment>Order/filter?search=W3sibmFtZSI6IlNUQVRVUyIsIm9wZXJhdG9yIjoiRVFVQUwiLCJ2YWx1ZUtleSI6IjIiLCJ2YWx1ZSI6IlZlcnNlbmRldCIsImNvbnRlbnRUeXBlIjoiVEVYVCJ9XQ%253D%253D</fragment> - <singleton v="true" /> - <requiresConfiguration v="false" /> - <icon>VAADIN:FILE_TEXT_O</icon> - <categories> - <neonDashletCategory> - <name>sales</name> - <title>Sales</title> - </neonDashletCategory> - <neonDashletCategory> - <name>order</name> - <title>Receipt</title> - </neonDashletCategory> - </categories> - </neonDashletConfiguration> - </dashletConfigurations> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <tableViewTemplate> - <name>Orders</name> - <inlineEdit v="true" /> - <iconField>IMAGE</iconField> - <titleField>SALESORDERCODE</titleField> - <subtitleField>STATUS</subtitleField> - <descriptionField>NET</descriptionField> - <entityField>#ENTITY</entityField> - <columns> - <neonTableColumn> - <name>8d4948c3-40cb-45dd-ae04-32ae06458b26</name> - <entityField>IMAGE</entityField> - </neonTableColumn> - <neonTableColumn> - <name>60b83daa-9349-4bef-94d8-5f1fc350da59</name> - <entityField>SALESORDERCODE</entityField> - </neonTableColumn> - <neonTableColumn> - <name>5688908f-7c50-46a3-8899-2767ea5b4a90</name> - <entityField>CONTACT_ORG_ID</entityField> - <width v="75" /> - <expandRatio v="100" /> - </neonTableColumn> - <neonTableColumn> - <name>6fdca295-2e0a-4f89-a386-1ddda8a3090c</name> - <entityField>CONTACT_PERSON_ID</entityField> - </neonTableColumn> - <neonTableColumn> - <name>443c8480-5676-43a3-9617-f86dae39c960</name> - <entityField>SALESORDERDATE</entityField> - </neonTableColumn> - <neonTableColumn> - <name>c5780864-ac2c-4650-8630-2690a9a074ea</name> - <entityField>STATUS</entityField> - </neonTableColumn> - <neonTableColumn> - <name>6f55da1e-281c-44ba-ab97-729b75516c32</name> - <entityField>NET</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> - </children> -</neonView> +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>OrderFilter_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> + <dashletConfigurations> + <neonDashletConfiguration> + <name>AllOrdersDashlet</name> + <title>Receipts</title> + <description>Show all receipts</description> + <fragment>Order/filter</fragment> + <singleton v="true" /> + <requiresConfiguration v="false" /> + <icon>VAADIN:FILE_TEXT_O</icon> + <categories> + <neonDashletCategory> + <name>sales</name> + <title>Sales</title> + </neonDashletCategory> + <neonDashletCategory> + <name>order</name> + <title>Receipt</title> + </neonDashletCategory> + </categories> + </neonDashletConfiguration> + <neonDashletConfiguration> + <name>SendOrdersDashlet</name> + <title>Sent receipts</title> + <description>Show all sent receipts</description> + <fragment>Order/filter?search=W3sibmFtZSI6IlNUQVRVUyIsIm9wZXJhdG9yIjoiRVFVQUwiLCJ2YWx1ZUtleSI6IjIiLCJ2YWx1ZSI6IlZlcnNlbmRldCIsImNvbnRlbnRUeXBlIjoiVEVYVCJ9XQ%253D%253D</fragment> + <singleton v="true" /> + <requiresConfiguration v="false" /> + <icon>VAADIN:FILE_TEXT_O</icon> + <categories> + <neonDashletCategory> + <name>sales</name> + <title>Sales</title> + </neonDashletCategory> + <neonDashletCategory> + <name>order</name> + <title>Receipt</title> + </neonDashletCategory> + </categories> + </neonDashletConfiguration> + </dashletConfigurations> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <tableViewTemplate> + <name>Orders</name> + <inlineEdit v="true" /> + <iconField>IMAGE</iconField> + <titleField>SALESORDERCODE</titleField> + <subtitleField>STATUS</subtitleField> + <descriptionField>NET</descriptionField> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>8d4948c3-40cb-45dd-ae04-32ae06458b26</name> + <entityField>IMAGE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>dba5604f-cc1b-4083-8115-7bbe1ba07bf4</name> + <entityField>ORDERTYPE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>60b83daa-9349-4bef-94d8-5f1fc350da59</name> + <entityField>SALESORDERCODE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>5688908f-7c50-46a3-8899-2767ea5b4a90</name> + <entityField>CONTACT_ORG_ID</entityField> + <width v="75" /> + <expandRatio v="100" /> + </neonTableColumn> + <neonTableColumn> + <name>6fdca295-2e0a-4f89-a386-1ddda8a3090c</name> + <entityField>CONTACT_PERSON_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>443c8480-5676-43a3-9617-f86dae39c960</name> + <entityField>SALESORDERDATE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>c5780864-ac2c-4650-8630-2690a9a074ea</name> + <entityField>STATUS</entityField> + </neonTableColumn> + <neonTableColumn> + <name>6f55da1e-281c-44ba-ab97-729b75516c32</name> + <entityField>NET</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/OrderPreview_view/OrderPreview_view.aod b/neonView/OrderPreview_view/OrderPreview_view.aod index 1e6378df7c83c302dbf7c2817ca6eddd03b6efc1..e2d1a4026ff9129e06cb641ab7dc77d1a8edcab3 100644 --- a/neonView/OrderPreview_view/OrderPreview_view.aod +++ b/neonView/OrderPreview_view/OrderPreview_view.aod @@ -56,6 +56,14 @@ <name>8f976c0e-f31d-4482-a8f7-7c93864f1815</name> <entityField>DELIVERYTERMS</entityField> </entityFieldLink> + <entityFieldLink> + <name>39a40fbb-b3af-49a2-8ce2-0ece7bbf6fda</name> + <entityField>ORDERSTATUS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>8604c69f-5f3d-472a-9b8f-b8f1bcaf25fe</name> + <entityField>CANCELLATION</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <genericViewTemplate>