git-svn-id: svn://10.65.10.50/branches/R_10_00@23189 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5977b9d122
commit
86448985ed
174
fe/fe0100.cpp
174
fe/fe0100.cpp
@ -149,14 +149,21 @@ TExclusion_mode TSpesometro_msk::segnala_movimento(const TRectype& mov, TExclusi
|
||||
const long numreg = mov.get_long(MOV_NUMREG);
|
||||
const char tipocf = mov.get_char(MOV_TIPO);
|
||||
const long codcf = mov.get_long(MOV_CODCF);
|
||||
const TAnagrafica a(tipocf, codcf, mov.get(MOV_OCFPI));
|
||||
TString msg;
|
||||
msg.format(FR("Mov. %7ld %s %s: "), numreg,
|
||||
tipocf=='F' ? TR("For.") : TR("Cli."), (const char*)a.ragione_sociale());
|
||||
msg << mode2string(motivo);
|
||||
if (codcf > 0)
|
||||
{
|
||||
const TAnagrafica a(tipocf, codcf, mov.get(MOV_OCFPI));
|
||||
msg.format(FR("Mov. %7ld %s %s: "), numreg,
|
||||
tipocf=='F' ? TR("For.") : TR("Cli."), (const char*)a.ragione_sociale());
|
||||
msg << mode2string(motivo);
|
||||
|
||||
if (a.estero() && a.stato_estero_UNICO().blank())
|
||||
msg << " (Codice UNICO non specificato)";
|
||||
if (a.estero() && a.stato_estero_UNICO().blank())
|
||||
msg << " (Codice UNICO non specificato)";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.format(FR("Mov. %7ld %s senza codice: "), numreg, tipocf=='F' ? TR("For.") : TR("Cli."));
|
||||
}
|
||||
|
||||
msg.strip_double_spaces();
|
||||
_log->log(1, msg);
|
||||
@ -173,6 +180,11 @@ TExclusion_mode TSpesometro_msk::validate_clifo(const TRectype& mov)
|
||||
if (tipocf <= ' ' || (codcf <= 0 && ocfpi.blank()))
|
||||
return segnala_movimento(mov, em_no_allegato);
|
||||
|
||||
#ifdef DBG
|
||||
if (codcf == 269)
|
||||
int ok=false;
|
||||
#endif
|
||||
|
||||
TString8 key; key.format("%c|%ld", tipocf, codcf);
|
||||
const TRectype& rec_clifo = cache().get(LF_CLIFO, key);
|
||||
const int alleg = rec_clifo.get_int(CLI_ALLEG);
|
||||
@ -232,6 +244,35 @@ TExclusion_mode TSpesometro_msk::validate_mov(const TRectype& mov)
|
||||
if (anno < 2012)
|
||||
return segnala_movimento(mov, em_data_limite);
|
||||
|
||||
#ifdef DBG
|
||||
if (mov.get_long(MOV_NUMREG) ==14224)
|
||||
int sn = 1;
|
||||
#endif
|
||||
const char tipocf = mov.get_char(MOV_TIPO);
|
||||
const real impmin = get_real(F_IMPMIN);
|
||||
|
||||
if (tipocf == 'C' && impmin > ZERO && abs(mov.get_real(MOV_TOTDOC)) <= impmin)
|
||||
return segnala_movimento(mov, em_importo_limite);
|
||||
|
||||
const TString& keytok = mov.get(MOV_NUMREG);
|
||||
TRecord_array righe_iva(keytok, LF_RMOVIVA);
|
||||
real tot_imponibile, tot_imposta;
|
||||
//calcolo di imponibile ed imposta di tutte le righe iva del movimento
|
||||
for (int r = righe_iva.last_row(); r > 0; r = righe_iva.pred_row(r))
|
||||
{
|
||||
const TRectype& rmi = righe_iva.row(r);
|
||||
const TCodiceIVA ci(rmi.get(RMI_CODIVA));
|
||||
const int natura_operazione = ci.allegato(tipocf);
|
||||
if (natura_operazione <= 0 || natura_operazione > 5)
|
||||
continue;
|
||||
tot_imponibile += rmi.get_real(RMI_IMPONIBILE);
|
||||
tot_imposta += rmi.get_real(RMI_IMPOSTA);
|
||||
}
|
||||
if (tot_imponibile.is_zero() && tot_imposta.is_zero())
|
||||
return segnala_movimento(mov, em_importo_limite);
|
||||
if (tipocf == 'C' && abs(tot_imponibile) < impmin)
|
||||
return segnala_movimento(mov, em_importo_limite);
|
||||
|
||||
TExclusion_mode em = validate_clifo(mov);
|
||||
if (em != em_normale)
|
||||
return em;
|
||||
@ -239,26 +280,6 @@ TExclusion_mode TSpesometro_msk::validate_mov(const TRectype& mov)
|
||||
// Trova i movimenti INTRA
|
||||
if (!mov.get_real(MOV_CORRLIRE).is_zero() || !mov.get_real(MOV_CORRVALUTA).is_zero())
|
||||
em = segnala_movimento(mov, em_intra);
|
||||
else
|
||||
{
|
||||
const TString& keytok = mov.get(MOV_NUMREG);
|
||||
const char tipocf = mov.get_char(MOV_TIPO);
|
||||
TRecord_array righe_iva(keytok, LF_RMOVIVA);
|
||||
real tot_imponibile, tot_imposta;
|
||||
//calcolo di imponibile ed imposta di tutte le righe iva del movimento
|
||||
for (int r = righe_iva.last_row(); r > 0; r = righe_iva.pred_row(r))
|
||||
{
|
||||
const TRectype& rmi = righe_iva.row(r);
|
||||
const TCodiceIVA ci(rmi.get(RMI_CODIVA));
|
||||
const int natura_operazione = ci.allegato(tipocf);
|
||||
if (natura_operazione <= 0 || natura_operazione > 5)
|
||||
continue;
|
||||
tot_imponibile += rmi.get_real(RMI_IMPONIBILE);
|
||||
tot_imposta += rmi.get_real(RMI_IMPOSTA);
|
||||
}
|
||||
if (tot_imponibile.is_zero() && tot_imposta.is_zero())
|
||||
em = segnala_movimento(mov, em_importo_limite);
|
||||
}
|
||||
|
||||
return em;
|
||||
}
|
||||
@ -297,51 +318,55 @@ TExclusion_mode TSpesometro_msk::elabora_movimento(const TRectype& mov, TBaseisa
|
||||
}
|
||||
}
|
||||
|
||||
const TString& keytok = mov.get(MOV_NUMREG);
|
||||
TRecord_array righe_iva(keytok, LF_RMOVIVA);
|
||||
int tipo_iva = 1; // Normale
|
||||
real tot_imponibile, tot_imposta;
|
||||
int tipo_iva = 1; // Normale
|
||||
real ser_imponibile, mer_imponibile;
|
||||
//calcolo di imponibile ed imposta di tutte le righe iva del movimento
|
||||
for (int r = righe_iva.last_row(); r > 0; r = righe_iva.pred_row(r))
|
||||
|
||||
if (em != em_importo_limite)
|
||||
{
|
||||
const TRectype& rmi = righe_iva.row(r);
|
||||
const TCodiceIVA ci(rmi.get(RMI_CODIVA));
|
||||
int natura_operazione = ci.allegato(tipocf);
|
||||
if (natura_operazione <= 0 || natura_operazione > 5)
|
||||
continue; // Scarta codici IVA non rilevanti
|
||||
if (natura_operazione > tipo_iva)
|
||||
tipo_iva = natura_operazione;
|
||||
// Esportazioni
|
||||
const bool art_8 = ci.get("S2") == "20" && ci.get("S3") == "1";
|
||||
if (art_8)
|
||||
segnala_movimento(mov, em_art8);
|
||||
|
||||
const TString4 cod_det = rmi.get(RMI_TIPODET);
|
||||
const int tip_det = cod_det == "3" ? 3 : atoi(cache().get("%DET", cod_det, "I0"));
|
||||
if (tip_det == 3)
|
||||
segnala_movimento(mov, em_passaggi_interni);
|
||||
|
||||
real rmi_imponibile = rmi.get_real(RMI_IMPONIBILE);
|
||||
real rmi_imposta = rmi.get_real(RMI_IMPOSTA);
|
||||
|
||||
if (natura_operazione == 4 && rmi_imposta.is_zero()) // se l'imposta non è specificata sullo scontrino ...
|
||||
rmi_imposta = ci.scorpora(rmi_imponibile); // ... scorporo il lordo
|
||||
|
||||
tot_imponibile += rmi_imponibile;
|
||||
tot_imposta += rmi_imposta;
|
||||
|
||||
if (tipope == "SE")
|
||||
const TString& keytok = mov.get(MOV_NUMREG);
|
||||
TRecord_array righe_iva(keytok, LF_RMOVIVA);
|
||||
//calcolo di imponibile ed imposta di tutte le righe iva del movimento
|
||||
for (int r = righe_iva.last_row(); r > 0; r = righe_iva.pred_row(r))
|
||||
{
|
||||
const TBill zio(rmi);
|
||||
const TRectype& rec = cache().get(LF_PCON, zio.string());
|
||||
if (rec.get_int(PCN_RICSER) == 1) // 0=Altro; 1=Servizi; 2=Merce
|
||||
ser_imponibile += rmi_imponibile;
|
||||
else
|
||||
mer_imponibile += rmi_imponibile;
|
||||
const TRectype& rmi = righe_iva.row(r);
|
||||
const TCodiceIVA ci(rmi.get(RMI_CODIVA));
|
||||
int natura_operazione = ci.allegato(tipocf);
|
||||
if (natura_operazione <= 0 || natura_operazione > 5)
|
||||
continue; // Scarta codici IVA non rilevanti
|
||||
if (natura_operazione > tipo_iva)
|
||||
tipo_iva = natura_operazione;
|
||||
// Esportazioni
|
||||
const bool art_8 = ci.get("S2") == "20" && ci.get("S3") == "1";
|
||||
if (art_8)
|
||||
segnala_movimento(mov, em_art8);
|
||||
|
||||
const TString4 cod_det = rmi.get(RMI_TIPODET);
|
||||
const int tip_det = cod_det == "3" ? 3 : atoi(cache().get("%DET", cod_det, "I0"));
|
||||
if (tip_det == 3)
|
||||
segnala_movimento(mov, em_passaggi_interni);
|
||||
|
||||
real rmi_imponibile = rmi.get_real(RMI_IMPONIBILE);
|
||||
real rmi_imposta = rmi.get_real(RMI_IMPOSTA);
|
||||
|
||||
if (natura_operazione == 4 && rmi_imposta.is_zero()) // se l'imposta non è specificata sullo scontrino ...
|
||||
rmi_imposta = ci.scorpora(rmi_imponibile); // ... scorporo il lordo
|
||||
|
||||
tot_imponibile += rmi_imponibile;
|
||||
tot_imposta += rmi_imposta;
|
||||
|
||||
if (tipope == "SE")
|
||||
{
|
||||
const TBill zio(rmi);
|
||||
const TRectype& rec = cache().get(LF_PCON, zio.string());
|
||||
if (rec.get_int(PCN_RICSER) == 1) // 0=Altro; 1=Servizi; 2=Merce
|
||||
ser_imponibile += rmi_imponibile;
|
||||
else
|
||||
mer_imponibile += rmi_imponibile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const long numreg = mov.get_long(MOV_NUMREG);
|
||||
|
||||
// Registro tutti i dati del cliente e gli importi
|
||||
@ -800,7 +825,7 @@ bool TSpesometro_msk::recall_alleg() const
|
||||
const int anno = get_date_range(dal, al);
|
||||
|
||||
if (!delete_box(FR("Si desidera annullare l'invio definitivo dal %s al %s?"),
|
||||
dal.stringa(), al.stringa()))
|
||||
dal.stringa(), al.stringa()))
|
||||
return false;
|
||||
|
||||
TFast_isamfile mov(LF_MOV);
|
||||
@ -988,6 +1013,7 @@ void TSpesometro_msk::load_sheet()
|
||||
const char tipocf = get(F_TIPOCF)[0];
|
||||
const long codcf = get_long(F_CODCF);
|
||||
const TString& ocfpi = get(F_OCFPI);
|
||||
real vendite, acquisti;
|
||||
|
||||
TSheet_field& s = sfield(F_RIGHE);
|
||||
s.hide(); // Nascondo lo sheet per guadagnare un 20% di velocità di caricamento
|
||||
@ -1072,11 +1098,22 @@ void TSpesometro_msk::load_sheet()
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
s.autoload_line(++rec, curr);
|
||||
if (s.autoload_line(++rec, curr))
|
||||
{
|
||||
const real imp = curr.get(ALL_IMPORTO);
|
||||
if (curr.get_char(ALL_TIPOCF) == 'F')
|
||||
acquisti += imp;
|
||||
else
|
||||
vendite += imp;
|
||||
}
|
||||
}
|
||||
}
|
||||
//alleg_sort(s);
|
||||
|
||||
set(F_ACQUISTI, acquisti);
|
||||
set(F_VENDITE, vendite);
|
||||
set(F_TOTALE, real(acquisti+vendite));
|
||||
|
||||
s.force_update();
|
||||
s.show();
|
||||
set_dirty(false);
|
||||
@ -1436,10 +1473,11 @@ bool TSpesometro_app::create()
|
||||
{
|
||||
if (!has_module(F3AUT))
|
||||
{
|
||||
const TDate oggi(TODAY);
|
||||
TString html;
|
||||
html << "<html><body>"
|
||||
<< "<h5>Attenzione: Il modulo FE deve essere attivato in congiunzione a F3.</h5>\n"
|
||||
<< "<p align=justify>Al fine di poter attivare l'utilizzo della Comunicazione Polivalente 2014 "
|
||||
<< "<p align=justify>Al fine di poter attivare l'utilizzo della Comunicazione Polivalente " << oggi.year() << " "
|
||||
<< "La preghiamo di contattare <b>Sirio informatica e sistemi</b> al seguente riferimento:</p><br/>"
|
||||
<< "<ul>"
|
||||
<< "<li>Casella vocale Hotline Campo: <br /><a href=mailto:hotlinecampo@sirio-is.it>hotlinecampo@sirio-is.it</a> Tel. 02-36583540</li>"
|
||||
|
@ -11,6 +11,11 @@
|
||||
#define F_OCFPI 313
|
||||
#define F_RAGSOC 314
|
||||
#define F_RAGOCC 315
|
||||
#define F_IMPMIN 318
|
||||
#define F_VENDITE 320
|
||||
#define F_ACQUISTI 321
|
||||
#define F_TOTALE 322
|
||||
|
||||
|
||||
#define F_RIGHE 300
|
||||
|
||||
|
105
fe/fe0100a.uml
105
fe/fe0100a.uml
@ -67,24 +67,14 @@ ENDPAGE
|
||||
|
||||
PAGE "Comunicazione Polivalente" 0 2 0 0
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
GROUPBOX DLG_NULL 53 5
|
||||
BEGIN
|
||||
PROMPT 1 0 "@bFiltri di visualizzazione"
|
||||
END
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "Anno "
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "AU"
|
||||
GROUP 1
|
||||
NUM_EXPR #THIS_FIELD>=2012
|
||||
WARNING "Anno non valido"
|
||||
END
|
||||
|
||||
LIST F_TIPO 2 10
|
||||
BEGIN
|
||||
PROMPT 21 1 "Tipo "
|
||||
PROMPT 2 1 ""
|
||||
ITEM "FE|Spesometro"
|
||||
ITEM "BL|Black List"
|
||||
ITEM "XX|Ignorati"
|
||||
@ -92,6 +82,16 @@ BEGIN
|
||||
ITEM "**|Tutti"
|
||||
END
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
PROMPT 16 1 "Anno "
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "AU"
|
||||
GROUP 1
|
||||
NUM_EXPR #THIS_FIELD>=2012
|
||||
WARNING "Anno non valido"
|
||||
END
|
||||
|
||||
LIST F_TIPOCF 1 10
|
||||
BEGIN
|
||||
PROMPT 2 2 ""
|
||||
@ -118,24 +118,9 @@ BEGIN
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 50 49
|
||||
BEGIN
|
||||
PROMPT 26 2 ""
|
||||
USE LF_CLIFO KEY 2
|
||||
INPUT TIPOCF F_TIPOCF SELECT
|
||||
INPUT RAGSOC F_RAGSOC
|
||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
||||
DISPLAY "Codice" CODCF
|
||||
DISPLAY "Codice Fiscale@16" COFI
|
||||
DISPLAY "Partita IVA@15" PAIV
|
||||
COPY OUTPUT F_CODCF
|
||||
ADD RUN CG0 -1
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_OCFPI 16
|
||||
BEGIN
|
||||
PROMPT 2 3 "Occ."
|
||||
PROMPT 29 2 "Occas."
|
||||
USE LF_OCCAS
|
||||
INPUT CFPI F_OCFPI
|
||||
DISPLAY "Codice@16" CFPI
|
||||
@ -149,30 +134,84 @@ BEGIN
|
||||
MESSAGE HIDE,F_RAGSOC|SHOW,F_RAGOCC
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 50 49
|
||||
BEGIN
|
||||
PROMPT 2 3 ""
|
||||
USE LF_CLIFO KEY 2
|
||||
INPUT TIPOCF F_TIPOCF SELECT
|
||||
INPUT RAGSOC F_RAGSOC
|
||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
||||
DISPLAY "Codice" CODCF
|
||||
DISPLAY "Codice Fiscale@16" COFI
|
||||
DISPLAY "Partita IVA@15" PAIV
|
||||
COPY OUTPUT F_CODCF
|
||||
ADD RUN CG0 -1
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
|
||||
STRING F_RAGOCC 50 49
|
||||
BEGIN
|
||||
PROMPT 26 3 ""
|
||||
PROMPT 1 3 ""
|
||||
FLAGS "H"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_OUTFOLDER 255 45
|
||||
GROUPBOX DLG_NULL 24 5
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cartella "
|
||||
PROMPT 55 0 "@bTotali"
|
||||
END
|
||||
|
||||
CURRENCY F_VENDITE 16
|
||||
BEGIN
|
||||
PROMPT 56 1 "Ven. "
|
||||
FLAGS "L"
|
||||
END
|
||||
|
||||
CURRENCY F_ACQUISTI 16
|
||||
BEGIN
|
||||
PROMPT 56 2 "Acq. "
|
||||
FLAGS "L"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 56 3 "@bTot."
|
||||
END
|
||||
|
||||
CURRENCY F_TOTALE 16
|
||||
BEGIN
|
||||
PROMPT 61 3 ""
|
||||
FLAGS "LG"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 1 5 "@bParametri di generazione file"
|
||||
END
|
||||
|
||||
STRING F_OUTFOLDER 255 65
|
||||
BEGIN
|
||||
PROMPT 2 6 "Cartella "
|
||||
DSELECT
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "M"
|
||||
WARNING "Specificare una cartella di destinazione valida"
|
||||
END
|
||||
|
||||
CURRENCY F_IMPMIN 8
|
||||
BEGIN
|
||||
PROMPT 2 7 "Imponibile minimo fatture (dettaglianti) "
|
||||
END
|
||||
|
||||
BOOLEAN F_DEFINITIVO
|
||||
BEGIN
|
||||
PROMPT 65 4 "Definitivo"
|
||||
PROMPT 58 7 "Invio definitivo"
|
||||
END
|
||||
|
||||
SPREADSHEET F_RIGHE
|
||||
BEGIN
|
||||
PROMPT 0 6 ""
|
||||
PROMPT 0 9 ""
|
||||
ITEM "Numero\nRegistraz.@7F"
|
||||
ITEM "Forzata@C"
|
||||
ITEM "Ignora@5"
|
||||
|
Loading…
x
Reference in New Issue
Block a user