Patch level : 12.0 990
Files correlati : ve0.exe ve1.exe ve5.exe ve6.exe Commento : Cam iato occasionale in is_occasionale per avere la funzione occasionale che restituisce l'oggetto occasionale. Aggiunte le funzioni get_dest_sdi, get_rif_sdi(), tipo_doc_sdi() dei documenti
This commit is contained in:
parent
7416ca4c12
commit
db65d892ea
@ -946,12 +946,14 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TDocumento& d = doc();
|
TDocumento& d = doc();
|
||||||
|
|
||||||
d.put(DOC_TIPOCF, msk.get(F_TIPOCF));
|
d.put(DOC_TIPOCF, msk.get(F_TIPOCF));
|
||||||
d.put(DOC_CODCF, msk.get(F_CODCF));
|
d.put(DOC_CODCF, msk.get(F_CODCF));
|
||||||
const TCli_for& c = d.clifor();
|
|
||||||
|
const TCli_for& c = d.clifor();
|
||||||
|
|
||||||
// Compilo dati occasionale se presenti
|
// Compilo dati occasionale se presenti
|
||||||
if (c.occasionale() && ini.set_paragraph("18")) // LF_OCCAS
|
if (c.is_occasionale() && ini.set_paragraph("18")) // LF_OCCAS
|
||||||
{
|
{
|
||||||
const TString& ocfpi = ini.get(OCC_CFPI);
|
const TString& ocfpi = ini.get(OCC_CFPI);
|
||||||
if (ocfpi.full())
|
if (ocfpi.full())
|
||||||
|
@ -822,7 +822,7 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
// !COMN-><FIELD> accede ai campi del comune di nascita del cliente
|
// !COMN-><FIELD> accede ai campi del comune di nascita del cliente
|
||||||
TCli_for & cli_for = _doc->clifor();
|
TCli_for & cli_for = _doc->clifor();
|
||||||
TOccasionale & cli_occ = _doc->occas();
|
TOccasionale & cli_occ = _doc->occas();
|
||||||
const bool occasionale = cli_for.occasionale();
|
const bool occasionale = cli_for.is_occasionale();
|
||||||
TString in(s.get()); // prende la macro o il fieldref
|
TString in(s.get()); // prende la macro o il fieldref
|
||||||
if (in[0] != '!')
|
if (in[0] != '!')
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include "../cg/cglib.h"
|
#include "../cg/cglib.h"
|
||||||
|
#include "../fp/fplib.h"
|
||||||
|
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
|
|
||||||
@ -288,6 +289,68 @@ TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec)
|
|||||||
_parm.qta_lit = 3; _parm.qta_val = 3;
|
_parm.qta_lit = 3; _parm.qta_val = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TString & TDocumentoEsteso::get_dest_sdi()
|
||||||
|
{
|
||||||
|
TString & codsdi = get_tmp_string(16);
|
||||||
|
TString & pec = get_tmp_string(256);
|
||||||
|
|
||||||
|
get_coddest(codsdi, pec);
|
||||||
|
|
||||||
|
return pec.full() ? pec : codsdi;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDocumentoEsteso::get_coddest(TString& coddest, TString& pec)
|
||||||
|
{
|
||||||
|
const TCli_for & clifo = clifor();
|
||||||
|
|
||||||
|
coddest = clifo.vendite().get(CFV_PADESTIN);
|
||||||
|
pec = clifo.get("PEC");
|
||||||
|
if (coddest.empty())
|
||||||
|
{
|
||||||
|
if (pec.full() || ini_get_bool(CONFIG_DITTA, "fp", "esppri"))
|
||||||
|
coddest = "0000000";
|
||||||
|
// Controllo se è straniero
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const TAnagrafica & anag = clifor().anagrafica_cliente();
|
||||||
|
|
||||||
|
if (anag.estero() && anag.stato_partita_IVA() != "IT")
|
||||||
|
coddest = ini_get_bool(CONFIG_DITTA, "fp", "espest") ? ini_get_string(CONFIG_DITTA, "fp", "espestcod", "XXXXXXX") : "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pec = "";
|
||||||
|
|
||||||
|
const int codindsp = get_int(DOC_CODINDSP);
|
||||||
|
|
||||||
|
if (codindsp > 0)
|
||||||
|
coddest = clifo.indsp(codindsp).get(IND_PADESTIN);
|
||||||
|
|
||||||
|
|
||||||
|
return coddest.full();
|
||||||
|
}
|
||||||
|
|
||||||
|
const TString & TDocumentoEsteso::get_rif_sdi()
|
||||||
|
{
|
||||||
|
const TCli_for & clifo = clifor();
|
||||||
|
const int codindsp = get_int(DOC_CODINDSP);
|
||||||
|
|
||||||
|
if (codindsp > 0)
|
||||||
|
return clifo.indsp(codindsp).get(IND_PARIFAMM);
|
||||||
|
return clifo.vendite().get(CFV_PARIFAMM);
|
||||||
|
}
|
||||||
|
|
||||||
|
const TString & TDocumentoEsteso::tipo_doc_sdi() const
|
||||||
|
{
|
||||||
|
TString & tipo_doc_sdi = get_tmp_string(16);
|
||||||
|
|
||||||
|
tipo_doc_sdi = get(DOC_TIPODOCSDI);
|
||||||
|
// Controlli da fare per clienti a cui si fotte la conversione e mi trovo dati sporchi nella colonna
|
||||||
|
if (tipo_doc_sdi.len() == 4 && tipo_doc_sdi.starts_with("TD"))
|
||||||
|
return tipo_doc_sdi;
|
||||||
|
return tipo().tipo_doc_sdi();
|
||||||
|
}
|
||||||
|
|
||||||
TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec, dec_parm & parm)
|
TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec, dec_parm & parm)
|
||||||
: TDocumento(rec), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1),
|
: TDocumento(rec), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1),
|
||||||
_conai(NULL), _tic(NULL), _split(NULL)
|
_conai(NULL), _tic(NULL), _split(NULL)
|
||||||
@ -302,9 +365,9 @@ TDocumentoEsteso::TDocumentoEsteso()
|
|||||||
|
|
||||||
TDocumentoEsteso::~TDocumentoEsteso()
|
TDocumentoEsteso::~TDocumentoEsteso()
|
||||||
{
|
{
|
||||||
if (_conai) delete _conai;
|
safe_delete(_conai);
|
||||||
if (_tic) delete _tic;
|
safe_delete(_tic);
|
||||||
if (_split) delete _split;
|
safe_delete(_split);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TDocumentoEsteso::set_riga_conai()
|
void TDocumentoEsteso::set_riga_conai()
|
||||||
|
@ -78,10 +78,23 @@ public:
|
|||||||
void set_riga_conai();
|
void set_riga_conai();
|
||||||
void set_riga_tic();
|
void set_riga_tic();
|
||||||
void set_riga_split();
|
void set_riga_split();
|
||||||
|
|
||||||
|
// funzioni per fp
|
||||||
|
// Ritorna cod sdi, pec o vuoto. Chiama get_coddest()
|
||||||
|
const TString & get_dest_sdi();
|
||||||
|
// Valorizza codice sdi e pec in base alle configurazioni del monitor
|
||||||
|
bool get_coddest(TString& coddest, TString& pec);
|
||||||
|
// Ritorna riferimento sdi
|
||||||
|
const TString & get_rif_sdi();
|
||||||
|
// Ritorna tipo documento sdi
|
||||||
|
const TString& tipo_doc_sdi() const;
|
||||||
|
|
||||||
// Funzioni per settare i parametri
|
// Funzioni per settare i parametri
|
||||||
void set_decimals(const dec_parm & parm) { _parm = parm ; }
|
void set_decimals(const dec_parm & parm) { _parm = parm ; }
|
||||||
// void set_condv(TCli_for * cli); // Cambia le condizioni di vendita
|
// void set_condv(TCli_for * cli); // Cambia le condizioni di vendita
|
||||||
|
TDocumentoEsteso(const TDocumento & d) : TDocumento(d) {};
|
||||||
|
TDocumentoEsteso(char provv, int anno, const char* codnum, long numdoc) : TDocumento(provv, anno, codnum, numdoc) {};
|
||||||
|
TDocumentoEsteso(const TDoc_key& key) : TDocumento(key) {};
|
||||||
TDocumentoEsteso (const TRectype & rec, dec_parm & parm) ;
|
TDocumentoEsteso (const TRectype & rec, dec_parm & parm) ;
|
||||||
TDocumentoEsteso (const TRectype & rec) ;
|
TDocumentoEsteso (const TRectype & rec) ;
|
||||||
TDocumentoEsteso () ;
|
TDocumentoEsteso () ;
|
||||||
|
@ -1051,7 +1051,7 @@ void TDocumento_mask::cli2mask(bool force_load)
|
|||||||
const bool onload = !is_running();
|
const bool onload = !is_running();
|
||||||
|
|
||||||
// Setta i campi che appartengono al file LF_CLIFO
|
// Setta i campi che appartengono al file LF_CLIFO
|
||||||
const bool occas = c.occasionale();
|
const bool occas = c.is_occasionale();
|
||||||
|
|
||||||
show(F_OCCASEDIT, occas);
|
show(F_OCCASEDIT, occas);
|
||||||
if (!occas)
|
if (!occas)
|
||||||
@ -2322,9 +2322,10 @@ bool TDocumento_mask::clifo_handler( TMask_field& f, KEY key )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cli_for.occasionale())
|
if (cli_for.is_occasionale())
|
||||||
{
|
{
|
||||||
const TOccasionale& occas = d.occas();
|
const TOccasionale& occas = d.occas();
|
||||||
|
|
||||||
if(m.id2pos(F_OCCASEDIT) > 0 && f.to_check(key) && occas.codice().blank())
|
if(m.id2pos(F_OCCASEDIT) > 0 && f.to_check(key) && occas.codice().blank())
|
||||||
m.send_key( K_SPACE, F_OCCASEDIT ); // Lancia maschera occasionali
|
m.send_key( K_SPACE, F_OCCASEDIT ); // Lancia maschera occasionali
|
||||||
}
|
}
|
||||||
|
@ -460,7 +460,7 @@ bool TDocument_report::msg_cliente(TVariant_stack& stack)
|
|||||||
|
|
||||||
const TCli_for& cli_for = doc.clifor();
|
const TCli_for& cli_for = doc.clifor();
|
||||||
const TOccasionale& cli_occ = doc.occas();
|
const TOccasionale& cli_occ = doc.occas();
|
||||||
const bool occasionale = cli_for.occasionale();
|
const bool occasionale = cli_for.is_occasionale();
|
||||||
|
|
||||||
TString in = stack.pop().as_string(); // prende la macro o il fieldref
|
TString in = stack.pop().as_string(); // prende la macro o il fieldref
|
||||||
TString valore;
|
TString valore;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user