- updates;

This commit is contained in:
Vitalii Kiiko
2025-02-05 17:01:44 +01:00
parent 0ec9f4e15e
commit a6c35af7ca
7 changed files with 130 additions and 37 deletions

View File

@@ -1,4 +1,5 @@
import { head, isNil, pathOr } from 'ramda'; import { head, isNil, pathOr } from 'ramda';
import getNumberFormatted from '../../../../../../../helpers/getNumberFormatted';
const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, tableValue = []}) => { const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, tableValue = []}) => {
const cellData = head(lastRowCfg.filter(o => !isNil(o[columnId]))); const cellData = head(lastRowCfg.filter(o => !isNil(o[columnId])));
@@ -8,7 +9,7 @@ const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, tableValue = []}) =
cellValue = pathOr(0, ['total'], tableValue); cellValue = pathOr(0, ['total'], tableValue);
} }
return <td>{cellValue}</td>; return <td>{getNumberFormatted(cellValue)}</td>;
}; };
export default LastRowCell; export default LastRowCell;

View File

@@ -6,7 +6,6 @@ import { head, isEmpty, isNil, pathOr, sum } from 'ramda';
// components // components
import DefaultCell from './components/DefaultCell'; import DefaultCell from './components/DefaultCell';
import LastRowCell from './components/LastRowCell'; import LastRowCell from './components/LastRowCell';
import getNumberFormatted from '../../../../../helpers/getNumberFormatted';
const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn, disabled }) => { const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn, disabled }) => {
const rows = pathOr([], ['rows'], tableValue) const rows = pathOr([], ['rows'], tableValue)
@@ -32,7 +31,7 @@ const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn,
.map(v => isEmpty(v) || isNil(v) ? 0 : v); .map(v => isEmpty(v) || isNil(v) ? 0 : v);
if (cellValue === 'sum') { if (cellValue === 'sum') {
total = getNumberFormatted(sum(getAllRowsValues)); total = sum(getAllRowsValues);
} else { } else {
total = 0; total = 0;
} }

View File

@@ -50,105 +50,195 @@ export const dynamicDataOptions = {
export const protocolType = [ export const protocolType = [
{ {
'id': 1, 'id': 1,
'name': 'PROTOCOLLO IN ENTRATA' 'name': 'PROTOCOLLO ENTRATA'
}, },
{ {
'id': 2, 'id': 2,
'name': 'PROTOCOLLO IN USCITA' 'name': 'PROTOCOLLO USCITA'
}, },
{ {
'id': 3, 'id': 3,
'name': 'DOCUMENTO INTERNO' 'name': 'DOCUMENTO INTERNO'
}, },
{ /*{
'id': 1003, 'id': 1003,
'name': 'PROTOCOLLO INTERNO ' 'name': 'PROTOCOLLO INTERNO '
} }*/
]; ];
export const classificationType = [ export const classificationType = [
{ {
'idClassificazione': 1, 'idClassificazione': 101,
'name': 'BILANCIO', 'name': 'BILANCIO',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 2, 'idClassificazione': 102,
'name': 'DICHHIARAZIONE DEI REDDITI', 'name': 'DICHHIARAZIONE DEI REDDITI',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 3, 'idClassificazione': 103,
'name': 'SITUAZIONE CONTABILE', 'name': 'SITUAZIONE CONTABILE',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 4, 'idClassificazione': 104,
'name': 'PROSPETTO CONTO ECONOMICO', 'name': 'PROSPETTO CONTO ECONOMICO',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 5, 'idClassificazione': 105,
'name': 'CENTRALE DEI RISCHI', 'name': 'CENTRALE DEI RISCHI',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 6, 'idClassificazione': 106,
'name': 'RELAZIONE AZIENDALE ILLUSTRATIVA (MOD R1C, R1I, R1R, R1R A SECONDO DEI ', 'name': 'RELAZIONE AZIENDALE ILLUSTRATIVA (MOD R1C, R1I, R1R, R1S A SECONDA DEI SETTORI)',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 7, 'idClassificazione': 107,
'name': 'DOCUMENTO IDENTITA\'', 'name': 'DOCUMENTO IDENTITA\'',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 8, 'idClassificazione': 108,
'name': 'MODELLO SP1', 'name': 'MODELLO SP1',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 9, 'idClassificazione': 109,
'name': 'PRIVACY', 'name': 'PRIVACY',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 10, 'idClassificazione': 110,
'name': 'DOCUMENTAZIONE CHE ATTESTA POSSIBILITA\' DI RILASCIARE GAA FAVORE', 'name': 'DOCUMENTAZIONE CHE ATTESTA POSSIBILITA\' DI RILASCIARE GARANZIE A FAVORE DI TERZI (ES. STATUTO, VISURA…)',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 11, 'idClassificazione': 111,
'name': 'MODELLO AR1 D.LG 231/2007', 'name': 'MODELLO AR1 D.LG 231/2007',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 12, 'idClassificazione': 112,
'name': 'DOCUMENTO IDENTITA\' FIRMATORIO DICHHIARAZIONE SOSTITUTIVA', 'name': 'DOCUMENTO IDENTITA\' FIRMATARIO DICHIARAZIONE SOSTITUTIVA',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 13, 'idClassificazione': 113,
'name': 'PRIVACY FIRMATARIO DICHHIARAZIONE SOSTITUTIVA', 'name': 'PRIVACY FIRMATARIO DICHIARAZIONE SOSTITUTIVA',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 14, 'idClassificazione': 114,
'name': 'NULLAOSTA ANTIMAFIA', 'name': 'NULLAOSTA ANTIMAFIA',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 1, 'idClassificazione': 115,
'name': 'LETTERA ESITO DELIBERA', 'name': 'VISURA CRIF',
'idTipoprotocollo': 2 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 2, 'idClassificazione': 116,
'name': 'DURC',
'idTipoprotocollo': 1
},
{
'idClassificazione': 117,
'name': 'STATO PATRIMONIALE E CONTO ECONOMICO',
'idTipoprotocollo': 1
},
{
'idClassificazione': 118,
'name': 'DOCUMENTAZIONE FISCALE E CONTABILE',
'idTipoprotocollo': 1
},
{
'idClassificazione': 119,
'name': 'BILANCIO GRUPPO IMPRESE',
'idTipoprotocollo': 1
},
{
'idClassificazione': 121,
'name': 'DICHIARAZIONE DEI REDDITI GARANTI',
'idTipoprotocollo': 1
},
{
'idClassificazione': 122,
'name': 'CENTRALE DEI RISCHI GARANTI',
'idTipoprotocollo': 1
},
{
'idClassificazione': 123,
'name': 'BILANCIO / DICHIARAZIONE REDDITI GARANTI',
'idTipoprotocollo': 1
},
{
'idClassificazione': 125,
'name': 'CONTRATTO FIRMATO DAL CLIENTE',
'idTipoprotocollo': 1
},
{
'idClassificazione': 126,
'name': 'CONTRATTO FIRMATO DA GEPAFIN',
'idTipoprotocollo': 1
},
{
'idClassificazione': 128,
'name': 'ALLEGATO 4',
'idTipoprotocollo': 1
},
{
'idClassificazione': 129,
'name': 'ATTESTAZIONE PREGIUDIZIEVOLI',
'idTipoprotocollo': 1
},
{
'idClassificazione': 130,
'name': 'DELIBERA BANCA',
'idTipoprotocollo': 1
},
{
'idClassificazione': 131,
'name': 'ALTRO',
'idTipoprotocollo': 1
},
{
'idClassificazione': 202,
'name': 'LETTERA DI GARANZIA', 'name': 'LETTERA DI GARANZIA',
'idTipoprotocollo': 1 'idTipoprotocollo': 1
}, },
{ {
'idClassificazione': 3, 'idClassificazione': 127,
'name': 'FATTURA',
'idTipoprotocollo': 2
},
{
'idClassificazione': 201,
'name': 'LETTERA ESITO DELIBERA',
'idTipoprotocollo': 2
},
{
'idClassificazione': 204,
'name': 'LETTERA TRASPARENZA',
'idTipoprotocollo': 2
},
{
'idClassificazione': 205,
'name': 'CONTRATTO',
'idTipoprotocollo': 1
},
{
'idClassificazione': 124,
'name': 'STAMPA PROPOSTA DELIBERA',
'idTipoprotocollo': 3
},
{
'idClassificazione': 203,
'name': 'GENERICO', 'name': 'GENERICO',
'idTipoprotocollo': 3 'idTipoprotocollo': 3
} }

View File

@@ -35,12 +35,12 @@ const ElementSetting = ({ setting, changeFn, updateDataFn, bandoStatus }) => {
text: __('Testo formattato', 'gepafin'), text: __('Testo formattato', 'gepafin'),
table_columns: '', table_columns: '',
criteria_table_columns: '', criteria_table_columns: '',
variable: __('Variable (only letters and "_")', 'gepafin'), variable: __('Variabile (lettere, cifre e "_"; il primo carattere deve essere una lettera!)', 'gepafin'),
formula: __('Auto calculation formula', 'gepafin') formula: __('Formula di calcolo automatico', 'gepafin')
} }
const settingDescription = { const settingDescription = {
formula: __('Create formula using previously declared variables. Use these math operators: <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>. Example of formula: <code>{entrate}+{assicurazione}</code>.', 'gepafin') formula: __('Crea una formula usando variabili dichiarate in precedenza. Utilizza questi operatori matematici: <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>. Esempio: <code>{entrate}+{assicurazione}</code>.', 'gepafin')
} }
const renderHeader = () => { const renderHeader = () => {

View File

@@ -8,7 +8,7 @@ const ElementSettingChips = ({ restrictedValues = [], changeFn, value = [] }) =>
const [lastTyped, setLastTyped] = useState([]) const [lastTyped, setLastTyped] = useState([])
const isValidValue = (newVal) => { const isValidValue = (newVal) => {
const validationRegex = /^[a-zA-Z_]+$/; const validationRegex = /^[a-zA-Z][a-zA-Z0-9_]*$/;
return validationRegex.test(newVal); return validationRegex.test(newVal);
}; };

View File

@@ -237,7 +237,7 @@ const BuilderElementSettings = ({ closeSettingsFn, bandoStatus }) => {
{settings {settings
&& settings && settings
.filter(o => ['variable', 'formula'].includes(o.name)).length > 0 .filter(o => ['variable', 'formula'].includes(o.name)).length > 0
? <TabPanel header={__('Calculation', 'gepafin')}> ? <TabPanel header={__('Calcolo', 'gepafin')}>
{settings {settings
? settings ? settings
.filter(o => ['variable', 'formula'].includes(o.name)) .filter(o => ['variable', 'formula'].includes(o.name))
@@ -251,8 +251,11 @@ const BuilderElementSettings = ({ closeSettingsFn, bandoStatus }) => {
</TabPanel> : null} </TabPanel> : null}
</TabView> </TabView>
<div style={{display: 'flex', gap: '0.5rem'}}>
<Button label={__('Annulla', 'gepafin')} onClick={closeSettingsFn} severity="danger"/>
<Button label={__('Salva', 'gepafin')} onClick={saveSettings}/> <Button label={__('Salva', 'gepafin')} onClick={saveSettings}/>
</div> </div>
</div>
: null : null
) )
} }

View File

@@ -56,7 +56,7 @@ const FormBuilder = ({ bandoStatus }) => {
return ( return (
<> <>
<Sidebar visible={!isEmpty(activeElement)} onHide={closeSettings} className="formBuilder__elementSettings"> <Sidebar visible={!isEmpty(activeElement)} onHide={closeSettings} dismissable={false} className="formBuilder__elementSettings">
<h2>{__('Impostazioni del campo modulo', 'gepafin')}</h2> <h2>{__('Impostazioni del campo modulo', 'gepafin')}</h2>
{!isEmpty(activeElement) ? <BuilderElementSettings closeSettingsFn={closeSettings} bandoStatus={bandoStatus}/> : null} {!isEmpty(activeElement) ? <BuilderElementSettings closeSettingsFn={closeSettings} bandoStatus={bandoStatus}/> : null}
</Sidebar> </Sidebar>