Skip to content

Commit

Permalink
fix: Generate report on window as print.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Mar 13, 2024
1 parent b88a494 commit 13733ed
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
24 changes: 18 additions & 6 deletions src/api/ADempiere/reportManagement/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,38 @@
import { request } from '@/utils/ADempiere/request'

/**
* Get default value for a field, parameter or query criteria
* @param {number} id, identifier of field
* Generate report
* @param {number} id, identifier of Report
* @param {string} reportType, PDF, XLS, XML, TXT...
* @param {array} parameters, filters
* @param {number} printFormatId
* @param {number} reportViewId
* @param {boolean} isSummary, show as summary data
* @param {string} tableName, table of window tab
* @param {number} recordId, record of window tab
*/
export function generateReportRequest({
id,
parameters,
reportType,
parameters,
printFormatId,
reportViewId,
isSummary
isSummary,
// window
tableName,
recordId,
}) {
return request({
url: `/report-management/report/${id}`,
method: 'post',
data: {
parameters,
report_type: reportType,
parameters,
print_format_id: printFormatId,
report_view_id: reportViewId,
is_summary: isSummary
is_summary: isSummary,
table_name: tableName,
record_id: recordId
}
})
}
11 changes: 8 additions & 3 deletions src/store/modules/ADempiere/reportManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,20 @@ const reportManager = {
}
}

const recordId = rootGetters.getIdOfContainer({
containerUuid,
tableName
})
generateReportRequest({
id: reportDefinition.id,
reportType,
parameters,
printFormatId,
reportViewId
// tableName,
reportViewId,
// isSummary,
// recordUuid
// window
tableName,
recordId
})
.then(runReportRepsonse => {
const { instance_id, output, is_error } = runReportRepsonse
Expand Down

0 comments on commit 13733ed

Please sign in to comment.