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

#1051579: Offer_lib: Add #buildOfferReport(...) function and use...

#1051579: Offer_lib: Add #buildOfferReport(...) function and use neon.openContext(...) for #openOfferReport(...)
parent 3d18be00
No related branches found
No related tags found
No related merge requests found
......@@ -94,15 +94,14 @@ OfferUtils.createNewOffer = function(pContextId, pRowId, pRelationId, pActivityI
neon.openContext("Offer", null, null, neon.OPERATINGSTATE_NEW, params);
}
/*
* Open Offer report, the report is translated to the language of the offer
/**
* Builds the Offer report.
*
* @param {String} pOfferID
*
* @return {[]}
* @return {Array} [filename, data_bytes]
*/
OfferUtils.openOfferReport = function (pOfferID)
{
OfferUtils.buildOfferReport = function (pOfferID)
{
var offerReport = new Report("Offer_report");
var sqlUtil = new SqlMaskingUtils();
......@@ -165,7 +164,7 @@ OfferUtils.openOfferReport = function (pOfferID)
.table();
if (itemData.length == 0)
return;
return null;
var fullPrice = 0;
var itemSum = 0;
......@@ -295,7 +294,20 @@ OfferUtils.openOfferReport = function (pOfferID)
"OFFERITEM_UNITTEXT"
])
.add(itemData));
offerReport.openReport();
return offerReport.exportReport();
}
/*
* Open Offer report, the report is translated to the language of the offer
*
* @param {String} pOfferID
*
* @return {[]}
*/
OfferUtils.openOfferReport = function (pOfferID)
{
neon.openContext("Offer", "OfferReport_view", [pOfferID], 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