diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 4e84661dad2abf9988e1faa3e2cd03aa0f1bc1ce..4c2e282be88bc5cfcbd033fe50886f623245d9d2 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -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) } /**