Patch level : 12.00 1402
Files correlati : ve01.exe Commento : Corretta abilitazione CIG CUP
This commit is contained in:
parent
3f40482d7c
commit
6d3b7ca5fd
@ -21,6 +21,7 @@
|
|||||||
// Campi su maschera
|
// Campi su maschera
|
||||||
#include "cg2100.h"
|
#include "cg2100.h"
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
|
#include "../ca/calib01.h"
|
||||||
#include "../fp01/fplib.h"
|
#include "../fp01/fplib.h"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -112,7 +113,7 @@ void TPrimanota_application::add_xml_page(TMask & mask)
|
|||||||
stile.replace_items(items, items);
|
stile.replace_items(items, items);
|
||||||
mask.add_button(DLG_RECALC, newpage, TR("~Genera"), 2, 12, 10, 2, "", BMP_GENERA);
|
mask.add_button(DLG_RECALC, newpage, TR("~Genera"), 2, 12, 10, 2, "", BMP_GENERA);
|
||||||
mask.add_button(DLG_INVIO_SDI, newpage, TR("~Invia"), 20, 12, 10, 2, "", TOOL_EXPORT);
|
mask.add_button(DLG_INVIO_SDI, newpage, TR("~Invia"), 20, 12, 10, 2, "", TOOL_EXPORT);
|
||||||
mask.add_button(DLG_CHECK_SDI, newpage, TR("~Controlla"), 40, 12, 10, 2, "", BMP_CHECK2);
|
mask.add_button(DLG_CHECK_SDI, newpage, TR("~Controlla"), 40, 12, 10, 2, "", BMP_CHECK);
|
||||||
mask.add_button(DLG_ESITO_SDI, newpage, TR("~Esito"), 60, 12, 10, 2, "", BMP_OK);
|
mask.add_button(DLG_ESITO_SDI, newpage, TR("~Esito"), 60, 12, 10, 2, "", BMP_OK);
|
||||||
mask.add_button(DLG_XML_PREVIEW, newpage, TR("~XML"), 2, 15, 10, 2, "", BMP_XML);
|
mask.add_button(DLG_XML_PREVIEW, newpage, TR("~XML"), 2, 15, 10, 2, "", BMP_XML);
|
||||||
mask.add_button(DLG_PDF_PREVIEW, newpage, TR("~PDF"), 20, 15, 10, 2, "", BMP_PDF);
|
mask.add_button(DLG_PDF_PREVIEW, newpage, TR("~PDF"), 20, 15, 10, 2, "", BMP_PDF);
|
||||||
@ -1063,6 +1064,7 @@ void TPrimanota_application::init_insert_mode(TMask& m)
|
|||||||
}
|
}
|
||||||
if (m.exist(DLG_XML_PREVIEW))
|
if (m.exist(DLG_XML_PREVIEW))
|
||||||
{
|
{
|
||||||
|
m.disable(DLG_RECALC);
|
||||||
m.disable(DLG_XML_PREVIEW);
|
m.disable(DLG_XML_PREVIEW);
|
||||||
m.disable(DLG_PDF_PREVIEW);
|
m.disable(DLG_PDF_PREVIEW);
|
||||||
m.disable(DLG_CHECK_SDI);
|
m.disable(DLG_CHECK_SDI);
|
||||||
@ -1188,9 +1190,10 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
|||||||
TString prg_invio = m.get(F_PRG_INVIO);
|
TString prg_invio = m.get(F_PRG_INVIO);
|
||||||
const TString & esito = m.get(F_STATO_SDI); // "|Da generare X|Da inviare I|Inviate C|Consegnate E|In errore D|Diag.
|
const TString & esito = m.get(F_STATO_SDI); // "|Da generare X|Da inviare I|Inviate C|Consegnate E|In errore D|Diag.
|
||||||
|
|
||||||
|
m.enable(DLG_RECALC);
|
||||||
m.enable(DLG_XML_PREVIEW, prg_invio.full());
|
m.enable(DLG_XML_PREVIEW, prg_invio.full());
|
||||||
m.enable(DLG_PDF_PREVIEW, prg_invio.full());
|
m.enable(DLG_PDF_PREVIEW, prg_invio.full());
|
||||||
m.enable(DLG_CHECK_SDI, prg_invio.full() && esito == "X");
|
m.enable(DLG_CHECK_SDI, fp_has_check() && prg_invio.full() && (esito == "X" || esito == "I" || esito == "D" || esito == "E"));
|
||||||
m.enable(DLG_INVIO_SDI, prg_invio.full() && esito == "X");
|
m.enable(DLG_INVIO_SDI, prg_invio.full() && esito == "X");
|
||||||
m.enable(DLG_ESITO_SDI, prg_invio.full() && esito == "C" && esito == "E");
|
m.enable(DLG_ESITO_SDI, prg_invio.full() && esito == "C" && esito == "E");
|
||||||
}
|
}
|
||||||
@ -2845,6 +2848,8 @@ bool TPrimanota_application::link_anal(const TMask& msk, const char* action)
|
|||||||
if (!(has_module(CMAUT) || has_module(CAAUT) || has_module(CIAUT)))
|
if (!(has_module(CMAUT) || has_module(CAAUT) || has_module(CIAUT)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!(ca_config().get_int("Authorizations") & 0x5))
|
||||||
|
return false;
|
||||||
// Controlla flag sulla causale
|
// Controlla flag sulla causale
|
||||||
if (!(causale().link_analitica() || causale().link_industriale()))
|
if (!(causale().link_analitica() || causale().link_industriale()))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -1,817 +0,0 @@
|
|||||||
#include "cg2100.h"
|
|
||||||
#include "cg21sld.h"
|
|
||||||
|
|
||||||
TOOLBAR "topbar" 0 0 0 2
|
|
||||||
|
|
||||||
BUTTON DLG_LINK 2 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 3 1 "Fatture SDI"
|
|
||||||
PICTURE TOOL_ELABORA
|
|
||||||
MODULE FP
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON DLG_NULL 2 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 1 ""
|
|
||||||
END
|
|
||||||
|
|
||||||
#include <relapbar.h>
|
|
||||||
|
|
||||||
|
|
||||||
ENDPAGE
|
|
||||||
|
|
||||||
PAGE "Testata" -1 -1 77 20
|
|
||||||
|
|
||||||
BOOLEAN F_REGST
|
|
||||||
BEGIN
|
|
||||||
FIELD REGST
|
|
||||||
FLAGS "H"
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_STAMPATO
|
|
||||||
BEGIN
|
|
||||||
FIELD STAMPATO
|
|
||||||
FLAGS "H"
|
|
||||||
END
|
|
||||||
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 0 "@BMovimento IVA"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_NUMREG 7
|
|
||||||
BEGIN
|
|
||||||
PROMPT 56 1 "Operazione n. "
|
|
||||||
FIELD NUMREG
|
|
||||||
FLAGS "DGR"
|
|
||||||
KEY 1
|
|
||||||
MESSAGE COPY,H_NUMREG
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE F_DATAREG
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 1 "Data operazione "
|
|
||||||
FIELD DATAREG
|
|
||||||
MESSAGE COPY,H_DATAREG|COPY,F_ANNOIVA,7,10
|
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_ANNOIVA 4
|
|
||||||
BEGIN
|
|
||||||
PROMPT 31 1 "Anno IVA "
|
|
||||||
FIELD ANNOIVA
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE F_DATACOMP
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 2 "Data competenza "
|
|
||||||
FIELD DATACOMP
|
|
||||||
FLAGS "G"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_ANNOES 4
|
|
||||||
BEGIN
|
|
||||||
PROMPT 31 2 "Codice esercizio "
|
|
||||||
FIELD ANNOES
|
|
||||||
FLAGS "DGZ"
|
|
||||||
MESSAGE COPY,H_ANNOES
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_CODREG 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 56 2 "Registro IVA "
|
|
||||||
FLAGS "DUZ"
|
|
||||||
FIELD REG
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE F_DATACOMPCR
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 3 "Data comp.c/r "
|
|
||||||
FIELD DATACOMPCR
|
|
||||||
FLAGS "G"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_CODCAUS 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 4 "Causale "
|
|
||||||
FLAGS "UZ"
|
|
||||||
FIELD CODCAUS
|
|
||||||
USE LF_CAUSALI SELECT REG!=""
|
|
||||||
INPUT CODCAUS F_CODCAUS
|
|
||||||
DISPLAY "Codice" CODCAUS
|
|
||||||
DISPLAY "Descrizione@50" DESCR
|
|
||||||
DISPLAY "Tipo" TIPODOC
|
|
||||||
DISPLAY "Registro" REG
|
|
||||||
OUTPUT F_CODCAUS CODCAUS
|
|
||||||
OUTPUT F_DESCRCAUS DESCR
|
|
||||||
OUTPUT F_CODREG REG
|
|
||||||
OUTPUT F_TIPODOC TIPODOC
|
|
||||||
MESSAGE COPY,H_CODCAUS
|
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
ADD RUN cg0 -4
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_DESCRCAUS 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 4 ""
|
|
||||||
USE LF_CAUSALI KEY 2 SELECT REG!=""
|
|
||||||
INPUT DESCR F_DESCRCAUS
|
|
||||||
DISPLAY "Descrizione@50" DESCR
|
|
||||||
DISPLAY "Codice" CODCAUS
|
|
||||||
DISPLAY "Tipo" TIPODOC
|
|
||||||
DISPLAY "Registro" REG
|
|
||||||
COPY OUTPUT F_CODCAUS
|
|
||||||
MESSAGE COPY,H_DESCRCAUS
|
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
ADD RUN cg0 -4
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_NUMDOCEXT 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 5 "Numero documento esteso "
|
|
||||||
FIELD NUMDOCEXT
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_NUMDOC 7
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 6 "Documento n. "
|
|
||||||
FIELD NUMDOC
|
|
||||||
FLAGS "U"
|
|
||||||
WARNING "La causale o il saldaconto richiedono il numero documento"
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE F_DATADOC
|
|
||||||
BEGIN
|
|
||||||
PROMPT 27 6 "Data documento "
|
|
||||||
FIELD DATADOC
|
|
||||||
WARNING "Inserire una data documento non superiore alla data dell'operazione"
|
|
||||||
VALIDATE DATE_CMP_FUNC <= F_DATAREG
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_TIPODOC 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 56 6 "Tipo "
|
|
||||||
FIELD TIPODOC
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON F_LINKDOC 3 1
|
|
||||||
BEGIN
|
|
||||||
PROMPT 73 6 "Doc."
|
|
||||||
END
|
|
||||||
|
|
||||||
LIST F_SOLAIVA 1 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 7 "Movimento di sola IVA "
|
|
||||||
ITEM " |No"
|
|
||||||
ITEM "X|Si"
|
|
||||||
END
|
|
||||||
|
|
||||||
LIST F_PROVVISORIO 1 28
|
|
||||||
BEGIN
|
|
||||||
PROMPT 31 7 "Mov.provvisorio "
|
|
||||||
FIELD PROVVIS
|
|
||||||
ITEM " |No (movimento normale)"
|
|
||||||
ITEM "P|Si (cancellabile)"
|
|
||||||
ITEM "N|Si (Non cancellabile)"
|
|
||||||
ITEM "B|Si (Bilancio costi/ricavi)"
|
|
||||||
ITEM "C|Si (Cespiti)"
|
|
||||||
FLAGS "DG"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_DESCAGG 5 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 8 "Descrizione "
|
|
||||||
FLAGS "UZ"
|
|
||||||
USE %DPN
|
|
||||||
INPUT CODTAB F_DESCAGG
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
DISPLAY "Descrizione@50" S0
|
|
||||||
OUTPUT F_DESCAGG CODTAB
|
|
||||||
OUTPUT F_DESCR S0
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_DESCR 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 8 ""
|
|
||||||
FIELD DESCR
|
|
||||||
USE %DPN KEY 2
|
|
||||||
INPUT S0 F_DESCR
|
|
||||||
DISPLAY "Descrizione@60" S0
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
COPY OUTPUT F_DESCAGG
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_PROTIVA 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 9 "Protocollo IVA "
|
|
||||||
FIELD PROTIVA
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_RIEPILOGO 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 9 "Riepilogo al n."
|
|
||||||
FIELD UPROTIVA
|
|
||||||
NUM_EXPR {(#F_RIEPILOGO==0)||(#F_RIEPILOGO>=#F_PROTIVA)}
|
|
||||||
WARNING "Inserire un riepilogo non inferiore al protocollo IVA (Obbigatorio se il cliente/fornitore ha codice inserimento in allegati uguale a 3)"
|
|
||||||
END
|
|
||||||
|
|
||||||
LIST F_DIFFERITA 1 19
|
|
||||||
BEGIN
|
|
||||||
PROMPT 48 9 "Liquid. "
|
|
||||||
ITEM " |periodo in corso"
|
|
||||||
ITEM "X|periodo precedente"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_CODCLIFOR 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 10 "Cliente "
|
|
||||||
FIELD CODCF
|
|
||||||
GROUP 1
|
|
||||||
USE LF_CLIFO
|
|
||||||
INPUT TIPOCF F_CLIFO SELECT
|
|
||||||
INPUT CODCF F_CODCLIFOR
|
|
||||||
DISPLAY "Codice" CODCF
|
|
||||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
|
||||||
DISPLAY "Sospeso@C" SOSPESO
|
|
||||||
DISPLAY "Partita IVA@12" PAIV
|
|
||||||
DISPLAY "Codice Fiscale@16" COFI
|
|
||||||
OUTPUT F_CODCLIFOR CODCF
|
|
||||||
OUTPUT F_RAGSOCCF RAGSOC
|
|
||||||
OUTPUT F_STATOPAIV STATOPAIV
|
|
||||||
OUTPUT F_PIVA PAIV
|
|
||||||
OUTPUT F_COFI COFI
|
|
||||||
OUTPUT F_RICALT RICALT
|
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
WARNING "Cliente/Fornitore assente"
|
|
||||||
ADD RUN cg0 -1
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
STRING F_RAGSOCCF 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 10 ""
|
|
||||||
GROUP 2
|
|
||||||
USE LF_CLIFO KEY 2
|
|
||||||
INPUT TIPOCF F_CLIFO SELECT
|
|
||||||
INPUT RAGSOC F_RAGSOCCF
|
|
||||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
|
||||||
DISPLAY "Codice" CODCF
|
|
||||||
DISPLAY "Sospeso@C" SOSPESO
|
|
||||||
DISPLAY "Partita IVA@12" PAIV
|
|
||||||
DISPLAY "Codice Fiscale@16" COFI
|
|
||||||
COPY OUTPUT F_CODCLIFOR
|
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
ADD RUN cg0 -1
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
STRING F_COFI 16
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 11 "C.F. "
|
|
||||||
GROUP 1
|
|
||||||
USE LF_CLIFO KEY 4
|
|
||||||
INPUT TIPOCF F_CLIFO SELECT
|
|
||||||
INPUT COFI F_COFI
|
|
||||||
DISPLAY "Codice fiscale@16" COFI
|
|
||||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
|
||||||
DISPLAY "Codice" CODCF
|
|
||||||
DISPLAY "Sospeso@C" SOSPESO
|
|
||||||
DISPLAY "Partita IVA@12" PAIV
|
|
||||||
COPY OUTPUT F_CODCLIFOR
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
ADD RUN cg0 -1
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_PIVA 12
|
|
||||||
BEGIN
|
|
||||||
PROMPT 26 11 "P.I. "
|
|
||||||
GROUP 1
|
|
||||||
USE LF_CLIFO KEY 5
|
|
||||||
INPUT TIPOCF F_CLIFO SELECT
|
|
||||||
INPUT STATOPAIV F_STATOPAIV
|
|
||||||
INPUT PAIV F_PIVA
|
|
||||||
DISPLAY "Partita IVA@12" PAIV
|
|
||||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
|
||||||
DISPLAY "Codice" CODCF
|
|
||||||
DISPLAY "Sospeso@C" SOSPESO
|
|
||||||
DISPLAY "Codice Fiscale@16" COFI
|
|
||||||
COPY OUTPUT F_CODCLIFOR
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
ADD RUN cg0 -1
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_STATOPAIV 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 46 11 ""
|
|
||||||
FLAGS "U"
|
|
||||||
USE %SCE
|
|
||||||
INPUT CODTAB F_STATOPAIV
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
DISPLAY "Descrizione@50" S0
|
|
||||||
OUTPUT F_STATOPAIV CODTAB
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_RICALT 30 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 52 11 "Alt. "
|
|
||||||
USE LF_CLIFO KEY 6
|
|
||||||
INPUT TIPOCF F_CLIFO SELECT
|
|
||||||
INPUT RICALT F_RICALT
|
|
||||||
DISPLAY "Codice alternativo@30" RICALT
|
|
||||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
|
||||||
DISPLAY "Codice" CODCF
|
|
||||||
DISPLAY "Sospeso@C" SOSPESO
|
|
||||||
DISPLAY "Partita IVA@12" PAIV
|
|
||||||
DISPLAY "Codice Fiscale@16" COFI
|
|
||||||
COPY OUTPUT F_CODCLIFOR
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
ADD RUN cg0 -1
|
|
||||||
GROUP 1
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON F_OCCASEDIT 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 11 "Dati del cliente o fornitore occasionale"
|
|
||||||
FLAGS "H"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_CODPAG 4
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 12 "Codice Pagamento "
|
|
||||||
FIELD CODPAG
|
|
||||||
FLAGS "U#"
|
|
||||||
USE %CPG
|
|
||||||
INPUT CODTAB F_CODPAG
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
DISPLAY "Descrizione@50" S0
|
|
||||||
OUTPUT F_CODPAG CODTAB
|
|
||||||
OUTPUT F_DESPAG S0
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
ADD RUN ba3 -6
|
|
||||||
WARNING "Codice pagamento assente"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_DESPAG 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 12 ""
|
|
||||||
USE %CPG KEY 2
|
|
||||||
INPUT S0 F_DESPAG
|
|
||||||
DISPLAY "Descrizione@60" S0
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
COPY OUTPUT F_CODPAG
|
|
||||||
ADD RUN ba3 -6
|
|
||||||
END
|
|
||||||
|
|
||||||
// Campi per Invio dati rilevanti (FE)
|
|
||||||
|
|
||||||
LIST F_CLIFO 1 10
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 13 "Tipo "
|
|
||||||
ITEM "|Conto"
|
|
||||||
ITEM "C|Cliente"
|
|
||||||
ITEM "F|Fornitore"
|
|
||||||
FIELD TIPO
|
|
||||||
FLAGS "H"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_BOLLACODCLI 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 13 "Forn. collegato "
|
|
||||||
FIELD CFBOLLADOG
|
|
||||||
USE LF_CLIFO
|
|
||||||
INPUT TIPOCF "F"
|
|
||||||
INPUT CODCF F_BOLLACODCLI
|
|
||||||
DISPLAY "Codice" CODCF
|
|
||||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
|
||||||
DISPLAY "Sospeso@C" SOSPESO
|
|
||||||
DISPLAY "Partita IVA@12" PAIV
|
|
||||||
DISPLAY "Codice Fiscale@16" COFI
|
|
||||||
OUTPUT F_BOLLACODCLI CODCF
|
|
||||||
OUTPUT F_BOLLARAGCLI RAGSOC
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
WARNING "Fornitore associato a bolla doganale assente"
|
|
||||||
ADD RUN cg0 -1
|
|
||||||
FLAGS ""
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_BOLLARAGCLI 50 47
|
|
||||||
BEGIN
|
|
||||||
PROMPT 28 13 ""
|
|
||||||
USE LF_CLIFO KEY 2
|
|
||||||
INPUT TIPOCF "F"
|
|
||||||
INPUT RAGSOC F_BOLLARAGCLI
|
|
||||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
|
||||||
DISPLAY "Codice" CODCF
|
|
||||||
DISPLAY "Sospeso@C" SOSPESO
|
|
||||||
DISPLAY "Partita IVA@12" PAIV
|
|
||||||
DISPLAY "Codice Fiscale@16" COFI
|
|
||||||
OUTPUT F_BOLLACODCLI CODCF
|
|
||||||
OUTPUT F_BOLLARAGCLI RAGSOC
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
ADD RUN cg0 -1
|
|
||||||
FLAGS ""
|
|
||||||
END
|
|
||||||
|
|
||||||
// Campi per saldaconto in valuta
|
|
||||||
|
|
||||||
STRING SK_VALUTA 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 14 "Valuta "
|
|
||||||
FIELD CODVAL
|
|
||||||
FLAGS "UZ"
|
|
||||||
GROUP 3
|
|
||||||
USE %VAL
|
|
||||||
INPUT CODTAB SK_VALUTA
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
DISPLAY "Nome@50" S0
|
|
||||||
OUTPUT SK_VALUTA CODTAB
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
WARNING "Codice valuta assente"
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE SK_DATACAMBIO
|
|
||||||
BEGIN
|
|
||||||
PROMPT 18 14 "Data cambio "
|
|
||||||
FIELD DATACAM
|
|
||||||
FLAGS "R"
|
|
||||||
USE CAM
|
|
||||||
JOIN %VAL ALIAS 104 INTO CODTAB[1,3]==CODTAB[1,3]
|
|
||||||
INPUT CODTAB[1,3] SK_VALUTA SELECT
|
|
||||||
INPUT CODTAB[4,11] SK_DATACAMBIO
|
|
||||||
DISPLAY "Cod" CODTAB[1,3]
|
|
||||||
DISPLAY "Data@10" D0
|
|
||||||
DISPLAY "Cambio@18R" S4
|
|
||||||
DISPLAY "Valuta@50" 104@->S0
|
|
||||||
OUTPUT SK_DATACAMBIO D0
|
|
||||||
OUTPUT SK_CAMBIO S4
|
|
||||||
GROUP 3
|
|
||||||
CHECKTYPE SEARCH
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER SK_CAMBIO 15 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 44 14 "Cambio "
|
|
||||||
FIELD CAMBIO
|
|
||||||
FLAGS "RU"
|
|
||||||
GROUP 3
|
|
||||||
PICTURE ".6"
|
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
WARNING "Inserire il cambio o eliminare il codice valuta"
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_TOTALE 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 15 "Totale documento "
|
|
||||||
FIELD TOTDOC
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY SK_TOTDOCVAL 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 38 15 "in valuta "
|
|
||||||
FIELD TOTDOCVAL
|
|
||||||
GROUP 3
|
|
||||||
VALIDATE REQIF_FUNC 1 F_TOTALE
|
|
||||||
DRIVENBY SK_VALUTA
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_CODIVA 4
|
|
||||||
BEGIN
|
|
||||||
PROMPT 67 15 "IVA "
|
|
||||||
FLAGS "U"
|
|
||||||
USE %IVA
|
|
||||||
INPUT CODTAB F_CODIVA
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
DISPLAY "Descrizione@50" S0
|
|
||||||
DISPLAY "%@6" R0
|
|
||||||
DISPLAY "Tipo" S1
|
|
||||||
OUTPUT F_CODIVA CODTAB
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
VALIDATE ZEROFILL_FUNC 2
|
|
||||||
WARNING "Codice IVA assente"
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_RITFIS 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 16 "Ritenute fiscali "
|
|
||||||
FIELD RITFIS
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_RITSOC 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 17 "Ritenute sociali "
|
|
||||||
FIELD RITSOC
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_REVCHARGE 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 18 "Reverse charge "
|
|
||||||
FIELD REVCHARGE
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE F_DATA74TER
|
|
||||||
BEGIN
|
|
||||||
PROMPT 52 16 "Data 74/ter "
|
|
||||||
WARNING "E' richiesta la data del 74/ter"
|
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
FIELD DATA74TER
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_IVAXCASSA
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 19 "IVA per cassa"
|
|
||||||
FIELD IVAXCASSA
|
|
||||||
MODULE IC
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_LIQDIFF
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 19 "Liquidazione differita"
|
|
||||||
WARNING "Data di incasso per liquidazione differita"
|
|
||||||
FIELD LIQDIFF
|
|
||||||
MESSAGE FALSE CLEAR,F_DATAINC
|
|
||||||
MESSAGE TRUE ENABLE,F_DATAINC
|
|
||||||
FLAGS "HG"
|
|
||||||
END
|
|
||||||
|
|
||||||
LIST F_SPLITPAY 1 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 51 19 "Scissione pagamenti "
|
|
||||||
FIELD SPLITPAY
|
|
||||||
ITEM "| "
|
|
||||||
ITEM "S|Si"
|
|
||||||
ITEM "N|No"
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
DATE F_DATAINC
|
|
||||||
BEGIN
|
|
||||||
PROMPT 52 18 "Data incasso "
|
|
||||||
WARNING "Data di incasso per liquidazione differita"
|
|
||||||
FIELD DATAINC
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_ANNORIF 4
|
|
||||||
BEGIN
|
|
||||||
PROMPT 48 17 "Rif.partita "
|
|
||||||
FIELD LF_PARTITE->ANNO
|
|
||||||
FLAGS "U"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_NUMRIF 7
|
|
||||||
BEGIN
|
|
||||||
PROMPT 66 17 "/ "
|
|
||||||
FIELD LF_PARTITE->NUMPART
|
|
||||||
FLAGS "U#"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_VALUTAINTRA 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 20 "Cambio intracom. "
|
|
||||||
FIELD CODVALI
|
|
||||||
FLAGS "UZ"
|
|
||||||
GROUP 4
|
|
||||||
USE %VAL
|
|
||||||
INPUT CODTAB F_VALUTAINTRA
|
|
||||||
DISPLAY "Codice" CODTAB
|
|
||||||
DISPLAY "Nome@50" S0
|
|
||||||
DISPLAY "Cambio@15" S4
|
|
||||||
DISPLAY "Ultimo aggiornamento" D0
|
|
||||||
OUTPUT F_VALUTAINTRA CODTAB
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
WARNING "Codice valuta assente"
|
|
||||||
VALIDATE REQIF_FUNC 1 F_CORRVALUTA
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_CAMBIOINTRA 15 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 20 ""
|
|
||||||
FIELD CAMBIOI
|
|
||||||
FLAGS "U"
|
|
||||||
GROUP 4
|
|
||||||
PICTURE ".6"
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE F_DATAINTRA
|
|
||||||
BEGIN
|
|
||||||
PROMPT 43 20 "Data competenza intra "
|
|
||||||
FIELD DATACOMPI
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_CORRISPETTIVO 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 21 "Corrispettivo "
|
|
||||||
FIELD CORRLIRE
|
|
||||||
GROUP 4
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_CORRVALUTA 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 39 21 "Corrispet. valuta "
|
|
||||||
FIELD CORRVALUTA
|
|
||||||
GROUP 4
|
|
||||||
VALIDATE REQIF_FUNC 1 F_VALUTAINTRA
|
|
||||||
DRIVENBY F_VALUTAINTRA
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_COLFPPRO
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 19 "Registrazione collegata a FPPRO"
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_PROKEY 80
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 19 "db key"
|
|
||||||
HELP "Chiave database"
|
|
||||||
FIELD KEYFPPRO
|
|
||||||
FLAGS "H"
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_RITFATT
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 22 "Fattura in ritardo "
|
|
||||||
FIELD RITFATT
|
|
||||||
END
|
|
||||||
|
|
||||||
#ifdef PRORATA100
|
|
||||||
BUTTON F_ADJUST_PRORATA 40
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 -1 "Corre~zione automatica righe contabili"
|
|
||||||
FLAGS "H"
|
|
||||||
END
|
|
||||||
#endif
|
|
||||||
STRING NP_CONTSEP 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 23 "Cont. separata "
|
|
||||||
USE &NPENT
|
|
||||||
INPUT CODTAB NP_CONTSEP
|
|
||||||
DISPLAY "Codice@6" CODTAB
|
|
||||||
DISPLAY "Descrizione@50" S0
|
|
||||||
OUTPUT NP_CONTSEP CODTAB
|
|
||||||
OUTPUT NP_DESCONTSEP S0
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
FIELD CONTSEP
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING NP_DESCONTSEP 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 23 ""
|
|
||||||
USE &NPENT KEY 2
|
|
||||||
INPUT S0 NP_DESCONTSEP
|
|
||||||
DISPLAY "Descrizione@50" S0
|
|
||||||
DISPLAY "Codice@6" CODTAB
|
|
||||||
COPY OUTPUT NP_CONTSEP
|
|
||||||
CHECKTYPE NORMAL
|
|
||||||
END
|
|
||||||
|
|
||||||
ENDPAGE
|
|
||||||
|
|
||||||
PAGE "IVA" -1 -1 77 20
|
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 4
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 0 "@BRighe movimento IVA"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER H_NUMREG 7
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 1 "Operazione n. "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
DATE H_DATAREG
|
|
||||||
BEGIN
|
|
||||||
PROMPT 32 1 "Data "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER H_ANNOES 4
|
|
||||||
BEGIN
|
|
||||||
PROMPT 54 1 "Codice esercizio "
|
|
||||||
FLAGS "DZ"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING H_CODCAUS 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 2 "Causale "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING H_DESCRCAUS 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 25 2 ""
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON F_ADJUST_IVA 10 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT -1 1 "Quadratura"
|
|
||||||
END
|
|
||||||
|
|
||||||
SPREADSHEET F_SHEETIVA 0 5
|
|
||||||
BEGIN
|
|
||||||
PROMPT 0 4 ""
|
|
||||||
ITEM "Imponibile@15"
|
|
||||||
ITEM "Iva@5"
|
|
||||||
ITEM "Det@2"
|
|
||||||
ITEM "Imposta@15"
|
|
||||||
ITEM "CR@1"
|
|
||||||
ITEM "CF@1"
|
|
||||||
ITEM "Gr."
|
|
||||||
ITEM "Co."
|
|
||||||
ITEM "Sottoc.@6"
|
|
||||||
ITEM "Descrizione Conto@50"
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_IMPONIBILI 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 10 "Totale imponibili "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_IMPOSTE 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 41 10 "Totale imposte "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
SPREADSHEET F_SHEETCG 0 -3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 0 11 ""
|
|
||||||
ITEM "Dare@15F"
|
|
||||||
ITEM "Avere@15F"
|
|
||||||
ITEM "C/F@1"
|
|
||||||
ITEM "Gr."
|
|
||||||
ITEM "Co."
|
|
||||||
ITEM "Sott.@6"
|
|
||||||
ITEM "Descrizione conto@30"
|
|
||||||
ITEM "Codice"
|
|
||||||
ITEM "Descrizione riga@30"
|
|
||||||
ITEM "C/F@1"
|
|
||||||
ITEM "Gr./c@3"
|
|
||||||
ITEM "Co./c@3"
|
|
||||||
ITEM "Sott./c@6"
|
|
||||||
ITEM "Descrizione contropartita@30"
|
|
||||||
ITEM "CUP@15"
|
|
||||||
ITEM "Descrizione CUP@50"
|
|
||||||
ITEM "CIG@10"
|
|
||||||
ITEM "Descrizione CIG@50"
|
|
||||||
ITEM "Tipo@4"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_GRUPPO 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 -2 "Conto riga corrente "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_CONTO 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 26 -2 ""
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_SOTTOCONTO 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 31 -2 ""
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON F_MASTRINO 8
|
|
||||||
BEGIN
|
|
||||||
PROMPT 39 -2 "Mastrino"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_SALDOCONTO 20
|
|
||||||
BEGIN
|
|
||||||
PROMPT 51 -2 "Saldo "
|
|
||||||
FLAGS "DR"
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_DARE 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 -1 "Sbilancio Dare "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
CURRENCY F_AVERE 18
|
|
||||||
BEGIN
|
|
||||||
PROMPT 41 -1 "Sbilancio Avere "
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
ENDPAGE
|
|
||||||
|
|
||||||
#include "cg21sld.uml"
|
|
||||||
|
|
||||||
ENDMASK
|
|
||||||
|
|
||||||
#include "cg21iva.uml"
|
|
||||||
#include "cg21cg.uml"
|
|
||||||
#include "cg21rata.uml"
|
|
||||||
|
|
||||||
ENDMASK
|
|
||||||
@ -1,485 +0,0 @@
|
|||||||
#ifndef __CG2102_H
|
|
||||||
#define __CG2102_H
|
|
||||||
|
|
||||||
#ifndef __RELAPP_H
|
|
||||||
#include <relapp.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CGPAGAME_H
|
|
||||||
#include "cgpagame.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __MOV_H
|
|
||||||
#include "mov.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CGSALDAC_H
|
|
||||||
#include "cgsaldac.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CGLIB_H
|
|
||||||
#include "cglib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CG2100_H
|
|
||||||
#include "cg2100.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <automask.h>
|
|
||||||
#include "../f1/f1lib.h"
|
|
||||||
|
|
||||||
#define K_ELIMMAS 0 // Key per eliminazione massima
|
|
||||||
|
|
||||||
#define FPRI_IMPONIBILE 0
|
|
||||||
#define FPRI_IMPOSTA 1
|
|
||||||
#define FPRI_ALIQUOTA 2
|
|
||||||
#define FPRI_NATURA 3
|
|
||||||
#define FPRI_ESIGIBILITA 4
|
|
||||||
|
|
||||||
#define FPSC_DATA 0
|
|
||||||
#define FPSC_IMPORTO 1
|
|
||||||
|
|
||||||
class TDati_mov_auto;
|
|
||||||
|
|
||||||
enum CGMaskType { _query = 0, _no_iva = 1, _iva = 2, _occas = 3};
|
|
||||||
|
|
||||||
class TPro_msk : public TAutomask
|
|
||||||
{
|
|
||||||
long _numero;
|
|
||||||
TDate _datadoc;
|
|
||||||
real _totdoc;
|
|
||||||
real _ritenute;
|
|
||||||
TProtocollo _protfppro;
|
|
||||||
TString _fpprokeys;
|
|
||||||
TString _piva;
|
|
||||||
long _codforn;
|
|
||||||
TString_array _righe_iva;
|
|
||||||
TString_array _scadenze;
|
|
||||||
bool _riporta;
|
|
||||||
TString _str_numero;
|
|
||||||
|
|
||||||
// Non permette la selezione multipla
|
|
||||||
void fppro_selfatt() const;
|
|
||||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
|
||||||
public:
|
|
||||||
bool da_riportare() const { return _riporta; }
|
|
||||||
bool is_doc_split() ;
|
|
||||||
|
|
||||||
void set_righeiva(const char* fpprokeys);
|
|
||||||
void set_scadenze(const char* fpprokeys);
|
|
||||||
void set_doc(TSheet_field & s, int nrow);
|
|
||||||
|
|
||||||
const long get_numdoc() const { return _numero; }
|
|
||||||
const TString & get_str_numdoc() const { return _str_numero; }
|
|
||||||
const TDate & get_datadoc() const { return _datadoc; }
|
|
||||||
const real & get_totdoc() const { return _totdoc; }
|
|
||||||
const real & get_ritenute() const { return _ritenute; }
|
|
||||||
const TString & get_fpprokeys() const { return _fpprokeys; }
|
|
||||||
const long get_codforn() const { return _codforn; }
|
|
||||||
const TString & get_piva() const { return _piva; }
|
|
||||||
const TString_array& get_righeiva() const { return _righe_iva; }
|
|
||||||
const TProtocollo& get_protocollo() const { return _protfppro; }
|
|
||||||
const TString_array& get_scadenze() const { return _scadenze; }
|
|
||||||
|
|
||||||
real get_tot_imp_riva() ;
|
|
||||||
|
|
||||||
void add_rigaiva(const real& imponibile, const real& imposta, const real& aliquota, const TString4& natura, char esigib);
|
|
||||||
void add_scad(const TDate& date, const real& importo);
|
|
||||||
|
|
||||||
static TString& query_fppro(const TString& codforn, const TDate& date);
|
|
||||||
static TString& query_fppro(const TString& stato_piva, const TString& piva, const TDate& date);
|
|
||||||
static TString& query_fppro(const TString& codforn, const TString& stato_piva, const TString& piva, const TString& where_str, const TDate& date, const TString& keyprginvio, const TString& keyheaderfatt, const TString& keybodyfatt, bool order = true, bool piva_research = false);
|
|
||||||
static TString& query_string();
|
|
||||||
|
|
||||||
void abilita_piva();
|
|
||||||
|
|
||||||
// Carica documenti FPPRO sulla maschera
|
|
||||||
bool riporta(TMask_field& f);
|
|
||||||
bool load_fppro_mask(TMask & msk);
|
|
||||||
|
|
||||||
TPro_msk(TMask& cg_msk);
|
|
||||||
};
|
|
||||||
|
|
||||||
class TPrimanota_application : public TRelation_application
|
|
||||||
{
|
|
||||||
TMovimentoPN* _rel; // Relazione principale
|
|
||||||
|
|
||||||
TPagamento* _pag;
|
|
||||||
|
|
||||||
bool _ges_val, _ges_sal; // Gestione valuta e saldaconto
|
|
||||||
bool _num_cli, _num_for; // Riferimento partita allineato a destra
|
|
||||||
bool _liqdiff; // Liquidazione differita
|
|
||||||
bool _npart_is_prot; // Riferimento partita = n. prot. IVA anziche' doc
|
|
||||||
bool _npart_is_month; // Riferimento partita = mese
|
|
||||||
bool _skip_giornale_check; // Ignora controllo data stampa libro giornale
|
|
||||||
bool _skip_bollato_check; // Ignora controllo data stampa bollato
|
|
||||||
|
|
||||||
bool _savenew; // Registra e nuovo
|
|
||||||
short _firstfocus; // Primo campo della maschera a prendere il focus
|
|
||||||
|
|
||||||
bool _sheet_shown; // Lo sheet e' gia' stato visualizzato una volta?
|
|
||||||
bool _swap_mask;
|
|
||||||
|
|
||||||
bool _is_saldaconto; // saldaconto si/no (vede parametri e causale)
|
|
||||||
bool _scad_free; // posso variare liberamente le rate della fattura
|
|
||||||
bool _easy_sal; // Nuovo saldaconto semplificato
|
|
||||||
bool _quadratura; // Bottone quadratura automatica per ATS
|
|
||||||
|
|
||||||
TString _perc_attesa_fld; // Percentuale del fornitore/cliente
|
|
||||||
|
|
||||||
TSaldo_agg _saldi; // Saldi da aggiornare
|
|
||||||
TPartite_array _partite; // Partite coinvolte
|
|
||||||
|
|
||||||
TMask* _msk[4]; // Maschere di query, cg, iva, occasionali
|
|
||||||
int _mode; // Modo maschera corrente
|
|
||||||
bool _as400; // Movimento trasferito da as400?
|
|
||||||
bool _sal_dirty; // Il saldaconto e' stato "toccato"?
|
|
||||||
|
|
||||||
TipoIVA _iva; // Tipo di IVA corrente
|
|
||||||
TCausale * _causale; // Causale corrente
|
|
||||||
TLibro_giornale* _giornale; // Libro giornale corrente
|
|
||||||
long _lastreg; // Numero ultima registrazione
|
|
||||||
|
|
||||||
TDate _last_dreg; // Ultima data registrazione inserita
|
|
||||||
TDate _last_dcom; // Ultima data competenza inserita
|
|
||||||
|
|
||||||
TDati_mov_auto* _automatico;// Dati per gestire incasso immediato
|
|
||||||
|
|
||||||
TBill _conto_ricavo; // Conto di ricavo del clifo
|
|
||||||
|
|
||||||
TToken_string _tmp; // Stringa temporanea da ritornare
|
|
||||||
TString_array _pag_rows; // Copia dello sheet delle rate
|
|
||||||
|
|
||||||
TEsercizi_contabili _esercizi; // Tabella degli esercizi contabili
|
|
||||||
|
|
||||||
TAssoc_array _colori; // Colori delle righe
|
|
||||||
bool _isf1;
|
|
||||||
TPro_msk * _pro_mask;
|
|
||||||
bool _is_set_fpcheck;
|
|
||||||
int _last_date;
|
|
||||||
// bool _f1_ini;
|
|
||||||
// bool _f1_liq;
|
|
||||||
TString _num_doc_rif_partite;
|
|
||||||
friend class TPro_msk;
|
|
||||||
|
|
||||||
static bool showpartite_handler(TMask_field& f, KEY k);
|
|
||||||
static bool speserimb_handler(TMask_field& f, KEY k);
|
|
||||||
static bool altrespese_handler(TMask_field& f, KEY k);
|
|
||||||
static bool abbatt_handler(TMask_field& f, KEY k);
|
|
||||||
static bool abbpass_handler(TMask_field& f, KEY k);
|
|
||||||
static bool ritprof_handler(TMask_field& f, KEY k);
|
|
||||||
static bool diffcamb_handler(TMask_field& f, KEY k);
|
|
||||||
static bool suspended_handler(TMask_field& f, KEY k);
|
|
||||||
static bool num_handler(TMask_field& f, KEY key);
|
|
||||||
static bool caus_query_handler(TMask_field& f, KEY key);
|
|
||||||
static void check_fppro_fields(TMask& m);
|
|
||||||
static bool caus_modify_handler(TMask_field& f, KEY key);
|
|
||||||
static bool datareg_handler(TMask_field& f, KEY key);
|
|
||||||
static bool datacomp_handler(TMask_field& f, KEY key);
|
|
||||||
static bool datacompcr_handler(TMask_field& f, KEY key);
|
|
||||||
static bool data74ter_handler(TMask_field& f, KEY key);
|
|
||||||
static bool datadoc_handler(TMask_field& f, KEY key);
|
|
||||||
static bool numdoc_handler(TMask_field& f, KEY key);
|
|
||||||
static bool ndocext_handler(TMask_field& f, KEY key);
|
|
||||||
static bool annorif_handler(TMask_field& f, KEY key);
|
|
||||||
static bool numrif_handler(TMask_field& f, KEY key);
|
|
||||||
static bool protiva_handler(TMask_field& f, KEY key);
|
|
||||||
|
|
||||||
static bool clifo_handler(TMask_field& f, KEY key);
|
|
||||||
static bool totdoc_handler(TMask_field& f, KEY key);
|
|
||||||
static bool totdocval_handler(TMask_field& f, KEY key);
|
|
||||||
static bool ritfis_handler(TMask_field& f, KEY key);
|
|
||||||
static bool ritsoc_handler(TMask_field& f, KEY key);
|
|
||||||
static bool revcharge_handler(TMask_field& f, KEY key);
|
|
||||||
static bool main_codiva_handler(TMask_field& f, KEY key);
|
|
||||||
static bool liqdiff_handler(TMask_field& f, KEY key);
|
|
||||||
static bool ivaxcassa_handler(TMask_field& f, KEY key);
|
|
||||||
static bool dataintra_handler(TMask_field& f, KEY key);
|
|
||||||
static bool corrlire_handler(TMask_field& f, KEY key);
|
|
||||||
static bool corrvaluta_handler(TMask_field& f, KEY key);
|
|
||||||
static bool occas_code_handler(TMask_field& f, KEY key);
|
|
||||||
static bool occas_cfpi_handler(TMask_field& f, KEY key);
|
|
||||||
static bool occas_handler(TMask_field& f, KEY key);
|
|
||||||
static bool solaiva_handler(TMask_field& f, KEY key);
|
|
||||||
static bool descr_handler(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
static bool sheet_clifo_handler(TMask_field& f, KEY k);
|
|
||||||
static bool sheet_mastrino_handler(TMask_field& f, KEY k);
|
|
||||||
static bool sheet_rateo_handler(TMask_field& f, KEY k);
|
|
||||||
static bool sheet_risconto_handler(TMask_field& f, KEY k);
|
|
||||||
static bool iva_sottoconto_handler(TMask_field& f, KEY k);
|
|
||||||
static bool imponibile_handler(TMask_field& f, KEY key);
|
|
||||||
static bool detrazione_handler(TMask_field& f, KEY key);
|
|
||||||
static bool codiva_handler(TMask_field& f, KEY key);
|
|
||||||
static bool imposta_handler(TMask_field& f, KEY key);
|
|
||||||
static bool dareavere_handler(TMask_field& f, KEY k);
|
|
||||||
static bool fase_handler(TMask_field& f, KEY key);
|
|
||||||
static bool cg_tipo_handler(TMask_field& f, KEY key);
|
|
||||||
static bool cg_gruppo_handler(TMask_field& f, KEY key);
|
|
||||||
static bool cg_conto_handler(TMask_field& f, KEY key);
|
|
||||||
static bool cg_sottoconto_handler(TMask_field& f, KEY key);
|
|
||||||
|
|
||||||
static bool codpag_handler(TMask_field& f, KEY key);
|
|
||||||
static bool valuta_handler(TMask_field& f, KEY key);
|
|
||||||
static bool datacambio_handler(TMask_field& f, KEY key);
|
|
||||||
static bool cambio_handler(TMask_field& f, KEY key);
|
|
||||||
static bool reset_handler(TMask_field& f, KEY key);
|
|
||||||
static bool nrate_handler(TMask_field& f, KEY key);
|
|
||||||
static bool recalc_handler(TMask_field& f, KEY key);
|
|
||||||
static bool codcab_handler(TMask_field& f, KEY key);
|
|
||||||
static bool tipopag_handler(TMask_field& f, KEY key);
|
|
||||||
static bool linkdoc_handler(TMask_field& f, KEY k);
|
|
||||||
static bool mastrino_handler(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
static bool rataeur_handler(TMask_field& f, KEY key);
|
|
||||||
static bool rataval_handler(TMask_field& f, KEY key);
|
|
||||||
|
|
||||||
static bool iva_handler(TMask_field& f, KEY key);
|
|
||||||
static bool cg_handler(TMask_field& f, KEY key);
|
|
||||||
|
|
||||||
static bool pag_notify(TSheet_field& s, int r, KEY key);
|
|
||||||
static bool pag_sheet_handler(TMask_field& f, KEY key);
|
|
||||||
static bool colors_handler(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
static bool quadratura_handler(TMask_field& f, KEY k); // Bottone quadratura per ATS
|
|
||||||
|
|
||||||
// Gestione F1
|
|
||||||
|
|
||||||
void write_righe_iva_f1(TMask& cg_msk, const TPro_msk & msk);
|
|
||||||
bool write_scad_f1(const TMask& cg_msk, const TPro_msk & msk);
|
|
||||||
void write_clifo(TMask& cg_msk, const TPro_msk & msk);
|
|
||||||
void set_totale(TMask& cg_msk, TPro_msk & msk);
|
|
||||||
static void riporta_dati_f1(TMask& cg_msk, TPro_msk & msk);
|
|
||||||
void insert_part_scad(TConfig& ini);
|
|
||||||
// Handlers per aggancio FPPRO
|
|
||||||
// Bottone per maschera FPPRO
|
|
||||||
static bool fppro_mask(TMask_field& f, KEY key);
|
|
||||||
static bool scollega_handler(TMask_field& f, KEY key);
|
|
||||||
static void fppromask_set_handl(TMask* msk);
|
|
||||||
void load_list(TMask* msk, KEY k);
|
|
||||||
void f1_init(TMask& m, const bool fe_enabled, const bool f1_linked = false);
|
|
||||||
|
|
||||||
void reset_sheet_row(TSheet_field& s, int n);
|
|
||||||
int crea_somma_spese(TImporto& imp);
|
|
||||||
void update_saldo_riga(int r);
|
|
||||||
void link_mastrino(const TBill& bill) const;
|
|
||||||
|
|
||||||
protected: // TApplication
|
|
||||||
virtual void on_firm_change();
|
|
||||||
virtual void on_config_change();
|
|
||||||
virtual void print();
|
|
||||||
void dump_rec(TConfig & ini, const TRectype & rec, int row = 0, int pref = 0);
|
|
||||||
void dump_fatt(TConfig& ini, TPartita & game, int rigafatt, int pref = 0);
|
|
||||||
void set_scad_f1(TMask& m);
|
|
||||||
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
|
|
||||||
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
|
||||||
|
|
||||||
// Metodi per aggancio FPPRO (solo su operazioni di Fattura di Acquisto)
|
|
||||||
|
|
||||||
// Metodo chiamato dalla write e rewrite per salvare su db fatt.
|
|
||||||
void write_fppro();
|
|
||||||
static bool has_tot_doc(TToken_string& fppro_keys);
|
|
||||||
// Salvo dati fornitore e registrazione contabile sul db FPPRO
|
|
||||||
int save_fppro();
|
|
||||||
// Salva sul movimento il riferimento al documento in FPPRO (keys)
|
|
||||||
bool save_dbmov(bool clean = false) const;
|
|
||||||
static bool scollega(bool set = false);
|
|
||||||
// Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete)
|
|
||||||
void clean_fppro();
|
|
||||||
// Ha f1 ?
|
|
||||||
bool has_f1() const;
|
|
||||||
// controlla il db
|
|
||||||
bool has_f1_db(const TMask & m);
|
|
||||||
// Controlli prima di write e rewrite
|
|
||||||
int controlli_f1(const TMask& m);
|
|
||||||
|
|
||||||
virtual bool save(bool check_dirty);
|
|
||||||
|
|
||||||
bool get_mask_swap_file(TFilename& name) const;
|
|
||||||
bool force_mask_swap(const TCausale& old_caus, const TCausale& new_caus);
|
|
||||||
|
|
||||||
protected: // TRelation_application
|
|
||||||
// void check_f1_ini(); // setto variabili se ho f1 o liq nei parametri (ini da fp)
|
|
||||||
virtual bool user_create();
|
|
||||||
virtual bool user_destroy();
|
|
||||||
bool iva_mask(const TMask & m) const { return m.source_file() == "cg2100c.msk"; }
|
|
||||||
virtual bool changing_mask(int mode);
|
|
||||||
virtual TMask* _get_mask(int mode);
|
|
||||||
virtual TRelation* get_relation() const { return _rel; }
|
|
||||||
virtual void init_query_mode(TMask& m);
|
|
||||||
virtual void init_insert_mode(TMask& m);
|
|
||||||
virtual void init_modify_mode(TMask& m);
|
|
||||||
virtual bool save_and_new() const;
|
|
||||||
virtual bool save_and_quit() const;
|
|
||||||
virtual bool is_transaction() const;
|
|
||||||
virtual bool get_next_key(TToken_string& key);
|
|
||||||
virtual int read(TMask& m);
|
|
||||||
void find_movcoll(const long numreg);
|
|
||||||
void set_movcoll(const long movcoll, const long numreg);
|
|
||||||
virtual int write(const TMask& m);
|
|
||||||
virtual int rewrite(const TMask& m);
|
|
||||||
virtual bool remove();
|
|
||||||
virtual void write_enable(bool) {}
|
|
||||||
virtual bool protected_record(TRectype& rec);
|
|
||||||
virtual bool can_I_write(const TRelation* rel) const;
|
|
||||||
virtual const char* record_description(const TRelation& rel) const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void check_saldi();
|
|
||||||
void genera_automatico(int tipo, const char* causimm); // 0=nessuno, 1=incasso, 2=regolarizzazione 3= ?? 4 = rilevazione fatture da emettere/ricevere
|
|
||||||
void gioca_cambi(int force = 0x00);
|
|
||||||
|
|
||||||
TMask* load_mask(int n);
|
|
||||||
TMask& occas_mask() { return *load_mask(3); }
|
|
||||||
|
|
||||||
void mask2rel(const TMask& m);
|
|
||||||
|
|
||||||
TipoIVA iva() const { return _iva; }
|
|
||||||
const TString & clifo() const;
|
|
||||||
bool gestione_valuta() const { return _ges_val; }
|
|
||||||
bool gestione_saldaconto() const { return _ges_sal; }
|
|
||||||
bool npart_is_month() const { return _npart_is_month; }
|
|
||||||
bool npart_is_prot() const { return _npart_is_prot; }
|
|
||||||
|
|
||||||
bool is_saldaconto() const { return _is_saldaconto; }
|
|
||||||
bool is_fattura() const { return is_saldaconto() && causale().tipomov() == tm_fattura; }
|
|
||||||
bool is_nota_credito() const { return is_saldaconto() && causale().tipomov() == tm_nota_credito; }
|
|
||||||
bool is_pagamento() const { return is_saldaconto() && causale().tipomov() >= tm_pagamento; }
|
|
||||||
bool activate_split_payment(TMask& m);
|
|
||||||
bool is_split_payment() const;
|
|
||||||
bool is_fattura_split() const;
|
|
||||||
|
|
||||||
bool activate_numrif(TMask& m, bool set_pag);
|
|
||||||
|
|
||||||
void fill_sheet(TMask& m) const;
|
|
||||||
void init_mask(TMask& m);
|
|
||||||
|
|
||||||
static TipoIVA reg2IVA(const char* registro, int anno);
|
|
||||||
static const real& cod2IVA(const TMask& m);
|
|
||||||
static real scorpora(real& imponibile, const real& percentuale);
|
|
||||||
static int get_importi_iva(TToken_string & row, real& imp_det, real& iva_det, real& imp_ind, real& iva_ind);
|
|
||||||
static int bill2pos(const TBill& conto, char tipo);
|
|
||||||
|
|
||||||
TipoIVA cau2IVA(const char* causale, int anno);
|
|
||||||
bool IVA2bill(const TCodiceIVA& iva, TBill& bill);
|
|
||||||
int bill2contr(const TBill& c, char sezione) const;
|
|
||||||
int bill_used(const TBill& conto) const;
|
|
||||||
TBill& ivas_bill(TBill& tc);
|
|
||||||
|
|
||||||
void load_colors();
|
|
||||||
void save_colors();
|
|
||||||
COLOR type2color(char tipor, char tipoc);
|
|
||||||
void set_type_color(char tipor, char tipoc, COLOR col);
|
|
||||||
void set_colors();
|
|
||||||
|
|
||||||
bool read_caus(const char* cod = nullptr, int year = 0);
|
|
||||||
TLibro_giornale& giornale() { return *_giornale; }
|
|
||||||
|
|
||||||
bool test_swap(bool ritsoc);
|
|
||||||
TImporto real2imp(const real& r, char tipo);
|
|
||||||
real totale_documento();
|
|
||||||
|
|
||||||
void ivas_pack();
|
|
||||||
void cgs_pack();
|
|
||||||
bool ci_sono_importi(const TSheet_field& cgs) const;
|
|
||||||
real calcola_imp() const;
|
|
||||||
|
|
||||||
void add_cgs_tot(TMask& m);
|
|
||||||
int set_cgs_row(int n, TImporto& importo, const TBill& conto, const char* desc, char tipo,
|
|
||||||
const char* cms = nullptr, const char* fas = nullptr);
|
|
||||||
void set_cgs_imp(int n, const TImporto& importo);
|
|
||||||
bool add_cgs_imp(int n, const TImporto& importo);
|
|
||||||
bool sub_cgs_imp(int n, const TImporto& importo);
|
|
||||||
void disable_cgs_cells(int n, char tipo);
|
|
||||||
|
|
||||||
void add_cup_or_cig(short id, const TRectype& rec, TToken_string& riga) const;
|
|
||||||
void add_cup_or_cig(short id, TConfig& ini, TToken_string& riga) const;
|
|
||||||
|
|
||||||
void add_cgs_ritenute(char fsr); // Fiscali, Sociali, Reverse Charge
|
|
||||||
void generazione_righe_cg(int r);
|
|
||||||
|
|
||||||
void reset_cgs_row(int n) { reset_sheet_row(cgs(), n); }
|
|
||||||
void reset_ivas_row(int n) { reset_sheet_row(ivas(), n); }
|
|
||||||
|
|
||||||
TPagamento& pagamento() const;
|
|
||||||
|
|
||||||
void set_pagamento(const char* c, const char* d);
|
|
||||||
void set_totale_pagamento(bool update);
|
|
||||||
void reset_pagamento();
|
|
||||||
void set_scadenze(TMask& m);
|
|
||||||
void set_banche(TMask& m);
|
|
||||||
bool read_scadenze(TMask& m);
|
|
||||||
void write_scadenze(const TMask& m);
|
|
||||||
void remove_scadenze(const TMask& m, const char* rif);
|
|
||||||
void renumber_partita(TMask& m, const char* oldp, const char* newp);
|
|
||||||
void recalc_scadenze(const TDate& d);
|
|
||||||
|
|
||||||
#ifdef PRORATA100
|
|
||||||
static bool prorata_handler(TMask_field& f, KEY k);
|
|
||||||
bool test_prorata();
|
|
||||||
bool aggiusta_prorata();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int cerca_conto_cf(TBill& bill) const;
|
|
||||||
|
|
||||||
bool edit_partite(const TMask& m, int riga);
|
|
||||||
bool crea_partita(const TBill& bill, int anno, const TString& numero, int numrig, const TImporto& importo);
|
|
||||||
|
|
||||||
bool notify_cgline_deletion(TPartita& partita, long nreg, int numrig);
|
|
||||||
bool notify_cgline_deletion(int numrig);
|
|
||||||
|
|
||||||
bool is_percipient(long forn, char& tipper, long& codper) const;
|
|
||||||
long calcola_m770(int tipo_coll, real& spese, real& compenso, real& iva, real& ritfis);
|
|
||||||
bool link_m770();
|
|
||||||
bool link_cesp (const TMask& msk, const char* action);
|
|
||||||
bool link_intra(const TMask& msk, const char* action);
|
|
||||||
bool link_anal (const TMask& msk, const char* action);
|
|
||||||
|
|
||||||
public:
|
|
||||||
static int type2pos(char tipo);
|
|
||||||
static char row_type(const TToken_string& s);
|
|
||||||
void add2cg_row(TSheet_field& s, TToken_string & row, TString_array & saved_desc, const bool add = true);
|
|
||||||
void sub2cg_row(TSheet_field& s, TToken_string & row, TString_array & saved_desc) { add2cg_row(s, row, saved_desc, false) ; }
|
|
||||||
static bool iva_notify(TSheet_field& s, int r, KEY k);
|
|
||||||
static bool cg_notify(TSheet_field& s, int r, KEY key);
|
|
||||||
bool get_isf1() const { return _isf1; }
|
|
||||||
int get_lastdate() { return _last_date; }
|
|
||||||
|
|
||||||
TMask * mask(CGMaskType type);
|
|
||||||
|
|
||||||
void type2colors(char tipor, COLOR& back, COLOR& fore);
|
|
||||||
void set_type_colors(char tipor, COLOR back, COLOR fore);
|
|
||||||
void reset_colors();
|
|
||||||
real calcola_saldo() const;
|
|
||||||
|
|
||||||
TCausale& causale() const { return * _causale; }
|
|
||||||
TPartite_array& partite() { return _partite; } // Partite editate
|
|
||||||
bool edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp);
|
|
||||||
bool notify_edit_pagamento(TPartita& partita, TRectype& new_pag,
|
|
||||||
const TValuta& valuta, int deleting = 0);
|
|
||||||
|
|
||||||
TSheet_field& cgs() const;
|
|
||||||
TSheet_field& ivas() const;
|
|
||||||
TSheet_field& pags() const;
|
|
||||||
TString_array& pag_rows() { return _pag_rows; }
|
|
||||||
TImporto get_cgs_imp(int n) const;
|
|
||||||
|
|
||||||
TPro_msk * pro_mask() const { return _pro_mask; }
|
|
||||||
|
|
||||||
TImporto imposte_split_pay() const;
|
|
||||||
const TString& num_doc_rif() const { return _num_doc_rif_partite; }
|
|
||||||
|
|
||||||
TPrimanota_application();
|
|
||||||
virtual ~TPrimanota_application() { safe_delete(_pro_mask); }
|
|
||||||
};
|
|
||||||
|
|
||||||
bool& is_f1();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __EXTRA__
|
|
||||||
inline TPrimanota_application& app()
|
|
||||||
{ return (TPrimanota_application&)main_app(); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -4205,7 +4205,7 @@ bool TPrimanota_application::genera_xml_handler(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
m.enable(DLG_XML_PREVIEW, prg_invio.full());
|
m.enable(DLG_XML_PREVIEW, prg_invio.full());
|
||||||
m.enable(DLG_PDF_PREVIEW, prg_invio.full());
|
m.enable(DLG_PDF_PREVIEW, prg_invio.full());
|
||||||
m.enable(DLG_CHECK_SDI, prg_invio.full() && esito == "X");
|
m.enable(DLG_CHECK_SDI, fp_has_check() && prg_invio.full() && esito == "X");
|
||||||
m.enable(DLG_INVIO_SDI, prg_invio.full() && esito == "X");
|
m.enable(DLG_INVIO_SDI, prg_invio.full() && esito == "X");
|
||||||
m.enable(DLG_ESITO_SDI, prg_invio.full() && esito == "C" && esito == "E");
|
m.enable(DLG_ESITO_SDI, prg_invio.full() && esito == "C" && esito == "E");
|
||||||
}
|
}
|
||||||
@ -4374,8 +4374,8 @@ bool TPrimanota_application::check_sdi_handler(TMask_field& f, KEY key)
|
|||||||
if (block_errors == 0)
|
if (block_errors == 0)
|
||||||
{
|
{
|
||||||
mask.doc().put(DOC_STATO_SDI, "D");
|
mask.doc().put(DOC_STATO_SDI, "D");
|
||||||
mask.set(F_STATO_SDI, "D");
|
mask.set(F_STATO_SDI, "D");
|
||||||
}
|
}
|
||||||
TString res_page = "https://";
|
TString res_page = "https://";
|
||||||
TFilename http;
|
TFilename http;
|
||||||
|
|
||||||
|
|||||||
@ -220,9 +220,10 @@ bool TPrimanota_application::pag_notify(TSheet_field& ps, int r, KEY k)
|
|||||||
bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
if (key == K_TAB || key == K_ENTER)
|
TMask& m = f.mask();
|
||||||
|
|
||||||
|
if ((key == K_TAB || key == K_ENTER) && m.get(F_CODPAG).full())
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
|
||||||
|
|
||||||
TPagamento& pag = app().pagamento();
|
TPagamento& pag = app().pagamento();
|
||||||
const TDate dt(m.get(F_DATADOC));
|
const TDate dt(m.get(F_DATADOC));
|
||||||
|
|||||||
@ -200,7 +200,7 @@ public:
|
|||||||
const TEsercizio& operator [](int codice) const { return esercizio(codice); }
|
const TEsercizio& operator [](int codice) const { return esercizio(codice); }
|
||||||
const TEsercizio& esercizio(const TDate& date) const { return esercizio(date2esc(date)); }
|
const TEsercizio& esercizio(const TDate& date) const { return esercizio(date2esc(date)); }
|
||||||
|
|
||||||
int date2esc(const TDate& date) const;
|
int date2esc(const TDate& date) const;
|
||||||
int date2prevesc(const TDate& date) const;
|
int date2prevesc(const TDate& date) const;
|
||||||
int date2nextesc(const TDate& date) const;
|
int date2nextesc(const TDate& date) const;
|
||||||
int pred(int codice) const;
|
int pred(int codice) const;
|
||||||
@ -1652,6 +1652,7 @@ public:
|
|||||||
bool get_coddest(TString& coddest, TString& pec, const int ind_sped);
|
bool get_coddest(TString& coddest, TString& pec, const int ind_sped);
|
||||||
bool generate_xml(TLog_report * log = nullptr, const char * tipodocsdi = nullptr);
|
bool generate_xml(TLog_report * log = nullptr, const char * tipodocsdi = nullptr);
|
||||||
bool send_xml();
|
bool send_xml();
|
||||||
|
bool check();
|
||||||
|
|
||||||
TMovimento_contabile();
|
TMovimento_contabile();
|
||||||
TMovimento_contabile(const TMovimento_contabile& mov);
|
TMovimento_contabile(const TMovimento_contabile& mov);
|
||||||
|
|||||||
@ -116,21 +116,21 @@ bool gestione_IVAxCassa(const TDate& data_mov, long firm)
|
|||||||
const int anno = data.year();
|
const int anno = data.year();
|
||||||
bool yes = true;
|
bool yes = true;
|
||||||
|
|
||||||
if (firm <= 0)
|
if (firm <= 0)
|
||||||
firm = prefix().get_codditta();
|
firm = prefix().get_codditta();
|
||||||
TString16 codtab;
|
TString16 codtab;
|
||||||
|
|
||||||
codtab.format("%05ld%04d", firm, anno);
|
codtab.format("%05ld%04d", firm, anno);
|
||||||
|
|
||||||
const TRectype& lia = cache().get("%LIA", codtab);
|
const TRectype& lia = cache().get("%LIA", codtab);
|
||||||
|
|
||||||
yes = lia.get_bool("B5");
|
yes = lia.get_bool("B5");
|
||||||
if (yes)
|
if (yes)
|
||||||
{
|
{
|
||||||
TDate dal = lia.get("D0"); if (dal.year() != anno) dal = TDate( 1, 1, anno);
|
TDate dal = lia.get("D0"); if (dal.year() != anno) dal = TDate( 1, 1, anno);
|
||||||
TDate al = lia.get("D1"); if (al.year() != anno) al = TDate(31,12, anno);
|
TDate al = lia.get("D1"); if (al.year() != anno) al = TDate(31,12, anno);
|
||||||
yes = data >= dal && data <= al;
|
yes = data >= dal && data <= al;
|
||||||
}
|
}
|
||||||
return yes;
|
return yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
|
#include <golem.h>
|
||||||
|
#include <isamrpc.h>
|
||||||
#include <lffiles.h>
|
#include <lffiles.h>
|
||||||
#include <modaut.h>
|
#include <modaut.h>
|
||||||
|
|
||||||
@ -829,3 +831,120 @@ bool TMovimento_contabile::send_xml()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HIDDEN int get_resp_prop(const char * prop, TString & val, const TString & response, int startpos = 0)
|
||||||
|
{
|
||||||
|
val.cut(0);
|
||||||
|
int pos = response.find(prop, startpos);
|
||||||
|
int stop = 0;
|
||||||
|
|
||||||
|
if (pos > 0)
|
||||||
|
{
|
||||||
|
pos = response.find("\"", pos) + 1;
|
||||||
|
pos = response.find("\"", pos) + 1;
|
||||||
|
stop = response.find("\"", pos);
|
||||||
|
|
||||||
|
val = response.smid(pos, stop - pos);
|
||||||
|
}
|
||||||
|
return stop;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMovimento_contabile::check()
|
||||||
|
{
|
||||||
|
bool ok = false;
|
||||||
|
|
||||||
|
if (get(MOV_STATO_SDI).full())
|
||||||
|
{
|
||||||
|
const TString& tipocheck = get_fp_string_var(FP_TIPO_CHECK);
|
||||||
|
|
||||||
|
if (tipocheck == "F")
|
||||||
|
{
|
||||||
|
TFilename xml_name = get_xml_filename(true, get_int(MOV_ANNOES), get(MOV_XML_NAME));
|
||||||
|
TString content;
|
||||||
|
TString answer;
|
||||||
|
|
||||||
|
if (!xml_name.exist())
|
||||||
|
return error_box("File XML mancante");
|
||||||
|
content << '{' << '\n' << "\"call\" : \"fexApi.errorsCount\"," << '\n' << "\"apiPars\" : {" << '\n';
|
||||||
|
content << "\"sessid\" : \"" << get_fp_string_var(FP_SESSION_ID) << "\",\n";
|
||||||
|
content << "\"xml\" : \"";
|
||||||
|
|
||||||
|
int size = fsize(xml_name);
|
||||||
|
char * enc = new char[2 * size + 1];
|
||||||
|
TFilename temp;
|
||||||
|
|
||||||
|
temp.temp();
|
||||||
|
|
||||||
|
ofstream out(temp);
|
||||||
|
|
||||||
|
xvt_str_base64_encode(xml_name, enc);
|
||||||
|
content << enc << "\"" << "\n}\n}\n";
|
||||||
|
delete enc;
|
||||||
|
out << content;
|
||||||
|
out.close();
|
||||||
|
content = "@";
|
||||||
|
content << temp;
|
||||||
|
if (http_curl_post("https://fex-app.com", "/api/def", media_json, content, answer))
|
||||||
|
{
|
||||||
|
TString val;
|
||||||
|
int pos = get_resp_prop("block", val, answer);
|
||||||
|
|
||||||
|
int block_errors = atoi(val);
|
||||||
|
|
||||||
|
pos = get_resp_prop("reservedSessid", val, answer, pos);
|
||||||
|
|
||||||
|
TString sess_id = val;
|
||||||
|
|
||||||
|
pos = get_resp_prop("reqWas", val, answer, pos);
|
||||||
|
if (val == "fexApi.errorsCount")
|
||||||
|
{
|
||||||
|
if (block_errors == 0 && get(MOV_STATO_SDI) != "I")
|
||||||
|
put(MOV_STATO_SDI, "D");
|
||||||
|
|
||||||
|
TString http = "https:/fex-app.com/servizi/inizia?sessid=";
|
||||||
|
|
||||||
|
http << sess_id << "&auth=" << get_fp_string_var(FP_SESSION_ID);
|
||||||
|
goto_url(http);
|
||||||
|
ok = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
remove_file(temp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TString str = get_fp_string_var(FP_CHECK_APP);
|
||||||
|
TString command = str;
|
||||||
|
int p = str.find("<file>");
|
||||||
|
|
||||||
|
if (p > 0)
|
||||||
|
{
|
||||||
|
TFilename xml_name = get_xml_filename(true, get_int(DOC_ANNO), get(DOC_XML_NAME));
|
||||||
|
|
||||||
|
command = str.sleft(p);
|
||||||
|
if (command[command.len() - 1] != ' ')
|
||||||
|
command << " ";
|
||||||
|
command << xml_name;
|
||||||
|
if (p + 6 < str.len())
|
||||||
|
{
|
||||||
|
if (command[command.len() - 1] != ' ')
|
||||||
|
command << " ";
|
||||||
|
command << str.smid(p + 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (command.starts_with("http"))
|
||||||
|
{
|
||||||
|
goto_url(command);
|
||||||
|
ok = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TExternal_app check(command);
|
||||||
|
|
||||||
|
int res = check.run();
|
||||||
|
ok = res == 0;
|
||||||
|
}
|
||||||
|
if (ok && get(DOC_STATO_SDI) != "I")
|
||||||
|
put(DOC_STATO_SDI, "D");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|||||||
@ -1885,19 +1885,19 @@ bool TPartita::read(const TBill& clifo, int year, const char* num)
|
|||||||
|
|
||||||
calcola_saldo(saldo, doc, pag, imp);
|
calcola_saldo(saldo, doc, pag, imp);
|
||||||
|
|
||||||
TImporto oldsaldo;
|
|
||||||
TImporto olddoc;
|
|
||||||
TImporto oldpag;
|
|
||||||
TImporto oldimp;
|
|
||||||
TRectype riga_saldo(LF_PARTITE);
|
|
||||||
|
|
||||||
read_saldo(riga_saldo, oldsaldo, olddoc, oldpag, oldimp, true);
|
|
||||||
|
|
||||||
if (saldo != oldsaldo || doc != olddoc || pag != oldpag || imp != oldimp)
|
|
||||||
write_saldo(true);
|
|
||||||
|
|
||||||
if (_patched)
|
if (_patched)
|
||||||
|
{
|
||||||
|
TImporto oldsaldo;
|
||||||
|
TImporto olddoc;
|
||||||
|
TImporto oldpag;
|
||||||
|
TImporto oldimp;
|
||||||
|
TRectype riga_saldo(LF_PARTITE);
|
||||||
|
|
||||||
|
read_saldo(riga_saldo, oldsaldo, olddoc, oldpag, oldimp, true);
|
||||||
|
if (saldo != oldsaldo || doc != olddoc || pag != oldpag || imp != oldimp)
|
||||||
|
write_saldo(true);
|
||||||
rewrite();
|
rewrite();
|
||||||
|
}
|
||||||
return ok();
|
return ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user