forked from adempiere/adempiere-vue
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Date field on table records. (adempiere#1642)
- Loading branch information
1 parent
38ec8b1
commit 51ae95f
Showing
3 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution | ||
* Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com | ||
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com | ||
* Contributor(s): Edwin Betancourt [email protected] https://github.com/EdwinBetanc0urt | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -21,7 +21,7 @@ import { computed, onMounted } from '@vue/composition-api' | |
import store from '@/store' | ||
|
||
// Utils and Helpers Methods | ||
import { isEmptyValue } from '@/utils/ADempiere/valueUtils' | ||
import { getTypeOfValue, isEmptyValue } from '@/utils/ADempiere/valueUtils' | ||
|
||
export default function useFieldDefinition({ fieldMetadata, containerManager }) { | ||
const isMobile = computed(() => { | ||
|
@@ -91,20 +91,30 @@ export default function useFieldDefinition({ fieldMetadata, containerManager }) | |
if (inTable) { | ||
// implement container manager row | ||
if (containerManager && containerManager.getCell) { | ||
return containerManager.getCell({ | ||
const value = containerManager.getCell({ | ||
containerUuid, | ||
rowIndex: fieldMetadata.rowIndex, | ||
columnName | ||
}) | ||
// types `decimal` and `date` is a object struct | ||
if ((getTypeOfValue(value) === 'OBJECT') && !isEmptyValue(value.type)) { | ||
return value.value | ||
} | ||
return value | ||
} | ||
} | ||
|
||
// main panel values | ||
return store.getters.getValueOfFieldOnContainer({ | ||
const value = store.getters.getValueOfFieldOnContainer({ | ||
parentUuid: fieldMetadata.parentUuid, | ||
containerUuid, | ||
columnName | ||
}) | ||
// types `decimal` and `date` is a object struct | ||
if ((getTypeOfValue(value) === 'OBJECT') && !isEmptyValue(value.type)) { | ||
return value.value | ||
} | ||
return value | ||
}, | ||
set(newValue) { | ||
const { columnName, containerUuid, inTable } = fieldMetadata | ||
|