Skip to content

Commit

Permalink
fix: Report Engine duplicated zoom. (PanJiaChen#2929)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Nov 5, 2024
1 parent 0344c32 commit bec978a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
26 changes: 14 additions & 12 deletions src/components/ADempiere/Report/Data/DataCells.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,21 +246,26 @@ export default defineComponent({
.then(response => {
const { zoom_windows } = response
let listZoom = zoom_windows
if (listZoom.length > 1) {
// TODO: Add support to row report
const salesTransaction = isSalesTransaction({
// parentUuid: uuid,
containerUuid: props.containerUuid
})

// filter windows
if (listZoom.length > 1 && !isEmptyValue(salesTransaction)) {
listZoom = zoom_windows.filter(zoom => {
const {
uuid,
is_sales_transaction
// is_sales_transaction,
is_purchase
} = zoom
const salesTransaction = isSalesTransaction({
parentUuid: uuid,
containerUuid: props.containerUuid
})
if (is_sales_transaction === salesTransaction) {
return zoom
if (!is_purchase === salesTransaction) {
return true
}
return false
})
}

const listZoomWindows = listZoom.map(listZoom => {
return {
...listZoom,
Expand All @@ -272,9 +277,6 @@ export default defineComponent({
props.rowData.zoom_windows = listZoomWindows
isLoaded.value = false
})
.catch(() => {
isLoaded.value = false
})
.finally(() => {
isLoaded.value = false
})
Expand Down
12 changes: 7 additions & 5 deletions src/utils/ADempiere/constants/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export const staticReportRoutes = [
}
]

export const REPORT_EXPORT_TYPE_XLSX = {
name: language.t('report.reportExportTypes.xlsx.name'),
description: language.t('report.reportExportTypes.xlsx.description'),
type: language.t('report.reportExportTypes.xlsx.type')
}

export const REPORT_EXPORT_TYPES = [
{
name: language.t('report.reportExportTypes.ps.name'),
Expand Down Expand Up @@ -79,11 +85,7 @@ export const REPORT_EXPORT_TYPES = [
description: language.t('report.reportExportTypes.xls.description'),
type: language.t('report.reportExportTypes.xls.type')
},
{
name: language.t('report.reportExportTypes.xlsx.name'),
description: language.t('report.reportExportTypes.xlsx.description'),
type: language.t('report.reportExportTypes.xlsx.type')
},
REPORT_EXPORT_TYPE_XLSX,
{
name: language.t('report.reportExportTypes.arxml.name'),
description: language.t('report.reportExportTypes.arxml.description'),
Expand Down
32 changes: 22 additions & 10 deletions src/views/ADempiere/ReportViewerEngine/dialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,30 +168,41 @@
</template>

<script>
import { defineComponent, computed, ref, nextTick } from '@vue/composition-api'
import store from '@/store'
import language from '@/lang'
// Components and Mixins
import marked from 'marked'
import { defineComponent, computed, ref, nextTick } from '@vue/composition-api'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
import markdown from '@/components/ADempiere/MarkDown'
import contactSend from './contactSend'
import typeNotify from './typeNotify'
// Constants
import { config } from '@/utils/ADempiere/config'
import { REPORT_EXPORT_TYPES } from '@/utils/ADempiere/constants/report'
import { showNotificationReport } from '@/utils/ADempiere/notification.js'
import { showNotification } from '@/utils/ADempiere/notification'
import { REPORT_EXPORT_TYPE_XLSX } from '@/utils/ADempiere/constants/report'
// API Request Methods
import {
requestShareResources
} from '@/api/ADempiere/file-management/resource-reference.ts'
// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
import { showNotificationReport } from '@/utils/ADempiere/notification.js'
import { showNotification } from '@/utils/ADempiere/notification'
import { copyToClipboard } from '@/utils/ADempiere/coreUtils.js'
import contactSend from './contactSend'
import typeNotify from './typeNotify'
import markdown from '@/components/ADempiere/MarkDown'
export default defineComponent({
name: 'dialogShareReport',
name: 'DialogShareReport',
components: {
contactSend,
typeNotify,
markdown
},
props: {
containerUuid: {
type: String,
Expand All @@ -216,6 +227,7 @@ export default defineComponent({
default: false
}
},
setup(props) {
const shortsKey = computed(() => {
return {
Expand All @@ -239,7 +251,7 @@ export default defineComponent({
const checkedItemGeneral = ref(0)
const checkedItem = ref(0)
const printFormat = computed(() => {
return REPORT_EXPORT_TYPES.filter(type => type.type === 'xlsx')
return REPORT_EXPORT_TYPE_XLSX
})
const printFormatValue = ref('xlsx')
const linkShare = ref('')
Expand Down

0 comments on commit bec978a

Please sign in to comment.