Skip to content

Commit

Permalink
fix: Report change print format. (#695)
Browse files Browse the repository at this point in the history
Co-authored-by: EdwinBetanc0urt <[email protected]>
  • Loading branch information
EdwinBetanc0urt and EdwinBetanc0urt authored Mar 26, 2021
1 parent 97830cd commit 0d30213
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/store/modules/ADempiere/processDefinition.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const process = {
let printFormatsAvailable = []
if (responseProcess.isReport) {
printFormatsAvailable = await dispatch('getListPrintFormats', {
processUuid: containerUuid
processUuid: containerUuid,
processId: responseProcess.id
})
}

Expand Down
12 changes: 10 additions & 2 deletions src/store/modules/ADempiere/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const reportControl = {
}) {

},

getListPrintFormats({ commit }, {
processId,
processUuid,
Expand Down Expand Up @@ -70,6 +71,7 @@ const reportControl = {
})
})
},

getReportViewsFromServer({ commit }, {
processId,
processUuid,
Expand Down Expand Up @@ -103,6 +105,7 @@ const reportControl = {
})
})
},

getDrillTablesFromServer({ commit }, {
processId,
processUuid,
Expand Down Expand Up @@ -140,7 +143,8 @@ const reportControl = {
})
})
},
getReportOutputFromServer({ commit, getters, rootGetters }, {

getReportOutputFromServer({ state, commit, getters, rootGetters }, {
tableName,
printFormatUuid,
reportViewUuid,
Expand All @@ -154,8 +158,12 @@ const reportControl = {
}) {
return new Promise(resolve => {
if (isEmptyValue(printFormatUuid)) {
printFormatUuid = getters.getDefaultPrintFormat(processUuid).printFormatUuid
const printFormat = getters.getDefaultPrintFormat(processUuid)
if (!isEmptyValue(printFormat)) {
printFormatUuid = printFormat.printFormatUuid
}
}

const parametersList = rootGetters.getParametersToServer({
containerUuid: processUuid
})
Expand Down
7 changes: 3 additions & 4 deletions src/utils/ADempiere/apiConverts/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ export function convertListPrintFormats(listPrintFormatsToConvert) {
}

export function convertPrintFormat(printFormatToConvert) {
const { id, uuid, name, description } = printFormatToConvert
const { name, description } = printFormatToConvert

return {
id,
uuid,
name,
description,
tableName: printFormatToConvert.table_name,
isDefault: printFormatToConvert.is_default,
reportViewUuid: printFormatToConvert.report_view_uuid
reportViewUuid: printFormatToConvert.report_view_uuid,
printFormatUuid: printFormatToConvert.print_format_uuid
}
}

Expand Down

0 comments on commit 0d30213

Please sign in to comment.