Merge pull request #337 from Kitzanos/pdf-year-change-prod
Cherry-pick (Updated year field in pdf)
This commit is contained in:
@@ -1670,12 +1670,12 @@ public class ApplicationDao {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void calculationProcessForFormula(ApplicationFormEntity applicationFormEntity, List<ContentResponseBean> contentResponseBeans, ApplicationFormFieldRequestBean applicationFormFieldRequestBean,FieldValidator fieldValidator) {
|
public void calculationProcessForFormula(ApplicationFormEntity applicationFormEntity, List<ContentResponseBean> contentResponseBeans,String fromFieldId,String formFieldValue,FieldValidator fieldValidator) {
|
||||||
List<String> formulaValue = new ArrayList<>();
|
List<String> formulaValue = new ArrayList<>();
|
||||||
String formulaValueOpt=null;
|
String formulaValueOpt=null;
|
||||||
String label=null;
|
String label=null;
|
||||||
for (ContentResponseBean contentResponseBean:contentResponseBeans){
|
for (ContentResponseBean contentResponseBean:contentResponseBeans){
|
||||||
if(contentResponseBean.getId().equals(applicationFormFieldRequestBean.getFieldId())){
|
if(contentResponseBean.getId().equals(fromFieldId)){
|
||||||
for (SettingResponseBean settingResponseBean:contentResponseBean.getSettings()){
|
for (SettingResponseBean settingResponseBean:contentResponseBean.getSettings()){
|
||||||
if (settingResponseBean.getName().equals("label")){
|
if (settingResponseBean.getName().equals("label")){
|
||||||
label= String.valueOf(settingResponseBean.getValue());
|
label= String.valueOf(settingResponseBean.getValue());
|
||||||
@@ -1689,7 +1689,7 @@ public class ApplicationDao {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map<String, String> mappedFormulaValue = new HashMap<>();
|
Map<String, String> mappedFormulaValue = new HashMap<>();
|
||||||
Object fieldValue = applicationFormFieldRequestBean.getFieldValue();
|
Object fieldValue = formFieldValue;
|
||||||
if (formulaValueOpt != null && fieldValue==null) {
|
if (formulaValueOpt != null && fieldValue==null) {
|
||||||
fieldValue=0;
|
fieldValue=0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ public class FormDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationDao applicationDao;
|
||||||
|
|
||||||
public FormEntity saveFormEntity(FormEntity formEntity){
|
public FormEntity saveFormEntity(FormEntity formEntity){
|
||||||
formEntity=formRepository.save(formEntity);
|
formEntity=formRepository.save(formEntity);
|
||||||
return formEntity;
|
return formEntity;
|
||||||
@@ -419,6 +422,8 @@ public class FormDao {
|
|||||||
.maxLength(value, fieldValidatorBean.getMaxLength(), fieldLabel,fieldValidatorBean.getMax(),contentResponseBean) // Only applies if maxLength is not null
|
.maxLength(value, fieldValidatorBean.getMaxLength(), fieldLabel,fieldValidatorBean.getMax(),contentResponseBean) // Only applies if maxLength is not null
|
||||||
.matchesPattern(value, fieldValidatorBean.getPattern(), fieldLabel) // Only applies if pattern is present
|
.matchesPattern(value, fieldValidatorBean.getPattern(), fieldLabel) // Only applies if pattern is present
|
||||||
.validateCustom(value, fieldValidatorBean.getCustom(), fieldLabel,contentResponseBean); // Add the custom validation here
|
.validateCustom(value, fieldValidatorBean.getCustom(), fieldLabel,contentResponseBean); // Add the custom validation here
|
||||||
|
|
||||||
|
// applicationDao.calculationProcessForFormula(applicationFormEntity,formResponseBean.getContent(),fieldId,value,validator);
|
||||||
if (fieldValidatorBean.getCustom() != null && fieldValidatorBean.getCustom().equals(GepafinConstant.IS_PIVA)) {
|
if (fieldValidatorBean.getCustom() != null && fieldValidatorBean.getCustom().equals(GepafinConstant.IS_PIVA)) {
|
||||||
Long hubId = applicationEntity.getHubId();
|
Long hubId = applicationEntity.getHubId();
|
||||||
String error = validateVatNumber(value, fieldLabel,hubId);
|
String error = validateVatNumber(value, fieldLabel,hubId);
|
||||||
|
|||||||
@@ -392,10 +392,12 @@ public class PdfDao {
|
|||||||
if (Boolean.TRUE.equals(formulaEnabledMap.get(key)) && Boolean.TRUE.equals(GepafinConstant.NUMERIC.equalsIgnoreCase(fieldTypeMap.get(key)))) {
|
if (Boolean.TRUE.equals(formulaEnabledMap.get(key)) && Boolean.TRUE.equals(GepafinConstant.NUMERIC.equalsIgnoreCase(fieldTypeMap.get(key)))) {
|
||||||
calculateValue(key, fieldValue, formulaTypeMap, columnSums);
|
calculateValue(key, fieldValue, formulaTypeMap, columnSums);
|
||||||
}
|
}
|
||||||
if(Boolean.TRUE.equals(Utils.isNumeric(fieldValue))){
|
String fieldLabel = stateFieldMap.getOrDefault(key, "");
|
||||||
fieldValue=Utils.convertToItalianFormat(fieldValue);
|
if(Boolean.FALSE.equals(fieldLabel.equalsIgnoreCase("Anno"))) {
|
||||||
|
if (Boolean.TRUE.equals(Utils.isNumeric(fieldValue))) {
|
||||||
|
fieldValue = Utils.convertToItalianFormat(fieldValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PdfPCell dataCell = PdfUtils.htmlToPdfPCell(fieldValue != null ? fieldValue : "", textFont);
|
PdfPCell dataCell = PdfUtils.htmlToPdfPCell(fieldValue != null ? fieldValue : "", textFont);
|
||||||
dataCell.setBackgroundColor(new BaseColor(239, 243, 248)); // Light blue for the cell
|
dataCell.setBackgroundColor(new BaseColor(239, 243, 248)); // Light blue for the cell
|
||||||
dataCell.setMinimumHeight(30f);
|
dataCell.setMinimumHeight(30f);
|
||||||
|
|||||||
Reference in New Issue
Block a user