Patch level : 12.0 344
Files correlati : ve6.exe, li Commento : Inizio implementazione controllo per verificare il plafond di un cliente. Manca il controllo sull'abilitazione del modulo li e bisogna ancora testare tutto git-svn-id: svn://10.65.10.50/branches/R_10_00@23597 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9368c12123
commit
6c601908d5
@ -1,8 +1,10 @@
|
||||
//#include <recset.h>
|
||||
#include <reputils.h>
|
||||
|
||||
#include "velib04.h"
|
||||
#include "ve6200.h"
|
||||
#include "ve6200a.h"
|
||||
#include "../li/lilib01.cpp"
|
||||
|
||||
#include <doc.h>
|
||||
|
||||
@ -361,6 +363,80 @@ void TFatturazione_bolle_app::process_by_fatt(const TMask& m)
|
||||
delete e;
|
||||
}
|
||||
|
||||
// Effettuo un test per i clienti che hanno un plafond attivo, se trovo delle bolle che fuoriescono chiedo se continuare
|
||||
bool TFatturazione_bolle_app::test_dicint(const TMask& m)
|
||||
{
|
||||
TProgress_monitor iw(0, "Inizializzazione...\n ");
|
||||
|
||||
const TDate data_elab = m.get_date(F_DATA_ELAB);
|
||||
const int anno = data_elab.year();
|
||||
|
||||
const long dc = m.get_long(F_CODICE_CLIFO_DA);
|
||||
const long ac = m.get_long(F_CODICE_CLIFO_A);
|
||||
const int da = m.get_int(F_CODICE_AGENTE_DA);
|
||||
const int aa = m.get_int(F_CODICE_AGENTE_A);
|
||||
const TString16 dz(m.get(F_CODICE_ZONA_DA));
|
||||
const TString16 az(m.get(F_CODICE_ZONA_A));
|
||||
|
||||
const TDate dd = m.get_date(F_DATA_DOCUMENTO_DA);
|
||||
TString st_da = m.get(F_DATA_DOCUMENTO_A); // qui verificare
|
||||
const TDate ad = st_da.not_empty() ? (TDate)(const char*)st_da : data_elab;
|
||||
const TString& codnum = m.get(F_CODICE_NUMERAZIONE);
|
||||
const long dn = m.get_long(F_NUMERO_DOCUMENTO_DA);
|
||||
const long an = m.get_long(F_NUMERO_DOCUMENTO_A);
|
||||
|
||||
TElaborazione& eld = *elab(m.get(F_CODICE_ELAB));
|
||||
TToken_string tipidoc(24), statidoc(10);
|
||||
eld.tipi_stati_iniziali(tipidoc, statidoc);
|
||||
|
||||
TTipo_documento t(eld.tipo_iniziale(0));
|
||||
char tipocf(t.tipocf());
|
||||
TLista_cf clienti(tipocf);
|
||||
|
||||
const int tot_cli = clienti.leggi_doc(eld, dd, ad, dc, ac, da, aa, dz, az);
|
||||
|
||||
TString msg(80);
|
||||
iw.set_max(tot_cli);
|
||||
|
||||
TLog_report lerr(TR("Errori controllo plafond"));
|
||||
bool err = false;
|
||||
|
||||
for (int c = 0; c < tot_cli; c++)
|
||||
{
|
||||
const long codcli = clienti[c]; // Codice cliente in esame
|
||||
|
||||
TLi_manager currentCli(tipocf, codcli, dd.year()); // Inizializzo l'oggetto per la gestione del plafond
|
||||
|
||||
if(currentCli.hasValidPlafond())
|
||||
{
|
||||
TLista_documenti din; // Legge tutti i documenti di input
|
||||
din.read('D', tipocf, codcli, anno, tipidoc, statidoc, dd, ad, codnum, dn, an);
|
||||
if (din.items() > 0)
|
||||
{
|
||||
if (m.get(F_ORDINAMENTO) == "Z")
|
||||
din.sort(DOC_ZONA"|"DOC_DATADOC"|"DOC_NDOC);
|
||||
|
||||
// Elaboro i documenti
|
||||
TLista_documenti dout;
|
||||
if (eld.elabora(din, dout, data_elab))
|
||||
{
|
||||
err = currentCli.testPlafond(dout, lerr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!iw.add_status())
|
||||
break;
|
||||
}
|
||||
delete &eld;
|
||||
if(err)
|
||||
{
|
||||
lerr.print_or_preview();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TFatturazione_bolle_app::clifo_da_fatt(const TMask& m) const
|
||||
{
|
||||
TElaborazione* e = elab(m.get(F_CODICE_ELAB));
|
||||
@ -372,14 +448,19 @@ bool TFatturazione_bolle_app::clifo_da_fatt(const TMask& m) const
|
||||
|
||||
return yes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TFatturazione_bolle_app::main_loop()
|
||||
{
|
||||
TMask m("ve6200a");
|
||||
m.set(F_SELEZIONE, _default_selection);
|
||||
|
||||
while (m.run() == K_ENTER)
|
||||
{
|
||||
{
|
||||
if(ini_get_bool(CONFIG_DITTA, "ve", "USELETTERE") && !test_dicint(m)) // Controllo se ho documenti al di fuori del plafond
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const TString& select_from = m.get(F_SELEZIONE);
|
||||
if (select_from != _default_selection)
|
||||
ini_set_string(CONFIG_DITTA, "ve", "FATBOLSEL", _default_selection = select_from);
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
void process_by_ragsoc(const TMask& m);
|
||||
void process_by_doc(const TMask& m);
|
||||
void process_by_fatt(const TMask& m);
|
||||
bool test_dicint(const TMask& m); // Effettua un test per la dichiarazione d'intenti
|
||||
};
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user