Repository: GeorgeKalash/ArgusFE
Pull request #1241: AR-3307
Author: login: imtithalhalalo
Created: 2025-05-29T10:21:29Z | Merged: 2025-05-30T13:37:07Z

change cash from lookup to combo
change the lookup to become a combo in:

- filter
- cash and banks / increase - decrease adjustment activity
- cash and banks / increase - decrease adjustment doc type default
- cash and banks / opening balances
- cash and banks / rebuild account balances
- financials / cash doc type defaults
- financials / cash transfers multicurrency
- financials / transfers
- financials / checkbook
- financials / PV Do type defaults
- financials / RV doc type defaults
- users / defaults tab


Diff:
diff --git a/src/components/Shared/apiMappings.js b/src/components/Shared/apiMappings.js
index de44497238..40233535d2 100644
--- a/src/components/Shared/apiMappings.js
+++ b/src/components/Shared/apiMappings.js
@@ -54,16 +54,15 @@ export const apiMappings = {
     displayField: 'fiscalYear'
   },
   [ResourceIds.CashAccount]: {
-    type: LOOKUP,
-    endpoint: CashBankRepository.CashAccount.snapshot,
-    parameters: {
-      _type: 0
-    },
-    firstField: 'reference',
-    valueOnSelection: 'recordId',
-    secondField: 'name',
-    displayFieldWidth: 1,
-    firstFieldWidth: 5
+    type: COMBOBOX,
+    endpoint: CashBankRepository.CashAccount.qry,
+    parameters: '_type=0',
+    valueField: 'recordId',
+    displayField: ['reference', 'name'],
+    columnsInDropDown: [
+      { key: 'reference', value: 'Reference' },
+      { key: 'name', value: 'Name' }
+    ]
   },
   [ResourceIds.Category]: {
     //Item Category
diff --git a/src/pages/ca-adj-dtd/[functionId]/form/AdjDocTypeDefaultsForm.js b/src/pages/ca-adj-dtd/[functionId]/form/AdjDocTypeDefaultsForm.js
index 048de53396..364c158ba4 100644
--- a/src/pages/ca-adj-dtd/[functionId]/form/AdjDocTypeDefaultsForm.js
+++ b/src/pages/ca-adj-dtd/[functionId]/form/AdjDocTypeDefaultsForm.js
@@ -27,7 +27,8 @@ export default function AdjDocTypeDefaultsForm({ labels, maxAccess, recordId, fu
     initialValues: {
       dtId: '',
       plantId: '',
-      recordId: recordId || ''
+      recordId: recordId || '',
+      cashAccountId: null,
     },
     maxAccess,
     enableReinitialize: true,
@@ -112,26 +113,23 @@ export default function AdjDocTypeDefaultsForm({ labels, maxAccess, recordId, fu
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='cashAccountId'
-                displayFieldWidth={2}
                 label={labels.cashAccount}
-                form={formik}
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.reference : null)
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : null)
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.cashAccountId && Boolean(formik.errors.cashAccountId)}
-                maxAccess={maxAccess}
               />
             </Grid>
           </Grid>
diff --git a/src/pages/ca-adjustment/form/CAadjustmentForms.js b/src/pages/ca-adjustment/form/CAadjustmentForms.js
index ed48e5aa17..aa425248d1 100644
--- a/src/pages/ca-adjustment/form/CAadjustmentForms.js
+++ b/src/pages/ca-adjustment/form/CAadjustmentForms.js
@@ -57,7 +57,7 @@ export default function CAadjustmentForm({ labels, access, recordId, functionId
       currencyId: parseInt(getDefaultsData()?.currencyId),
       currencyName: '',
       status: 1,
-      cashAccountId,
+      cashAccountId: cashAccountId || null,
       amount: '',
       baseAmount: '',
       exRate: 1,
@@ -166,7 +166,7 @@ export default function CAadjustmentForm({ labels, access, recordId, functionId
 
       const cashAccountValue = res?.record?.cashAccountId ? res?.record?.cashAccountId : cashAccountId
 
-      formik.setFieldValue('cashAccountId', cashAccountValue)
+      formik.setFieldValue('cashAccountId', cashAccountValue || null)
       getCashAccount(cashAccountValue)
 
       formik.setFieldValue('plantId', res?.record?.plantId ? res?.record?.plantId : plantId)
@@ -442,33 +442,25 @@ export default function CAadjustmentForm({ labels, access, recordId, functionId
               </Grid>
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 2
-                }}
-                readOnly={isPosted}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=2`}
                 name='cashAccountId'
-                maxAccess={maxAccess}
+                readOnly={isPosted}
                 required
                 label={labels.cashAccount}
-                form={formik}
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                onChange={(event, newValue) => {
-                  if (newValue) {
-                    formik.setFieldValue('cashAccountId', newValue?.recordId)
-                    formik.setFieldValue('cashAccountRef', newValue?.reference)
-                    formik.setFieldValue('cashAccountName', newValue?.name)
-                  } else {
-                    formik.setFieldValue('cashAccountId', null)
-                    formik.setFieldValue('cashAccountRef', null)
-                    formik.setFieldValue('cashAccountName', null)
-                  }
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || null)
                 }}
-                errorCheck={'cashAccountId'}
+                error={formik.touched.cashAccountId && Boolean(formik.errors.cashAccountId)}
               />
             </Grid>
             <Grid item xs={12}>
diff --git a/src/pages/ca-checkbook/forms/CheckbookForm.js b/src/pages/ca-checkbook/forms/CheckbookForm.js
index f0595a2d66..7b0d1ac38b 100644
--- a/src/pages/ca-checkbook/forms/CheckbookForm.js
+++ b/src/pages/ca-checkbook/forms/CheckbookForm.js
@@ -16,6 +16,7 @@ import { ResourceLookup } from 'src/components/Shared/ResourceLookup'
 import CustomDatePicker from 'src/components/Inputs/CustomDatePicker'
 import CustomNumberField from 'src/components/Inputs/CustomNumberField'
 import { formatDateFromApi, formatDateToApi } from 'src/lib/date-helper'
+import ResourceComboBox from 'src/components/Shared/ResourceComboBox'
 
 export default function CheckbookForm({ labels, maxAccess, recordId }) {
   const { getRequest, postRequest } = useContext(RequestsContext)
@@ -32,9 +33,7 @@ export default function CheckbookForm({ labels, maxAccess, recordId }) {
       size: '',
       firstCheckNo: '',
       lastCheckNo: '',
-      issueDate: null,
-      bankAccountRef: null,
-      bankAccountName: null
+      issueDate: null
     },
     maxAccess,
     enableReinitialize: true,
@@ -91,26 +90,24 @@ export default function CheckbookForm({ labels, maxAccess, recordId }) {
         <Grow>
           <Grid container spacing={4}>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                required
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='bankAccountId'
                 label={labels.bank}
-                valueField='reference'
-                displayField='name'
-                valueShow='bankAccountRef'
-                secondValueShow='bankAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('bankAccountId', newValue?.recordId || '')
-                  formik.setFieldValue('bankAccountRef', newValue?.reference || '')
-                  formik.setFieldValue('bankAccountName', newValue?.name || '')
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                required
+                maxAccess={maxAccess}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('bankAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.bankAccountId && Boolean(formik.errors.bankAccountId)}
-                maxAccess={maxAccess}
               />
             </Grid>
             <Grid item xs={12}>
diff --git a/src/pages/ca-opening-balances/form/OpeningBalanceForm.js b/src/pages/ca-opening-balances/form/OpeningBalanceForm.js
index 263e7df7db..240d9fbf0f 100644
--- a/src/pages/ca-opening-balances/form/OpeningBalanceForm.js
+++ b/src/pages/ca-opening-balances/form/OpeningBalanceForm.js
@@ -113,27 +113,25 @@ export default function OpeningBalanceForm({ labels, maxAccess, recordId, record
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                required
-                readOnly={editMode}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='cashAccountId'
+                readOnly={editMode}
+                required
                 label={labels.accountRef}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue?.recordId || '')
-                  formik.setFieldValue('cashAccountRef', newValue?.reference || '')
-                  formik.setFieldValue('cashAccountName', newValue?.name || '')
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.cashAccountId && Boolean(formik.errors.cashAccountId)}
-                maxAccess={maxAccess}
               />
             </Grid>
 
diff --git a/src/pages/ca-rebuild-aba/form/CARebuildForm.js b/src/pages/ca-rebuild-aba/form/CARebuildForm.js
index 51f4656f16..14e15312d2 100644
--- a/src/pages/ca-rebuild-aba/form/CARebuildForm.js
+++ b/src/pages/ca-rebuild-aba/form/CARebuildForm.js
@@ -23,7 +23,7 @@ export default function CARebuildAccountBalance({ _labels, access }) {
     validateOnChange: true,
 
     validationSchema: yup.object({
-      fiscalYear: yup.string().required(' ')
+      fiscalYear: yup.string().required()    
     }),
     onSubmit: async obj => {
       try {
@@ -90,24 +90,23 @@ export default function CARebuildAccountBalance({ _labels, access }) {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 2
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=2`}
                 name='cashAccountId'
                 label={_labels.account}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : 0)
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.reference : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
-                }}
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
                 maxAccess={access}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || 0)
+                }}
+                error={formik.touched.cashAccountId && Boolean(formik.errors.cashAccountId)}
               />
             </Grid>
           </Grid>
diff --git a/src/pages/cash-dtd/form/CaDocumentTypeDefaultForm.js b/src/pages/cash-dtd/form/CaDocumentTypeDefaultForm.js
index ef1e8895ba..bc83d89793 100644
--- a/src/pages/cash-dtd/form/CaDocumentTypeDefaultForm.js
+++ b/src/pages/cash-dtd/form/CaDocumentTypeDefaultForm.js
@@ -33,11 +33,7 @@ export default function CaDocumentTypeDefaultForm({ labels, maxAccess, recordId
       recordId: recordId || null,
       cashAccountId: '',
       fromCashAccountId: '',
-      toCashAccountId: '',
-      fromCashAccountRef: '',
-      fromCashAccountName: '',
-      toCashAccountName: '',
-      toCashAccountRef: ''
+      toCashAccountId: ''
     },
     maxAccess,
     enableReinitialize: false,
@@ -133,49 +129,43 @@ export default function CaDocumentTypeDefaultForm({ labels, maxAccess, recordId
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='fromCashAccountId'
-                displayFieldWidth={2}
                 label={labels.fromCa}
-                form={formik}
-                valueShow='fromCashAccountRef'
-                secondValueShow='fromCashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('fromCashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('fromCashAccountRef', newValue ? newValue.reference : null)
-                  formik.setFieldValue('fromCashAccountName', newValue ? newValue.name : null)
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('fromCashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.fromCashAccountId && Boolean(formik.errors.fromCashAccountId)}
-                maxAccess={maxAccess}
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='toCashAccountId'
-                displayFieldWidth={2}
                 label={labels.toCa}
-                form={formik}
-                valueShow='toCashAccountRef'
-                secondValueShow='toCashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('toCashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('toCashAccountRef', newValue ? newValue.reference : null)
-                  formik.setFieldValue('toCashAccountName', newValue ? newValue.name : null)
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('toCashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.toCashAccountId && Boolean(formik.errors.toCashAccountId)}
-                maxAccess={maxAccess}
               />
             </Grid>
           </Grid>
diff --git a/src/pages/cash-transfer/Tabs/CashTransferTab.js b/src/pages/cash-transfer/Tabs/CashTransferTab.js
index 1cf51d0c2e..e88c5f5ea1 100644
--- a/src/pages/cash-transfer/Tabs/CashTransferTab.js
+++ b/src/pages/cash-transfer/Tabs/CashTransferTab.js
@@ -51,11 +51,7 @@ export default function CashTransferTab({ labels, recordId, access, plantId, cas
     toPlantId: parseInt(plantId),
     fromPlantId: parseInt(plantId),
     fromCashAccountId: parseInt(cashAccountId),
-    fromCARef: '',
-    fromCAName: '',
     toCashAccountId: '',
-    toCARef: '',
-    toCAName: '',
     baseAmount: '',
     notes: '',
     wip: '',
@@ -401,29 +397,25 @@ export default function CashTransferTab({ labels, recordId, access, plantId, cas
                 />
               </Grid>
               <Grid item xs={12}>
-                <ResourceLookup
-                  endpointId={CashBankRepository.CashAccount.snapshot}
-                  parameters={{
-                    _type: 0
-                  }}
-                  firstFieldWidth={5}
-                  valueField='accountNo'
-                  displayField='name'
+                <ResourceComboBox
+                  endpointId={CashBankRepository.CashAccount.qry}
+                  parameters={`_type=0`}
                   name='fromCashAccountId'
-                  displayFieldWidth={2}
-                  required
                   label={labels.fromCashAcc}
-                  form={formik}
+                  valueField='recordId'
+                  displayField={['reference', 'name']}
+                  columnsInDropDown={[
+                    { key: 'reference', value: 'Reference' },
+                    { key: 'name', value: 'Name' }
+                  ]}
+                  values={formik.values}
                   readOnly
-                  valueShow='fromCARef'
-                  secondValueShow='fromCAName'
-                  onChange={(event, newValue) => {
-                    formik.setFieldValue('fromCashAccountId', newValue ? newValue.recordId : null)
-                    formik.setFieldValue('fromCARef', newValue ? newValue.accountNo : null)
-                    formik.setFieldValue('fromCAName', newValue ? newValue.name : null)
+                  required
+                  maxAccess={maxAccess}
+                  onChange={(_, newValue) => {
+                    formik.setFieldValue('fromCashAccountId', newValue?.recordId || null)
                   }}
                   error={formik.touched.fromCashAccountId && Boolean(formik.errors.fromCashAccountId)}
-                  maxAccess={maxAccess}
                 />
               </Grid>
             </Grid>
@@ -467,30 +459,25 @@ export default function CashTransferTab({ labels, recordId, access, plantId, cas
                 />
               </Grid>
               <Grid item xs={12}>
-                <ResourceLookup
-                  endpointId={CashBankRepository.CashAccount.snapshot}
-                  parameters={{
-                    _type: 0
-                  }}
-                  firstFieldWidth={5}
-                  valueField='accountNo'
-                  displayField='name'
+                <ResourceComboBox
+                  endpointId={CashBankRepository.CashAccount.qry}
+                  parameters={`_type=0`}
                   name='toCashAccountId'
-                  displayFieldWidth={2}
+                  label={labels.toCashAcc}
+                  valueField='recordId'
+                  displayField={['reference', 'name']}
+                  columnsInDropDown={[
+                    { key: 'reference', value: 'Reference' },
+                    { key: 'name', value: 'Name' }
+                  ]}
+                  values={formik.values}
                   required={formik.values.fromPlantId === formik.values.toPlantId}
+                  filter={item => item.plantId === formik.values.toPlantId}
                   readOnly={!formik.values.toPlantId || isClosed}
-                  label={labels.toCashAcc}
-                  form={formik}
-                  filter={{ plantId: formik.values.toPlantId }}
-                  valueShow='toCARef'
-                  secondValueShow='toCAName'
-                  viewHelperText={false}
-                  onChange={(event, newValue) => {
-                    formik.setFieldValue('toCashAccountId', newValue ? newValue.recordId : null)
-                    formik.setFieldValue('toCARef', newValue ? newValue.accountNo : null)
-                    formik.setFieldValue('toCAName', newValue ? newValue.name : null)
-                  }}
                   maxAccess={maxAccess}
+                  onChange={(_, newValue) => {
+                    formik.setFieldValue('toCashAccountId', newValue?.recordId || null)
+                  }}
                   error={formik.touched.toCashAccountId && Boolean(formik.errors.toCashAccountId)}
                 />
               </Grid>
diff --git a/src/pages/fi-cash-tfr/Forms/CashTransfersForm.js b/src/pages/fi-cash-tfr/Forms/CashTransfersForm.js
index dfbcdd524d..1e63f9db6b 100644
--- a/src/pages/fi-cash-tfr/Forms/CashTransfersForm.js
+++ b/src/pages/fi-cash-tfr/Forms/CashTransfersForm.js
@@ -52,11 +52,7 @@ export default function CashTransfersForm({ labels, maxAccess: access, recordId
     baseAmount: '',
     dtName: null,
     notes: '',
-    fromCARef: '',
-    toCARef: '',
     statusName: '',
-    fromCAName: '',
-    toCAName: '',
     functionId: SystemFunction.CashTransfers,
     reference: '',
     dtId: null,
@@ -393,51 +389,45 @@ export default function CashTransfersForm({ labels, maxAccess: access, recordId
             </Grid>
           </Grid>
           <Grid item xs={12}>
-            <ResourceLookup
-              endpointId={CashBankRepository.CashAccount.snapshot}
-              parameters={{
-                _type: 0
-              }}
-              valueField='reference'
-              displayField='name'
+            <ResourceComboBox
+              endpointId={CashBankRepository.CashAccount.qry}
+              parameters={`_type=0`}
               name='fromCashAccountId'
-              displayFieldWidth={2}
               label={labels.from}
-              form={formik}
+              valueField='recordId'
+              displayField={['reference', 'name']}
+              columnsInDropDown={[
+                { key: 'reference', value: 'Reference' },
+                { key: 'name', value: 'Name' }
+              ]}
+              values={formik.values}
               required
-              valueShow='fromCARef'
-              secondValueShow='fromCAName'
-              onChange={(event, newValue) => {
+              maxAccess={maxAccess}
+              onChange={(_, newValue) => {
                 formik.setFieldValue('fromCashAccountId', newValue?.recordId || null)
-                formik.setFieldValue('fromCARef', newValue?.reference || null)
-                formik.setFieldValue('fromCAName', newValue?.name || null)
               }}
               error={formik.touched.fromCashAccountId && Boolean(formik.errors.fromCashAccountId)}
-              maxAccess={maxAccess}
             />
           </Grid>
           <Grid item xs={12}>
-            <ResourceLookup
-              endpointId={CashBankRepository.CashAccount.snapshot}
-              parameters={{
-                _type: 0
-              }}
-              valueField='reference'
-              displayField='name'
+            <ResourceComboBox
+              endpointId={CashBankRepository.CashAccount.qry}
+              parameters={`_type=0`}
               name='toCashAccountId'
-              displayFieldWidth={2}
               label={labels.to}
-              form={formik}
+              valueField='recordId'
+              displayField={['reference', 'name']}
+              columnsInDropDown={[
+                { key: 'reference', value: 'Reference' },
+                { key: 'name', value: 'Name' }
+              ]}
+              values={formik.values}
               required
-              valueShow='toCARef'
-              secondValueShow='toCAName'
-              onChange={(event, newValue) => {
+              maxAccess={maxAccess}
+              onChange={(_, newValue) => {
                 formik.setFieldValue('toCashAccountId', newValue?.recordId || null)
-                formik.setFieldValue('toCARef', newValue?.reference || null)
-                formik.setFieldValue('toCAName', newValue?.name || null)
               }}
               error={formik.touched.toCashAccountId && Boolean(formik.errors.toCashAccountId)}
-              maxAccess={maxAccess}
             />
           </Grid>
           <Grid item xs={12}>
diff --git a/src/pages/pv-dtd/form/PVDocTypeDefaultsForm.js b/src/pages/pv-dtd/form/PVDocTypeDefaultsForm.js
index 6a2145bce4..468ff826f5 100644
--- a/src/pages/pv-dtd/form/PVDocTypeDefaultsForm.js
+++ b/src/pages/pv-dtd/form/PVDocTypeDefaultsForm.js
@@ -35,6 +35,7 @@ export default function PVDocTypeDefaultsForm({ labels, maxAccess, dtId }) {
       plantId: '',
       recordId: dtId,
       paymentMethod: '',
+      cashAccountId: null,
       disableExpenseGrid: false
     },
     maxAccess,
@@ -139,25 +140,23 @@ export default function PVDocTypeDefaultsForm({ labels, maxAccess, dtId }) {
             </Grid>
 
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='cashAccountId'
                 label={labels.cashAccount}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : '' || '')
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.accountNo : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.cashAccountId && Boolean(formik.errors.cashAccountId)}
-                maxAccess={maxAccess}
               />
             </Grid>
             <Grid item xs={12}>
diff --git a/src/pages/rv-dtd/form/RVDocTypeDefaultsForm.js b/src/pages/rv-dtd/form/RVDocTypeDefaultsForm.js
index 2056b8d505..d5688b1ac9 100644
--- a/src/pages/rv-dtd/form/RVDocTypeDefaultsForm.js
+++ b/src/pages/rv-dtd/form/RVDocTypeDefaultsForm.js
@@ -27,14 +27,13 @@ export default function RVDocTypeDefaultsForm({ labels, maxAccess, recordId }) {
   const { platformLabels } = useContext(ControlContext)
 
   const { formik } = useForm({
-    initialValues: { accountId: '', plantId: '', dtId: '', recordId: recordId || null },
+    initialValues: { cashAccountId: '', plantId: '', dtId: '', recordId: recordId || null },
     maxAccess,
     enableReinitialize: true,
     validateOnChange: true,
     validationSchema: yup.object({
-      dtId: yup.string().required(' '),
-
-      cashAccountId: yup.string().required(' ')
+      dtId: yup.string().required(),
+      cashAccountId: yup.number().required()
     }),
     onSubmit: async obj => {
       await postRequest({
@@ -95,23 +94,21 @@ export default function RVDocTypeDefaultsForm({ labels, maxAccess, recordId }) {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 required
                 name='cashAccountId'
                 label={labels.cashAccount}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : '' || '')
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.accountNo : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.cashAccountId && Boolean(formik.errors.cashAccountId)}
                 maxAccess={maxAccess}
diff --git a/src/pages/users/Tabs/DefaultsTab.js b/src/pages/users/Tabs/DefaultsTab.js
index cb47c825aa..449c896669 100644
--- a/src/pages/users/Tabs/DefaultsTab.js
+++ b/src/pages/users/Tabs/DefaultsTab.js
@@ -29,9 +29,7 @@ const DefaultsTab = ({ labels, maxAccess, storeRecordId }) => {
       plantId: '',
       spId: '',
       workCenterId: '',
-      cashAccountId: '',
-      cashAccountRef: '',
-      cashAccountName: ''
+      cashAccountId: ''
     },
     onSubmit: async obj => {
       const postField = async field => {
@@ -170,28 +168,22 @@ const DefaultsTab = ({ labels, maxAccess, storeRecordId }) => {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _size: 50,
-                  _startAt: 0,
-                  _type: 0
-                }}
-                filter={formik.values.plantId && { plantId: formik.values.plantId }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0&_size=50&_startAt=0`}
                 name='cashAccountId'
                 label={labels.cashAccount}
-                valueField='accountNo'
-                displayField='name'
-                firstFieldWidth={4}
-                displayFieldWidth={1.5}
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
+                filter={item => item.plantId === formik.values.plantId}
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
                 maxAccess={maxAccess}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : '')
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.accountNo : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
+                onChange={(_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.cashAccountId && Boolean(formik.errors.cashAccountId)}
               />
diff --git a/src/providers/AuthContext.js b/src/providers/AuthContext.js
index 07a8a57d38..5e4f1bb7d5 100644
--- a/src/providers/AuthContext.js
+++ b/src/providers/AuthContext.js
@@ -54,7 +54,7 @@ const AuthProvider = ({ children }) => {
   const fetchData = async () => {
     const matchHostname = window.location.hostname.match(/^(.+)\.softmachine\.co$/)
 
-    const accountName = matchHostname ? matchHostname[1] : 'neg-deploy'
+    const accountName = matchHostname ? matchHostname[1] : 'anthonys'
 
     try {
       const response = await axios.get(`${process.env.NEXT_PUBLIC_AuthURL}/MA.asmx/getAC?_accountName=${accountName}`)


Reviews:
user: login: omarZrayka23
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T07:10:29Z
user: login: imtithalhalalo
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-30T07:11:47Z
user: login: omarZrayka23
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T11:38:19Z
user: login: FatimaSalami
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T12:31:57Z
user: login: FatimaSalami
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T13:36:12Z

Review comments:
diff_hunk: @@ -90,24 +90,23 @@ export default function CARebuildAccountBalance({ _labels, access }) {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 2
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=2`}
                 name='cashAccountId'
                 label={_labels.account}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : 0)
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.reference : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
-                }}
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
                 maxAccess={access}
+                onChange={async (_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || 0)
path: src/pages/ca-rebuild-aba/form/CARebuildForm.js
user: login: omarZrayka23
body: why || 0
created_at: 2025-05-30T07:07:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -133,49 +133,43 @@ export default function CaDocumentTypeDefaultForm({ labels, maxAccess, recordId
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='fromCashAccountId'
-                displayFieldWidth={2}
                 label={labels.fromCa}
-                form={formik}
-                valueShow='fromCashAccountRef'
-                secondValueShow='fromCashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('fromCashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('fromCashAccountRef', newValue ? newValue.reference : null)
-                  formik.setFieldValue('fromCashAccountName', newValue ? newValue.name : null)
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={async (_, newValue) => {
+                  formik.setFieldValue('fromCashAccountId', newValue?.recordId || null)
                 }}
                 error={formik.touched.fromCashAccountId && Boolean(formik.errors.fromCashAccountId)}
-                maxAccess={maxAccess}
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='toCashAccountId'
-                displayFieldWidth={2}
                 label={labels.toCa}
-                form={formik}
-                valueShow='toCashAccountRef'
-                secondValueShow='toCashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('toCashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('toCashAccountRef', newValue ? newValue.reference : null)
-                  formik.setFieldValue('toCashAccountName', newValue ? newValue.name : null)
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={async (_, newValue) => {
path: src/pages/cash-dtd/form/CaDocumentTypeDefaultForm.js
user: login: omarZrayka23
body: clear async
created_at: 2025-05-30T07:07:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -133,49 +133,43 @@ export default function CaDocumentTypeDefaultForm({ labels, maxAccess, recordId
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='fromCashAccountId'
-                displayFieldWidth={2}
                 label={labels.fromCa}
-                form={formik}
-                valueShow='fromCashAccountRef'
-                secondValueShow='fromCashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('fromCashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('fromCashAccountRef', newValue ? newValue.reference : null)
-                  formik.setFieldValue('fromCashAccountName', newValue ? newValue.name : null)
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={async (_, newValue) => {
path: src/pages/cash-dtd/form/CaDocumentTypeDefaultForm.js
user: login: omarZrayka23
body: clear async
created_at: 2025-05-30T07:07:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -90,24 +90,23 @@ export default function CARebuildAccountBalance({ _labels, access }) {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 2
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=2`}
                 name='cashAccountId'
                 label={_labels.account}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : 0)
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.reference : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
-                }}
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
                 maxAccess={access}
+                onChange={async (_, newValue) => {
path: src/pages/ca-rebuild-aba/form/CARebuildForm.js
user: login: omarZrayka23
body: clear async
created_at: 2025-05-30T07:07:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -113,27 +113,25 @@ export default function OpeningBalanceForm({ labels, maxAccess, recordId, record
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                required
-                readOnly={editMode}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='cashAccountId'
+                readOnly={editMode}
+                required
                 label={labels.accountRef}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue?.recordId || '')
-                  formik.setFieldValue('cashAccountRef', newValue?.reference || '')
-                  formik.setFieldValue('cashAccountName', newValue?.name || '')
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={async (_, newValue) => {
path: src/pages/ca-opening-balances/form/OpeningBalanceForm.js
user: login: omarZrayka23
body: clearr async
created_at: 2025-05-30T07:08:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -442,33 +442,25 @@ export default function CAadjustmentForm({ labels, access, recordId, functionId
               </Grid>
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 2
-                }}
-                readOnly={isPosted}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=2`}
                 name='cashAccountId'
-                maxAccess={maxAccess}
+                readOnly={isPosted}
                 required
                 label={labels.cashAccount}
-                form={formik}
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                onChange={(event, newValue) => {
-                  if (newValue) {
-                    formik.setFieldValue('cashAccountId', newValue?.recordId)
-                    formik.setFieldValue('cashAccountRef', newValue?.reference)
-                    formik.setFieldValue('cashAccountName', newValue?.name)
-                  } else {
-                    formik.setFieldValue('cashAccountId', null)
-                    formik.setFieldValue('cashAccountRef', null)
-                    formik.setFieldValue('cashAccountName', null)
-                  }
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={async (_, newValue) => {
path: src/pages/ca-adjustment/form/CAadjustmentForms.js
user: login: omarZrayka23
body: clear sync
created_at: 2025-05-30T07:08:38Z
author_association: CONTRIBUTOR
diff_hunk: @@ -112,26 +112,23 @@ export default function AdjDocTypeDefaultsForm({ labels, maxAccess, recordId, fu
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='cashAccountId'
-                displayFieldWidth={2}
                 label={labels.cashAccount}
-                form={formik}
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.reference : null)
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : null)
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={async (_, newValue) => {
path: src/pages/ca-adj-dtd/[functionId]/form/AdjDocTypeDefaultsForm.js
user: login: omarZrayka23
body: claer async
created_at: 2025-05-30T07:08:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -401,29 +401,25 @@ export default function CashTransferTab({ labels, recordId, access, plantId, cas
                 />
               </Grid>
               <Grid item xs={12}>
-                <ResourceLookup
-                  endpointId={CashBankRepository.CashAccount.snapshot}
-                  parameters={{
-                    _type: 0
-                  }}
-                  firstFieldWidth={5}
-                  valueField='accountNo'
-                  displayField='name'
+                <ResourceComboBox
+                  endpointId={CashBankRepository.CashAccount.qry}
+                  parameters={`_type=0`}
                   name='fromCashAccountId'
-                  displayFieldWidth={2}
-                  required
                   label={labels.fromCashAcc}
-                  form={formik}
+                  valueField='recordId'
+                  displayField={['reference', 'name']}
+                  columnsInDropDown={[
+                    { key: 'reference', value: 'Reference' },
+                    { key: 'name', value: 'Name' }
+                  ]}
+                  values={formik.values}
                   readOnly
-                  valueShow='fromCARef'
-                  secondValueShow='fromCAName'
-                  onChange={(event, newValue) => {
-                    formik.setFieldValue('fromCashAccountId', newValue ? newValue.recordId : null)
-                    formik.setFieldValue('fromCARef', newValue ? newValue.accountNo : null)
-                    formik.setFieldValue('fromCAName', newValue ? newValue.name : null)
+                  required
+                  maxAccess={maxAccess}
+                  onChange={async (_, newValue) => {
path: src/pages/cash-transfer/Tabs/CashTransferTab.js
user: login: omarZrayka23
body: cleaar async
created_at: 2025-05-30T07:09:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -393,51 +393,45 @@ export default function CashTransfersForm({ labels, maxAccess: access, recordId
             </Grid>
           </Grid>
           <Grid item xs={12}>
-            <ResourceLookup
-              endpointId={CashBankRepository.CashAccount.snapshot}
-              parameters={{
-                _type: 0
-              }}
-              valueField='reference'
-              displayField='name'
+            <ResourceComboBox
+              endpointId={CashBankRepository.CashAccount.qry}
+              parameters={`_type=0`}
               name='fromCashAccountId'
-              displayFieldWidth={2}
               label={labels.from}
-              form={formik}
+              valueField='recordId'
+              displayField={['reference', 'name']}
+              columnsInDropDown={[
+                { key: 'reference', value: 'Reference' },
+                { key: 'name', value: 'Name' }
+              ]}
+              values={formik.values}
               required
-              valueShow='fromCARef'
-              secondValueShow='fromCAName'
-              onChange={(event, newValue) => {
+              maxAccess={maxAccess}
+              onChange={async (_, newValue) => {
path: src/pages/fi-cash-tfr/Forms/CashTransfersForm.js
user: login: omarZrayka23
body: async
created_at: 2025-05-30T07:09:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -139,25 +139,23 @@ export default function PVDocTypeDefaultsForm({ labels, maxAccess, dtId }) {
             </Grid>
 
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='cashAccountId'
                 label={labels.cashAccount}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : '' || '')
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.accountNo : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                maxAccess={maxAccess}
+                onChange={async (_, newValue) => {
path: src/pages/pv-dtd/form/PVDocTypeDefaultsForm.js
user: login: omarZrayka23
body: claer async
created_at: 2025-05-30T07:09:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -95,23 +94,21 @@ export default function RVDocTypeDefaultsForm({ labels, maxAccess, recordId }) {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 required
                 name='cashAccountId'
                 label={labels.cashAccount}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : '' || '')
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.accountNo : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
+                onChange={async (_, newValue) => {
path: src/pages/rv-dtd/form/RVDocTypeDefaultsForm.js
user: login: omarZrayka23
body: clear sync
created_at: 2025-05-30T07:09:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -170,28 +170,22 @@ const DefaultsTab = ({ labels, maxAccess, storeRecordId }) => {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _size: 50,
-                  _startAt: 0,
-                  _type: 0
-                }}
-                filter={formik.values.plantId && { plantId: formik.values.plantId }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0&_size=50&_startAt=0`}
                 name='cashAccountId'
                 label={labels.cashAccount}
-                valueField='accountNo'
-                displayField='name'
-                firstFieldWidth={4}
-                displayFieldWidth={1.5}
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
+                filter={item => item.plantId === formik.values.plantId}
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
                 maxAccess={maxAccess}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : '')
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.accountNo : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
+                onChange={async (_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || null)
path: src/pages/users/Tabs/DefaultsTab.js
user: login: omarZrayka23
body: clear async
created_at: 2025-05-30T07:10:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -90,24 +90,23 @@ export default function CARebuildAccountBalance({ _labels, access }) {
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 2
-                }}
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=2`}
                 name='cashAccountId'
                 label={_labels.account}
-                valueField='reference'
-                displayField='name'
-                valueShow='cashAccountRef'
-                secondValueShow='cashAccountName'
-                form={formik}
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('cashAccountId', newValue ? newValue.recordId : 0)
-                  formik.setFieldValue('cashAccountRef', newValue ? newValue.reference : '')
-                  formik.setFieldValue('cashAccountName', newValue ? newValue.name : '')
-                }}
+                valueField='recordId'
+                displayField={['reference', 'name']}
+                columnsInDropDown={[
+                  { key: 'reference', value: 'Reference' },
+                  { key: 'name', value: 'Name' }
+                ]}
+                values={formik.values}
                 maxAccess={access}
+                onChange={async (_, newValue) => {
+                  formik.setFieldValue('cashAccountId', newValue?.recordId || 0)
path: src/pages/ca-rebuild-aba/form/CARebuildForm.js
user: login: imtithalhalalo
body: because it should allow no cashAccountId and take it as 0 (check the behaviour in deploy)
created_at: 2025-05-30T07:11:47Z
author_association: COLLABORATOR
diff_hunk: @@ -133,49 +133,43 @@ export default function CaDocumentTypeDefaultForm({ labels, maxAccess, recordId
               />
             </Grid>
             <Grid item xs={12}>
-              <ResourceLookup
-                endpointId={CashBankRepository.CashAccount.snapshot}
-                parameters={{
-                  _type: 0
-                }}
-                valueField='reference'
-                displayField='name'
+              <ResourceComboBox
+                endpointId={CashBankRepository.CashAccount.qry}
+                parameters={`_type=0`}
                 name='fromCashAccountId'
-                displayFieldWidth={2}
                 label={labels.fromCa}
-                form={formik}
-                valueShow='fromCashAccountRef'
-                secondValueShow='fromCashAccountName'
-                onChange={(event, newValue) => {
-                  formik.setFieldValue('fromCashAccountId', newValue ? newValue.recordId : null)
-                  formik.setFieldValue('fromCashAccountRef', newValue ? newValue.reference : null)
path: src/pages/cash-dtd/form/CaDocumentTypeDefaultForm.js
user: login: FatimaSalami
body: do we still need to and from cash ref and name in the initial values?
created_at: 2025-05-30T12:31:57Z
author_association: CONTRIBUTOR

PR comments:
user: login: vercel[bot]
created_at: 2025-05-29T10:21:33Z
body: [vc]: #97frmSsfVcXpfBbOB+oqWGjGKp1NmNF12OkB3Ro0/fk=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJhcmd1cy1mZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9nZW9yZ2Uta2FsYXNocy1wcm9qZWN0cy9hcmd1cy1mZS9INWVBNnhRR3l4VTRFWGQycFkzUDcyWTJCR2JNIiwicHJldmlld1VybCI6ImFyZ3VzLWZlLWdpdC1hci0zMzA3LWdlb3JnZS1rYWxhc2hzLXByb2plY3RzLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoiYXJndXMtZmUtZ2l0LWFyLTMzMDctZ2VvcmdlLWthbGFzaHMtcHJvamVjdHMudmVyY2VsLmFwcCJ9LCJyb290RGlyZWN0b3J5IjpudWxsfV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **argus-fe** | ✅ Ready ([Inspect](https://vercel.com/george-kalashs-projects/argus-fe/H5eA6xQGyxU4EXd2pY3P72Y2BGbM)) | [Visit Preview](https://argus-fe-git-ar-3307-george-kalashs-projects.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/argus-fe-git-ar-3307-george-kalashs-projects.vercel.app?via=pr-comment-feedback-link) | May 30, 2025 1:07pm |


author_association: NONE
user: login: omarZrayka23
created_at: 2025-05-30T06:37:24Z
body: <img width="1017" alt="Screenshot 2025-05-30 at 9 36 22 AM" src="https://github.com/user-attachments/assets/68539b51-00ee-46a1-ad56-b14f89fe7f6a" />

in new mode, i can submit  without fill cash account
author_association: CONTRIBUTOR
user: login: omarZrayka23
created_at: 2025-05-30T06:47:35Z
body: <img width="1017" alt="Screenshot 2025-05-30 at 9 46 59 AM" src="https://github.com/user-attachments/assets/1993c47f-b9b3-4f44-949f-a3dbaa61af30" />

when i opened page opening balances
author_association: CONTRIBUTOR