Patch level : 12.0 704
Files correlati : fp Commento : - Aggiunto piccolo controllo preventivo durante l'esportazione degli XML - Aggiunto flag per non rendere il controllo bloccante - Sistemata banca di appoggio - Aggiunta gestione casse professionali
This commit is contained in:
parent
c3ffdadf02
commit
9ecb4550b5
@ -44,6 +44,7 @@ void TParametri_mask::save_all() const
|
|||||||
fp_settings().set_gest_alleg(get_bool(F_ESPORTAALLEG));
|
fp_settings().set_gest_alleg(get_bool(F_ESPORTAALLEG));
|
||||||
fp_settings().set_allega_fat(get_bool(F_ESPORTADOC));
|
fp_settings().set_allega_fat(get_bool(F_ESPORTADOC));
|
||||||
fp_settings().set_f8(get_bool(F_F8));
|
fp_settings().set_f8(get_bool(F_F8));
|
||||||
|
fp_settings().set_check_not_block(get_bool(F_CHECK_NOT_BLOCK));
|
||||||
TFP_righe_custom().save_sheet(sfield(F_FORMPERS));
|
TFP_righe_custom().save_sheet(sfield(F_FORMPERS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ void TParametri_mask::load_all()
|
|||||||
set(F_ESPORTAALLEG, fp_settings().get_gest_alleg());
|
set(F_ESPORTAALLEG, fp_settings().get_gest_alleg());
|
||||||
set(F_ESPORTADOC, fp_settings().get_allega_fat());
|
set(F_ESPORTADOC, fp_settings().get_allega_fat());
|
||||||
set(F_F8, fp_settings().is_f8());
|
set(F_F8, fp_settings().is_f8());
|
||||||
|
set(F_CHECK_NOT_BLOCK, fp_settings().get_check_not_block());
|
||||||
TFP_righe_custom().load_sheet(sfield(F_FORMPERS));
|
TFP_righe_custom().load_sheet(sfield(F_FORMPERS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#define F_ESPORTAALLEG 208
|
#define F_ESPORTAALLEG 208
|
||||||
#define F_ESPORTADOC 209
|
#define F_ESPORTADOC 209
|
||||||
#define F_F8 210
|
#define F_F8 210
|
||||||
|
#define F_CHECK_NOT_BLOCK 211
|
||||||
|
|
||||||
#define F_SETPATCH 301
|
#define F_SETPATCH 301
|
||||||
#define F_ENPTYTABLE 302
|
#define F_ENPTYTABLE 302
|
||||||
|
@ -89,6 +89,32 @@ END
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Configurazione (2) " 0 2 0 0
|
||||||
|
|
||||||
|
SPREADSHEET F_FORMPERS 60 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Personalizzazioni calcolo tipi righe "
|
||||||
|
ITEM "Tipo\nDoc@4"
|
||||||
|
ITEM "Tipo\nRiga@4"
|
||||||
|
ITEM "Qta"
|
||||||
|
ITEM "Prezzo"
|
||||||
|
ITEM "Imponibile"
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "@BControlli preventivi"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_CHECK_NOT_BLOCK
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 11 "Rendi controlli XML non bloccanti"
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Assistenza FP" 0 2 0 0
|
PAGE "Assistenza FP" 0 2 0 0
|
||||||
|
|
||||||
@ -118,19 +144,6 @@ END
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Formule Pers " 0 2 0 0
|
|
||||||
|
|
||||||
SPREADSHEET F_FORMPERS 60 6
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 1 "Personalizzazioni calcolo tipi righe "
|
|
||||||
ITEM "Tipo\nDoc@4"
|
|
||||||
ITEM "Tipo\nRiga@4"
|
|
||||||
ITEM "Qta"
|
|
||||||
ITEM "Prezzo"
|
|
||||||
ITEM "Imponibile"
|
|
||||||
END
|
|
||||||
|
|
||||||
ENDPAGE
|
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
|
||||||
PAGE "Elementi spredsheet" 0 2 0 0
|
PAGE "Elementi spredsheet" 0 2 0 0
|
||||||
@ -185,7 +198,6 @@ BEGIN
|
|||||||
OUTPUT S_IMPONIBILE CODTAB
|
OUTPUT S_IMPONIBILE CODTAB
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
TOOLBAR "Riga" 0 0 0 2
|
TOOLBAR "Riga" 0 0 0 2
|
||||||
|
@ -147,15 +147,28 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool initialize(const TDocumentoEsteso& doc);
|
|
||||||
|
/**< Funzioni di controllo */
|
||||||
|
/**< Controlli di testata, non è const per il calcolo della codizione di pagamento */
|
||||||
|
bool check_initial(TDocumentoEsteso& doc);
|
||||||
|
/**< Controllo di riga */
|
||||||
|
bool check_row(const TRiga_documento& rdoc);
|
||||||
|
/**< Controllo riepilogo IVA */
|
||||||
|
bool check_riepilogo(const TDocumentoEsteso& doc, const TRiepilogo_iva& riva);
|
||||||
|
|
||||||
|
|
||||||
|
bool initialize(TDocumentoEsteso& doc);
|
||||||
bool parse_sconto(const TString& formula, TToken_string& sconti) const;
|
bool parse_sconto(const TString& formula, TToken_string& sconti) const;
|
||||||
static bool get_bnp_iban(const TString& abi, const TString& cab, int prg, TString& iban);
|
static bool get_bnp_iban(const TString& abi, const TString& cab, int prg, TString& iban);
|
||||||
bool get_bank(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
bool get_bank(TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||||
|
bool get_bank_presentazione(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||||
|
bool get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||||
const TString& descrizione(const TRiga_documento& rdoc);
|
const TString& descrizione(const TRiga_documento& rdoc);
|
||||||
const TRectype& cco(const TRectype& doc) const; // Contratto/Convenzione/Offerta
|
const TRectype& cco(const TRectype& doc) const; // Contratto/Convenzione/Offerta
|
||||||
|
|
||||||
void log(int severity, const char* msg);
|
void log(int severity, const char* msg);
|
||||||
const char* natura(const TString& codiva) const;
|
const char* natura(const TString& codiva) const;
|
||||||
|
const char* get_esigibilita_iva(const TDocumentoEsteso& doc);
|
||||||
void set_IVA(TString codiva, TPaf_record& paf) const;
|
void set_IVA(TString codiva, TPaf_record& paf) const;
|
||||||
void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf) const;
|
void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf) const;
|
||||||
bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf);
|
bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf);
|
||||||
@ -211,6 +224,7 @@ public:
|
|||||||
const bool get_esp_est() const;
|
const bool get_esp_est() const;
|
||||||
const TString& get_esp_est_cod() const;
|
const TString& get_esp_est_cod() const;
|
||||||
const bool is_f8() const;
|
const bool is_f8() const;
|
||||||
|
const bool get_check_not_block() const;
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
void set_db_indirizzo(const TString& ind) const;
|
void set_db_indirizzo(const TString& ind) const;
|
||||||
@ -226,6 +240,7 @@ public:
|
|||||||
void set_esp_est(bool esp_est) const;
|
void set_esp_est(bool esp_est) const;
|
||||||
void set_esp_est_cod(const TString& esp_est_cod) const;
|
void set_esp_est_cod(const TString& esp_est_cod) const;
|
||||||
void set_f8(bool f8) const;
|
void set_f8(bool f8) const;
|
||||||
|
void set_check_not_block(bool not_block) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline TFP_settings& fp_settings()
|
inline TFP_settings& fp_settings()
|
||||||
|
@ -190,7 +190,7 @@ bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString&
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
pec = "";
|
pec = "";
|
||||||
// Dopo la versione 1.2 torna sempre true
|
|
||||||
return coddest.full();
|
return coddest.full();
|
||||||
}
|
}
|
||||||
inline const TString& no_special(char a)
|
inline const TString& no_special(char a)
|
||||||
@ -529,7 +529,21 @@ bool TDoc_fp::get_bnp_iban(const TString& abi, const TString& cab, int nprog, TS
|
|||||||
iban = bnp.get("S3");
|
iban = bnp.get("S3");
|
||||||
return err == NOERR;
|
return err == NOERR;
|
||||||
}
|
}
|
||||||
bool TDoc_fp::get_bank(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
|
bool TDoc_fp::get_bank(TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
if(doc.pagamento().tipo_rata(0) == TTipo_pag::_bonfico)
|
||||||
|
{
|
||||||
|
found = get_bank_presentazione(doc, iban, abi, cab, istituto);
|
||||||
|
}
|
||||||
|
else if(doc.pagamento().tipo_rata(0) == TTipo_pag::_ric_ban || doc.pagamento().tipo_rata(0) == TTipo_pag::_rid)
|
||||||
|
{
|
||||||
|
found = get_bank_appoggio(doc, iban, abi, cab, istituto);
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDoc_fp::get_bank_presentazione(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
abi = doc.get(DOC_CODABIP);
|
abi = doc.get(DOC_CODABIP);
|
||||||
@ -538,25 +552,6 @@ bool TDoc_fp::get_bank(const TDocumento& doc, TString& iban, TString& abi, TStri
|
|||||||
found = abi.full() && cab.full();
|
found = abi.full() && cab.full();
|
||||||
if (found)
|
if (found)
|
||||||
get_bnp_iban(abi, cab, prg, iban);
|
get_bnp_iban(abi, cab, prg, iban);
|
||||||
if (!found) // Se non trovo banca sul DOC la cerco su CFBAN
|
|
||||||
{
|
|
||||||
TToken_string key;
|
|
||||||
key.add("C");
|
|
||||||
key.add(doc.codcf());
|
|
||||||
key.add("N");
|
|
||||||
key.add(1);
|
|
||||||
const TRectype& cfban = cache().get(LF_CFBAN, key);
|
|
||||||
if (!cfban.empty())
|
|
||||||
{
|
|
||||||
abi = cfban.get(CFBAN_ABI);
|
|
||||||
cab = cfban.get(CFBAN_CAB);
|
|
||||||
prg = cfban.get_int(CFBAN_PROGPR);
|
|
||||||
found = abi.full() && cab.full();
|
|
||||||
iban = cfban.get(CFBAN_IBAN);
|
|
||||||
if (found && iban.blank())
|
|
||||||
get_bnp_iban(abi, cab, prg, iban);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!found) // Se non trovo banca su CFBAN la cerco su CFVEN
|
if (!found) // Se non trovo banca su CFBAN la cerco su CFVEN
|
||||||
{
|
{
|
||||||
const TRectype& cfven = doc.clifor().vendite();
|
const TRectype& cfven = doc.clifor().vendite();
|
||||||
@ -570,6 +565,38 @@ bool TDoc_fp::get_bank(const TDocumento& doc, TString& iban, TString& abi, TStri
|
|||||||
istituto = cache().get("%BAN", abi, "S0");
|
istituto = cache().get("%BAN", abi, "S0");
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TDoc_fp::get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab,
|
||||||
|
TString& istituto) const
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
abi = doc.get(DOC_CODABIA);
|
||||||
|
cab = doc.get(DOC_CODCABA);
|
||||||
|
iban = doc.get(DOC_IBAN);
|
||||||
|
found = iban.full();
|
||||||
|
if (!found) // Se non trovo banca sul DOC la cerco su CFBAN
|
||||||
|
{
|
||||||
|
TToken_string key;
|
||||||
|
key.add("C");
|
||||||
|
key.add(doc.codcf());
|
||||||
|
key.add("N");
|
||||||
|
key.add(1);
|
||||||
|
const TRectype& cfban = cache().get(LF_CFBAN, key);
|
||||||
|
if (!cfban.empty())
|
||||||
|
{
|
||||||
|
abi = cfban.get(CFBAN_ABI);
|
||||||
|
cab = cfban.get(CFBAN_CAB);
|
||||||
|
found = abi.full() && cab.full();
|
||||||
|
iban = cfban.get(CFBAN_IBAN);
|
||||||
|
if (found && iban.blank())
|
||||||
|
get_bnp_iban(abi, cab, -1, iban);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found)
|
||||||
|
istituto = cache().get("%BAN", abi, "S0");
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
const TString& TDoc_fp::descrizione(const TRiga_documento& rdoc)
|
const TString& TDoc_fp::descrizione(const TRiga_documento& rdoc)
|
||||||
{
|
{
|
||||||
if (rdoc.get_bool(RDOC_DESCLUNGA))
|
if (rdoc.get_bool(RDOC_DESCLUNGA))
|
||||||
@ -687,7 +714,91 @@ bool TDoc_fp::save_paf()
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
|
bool TDoc_fp::check_initial(TDocumentoEsteso& doc)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
static TString msg;
|
||||||
|
|
||||||
|
if (_coddest.len() != 6 && _coddest.len() != 7)
|
||||||
|
{
|
||||||
|
log(1, "Il codice destinatario ha una lunghezza non conforme.");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_rec_clifo.get(CLI_PAIV).empty() && _rec_clifo.get(CLI_COFI).empty())
|
||||||
|
{
|
||||||
|
log(1, "Sia la partita IVA che il codice fiscale del cessionario committente sono vuoti, almeno uno dei due deve essere valorizzato.");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
TPagamento& pag = doc.pagamento();
|
||||||
|
if(pag.cond_pag_sdi().empty())
|
||||||
|
{
|
||||||
|
|
||||||
|
msg.cut(0) << "Non è valorizzata la condizione di pagamento SDI (TP01, TP02, TP03) per la condizione di pagamento " << pag.code();
|
||||||
|
log(1, msg);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int nr = 0; nr < doc.scadenze().items(); nr++)
|
||||||
|
{
|
||||||
|
const int rp = nr < pag.n_rate() ? nr : 0;
|
||||||
|
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
||||||
|
|
||||||
|
if(cache().get("%CLR", key_class, "S12").empty())
|
||||||
|
{
|
||||||
|
msg.cut(0) << "Non è valorizzata la tipologia di pagamento SDI (MPXX) per la condizione di pagamento " << pag.code();
|
||||||
|
log(1, msg);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDoc_fp::check_row(const TRiga_documento& rdoc)
|
||||||
|
{
|
||||||
|
bool ok = false;
|
||||||
|
static TString msg;
|
||||||
|
|
||||||
|
if(rdoc.is_spese())
|
||||||
|
{
|
||||||
|
const TSpesa_prest& spesa = rdoc.spesa();
|
||||||
|
if(spesa.perc().is_zero())
|
||||||
|
{
|
||||||
|
msg.cut(0) << "É corretto che per la spesa " << spesa.codice() << " la percentuale sia zero?";
|
||||||
|
log(1, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const TCodiceIVA& codice_iva = rdoc.iva();
|
||||||
|
if (codice_iva.codice().full() && codice_iva.percentuale() == ZERO && codice_iva.natura().empty())
|
||||||
|
{
|
||||||
|
msg.cut(0) << "Impossibile avere la natura non valorizzata a fronte di una aliquota con percentuale zero. Codice IVA: "; msg << codice_iva.codice();
|
||||||
|
log(1, msg);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDoc_fp::check_riepilogo(const TDocumentoEsteso& doc, const TRiepilogo_iva& riva)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
static TString msg;
|
||||||
|
|
||||||
|
if(*get_esigibilita_iva(doc) == 'S' && riva.cod_iva().natura() == "N6")
|
||||||
|
{
|
||||||
|
msg.cut(0) << "Impossibile avere un documento con scissione dei pagamenti e natura iva N6, codice: " << riva.cod_iva().codice();
|
||||||
|
log(1, msg);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
||||||
{
|
{
|
||||||
// Azzero
|
// Azzero
|
||||||
_hfatt.cut(0);
|
_hfatt.cut(0);
|
||||||
@ -723,7 +834,10 @@ bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
|
|||||||
#ifndef DBG
|
#ifndef DBG
|
||||||
_is_pa = doc.clifor().get_int("ALLEG") == 7;
|
_is_pa = doc.clifor().get_int("ALLEG") == 7;
|
||||||
if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec))
|
if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec))
|
||||||
|
{
|
||||||
|
log(1, "Impossibile trovare il codice destinatario per la fattura");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
_is_pa = true;
|
_is_pa = true;
|
||||||
_coddest = "WSUHKZ";
|
_coddest = "WSUHKZ";
|
||||||
@ -747,7 +861,7 @@ bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
|
|||||||
// Azzero indici
|
// Azzero indici
|
||||||
_index_cassa_previdenziale = 1;
|
_index_cassa_previdenziale = 1;
|
||||||
|
|
||||||
return true;
|
return check_initial(doc) || fp_settings().get_check_not_block();
|
||||||
}
|
}
|
||||||
|
|
||||||
const TRectype& TDoc_fp::cco(const TRectype& doc) const
|
const TRectype& TDoc_fp::cco(const TRectype& doc) const
|
||||||
@ -835,6 +949,18 @@ const char* TDoc_fp::natura(const TString& codiva) const
|
|||||||
return cache().get("%IVA", codiva, "S12");
|
return cache().get("%IVA", codiva, "S12");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* TDoc_fp::get_esigibilita_iva(const TDocumentoEsteso& doc)
|
||||||
|
{
|
||||||
|
// Esigibilità IVA: Immediata, Differita, Split payment
|
||||||
|
const char* eiva = "I";
|
||||||
|
if (doc.is_split_payment())
|
||||||
|
eiva = "S";
|
||||||
|
else if (doc.get_bool(DOC_LIQDIFF) || doc.get_bool(DOC_IVAXCASSA))
|
||||||
|
eiva = "D";
|
||||||
|
|
||||||
|
return eiva;
|
||||||
|
}
|
||||||
|
|
||||||
void TDoc_fp::set_IVA(TString codiva, TPaf_record& paf) const
|
void TDoc_fp::set_IVA(TString codiva, TPaf_record& paf) const
|
||||||
{
|
{
|
||||||
if (codiva.empty())
|
if (codiva.empty())
|
||||||
@ -1097,6 +1223,7 @@ bool TDoc_fp::export_paf0100f()
|
|||||||
paf0100f.set("P1_TELEFONO", tel);
|
paf0100f.set("P1_TELEFONO", tel);
|
||||||
paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL));
|
paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL));
|
||||||
paf0100f.set("P1_GESTIONE", "D");
|
paf0100f.set("P1_GESTIONE", "D");
|
||||||
|
paf0100f.set("P1_ERRINT", "");
|
||||||
// </DatiTrassmissione>
|
// </DatiTrassmissione>
|
||||||
return insert(paf0100f);
|
return insert(paf0100f);
|
||||||
}
|
}
|
||||||
@ -1402,6 +1529,10 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
|
|
||||||
FOR_EACH_PHYSICAL_RDOC(doc, r, rdoc)
|
FOR_EACH_PHYSICAL_RDOC(doc, r, rdoc)
|
||||||
{
|
{
|
||||||
|
// Controllo la riga
|
||||||
|
if (check_row(*rdoc) && !fp_settings().get_check_not_block())
|
||||||
|
return false;
|
||||||
|
|
||||||
bool skip_riga = false;
|
bool skip_riga = false;
|
||||||
paf1800f.reset();
|
paf1800f.reset();
|
||||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||||
@ -1561,6 +1692,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
// Controllo se è una ritenuta fiscale
|
// Controllo se è una ritenuta fiscale
|
||||||
if (sp.tipo_ritenuta() == 'F')
|
if (sp.tipo_ritenuta() == 'F')
|
||||||
{
|
{
|
||||||
|
paf1800f.set("PI_RITENUTA", "SI");
|
||||||
add_ritenuta(doc, rdoc->spesa(), paf0700f);
|
add_ritenuta(doc, rdoc->spesa(), paf0700f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1833,17 +1965,16 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
paf2200f.set("PL_KEYHEADERFATT", _hfatt);
|
paf2200f.set("PL_KEYHEADERFATT", _hfatt);
|
||||||
paf2200f.set("PL_KEYBODYFATT", _bfatt);
|
paf2200f.set("PL_KEYBODYFATT", _bfatt);
|
||||||
remove(paf2200f); // Cancella tutte le righe di riepilogo IVA
|
remove(paf2200f); // Cancella tutte le righe di riepilogo IVA
|
||||||
const char* eiva = "I"; // Esigibilità IVA: Immediata, Differita, Split payment
|
const char* eiva = get_esigibilita_iva(doc);
|
||||||
if (doc.is_split_payment())
|
|
||||||
eiva = "S";
|
|
||||||
else if (doc.get_bool(DOC_LIQDIFF) || doc.get_bool(DOC_IVAXCASSA))
|
|
||||||
eiva = "D";
|
|
||||||
long num_riep = 0;
|
long num_riep = 0;
|
||||||
TAssoc_array& tiva = doc.tabella_iva(false);
|
TAssoc_array& tiva = doc.tabella_iva(false);
|
||||||
FOR_EACH_ASSOC_OBJECT(tiva, obj, key, itm)
|
FOR_EACH_ASSOC_OBJECT(tiva, obj, key, itm)
|
||||||
{
|
{
|
||||||
const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm);
|
const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm);
|
||||||
|
|
||||||
|
if (!check_riepilogo(doc, riva) && !fp_settings().get_check_not_block())
|
||||||
|
return false;
|
||||||
|
|
||||||
add_riepilogo_iva(paf2200f, riva.cod_iva(), eiva, riva.imponibile(), riva.imposta());
|
add_riepilogo_iva(paf2200f, riva.cod_iva(), eiva, riva.imponibile(), riva.imposta());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1900,7 +2031,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
for (int nr = 0; nr < nrate; nr++)
|
for (int nr = 0; nr < nrate; nr++)
|
||||||
{
|
{
|
||||||
paf2500f.set("PO_RIGA", long(nr + 1)); // Numero rata
|
paf2500f.set("PO_RIGA", long(nr + 1)); // Numero rata
|
||||||
int rp = nr < pag.n_rate() ? nr : 0;
|
const int rp = nr < pag.n_rate() ? nr : 0;
|
||||||
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
||||||
paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile
|
paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile
|
||||||
TToken_string& riga_scadenze = scad.row(nr); // Data|Importo
|
TToken_string& riga_scadenze = scad.row(nr); // Data|Importo
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define FP_ESP_EST "espest"
|
#define FP_ESP_EST "espest"
|
||||||
#define FP_ESP_EST_COD "espestcod"
|
#define FP_ESP_EST_COD "espestcod"
|
||||||
#define FP_F8 "f8"
|
#define FP_F8 "f8"
|
||||||
|
#define FP_CHECK_NOT_BLOCK "checknotblock"
|
||||||
|
|
||||||
// Sheet fp0300
|
// Sheet fp0300
|
||||||
#define FP_SLD_COD "SLD"
|
#define FP_SLD_COD "SLD"
|
||||||
@ -112,6 +113,11 @@ const bool TFP_settings::is_f8() const
|
|||||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_F8);
|
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_F8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool TFP_settings::get_check_not_block() const
|
||||||
|
{
|
||||||
|
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NOT_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
void TFP_settings::set_db_indirizzo(const TString& ind) const
|
void TFP_settings::set_db_indirizzo(const TString& ind) const
|
||||||
{
|
{
|
||||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_IP, ind);
|
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_IP, ind);
|
||||||
@ -177,6 +183,11 @@ void TFP_settings::set_f8(const bool f8) const
|
|||||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_F8, f8);
|
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_F8, f8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TFP_settings::set_check_not_block(const bool not_block) const
|
||||||
|
{
|
||||||
|
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NOT_BLOCK, not_block);
|
||||||
|
}
|
||||||
|
|
||||||
TRectype TFP_selected_docs::fill_rectype() const
|
TRectype TFP_selected_docs::fill_rectype() const
|
||||||
{
|
{
|
||||||
TRectype r(LF_TABMOD);
|
TRectype r(LF_TABMOD);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user