modifiche a chiusura partite
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -15,9 +15,8 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
public class AccountingRules extends QueryRules {
|
||||
@@ -138,7 +137,7 @@ public class AccountingRules extends QueryRules {
|
||||
|
||||
public static Integer completeNumDocMov(Connection conn, CtbMovt entity) throws Exception {
|
||||
return DocumentRules.nextNumDoc(conn,
|
||||
UtilityLocalDate.localDateFromDate(entity.getDataDoc()),
|
||||
entity.getDataDoc(),
|
||||
entity.getCodIreg(),
|
||||
entity.getSerDoc(),
|
||||
entity.getNumIreg(),
|
||||
@@ -146,7 +145,7 @@ public class AccountingRules extends QueryRules {
|
||||
}
|
||||
|
||||
|
||||
public static Integer getAnnoComp(Connection conn, LocalDate dataCmov) throws SQLException {
|
||||
public static Integer getAnnoComp(Connection conn, Date dataCmov) throws SQLException {
|
||||
if (dataCmov == null)
|
||||
return UtilityLocalDate.getNow().getYear();
|
||||
|
||||
@@ -200,7 +199,7 @@ public class AccountingRules extends QueryRules {
|
||||
|
||||
String setCompetenzaDaDoc = setupGest.getSetup(connection, "CTB_MOVI", "SETUP", "COMPETENZA_IVA_" + gestione);
|
||||
|
||||
sql = "SELECT dbo.f_getDataLiquidazioneIva(" + UtilityDB.valueDateToString(ctbMovt.getDataDoc(), CommonConstants.DATE_FORMAT_YMD_DASHED) + ")";
|
||||
sql = "SELECT dbo.f_getDataLiquidazioneIva(" + UtilityDB.valueDateToString(ctbMovt.getDataDoc(), CommonConstants.DATE_FORMAT_YMD) + ")";
|
||||
|
||||
Date dataCheck = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
|
||||
@@ -627,6 +626,38 @@ public class AccountingRules extends QueryRules {
|
||||
impAvere = ctbScad.getImpAvere().divide(cambioScad, 5, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
boolean existPartita = false;
|
||||
if (riperta) {
|
||||
sql =
|
||||
Query.format(
|
||||
"select CAST(count(*) As bit)\n" +
|
||||
"from crl_scad_parr\n" +
|
||||
"where num_cmov = %s\n" +
|
||||
" and cod_anag = %s AND " +
|
||||
"tipo_anag = %s AND " +
|
||||
"anno_part = %s AND " +
|
||||
"ser_doc = %s AND " +
|
||||
"num_doc = %s AND " +
|
||||
"id_riga_scad = %s ",
|
||||
ctbMovr.getNumCmov(),
|
||||
ctbScad.getCodAnag(),
|
||||
ctbScad.getTipoAnag(),
|
||||
ctbScad.getAnnoPart(),
|
||||
ctbScad.getSerDoc(),
|
||||
ctbScad.getNumDoc(),
|
||||
ctbScad.getIdRiga()
|
||||
);
|
||||
|
||||
existPartita =
|
||||
UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn,
|
||||
sql);
|
||||
}
|
||||
|
||||
OperationType operationType = OperationType.INSERT_OR_UPDATE;
|
||||
if (riperta && existPartita){
|
||||
operationType = OperationType.DELETE;
|
||||
}
|
||||
|
||||
ctbParr =
|
||||
new CtbParr()
|
||||
.setCodCcon(ctbMovr.getCodCcon())
|
||||
@@ -644,7 +675,7 @@ public class AccountingRules extends QueryRules {
|
||||
.setTipoPartita(tipoPartita)
|
||||
.setChiudiScad(ctbMovr.getChiudiScad())
|
||||
.setCambioDiviScad(cambioScad);
|
||||
ctbParr.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
ctbParr.setOperation(operationType);
|
||||
}
|
||||
|
||||
elencoPartite.add(ctbParr);
|
||||
@@ -670,7 +701,10 @@ public class AccountingRules extends QueryRules {
|
||||
crlScadParr.setOperation(OperationType.INSERT);
|
||||
else {
|
||||
crlScadParr.setId(id);
|
||||
crlScadParr.setOperation(OperationType.UPDATE);
|
||||
if ( ctbScad.getOperation() == OperationType.DELETE)
|
||||
crlScadParr.setOperation(OperationType.DELETE);
|
||||
else
|
||||
crlScadParr.setOperation(OperationType.UPDATE);
|
||||
}
|
||||
ctbScad
|
||||
.setIdRigaMov(ctbMovr.getIdRiga())
|
||||
@@ -682,9 +716,9 @@ public class AccountingRules extends QueryRules {
|
||||
} else {
|
||||
sql =
|
||||
Query.format(
|
||||
"SELECT cast(case when count(*) > 1 THEN 1 ELSE 0 eND as bit) " +
|
||||
" FROM ctb_parr " +
|
||||
" WHERE cod_anag = %s AND " +
|
||||
"SELECT cast(count(*) as bit) " +
|
||||
" FROM ctb_parr " +
|
||||
" WHERE cod_anag = %s AND " +
|
||||
"tipo_anag = %s AND " +
|
||||
"anno_part = %s AND " +
|
||||
"ser_doc = %s AND " +
|
||||
|
||||
@@ -27,11 +27,10 @@ public class MtbDepoArea extends EntityBase {
|
||||
@SqlField(value = "descrizione", maxLength = 255)
|
||||
private String descrizione;
|
||||
|
||||
@PK
|
||||
@SqlField(value = "cod_area", maxLength = 15)
|
||||
private String codArea;
|
||||
|
||||
|
||||
|
||||
public MtbDepoArea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
@@ -1453,6 +1454,15 @@ public class ActivityService {
|
||||
StbActivity stbActivity = new StbActivity();
|
||||
stbActivity.setOperation(OperationType.UPDATE);
|
||||
|
||||
if (activity.getEffectiveEndtime() == null)
|
||||
activity.setEffectiveEndtime(UtilityLocalDate.getNowTime());
|
||||
|
||||
if (activity.getEffectiveTime() == null) {
|
||||
BigDecimal oreLav = activity.getOreLav().multiply(new BigDecimal(100))
|
||||
.divide(new BigDecimal(60));
|
||||
activity.setEffectiveTime(activity.getEffectiveEndtime().minusMinutes(oreLav.intValue()));
|
||||
}
|
||||
|
||||
stbActivity.setActivityId(activity.getActivityId())
|
||||
.setActivityDescription(activity.getActivityDescription())
|
||||
.setNote(activity.getNote())
|
||||
|
||||
Reference in New Issue
Block a user