sepa, giacenza tuidi

This commit is contained in:
2025-02-18 14:11:07 +01:00
parent 2cd81d3dd1
commit 0e50addf19
3 changed files with 19 additions and 11 deletions

View File

@@ -229,18 +229,20 @@ public class UtilityDate {
.atZone(currentZone)
.toInstant());
}
public static XMLGregorianCalendar convertDateToXMLGregorianCalendar(Date parsedDate, String format) throws Exception {
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(parsedDate);
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar);
xmlGregorianCalendar.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
return xmlGregorianCalendar;
}
public static XMLGregorianCalendar convertStringToXMLGregorianCalendar(String date, String format) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(format);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date parsedDate = sdf.parse(date);
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(parsedDate);
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar);
xmlGregorianCalendar.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
return xmlGregorianCalendar;
return convertDateToXMLGregorianCalendar(parsedDate, format);
}
public static int datePart(int datepart, @Nonnull Date date) {

View File

@@ -68,10 +68,12 @@ import it.integry.ems.response.ServiceRestResponse;
import it.integry.ems.service.EntityProcessor;
import it.integry.ems.service.MapService;
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
import it.integry.ems_model.config.EmsRestConstants;
import it.integry.ems_model.entity.VtbDist;
import it.integry.ems_model.service.SetupGest;
import it.integry.ems_model.types.OperationType;
import it.integry.ems_model.utility.UtilityDB;
import it.integry.ems_model.utility.UtilityDate;
import it.integry.ems_model.utility.UtilityString;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -531,9 +533,11 @@ public class SEPAService {
paymList.add(payment);
}
GregorianCalendar dataValGreg = new GregorianCalendar();
dataValGreg.setTime(rs.getDate("data_valuta"));
XMLGregorianCalendar dataExec = DatatypeFactory.newInstance().newXMLGregorianCalendar(dataValGreg);
XMLGregorianCalendar dataExec =UtilityDate.convertDateToXMLGregorianCalendar(rs.getDate("data_valuta"), CommonConstants.DATE_FORMAT_YMD);
// GregorianCalendar dataValGreg = new GregorianCalendar();
// dataValGreg.setTimeZone(TimeZone.getTimeZone("GMT"));
// dataValGreg.setTime(rs.getDate("data_valuta"));
// XMLGregorianCalendar dataExec = DatatypeFactory.newInstance().newXMLGregorianCalendar(dataValGreg);
it.integry.ems.contabil.sepa.dto.Bonifico_v00_04_01.CBIPaymentInstructionInformation pmtInf = new it.integry.ems.contabil.sepa.dto.Bonifico_v00_04_01.CBIPaymentInstructionInformation();
DateAndDateTime2Choice dateAndDateTime2Choice = new DateAndDateTime2Choice();

View File

@@ -673,8 +673,10 @@ public class GiacenzaService {
List<GiacenzaDTO> listGiacenza = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, GiacenzaDTO.class);
String listiniAcquisto = setupGest.getSetup("DATI_AZIENDA", "GIACENZA_DA_INV", "LISTINI_ACQUISTO");
List<String> listini = Arrays.asList(listiniAcquisto.split("\\|"));
List<String> listini = new ArrayList<>();
if (!UtilityString.isNullOrEmpty(listiniAcquisto)) {
listini = Arrays.asList(listiniAcquisto.split("\\|"));
}
if (readOrdini ) {
sql = "WITH incoming_stock_documenti AS (\n" +