Skip to content
Snippets Groups Projects
Commit 7fef1316 authored by Andre Loreth's avatar Andre Loreth
Browse files

#1051579: Order: Implement OrderReport_view

parent b9573099
No related branches found
No related tags found
No related merge requests found
......@@ -956,6 +956,10 @@
<name>REMINDER_REPORT_DATA</name>
<valueProcess>%aditoprj%/entity/Order_entity/entityfields/reminder_report_data/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>ORDER_REPORT_DATA</name>
<valueProcess>%aditoprj%/entity/Order_entity/entityfields/order_report_data/valueProcess.js</valueProcess>
</entityField>
<entityConsumer>
<name>Organisations</name>
<dependency>
......
import("system.result");
import("system.vars");
import("Order_lib");
var reportData = OrderUtils.buildOrderReport(vars.get("$field.SALESORDERID"));
if(reportData != null) {
result.string(reportData[1]);
}
\ No newline at end of file
......@@ -47,5 +47,13 @@
<name>5a70d5cf-d1d8-4773-900c-1376f5b9a988</name>
<view>OrderPaid_view</view>
</neonViewReference>
<neonViewReference>
<name>280d32c7-3ad2-4897-9123-a0e953a768ec</name>
<view>OrderReminderReport_view</view>
</neonViewReference>
<neonViewReference>
<name>99e9bf9f-3aa0-48c6-b136-6b0d81f602d4</name>
<view>OrderReport_view</view>
</neonViewReference>
</references>
</neonContext>
<?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.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.4">
<name>OrderReport_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<reportViewTemplate>
<name>Report</name>
<reportData>ORDER_REPORT_DATA</reportData>
<entityField>#ENTITY</entityField>
</reportViewTemplate>
</children>
</neonView>
......@@ -164,8 +164,14 @@ OrderUtils.copyOfferItemsToOrder = function (pSourceOfferId, pSourceOfferId)
.updateData(true, "SALESORDER", cols, null, vals);
}
OrderUtils.openOrderReport = function (pOrderID)
{
/**
* Will build the order report for the given order.
*
* @param {String} pOrderID The ID of the order, for which the report shall be built.
* @return {Array} [filename, data]
*/
OrderUtils.buildOrderReport = function (pOrderID)
{
var orderReport = new Report("Salesorder_report");
var sqlUtil = new SqlMaskingUtils();
......@@ -228,7 +234,7 @@ OrderUtils.openOrderReport = function (pOrderID)
.table();
if (itemData.length == 0)
return;
return null;
var fullPrice = 0;
var itemSum = 0;
......@@ -368,7 +374,18 @@ OrderUtils.openOrderReport = function (pOrderID)
"ORDERITEM.VAT"
])
.add(itemData));
orderReport.openReport();
return orderReport.exportReport();
}
/**
* Will open the report for the given order.
*
* @param {String} pOrderID The ID of the order which shall be opened.l
*/
OrderUtils.openOrderReport = function (pOrderID)
{
neon.openContext("Order", "OrderReport_view", [pOrderID], neon.OPERATINGSTATE_VIEW, null);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment