diff --git a/build/770.vcxproj b/build/770.vcxproj index 334fcab10..ae4a859ef 100644 --- a/build/770.vcxproj +++ b/build/770.vcxproj @@ -149,7 +149,6 @@ - %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) @@ -188,8 +187,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - @@ -344,6 +341,9 @@ {2d38a763-3d74-4338-9362-b891784ec90e} + + {7b80f974-ce2e-4bd9-855a-44ff139ff288} + diff --git a/build/770.vcxproj.filters b/build/770.vcxproj.filters index 79831893d..e101be570 100644 --- a/build/770.vcxproj.filters +++ b/build/770.vcxproj.filters @@ -41,21 +41,12 @@ Sources - - Sources - - - Sources - Sources Sources - - Sources - diff --git a/build/777.vcxproj b/build/777.vcxproj index 083bcbca1..4cca180be 100644 --- a/build/777.vcxproj +++ b/build/777.vcxproj @@ -147,9 +147,6 @@ - - - %(AdditionalIncludeDirectories) @@ -202,6 +199,9 @@ {2d38a763-3d74-4338-9362-b891784ec90e} + + {7b80f974-ce2e-4bd9-855a-44ff139ff288} + diff --git a/build/777.vcxproj.filters b/build/777.vcxproj.filters index d78171c63..f0f87ff85 100644 --- a/build/777.vcxproj.filters +++ b/build/777.vcxproj.filters @@ -33,24 +33,15 @@ Sources - - Sources - Sources Sources - - Sources - Sources - - Sources - diff --git a/build/m770.sln b/build/m770.sln index 40e6f645f..8f618f84f 100644 --- a/build/m770.sln +++ b/build/m770.sln @@ -1,7 +1,12 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.1778 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "770", "770.vcxproj", "{ECFC8D48-AF18-485E-8DBF-7AAC35C062AA}" + ProjectSection(ProjectDependencies) = postProject + {7B80F974-CE2E-4BD9-855A-44FF139FF288} = {7B80F974-CE2E-4BD9-855A-44FF139FF288} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "771mod", "771mod.vcxproj", "{60DC2528-9102-4E47-BA1B-4316C3F5E938}" EndProject @@ -19,6 +24,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "777", "777.vcxproj", "{0AC7 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AgaLib", "AgaLib.vcxproj", "{2D38A763-3D74-4338-9362-B891784EC90E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cglib", "cglib.vcxproj", "{7B80F974-CE2E-4BD9-855A-44FF139FF288}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -61,8 +68,15 @@ Global {2D38A763-3D74-4338-9362-B891784EC90E}.Debug|Win32.Build.0 = Debug|Win32 {2D38A763-3D74-4338-9362-B891784EC90E}.Release|Win32.ActiveCfg = Release|Win32 {2D38A763-3D74-4338-9362-B891784EC90E}.Release|Win32.Build.0 = Release|Win32 + {7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.ActiveCfg = Debug|Win32 + {7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.Build.0 = Debug|Win32 + {7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.ActiveCfg = Release|Win32 + {7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CE270B1F-2BC9-415E-BC19-6C86D3DCCF35} + EndGlobalSection EndGlobal diff --git a/src/fp/fp0300a.uml b/src/fp/fp0300a.uml index 6c88c4c60..6d3f0ea4c 100644 --- a/src/fp/fp0300a.uml +++ b/src/fp/fp0300a.uml @@ -116,6 +116,7 @@ END BOOLEAN F_PROVVISORIO BEGIN PROMPT 1 17 "Provvisorio" + FLAG "H" END ENDPAGE diff --git a/src/fp/fp0700.cpp b/src/fp/fp0700.cpp index 6a1bec393..fe94d1842 100644 --- a/src/fp/fp0700.cpp +++ b/src/fp/fp0700.cpp @@ -127,7 +127,7 @@ void TPAR_mask::fill() TPaf_record paf0100f("PAF0100F"); TSheet_field& regs = sfield(F_REGS); TString query; - const bool definitivo = get_bool(F_DEFINITIVO); + const bool diagn = get_bool(F_DIAGN); enable(DLG_OK, filter_selected.empty() || filter_selected == "E" || filter_selected == "X"); enable(DLG_PRINT, true); @@ -135,7 +135,7 @@ void TPAR_mask::fill() enable(DLG_FINDREC, filter_selected == "D"); enable(DLG_KEY, _enable_chiave_fixer && filter_selected.empty()); - regs.enable_column(S_ONLYGEN, !definitivo); // che regola si usa ?? + regs.enable_column(S_ONLYGEN, diagn); // che regola si usa ?? /* VECCHIA QUERY @@ -238,7 +238,7 @@ void TPAR_mask::fill() split = is_split_payment(mov); } } - if (!definitivo) + if (diagn) regs.set_row_cell(S_ONLYGEN, false, r); } @@ -409,8 +409,8 @@ void TPAR_mask::export_paf() int ndocs = 0; TSheet_field& sht = sfield(F_REGS); const TString &tipo_doc_sdi = get(F_TIPO_SDI); - const bool definitivo = get_bool(F_DEFINITIVO); - TReg_fp elab(tipo_doc_sdi,definitivo); + const bool diagn = get_bool(F_DIAGN); + TReg_fp elab(tipo_doc_sdi, !diagn); TReport_book book; //elab.set_cache_insert(true); @@ -442,12 +442,13 @@ void TPAR_mask::export_paf() if (!yesno_box(msg)) break; } - if (!definitivo) + if (diagn) { - TReport mov_rep; + TProgram_report mov_rep; mov_rep.load("fp0700a"); - mov_rep.set_var("#NUM", nreg); + mov_rep.recordset()->set_var("#NUM", nreg); + book.add(mov_rep); } } @@ -463,7 +464,7 @@ void TPAR_mask::export_paf() } } elab.show_log(); - if (!definitivo) + if (diagn) book.preview(); } } @@ -740,7 +741,10 @@ public: void Treg2Paf::main_loop() { - while (TPAR_mask().run() == K_ENTER) {} + TPAR_mask m; + + m.set(F_DIAGN, true); + while (m.run() == K_ENTER) {} } bool Treg2Paf::create() diff --git a/src/fp/fp0700a.h b/src/fp/fp0700a.h index 74d85ae42..b254881ca 100644 --- a/src/fp/fp0700a.h +++ b/src/fp/fp0700a.h @@ -4,9 +4,9 @@ #define F_CAUSALI_TIPO 404 #define F_TIPO_SDI 405 #define F_REGS 406 -#define F_DEFINITIVO 407 +#define F_DIAGN 407 #define START_MASK F_DATAINI -#define END_MASK F_DEFINITIVO +#define END_MASK F_DIAGN #define DLG_KEY 501 diff --git a/src/fp/fp0700a.uml b/src/fp/fp0700a.uml index 8aab5c404..e465665e5 100644 --- a/src/fp/fp0700a.uml +++ b/src/fp/fp0700a.uml @@ -98,9 +98,9 @@ BEGIN ITEM "TD20|TD20 Autofattura" END - BOOLEAN F_DEFINITIVO + BOOLEAN F_DIAGN BEGIN - PROMPT 1 15 "Definitivo" + PROMPT 1 15 "Esporta in stato diagnosticato" END STRING DLG_PROFILE 50 @@ -119,7 +119,7 @@ BEGIN ITEM "Anno" ITEM "Num.\nReg.@7" ITEM "Data\nReg.@10" - ITEM "Num.\nDoc.@7" + ITEM "Num.\nDoc.@7" ITEM "Data\nDoc.@10" ITEM "Cliente" ITEM "Ragione Sociale@50" @@ -169,7 +169,7 @@ BEGIN INPUT DESCR S_DESCR DISPLAY "Descrizione @50" DESCR DISPLAY "Cod." CODCAUS - DISPLAY "Documento" TIPODOC + DISPLAY "Documento" TIPODOC DISPLAY "Registro" REG DISPLAY "Tipo movimento" TIPOMOV DISPLAY "Regime IVA" REGSPIVA diff --git a/src/fp/fplib.h b/src/fp/fplib.h index 5583f9b82..43d7cdad3 100644 --- a/src/fp/fplib.h +++ b/src/fp/fplib.h @@ -513,7 +513,7 @@ private: TPaf_container _paf_container; int _count_r_conai; bool _nascondi_sconti_righe_fatt; - bool _provvisorio; + bool _diagn; TFP_nota_piede_f _riga_npf; bool _has_cust; bool _tracciati_2021; @@ -565,7 +565,9 @@ protected: bool get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const; const TString& descrizione(const TRiga_documento& rdoc); const TRectype& cco(const TRectype& doc) const; // Contratto/Convenzione/Offerta - const char * stato_paf() const { return _provvisorio ? "X" : "D"; } + + const char * stato_paf(); + //const char * stato_paf() const { return _provvisorio ? "X" : "D"; } const TString & natura(const char* codiva) const; static const char* get_esigibilita_iva(const TDocumentoEsteso& doc); @@ -693,7 +695,8 @@ protected: void set_qta_prezzo(TPaf_record& paf1800f, const TMovimento_contabile& mov, int n_row) const; void add_ritenuta(const TMovimento_contabile & mov, int n_row, TPaf_record& paf0700f) const; bool add_riepilogo_iva(const TMovimento_contabile mov, int n_riga); - const char * stato_paf() const { return _definitivo ? "D" : "X"; } + + const char * stato_paf() const { return _definitivo && !get_no_export_pronto() ? "P" : "D"; } const TFirm& TReg_fp::get_firm(){return prefix().firm();} diff --git a/src/fp/fplib01.cpp b/src/fp/fplib01.cpp index 4c633e963..b0cba2089 100644 --- a/src/fp/fplib01.cpp +++ b/src/fp/fplib01.cpp @@ -1328,6 +1328,19 @@ const TRectype& TDoc_fp::cco(const TRectype& doc) const return tabmod.curr(); } +const char* TDoc_fp::stato_paf() { + if (get_no_export_pronto()) + { + _diagn = true; + return "D"; + } + else + { + _diagn = false; + return "P"; + } +} + bool TDoc_fp::show_log() { TReport_book b; @@ -1338,15 +1351,45 @@ bool TDoc_fp::show_log() return _log.preview(); } -int TDoc_fp::commit() +//DA CORREGGERE PER EVITARE DI CONVERTIRE TUTTE DA STATO D A P +int TDoc_fp::commit() { int r = 0; if (_to_commit) { // Controllo stato diagnosticato + if (get_no_export_pronto()) + { + _log.log(2, "Le fatture sono state esportate in stato diagnosticato"); + } + else + { + _log.log(2, "Le fatture sono state esportate correttamente in stato pronto"); + } + + if (r >= 0 && fp_db().sq_commit()) + { + r += 2; + } + else + { + r = -1; + _log.log(2, fp_db().sq_get_token_text_error(1)); + //_log.log(2, "UPDATE PAF0100F SET P1_GESTIONE = 'P' WHERE P1_GESTIONE = 'D'"); + } + } + _to_commit = false; + return r; + + /* + int r = 0; + if (_to_commit) + { + // Controllo stato diagnosticato + if (!get_no_export_pronto()) { - if (fp_db().sq_set_exec("UPDATE PAF0100F SET P1_GESTIONE = 'P' WHERE P1_GESTIONE = 'D'")) + if (fp_db().sq_set_exec("UPDATE PAF0100F SET P1_GESTIONE = 'P' WHERE P1_GESTIONE = 'D'AND ")) { r += 1; _log.log(2, "Le fatture sono state esportate correttamente in stato pronto"); @@ -1374,12 +1417,15 @@ int TDoc_fp::commit() } _to_commit = false; return r; + */ } + int TDoc_fp::force_commit() { _to_commit = true; return commit(); } + const TString & TDoc_fp::natura(const char* codiva) const { const TCodiceIVA iva(codiva); @@ -2732,7 +2778,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc) pafw300f.set("PW_NUMERO", doc.numero()); pafw300f.set("PW_DATA", doc.data()); - if (!cached_tipodoc(doc.get(DOC_TIPODOC)).invio_xml() || doc.noinvioxml() || _provvisorio) + if (!cached_tipodoc(doc.get(DOC_TIPODOC)).invio_xml() || doc.noinvioxml() || _diagn) { pafw300f.set("PW_CODSDI", "**********"); } @@ -2799,7 +2845,7 @@ TRectype& TDoc_fp::key_to_doc(const TDoc_key& key) _doc_rec->put(DOC_NDOC, key.ndoc()); return *_doc_rec; } -TDoc_fp::TDoc_fp(bool provvisorio) : _doc_rec(nullptr), _log(nullptr), _cache_insert(false) , _provvisorio(provvisorio) +TDoc_fp::TDoc_fp(bool provvisorio) : _doc_rec(nullptr), _log(nullptr), _cache_insert(false) , _diagn(provvisorio) { _ditta.init(LF_NDITTE, prefix().get_codditta()); _cofi = get_cofi_tras(); @@ -2847,9 +2893,9 @@ TDoc_fp::~TDoc_fp() | $$ | $$ \ $$| $$_____/| $$ | $$ | $$ | $$ | $$| $$$$$$$| $$$$$$$ |__/ |__/ |__/ \_______/ \____ $$ - /$$ \ $$ - | $$$$$$/ - \______/ + /$$ \ $$ + | $$$$$$/ + \______/ */ bool TReg_fp::insert(TPaf_record& p) @@ -2998,7 +3044,11 @@ bool TReg_fp::initialize(const TMovimento_contabile& mov) // Controllo se il documento almeno in stato di stampa _is_pa = mov.clifo().get_int("ALLEG") == 7; - _coddest = _ditta.coddest(); + if (_ditta.coddest().empty()) + _coddest = "0000000"; + else + _coddest = _ditta.coddest(); + _pec = _ditta.pec(); _enapec = _coddest == "0000000" && _pec.full(); _privato = _coddest.len() != 6; @@ -3017,32 +3067,16 @@ int TReg_fp::commit() if (_to_commit) { // Controllo stato diagnosticato - if (!get_no_export_pronto()) - { - if (fp_db().sq_set_exec("UPDATE PAF0100F SET P1_GESTIONE = 'P' WHERE P1_GESTIONE = 'D'")) - { - r += 1; - _log.log(2, "Le fatture sono state esportate correttamente in stato pronto"); - } - else - { - r = -1; - _log.log(2, fp_db().sq_get_token_text_error(1)); - } - } - else - { + if (get_no_export_pronto() || !_definitivo) _log.log(2, "Le fatture sono state esportate in stato diagnosticato"); - } + else + _log.log(2, "Le fatture sono state esportate correttamente in stato pronto"); if (r >= 0 && fp_db().sq_commit()) - { r += 2; - } else { r = -1; _log.log(2, fp_db().sq_get_token_text_error(1)); - _log.log(2, "UPDATE PAF0100F SET P1_GESTIONE = 'P' WHERE P1_GESTIONE = 'D'"); } } _to_commit = false; @@ -3196,8 +3230,14 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov) paf0200f.set("P2_FISCIVACOD", fornitore.partita_IVA()); } paf0200f.set("P2_CODFISCALE", fornitore.codice_fiscale()); // + + const bool df = _ditta.fisica(); + if (_ditta.fisica()) { + TString forn_n = fornitore.nome(); + TString forn_c = fornitore.cognome(); + paf0200f.set("P2_ANANOME", fornitore.nome()); // paf0200f.set("P2_ANACOGNOME", fornitore.cognome()); // } @@ -3213,7 +3253,7 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov) paf0200f.set("P2_SEDENRCIVICO", fornitore.civico_residenza().left(8)); // paf0200f.set("P2_SEDECOMUNE", fornitore.comune_residenza()); // paf0200f.set("P2_SEDENAZ", fornitore.stato_residenza_ISO()); // - paf0200f.set("P2_GESTIONE", stato_paf()); + //paf0200f.set("P2_GESTIONE", stato_paf()); // I clienti esteri possono avere CAP alfanumerici, li tolgo if (fornitore.stato_residenza_ISO() != "IT") diff --git a/src/m770/771100.cpp b/src/m770/771100.cpp index 725db3b42..d0e7958a1 100755 --- a/src/m770/771100.cpp +++ b/src/m770/771100.cpp @@ -21,10 +21,6 @@ #include "771100.h" #include "77lib.h" -#include "../ba/ba4200.h" -#include "../ba/ba4300.h" // per il f_coddittah -#include "../ba/ba4500.h" - #include #include #include