Solleciti via mail
git-svn-id: svn://10.65.10.50/branches/R_10_00@22854 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
930208fa9f
commit
0e28e89c9f
@ -150,4 +150,29 @@ BEGIN
|
||||
ADD RUN cg0 -1 F
|
||||
END
|
||||
|
||||
NUMBER F_NUMERO 7
|
||||
BEGIN
|
||||
PROMPT 1 4 "Registrazione "
|
||||
USE LF_PARTITE SELECT (TIPOC=#F_TIPO)&&(NREG!="")
|
||||
JOIN LF_CLIFO INTO TIPOCF=TIPOC CODCF==SOTTOCONTO
|
||||
INPUT NREG F_NUMERO
|
||||
DISPLAY "Numero" NREG
|
||||
DISPLAY "Data@10" DATAREG
|
||||
DISPLAY "Tipo" TIPOMOV
|
||||
DISPLAY "C/F" TIPOC
|
||||
DISPLAY "Gruppo" GRUPPOCL
|
||||
DISPLAY "Conto" CONTOCL
|
||||
DISPLAY "Sottonto" SOTTOCONTO
|
||||
DISPLAY "Ragione sociale@50" LF_CLIFO->RAGSOC
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_NUMERO NREG
|
||||
OUTPUT F_GRUPPO GRUPPOCL
|
||||
OUTPUT F_CONTO CONTOCL
|
||||
OUTPUT F_SOTTOCONTO SOTTOCONTO
|
||||
OUTPUT F_CLIENTE SOTTOCONTO
|
||||
OUTPUT F_FORNITORE SOTTOCONTO
|
||||
CHECKTYPE SEARCH
|
||||
END
|
||||
|
||||
|
||||
ENDMASK
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "sc1.h"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
const int n = (argc > 1) ? (atoi(&argv[1][1])) : 0;
|
||||
switch(n)
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <mask.h>
|
||||
#include <config.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.h>
|
||||
#include <recset.h>
|
||||
#include <relation.h>
|
||||
#include <reputils.h>
|
||||
@ -34,6 +35,7 @@ void TAllinea_partite::on_config_change()
|
||||
|
||||
void TAllinea_partite::allinea(int logicnum, TLog_report& log, bool& can_write)
|
||||
{
|
||||
TFast_isamfile fast(logicnum);
|
||||
TString query;
|
||||
query << "USE " << logicnum;
|
||||
TISAM_recordset recset(query);
|
||||
|
@ -183,12 +183,14 @@ void TAbbuona_partite::fill_sheet(const char tipocf, const TCurrency& imp_min, T
|
||||
row.add(scad.get(SCAD_NUMPART));
|
||||
row.add(scad.get(SCAD_NRIGA));
|
||||
const TRectype& game_rec = cache().get(LF_PARTITE, row);
|
||||
if (game_rec.empty())
|
||||
continue;
|
||||
|
||||
// Ignora partite con la valuta incompatibile
|
||||
const TString& game_val = game_rec.get(PART_CODVAL);
|
||||
if (in_valuta)
|
||||
{
|
||||
if (game_val != cod_val)
|
||||
if (!same_values(game_val, cod_val))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
@ -200,7 +202,10 @@ void TAbbuona_partite::fill_sheet(const char tipocf, const TCurrency& imp_min, T
|
||||
TPartita partita(game_rec);
|
||||
const int nriga = scad.get_int(SCAD_NRIGA);
|
||||
const int nrata = scad.get_int(SCAD_NRATA);
|
||||
TRiga_scadenze& rata = partita.riga(nriga).rata(nrata);
|
||||
if (!partita.esiste(nriga, nrata))
|
||||
continue;
|
||||
|
||||
TRiga_scadenze& rata = partita.rata(nriga, nrata);
|
||||
TImporto imp_res = rata.residuo(in_valuta);
|
||||
imp_res.normalize(tipocf == 'C' ? 'D' : 'A');
|
||||
const TCurrency residuo(imp_res.valore(), cod_val);
|
||||
|
923
sc/sc2400.cpp
923
sc/sc2400.cpp
@ -1,433 +1,490 @@
|
||||
#include "sc2.h"
|
||||
#include "sc2402.h"
|
||||
#include "sc2102.h"
|
||||
#include "sc2400a.h"
|
||||
|
||||
#include <applicat.h>
|
||||
#include <progind.h>
|
||||
#include <printer.h>
|
||||
#include <reputils.h>
|
||||
|
||||
#include <clifo.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Stampa solleciti
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TStampaSol_application: public TSkeleton_application
|
||||
{
|
||||
TString _lingua_ditta;
|
||||
TSol_mask *_msk;
|
||||
bool _gesval;
|
||||
TSol_form *_form;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
virtual void on_firm_change();
|
||||
|
||||
bool get_mail_address(TToken_string& to, TToken_string& cc) const;
|
||||
virtual bool get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
||||
TString& subj, TString& text, TToken_string& attach, short& ui) const;
|
||||
|
||||
int print_sol(); // stampa l'elemento corrente
|
||||
|
||||
public:
|
||||
TSol_mask &mask() const { return *_msk; }
|
||||
TSol_form &form() const { return *_form; }
|
||||
TCursor_sheet &sheet() { return _msk->cur_sheet(); }
|
||||
|
||||
bool print_selected(); // cicla la stampa sugli elementi selezionati
|
||||
bool mail_selected(); // manda email agli elementi selezionati
|
||||
|
||||
TStampaSol_application();
|
||||
virtual ~TStampaSol_application() {}
|
||||
};
|
||||
|
||||
bool TStampaSol_application::print_selected()
|
||||
{
|
||||
TCursor_sheet &s = sheet();
|
||||
TCursor &c = *s.cursor();
|
||||
|
||||
const char who = mask().get_who();
|
||||
const int key = mask().get_key();
|
||||
|
||||
// Attiva la stampa del saldo partita
|
||||
form().stampa_saldo(mask().stampa_saldo());
|
||||
|
||||
// filtra il cursore del form in modo che diventi uguale al cursor_sheet corrente
|
||||
// Qui sarebbe bello copiarsi l'indice dell'altro cursore
|
||||
TCursor &fc = *form().cursor();
|
||||
fc.setkey(key);
|
||||
TRectype filter(LF_CLIFO);
|
||||
filter.put(CLI_TIPOCF, who);
|
||||
fc.setregion(filter, filter);
|
||||
|
||||
const long print_all = !s.one_checked(); // se non ho selezionato nulla allora li stampo tutti
|
||||
long analfabeti = 0; // persone non stampate in quanto aventi lingua errata
|
||||
|
||||
printer().open();
|
||||
|
||||
const long items = c.items();
|
||||
for (long i=0; i < items; i++)
|
||||
{
|
||||
if (print_all || s.checked(i))
|
||||
{
|
||||
fc = i; // muove il cursore alla posizione corrente
|
||||
const int ret = print_sol();
|
||||
if (ret < 0)
|
||||
analfabeti++;
|
||||
}
|
||||
|
||||
if (printer().frozen())
|
||||
break;
|
||||
}
|
||||
printer().close();
|
||||
|
||||
if (analfabeti > 0)
|
||||
warning_box(FR("%ld clienti non sono stati stampati in quanto "
|
||||
"il codice lingua non corrispondeva al profilo di stampa"), analfabeti);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int TStampaSol_application::print_sol()
|
||||
{
|
||||
TSol_form& f = form();
|
||||
|
||||
// preparazione variabili per controllo lingua
|
||||
const TRectype &clf= f.cursor()->file().curr();
|
||||
const TString lincf(clf.get(CLI_CODLIN));
|
||||
bool ok= TRUE;
|
||||
|
||||
// controllo lingua ditta corrente
|
||||
if ((f.lingua() == _lingua_ditta && !lincf.empty()) || f.lingua() != _lingua_ditta) ok= (lincf == f.lingua());
|
||||
if (!ok) return -1; // cliente analfabeta
|
||||
|
||||
f.azzera_totali();
|
||||
// filtra solo le partite del cliente selezionato
|
||||
TLocalisamfile partite(LF_PARTITE);
|
||||
partite.zero();
|
||||
partite.put(PART_TIPOCF, clf.get(CLI_TIPOCF));
|
||||
partite.put(PART_SOTTOCONTO, clf.get(CLI_CODCF));
|
||||
const TRectype filter(partite.curr());
|
||||
|
||||
bool one_printed = FALSE; // booleano di controllo di riuscita della stampa
|
||||
const bool sel_tot_saldo = f.get_sel_tot_saldo(); // selezione sul saldo totale cliente
|
||||
const real sel_importo(f.get_sel_importo()); // importo di selezione
|
||||
const TDate data_limite_soll(f.data_limite_operazione());
|
||||
const TDate data_limite_scad(f.data_limite_scaduto());
|
||||
|
||||
if (sel_tot_saldo && sel_importo > ZERO)
|
||||
{
|
||||
real saldo;
|
||||
for (int err = partite.read(_isgteq);
|
||||
err == NOERR && partite.curr() == filter;
|
||||
err = partite.read(_isgreat))
|
||||
{
|
||||
TPartita game(partite.curr());
|
||||
saldo += game.calcola_scaduto_al(FALSE, data_limite_soll); // Era data_limite_scad!
|
||||
partite.put(PART_NRIGA, 9999);
|
||||
}
|
||||
if (saldo < sel_importo)
|
||||
return 0;
|
||||
partite.curr() = filter;
|
||||
}
|
||||
for (int err = partite.read(_isgteq);
|
||||
err == NOERR && partite.curr() == filter;
|
||||
err = partite.read(_isgreat))
|
||||
{
|
||||
TPartita game(partite.curr());
|
||||
const real saldo = game.calcola_scaduto_al(FALSE, data_limite_scad);
|
||||
|
||||
TImporto unreferenced; //Totale non assegnati per questa partita.
|
||||
{
|
||||
// E' giusto calcolare il saldo, comprendente i non assegnati.
|
||||
// se il saldo della partita chiude in avere va sommato ad unreferenced
|
||||
const TRiga_partite& sum = game.riga(game.first());
|
||||
unreferenced = game.calcola_saldo_al(game.in_valuta() && f.in_valuta(),data_limite_soll, data_limite_scad, data_limite_scad);
|
||||
if (unreferenced.valore() > ZERO && unreferenced.sezione() == 'A')
|
||||
{
|
||||
unreferenced.normalize('A'); //per i non assegnati/anticipi c'e' solo la colonna AVERE
|
||||
const TString8 valuta = sum.get(PART_CODVAL);
|
||||
form().totali().add(unreferenced,valuta);
|
||||
}
|
||||
}
|
||||
|
||||
if (sel_tot_saldo || (saldo > ZERO && saldo >= sel_importo ))
|
||||
{
|
||||
const bool printed = form().print_game(game);
|
||||
one_printed |= printed;
|
||||
}
|
||||
|
||||
partite.put(PART_NRIGA, 9999);
|
||||
|
||||
if (printer().frozen())
|
||||
break;
|
||||
}
|
||||
|
||||
if (one_printed)
|
||||
{
|
||||
f.ultima_pagina();
|
||||
printer().formfeed();
|
||||
}
|
||||
|
||||
return one_printed ? 1 : 0;
|
||||
}
|
||||
|
||||
bool TStampaSol_application::get_mail_address(TToken_string& to, TToken_string& cc) const
|
||||
{
|
||||
const TRectype& fc = form().cursor()->curr();
|
||||
const long codcf = fc.get_long(CLI_CODCF);
|
||||
TString8 clifo; clifo.format("C%06ld", codcf);
|
||||
TISAM_recordset contacts("USE MULTIREL\nFROM COD=BACON FIRST=#CLIFO\nTO COD=BACON FIRST=#CLIFO");
|
||||
contacts.set_var("#CLIFO", clifo);
|
||||
|
||||
TToken_string data;
|
||||
for (bool ok = contacts.move_first(); ok; ok = contacts.move_next())
|
||||
{
|
||||
data = contacts.get("DATA").as_string();
|
||||
FOR_EACH_TOKEN(data, tok)
|
||||
{
|
||||
const TFixed_string doc(tok);
|
||||
if (doc.starts_with("sc2400", true) || doc.starts_with("sollec", true))
|
||||
{
|
||||
const TRectype& rub = cache().get(LF_CONTACT, contacts.get("SECOND").as_int());
|
||||
TString80 mail = rub.get("MAIL");
|
||||
if (mail.blank())
|
||||
mail = rub.get("MAIL2");
|
||||
if (mail.full())
|
||||
{
|
||||
if (to.blank())
|
||||
to = mail;
|
||||
else
|
||||
cc.add(mail);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (to.blank())
|
||||
{
|
||||
TString8 key; key << "C|" << codcf;
|
||||
to = cache().get(LF_CLIFO, key, CLI_DOCMAIL);
|
||||
}
|
||||
|
||||
return to.full();
|
||||
}
|
||||
|
||||
|
||||
bool TStampaSol_application::get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
||||
TString& subj, TString& text, TToken_string& attach, short& ui) const
|
||||
{
|
||||
bool ok = TApplication::get_next_mail(to, cc, ccn, subj, text, attach, ui) && get_mail_address(to, cc);
|
||||
|
||||
if (ok)
|
||||
{
|
||||
const TRectype& clifo = form().cursor()->curr();
|
||||
const TDate oggi = mask().get(F_DATASEND);
|
||||
|
||||
subj << TR("Sollecito ") << prefix().firm().ragione_sociale();
|
||||
text << "Spett. " << clifo.get(CLI_RAGSOC) << '\n';
|
||||
text << TR("Si sollecita il rispetto delle scadenze aperte al ") << oggi << TR(" riepilogate nel file ") << attach
|
||||
<< "\n" << prefix().firm().ragione_sociale();
|
||||
if (to.full())
|
||||
ui &= ~0x1; // No user interface
|
||||
ui |= 0x2; // Query receipt
|
||||
|
||||
const long codcf = clifo.get_long(CLI_CODCF);
|
||||
TFilename pdf;
|
||||
ok = get_next_pdf(oggi.year(), -1, "SOLL", oggi.date2ansi(), codcf, pdf);
|
||||
attach = pdf;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
struct TMail_message : public TObject
|
||||
{
|
||||
TToken_string _to, _cc, _ccn;
|
||||
TString _subj, _text;
|
||||
TToken_string _attach;
|
||||
short _ui;
|
||||
};
|
||||
|
||||
bool TStampaSol_application::mail_selected()
|
||||
{
|
||||
TCursor_sheet &s = sheet();
|
||||
TCursor &c = *s.cursor();
|
||||
|
||||
const char who = mask().get_who();
|
||||
const int key = mask().get_key();
|
||||
|
||||
// Attiva la stampa del saldo partita
|
||||
form().stampa_saldo(mask().stampa_saldo());
|
||||
|
||||
// filtra il cursore del form in modo che diventi uguale al cursor_sheet corrente
|
||||
// Qui sarebbe bello copiarsi l'indice dell'altro cursore
|
||||
TCursor &fc = *form().cursor();
|
||||
fc.setkey(key);
|
||||
TRectype filter(LF_CLIFO);
|
||||
filter.put(CLI_TIPOCF, who);
|
||||
fc.setregion(filter, filter);
|
||||
|
||||
const long print_all = !s.one_checked(); // se non ho selezionato nulla allora li stampo tutti
|
||||
|
||||
TLog_report log;
|
||||
|
||||
TArray mail;
|
||||
|
||||
const long items = c.items();
|
||||
if (items > 0)
|
||||
{
|
||||
const TDate oggi(TODAY);
|
||||
TProgind pi(items);
|
||||
for (long i=0; i < items; i++)
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
if (print_all || s.checked(i))
|
||||
{
|
||||
fc = i; // muove il cursore alla posizione corrente
|
||||
|
||||
printer().set_printtype(exportprinter);
|
||||
printer().open();
|
||||
const int ret = print_sol();
|
||||
printer().close();
|
||||
|
||||
if (ret > 0)
|
||||
{
|
||||
TString msg;
|
||||
msg << fc.curr().get(CLI_RAGSOC) << ": ";
|
||||
msg.strip_double_spaces();
|
||||
|
||||
TMail_message* m = new TMail_message;
|
||||
bool done = false;
|
||||
if (get_next_mail(m->_to, m->_cc, m->_ccn, m->_subj, m->_text, m->_attach, m->_ui))
|
||||
{
|
||||
const TFilename fn = m->_attach;
|
||||
done = printer().print_pdf(printer().get_txt(), fn);
|
||||
if (done)
|
||||
{
|
||||
msg << TR("invio ") << fn.name() << TR(" a ") << m->_to;
|
||||
log.log(0, msg);
|
||||
mail.add(m);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg << TR("Impossibile genereare ") << fn;
|
||||
log.log(2, msg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msg << TR("Impossibile trovare un indirizzo e-mail valido");
|
||||
log.log(2, msg);
|
||||
}
|
||||
|
||||
if (!done)
|
||||
delete m;
|
||||
}
|
||||
}
|
||||
}
|
||||
printer().read_configuration();
|
||||
}
|
||||
|
||||
log.preview();
|
||||
|
||||
if (!mail.empty())
|
||||
{
|
||||
TArray_sheet sheet(-1, -1, 78, 20, TR("Mail"), HR("@1|Destinatario@32|Messaggio@50"), 0, 1);
|
||||
FOR_EACH_ARRAY_ITEM(mail, r, obj)
|
||||
{
|
||||
const TMail_message& m = *(TMail_message*)obj;
|
||||
TToken_string* row = new TToken_string;
|
||||
*row = "X";
|
||||
row->add(m._to);
|
||||
row->add(m._text.before('\n'));
|
||||
sheet.add(row);
|
||||
}
|
||||
if (sheet.run() == K_ENTER)
|
||||
{
|
||||
const long m = sheet.checked();
|
||||
if (m > 0 && yesno_box(FR("Confermare l'invio di %ld mail?"), m))
|
||||
{
|
||||
FOR_EACH_CHECKED_ROW(sheet, r, row)
|
||||
{
|
||||
const TMail_message& m = (const TMail_message&)mail[r];
|
||||
xvt_mail_send(m._to, m._cc, m._ccn, m._subj, m._text, m._attach, m._ui);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TStampaSol_application::create()
|
||||
{
|
||||
TApplication::create();
|
||||
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CAUSALI, LF_MOV, LF_RMOV, 0);
|
||||
open_files(LF_NDITTE, LF_ANAG, LF_COMUNI, LF_RFORM, 0);
|
||||
open_files(LF_CLIFO, LF_PARTITE, LF_SCADENZE, LF_PAGSCA ,0);
|
||||
|
||||
_msk = new TSol_mask("sc2400a");
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TStampaSol_application::destroy()
|
||||
{
|
||||
delete _msk;
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
void TStampaSol_application::on_firm_change()
|
||||
{
|
||||
mask().reset();
|
||||
mask().set(F_STAMPSALDO, "X");
|
||||
|
||||
TApplication::on_firm_change();
|
||||
TConfig c(CONFIG_DITTA, "cg");
|
||||
_lingua_ditta= c.get("CodLin");
|
||||
_gesval= c.get_bool("GesVal");
|
||||
}
|
||||
|
||||
void TStampaSol_application::main_loop()
|
||||
{
|
||||
TSol_mask& m = mask();
|
||||
for(;;)
|
||||
{
|
||||
const KEY key = m.run();
|
||||
if (key == K_QUIT)
|
||||
break;
|
||||
|
||||
const TDate dlimsol(m.get(F_DATALIMSOL));
|
||||
const TDate dsped(m.get(F_DATASEND));
|
||||
if (dlimsol >= dsped)
|
||||
{
|
||||
_form= new TSol_form(m, _gesval, F_DATALIMOP, F_DATALIMSOL);
|
||||
if (key == 'M')
|
||||
mail_selected();
|
||||
else
|
||||
print_selected();
|
||||
delete _form;
|
||||
_form= NULL;
|
||||
}
|
||||
else
|
||||
error_box(TR("La data limite sollecito deve essere specificata e non puo' essere superiore alla data di invio"));
|
||||
}
|
||||
}
|
||||
|
||||
TStampaSol_application::TStampaSol_application(): _lingua_ditta(1), _msk(NULL), _form(NULL) {}
|
||||
|
||||
int sc2400(int argc, char** argv)
|
||||
{
|
||||
TStampaSol_application app;
|
||||
app.run(argc, argv, TR("Stampa solleciti"));
|
||||
return 0;
|
||||
}
|
||||
#include "sc2.h"
|
||||
#include "sc2402.h"
|
||||
#include "sc2102.h"
|
||||
#include "sc2400a.h"
|
||||
|
||||
#include <applicat.h>
|
||||
#include <progind.h>
|
||||
#include <printer.h>
|
||||
#include <reputils.h>
|
||||
|
||||
#include <clifo.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Stampa solleciti
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TStampaSol_application: public TSkeleton_application
|
||||
{
|
||||
TString _lingua_ditta;
|
||||
TSol_mask *_msk;
|
||||
bool _gesval;
|
||||
TSol_form *_form;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
virtual void on_firm_change();
|
||||
|
||||
bool get_mail_address(TToken_string& to, TToken_string& cc) const;
|
||||
virtual bool get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
||||
TString& subj, TString& text, TToken_string& attach, short& ui) const;
|
||||
|
||||
const TString& game_key(const TRectype& part) const; // Costruisce chiave univoca per TAssoc_array partite
|
||||
bool ci_sono_scadenze_aperte(const TPartita& game, const TDate& dal, const TDate& al) const;
|
||||
int print_sol(); // stampa l'elemento corrente
|
||||
|
||||
public:
|
||||
TSol_mask &mask() const { return *_msk; }
|
||||
TSol_form &form() const { return *_form; }
|
||||
TCursor_sheet &sheet() { return _msk->cur_sheet(); }
|
||||
|
||||
bool print_selected(); // cicla la stampa sugli elementi selezionati
|
||||
bool mail_selected(); // manda email agli elementi selezionati
|
||||
|
||||
TStampaSol_application();
|
||||
virtual ~TStampaSol_application() {}
|
||||
};
|
||||
|
||||
bool TStampaSol_application::print_selected()
|
||||
{
|
||||
TCursor_sheet &s = sheet();
|
||||
TCursor &c = *s.cursor();
|
||||
|
||||
const char who = mask().get_who();
|
||||
const int key = mask().get_key();
|
||||
|
||||
// Attiva la stampa del saldo partita
|
||||
form().stampa_saldo(mask().stampa_saldo());
|
||||
|
||||
// filtra il cursore del form in modo che diventi uguale al cursor_sheet corrente
|
||||
// Qui sarebbe bello copiarsi l'indice dell'altro cursore
|
||||
TCursor &fc = *form().cursor();
|
||||
fc.setkey(key);
|
||||
TRectype filter(LF_CLIFO);
|
||||
filter.put(CLI_TIPOCF, who);
|
||||
fc.setregion(filter, filter);
|
||||
|
||||
const long print_all = !s.one_checked(); // se non ho selezionato nulla allora li stampo tutti
|
||||
long analfabeti = 0; // persone non stampate in quanto aventi lingua errata
|
||||
|
||||
printer().open();
|
||||
|
||||
const long items = c.items();
|
||||
for (long i=0; i < items; i++)
|
||||
{
|
||||
if (print_all || s.checked(i))
|
||||
{
|
||||
fc = i; // muove il cursore alla posizione corrente
|
||||
const int ret = print_sol();
|
||||
if (ret < 0)
|
||||
analfabeti++;
|
||||
}
|
||||
|
||||
if (printer().frozen())
|
||||
break;
|
||||
}
|
||||
printer().close();
|
||||
|
||||
if (analfabeti > 0)
|
||||
warning_box(FR("%ld clienti non sono stati stampati in quanto "
|
||||
"il codice lingua non corrispondeva al profilo di stampa"), analfabeti);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TStampaSol_application::ci_sono_scadenze_aperte(const TPartita& game, const TDate& dal, const TDate& al) const
|
||||
{
|
||||
bool found = false;
|
||||
const int ultima = game.last();
|
||||
if (ultima > 0 && !game.chiusa(true))
|
||||
{
|
||||
for (int r = ultima; r > 0; r = game.pred(r))
|
||||
{
|
||||
const TRiga_partite& row = game.riga(r);
|
||||
if (row.is_fattura() && row.get_date(PART_DATAREG) <= al)
|
||||
{
|
||||
for (int s = row.rate(); s > 0 ;s--)
|
||||
{
|
||||
const TRiga_scadenze& rata = row.rata(s);
|
||||
if (!rata.chiusa(true))
|
||||
{
|
||||
const TDate data = rata.get(SCAD_DATASCAD);
|
||||
if (data >= dal && data <= al)
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
const TString& TStampaSol_application::game_key(const TRectype& part) const
|
||||
{
|
||||
TToken_string& tok = get_tmp_string();
|
||||
tok = part.get(PART_ANNO);
|
||||
tok.add(part.get(PART_NUMPART));
|
||||
return tok;
|
||||
}
|
||||
|
||||
int TStampaSol_application::print_sol()
|
||||
{
|
||||
TSol_form& f = form();
|
||||
|
||||
// preparazione variabili per controllo lingua
|
||||
const TRectype &clf= f.cursor()->file().curr();
|
||||
const TString lincf(clf.get(CLI_CODLIN));
|
||||
bool ok = true;
|
||||
|
||||
// controllo lingua ditta corrente
|
||||
if ((f.lingua() == _lingua_ditta && !lincf.empty()) || f.lingua() != _lingua_ditta) ok= (lincf == f.lingua());
|
||||
if (!ok) return -1; // cliente analfabeta
|
||||
|
||||
f.azzera_totali();
|
||||
// filtra solo le partite del cliente selezionato
|
||||
TLocalisamfile partite(LF_PARTITE);
|
||||
partite.zero();
|
||||
partite.put(PART_TIPOCF, clf.get(CLI_TIPOCF));
|
||||
partite.put(PART_SOTTOCONTO, clf.get(CLI_CODCF));
|
||||
const TRectype filter(partite.curr());
|
||||
|
||||
bool one_printed = false; // booleano di controllo di riuscita della stampa
|
||||
const bool sel_tot_saldo = f.get_sel_tot_saldo(); // selezione sul saldo totale cliente
|
||||
const real sel_importo(f.get_sel_importo()); // importo di selezione
|
||||
const TDate data_inizio_soll = _msk->get(F_DATAINISCAD);
|
||||
const TDate data_limite_soll = f.data_limite_operazione();
|
||||
const TDate data_limite_scaduto = f.data_limite_scaduto();
|
||||
|
||||
TAssoc_array games_in_range;
|
||||
|
||||
if ((sel_tot_saldo && sel_importo > ZERO) || data_inizio_soll.ok())
|
||||
{
|
||||
real saldo;
|
||||
for (int err = partite.read(_isgteq);
|
||||
err == NOERR && partite.curr() == filter;
|
||||
err = partite.read(_isgreat))
|
||||
{
|
||||
const TPartita game(partite.curr());
|
||||
const real sld = game.calcola_scaduto_al(false, data_limite_soll);
|
||||
|
||||
if (sld > ZERO && data_inizio_soll.ok() &&
|
||||
ci_sono_scadenze_aperte(game, data_inizio_soll, data_limite_soll))
|
||||
games_in_range.add(game_key(partite.curr()));
|
||||
|
||||
saldo += sld;
|
||||
partite.put(PART_NRIGA, 9999);
|
||||
}
|
||||
|
||||
if (sel_tot_saldo && sel_importo > ZERO && saldo < sel_importo)
|
||||
return 0;
|
||||
if (data_inizio_soll.ok() && games_in_range.empty())
|
||||
return 0;
|
||||
|
||||
partite.curr() = filter;
|
||||
}
|
||||
for (int err = partite.read(_isgteq);
|
||||
err == NOERR && partite.curr() == filter;
|
||||
err = partite.read(_isgreat))
|
||||
{
|
||||
if (data_inizio_soll.ok() && !games_in_range.is_key(game_key(partite.curr())))
|
||||
continue; // Scarta parite fuori range di date
|
||||
|
||||
const TPartita game(partite.curr());
|
||||
const real saldo = game.calcola_scaduto_al(false, data_limite_scaduto);
|
||||
|
||||
TImporto unreferenced; //Totale non assegnati per questa partita.
|
||||
{
|
||||
// E' giusto calcolare il saldo, comprendente i non assegnati.
|
||||
// se il saldo della partita chiude in avere va sommato ad unreferenced
|
||||
const TRiga_partite& sum = game.riga(game.first());
|
||||
unreferenced = game.calcola_saldo_al(game.in_valuta() && f.in_valuta(),data_limite_soll, data_limite_scaduto, data_limite_scaduto);
|
||||
if (unreferenced.valore() > ZERO && unreferenced.sezione() == 'A')
|
||||
{
|
||||
unreferenced.normalize('A'); //per i non assegnati/anticipi c'e' solo la colonna AVERE
|
||||
const TString8 valuta = sum.get(PART_CODVAL);
|
||||
form().totali().add(unreferenced,valuta);
|
||||
}
|
||||
}
|
||||
|
||||
if (sel_tot_saldo || (saldo > ZERO && saldo >= sel_importo ))
|
||||
{
|
||||
const bool printed = form().print_game(game);
|
||||
one_printed |= printed;
|
||||
}
|
||||
|
||||
partite.put(PART_NRIGA, 9999);
|
||||
|
||||
if (printer().frozen())
|
||||
break;
|
||||
}
|
||||
|
||||
if (one_printed)
|
||||
{
|
||||
f.ultima_pagina();
|
||||
printer().formfeed();
|
||||
}
|
||||
|
||||
return one_printed ? 1 : 0;
|
||||
}
|
||||
|
||||
bool TStampaSol_application::get_mail_address(TToken_string& to, TToken_string& cc) const
|
||||
{
|
||||
const TRectype& fc = form().cursor()->curr();
|
||||
const long codcf = fc.get_long(CLI_CODCF);
|
||||
TString8 clifo; clifo.format("C%06ld", codcf);
|
||||
TISAM_recordset contacts("USE MULTIREL\nFROM COD=BACON FIRST=#CLIFO\nTO COD=BACON FIRST=#CLIFO");
|
||||
contacts.set_var("#CLIFO", clifo);
|
||||
|
||||
TToken_string data;
|
||||
for (bool ok = contacts.move_first(); ok; ok = contacts.move_next())
|
||||
{
|
||||
data = contacts.get("DATA").as_string();
|
||||
FOR_EACH_TOKEN(data, tok)
|
||||
{
|
||||
const TFixed_string doc(tok);
|
||||
if (doc.starts_with("sc2400", true) || doc.starts_with("sollec", true))
|
||||
{
|
||||
const TRectype& rub = cache().get(LF_CONTACT, contacts.get("SECOND").as_int());
|
||||
TString80 mail = rub.get("MAIL");
|
||||
if (mail.blank())
|
||||
mail = rub.get("MAIL2");
|
||||
if (mail.full())
|
||||
{
|
||||
if (to.blank())
|
||||
to = mail;
|
||||
else
|
||||
cc.add(mail);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (to.blank())
|
||||
{
|
||||
TString8 key; key << "C|" << codcf;
|
||||
to = cache().get(LF_CLIFO, key, CLI_DOCMAIL);
|
||||
}
|
||||
|
||||
return to.full();
|
||||
}
|
||||
|
||||
|
||||
bool TStampaSol_application::get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
||||
TString& subj, TString& text, TToken_string& attach, short& ui) const
|
||||
{
|
||||
bool ok = TApplication::get_next_mail(to, cc, ccn, subj, text, attach, ui) && get_mail_address(to, cc);
|
||||
|
||||
if (ok)
|
||||
{
|
||||
const TRectype& clifo = form().cursor()->curr();
|
||||
TDate oggi = mask().get(F_DATALIMSOL);
|
||||
if (!oggi.ok())
|
||||
oggi = mask().get_date(F_DATASEND);
|
||||
|
||||
subj << TR("Sollecito ") << prefix().firm().ragione_sociale();
|
||||
TString ragsoc = clifo.get(CLI_RAGSOC); ragsoc.strip_double_spaces();
|
||||
text << "Spett. " << ragsoc << '\n';
|
||||
text << TR("Si sollecita il rispetto delle scadenze aperte al ") << oggi << TR(" riepilogate nel file ") << attach
|
||||
<< "\n" << prefix().firm().ragione_sociale();
|
||||
if (to.full())
|
||||
ui &= ~0x1; // No user interface
|
||||
ui |= 0x2; // Query receipt
|
||||
|
||||
const long codcf = clifo.get_long(CLI_CODCF);
|
||||
TFilename pdf;
|
||||
ok = get_next_pdf(oggi.year(), -1, "SOLL", oggi.date2ansi(), codcf, pdf);
|
||||
attach = pdf;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
struct TMail_message : public TObject
|
||||
{
|
||||
TToken_string _to, _cc, _ccn;
|
||||
TString _subj, _text;
|
||||
TToken_string _attach;
|
||||
short _ui;
|
||||
};
|
||||
|
||||
bool TStampaSol_application::mail_selected()
|
||||
{
|
||||
TCursor_sheet &s = sheet();
|
||||
TCursor &c = *s.cursor();
|
||||
|
||||
const char who = mask().get_who();
|
||||
const int key = mask().get_key();
|
||||
|
||||
// Attiva la stampa del saldo partita
|
||||
form().stampa_saldo(mask().stampa_saldo());
|
||||
|
||||
// filtra il cursore del form in modo che diventi uguale al cursor_sheet corrente
|
||||
// Qui sarebbe bello copiarsi l'indice dell'altro cursore
|
||||
TCursor &fc = *form().cursor();
|
||||
fc.setkey(key);
|
||||
TRectype filter(LF_CLIFO);
|
||||
filter.put(CLI_TIPOCF, who);
|
||||
fc.setregion(filter, filter);
|
||||
|
||||
const long print_all = !s.one_checked(); // se non ho selezionato nulla allora li stampo tutti
|
||||
|
||||
TLog_report log;
|
||||
|
||||
TArray mail;
|
||||
|
||||
const long items = c.items();
|
||||
if (items > 0)
|
||||
{
|
||||
const TDate oggi(TODAY);
|
||||
TProgind pi(items);
|
||||
for (long i=0; i < items; i++)
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
if (print_all || s.checked(i))
|
||||
{
|
||||
fc = i; // muove il cursore alla posizione corrente
|
||||
|
||||
printer().set_export_file("soll.pdf", true);
|
||||
printer().open();
|
||||
const int ret = print_sol();
|
||||
printer().close();
|
||||
|
||||
if (ret > 0)
|
||||
{
|
||||
TString msg;
|
||||
msg << fc.curr().get(CLI_RAGSOC) << ": ";
|
||||
msg.strip_double_spaces();
|
||||
|
||||
TMail_message* m = new TMail_message;
|
||||
bool done = false;
|
||||
if (get_next_mail(m->_to, m->_cc, m->_ccn, m->_subj, m->_text, m->_attach, m->_ui))
|
||||
{
|
||||
const TFilename fn = m->_attach;
|
||||
done = printer().print_pdf(printer().get_txt(), fn);
|
||||
if (done)
|
||||
{
|
||||
msg << TR("invio ") << fn.name() << TR(" a ") << m->_to;
|
||||
log.log(0, msg);
|
||||
mail.add(m);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg << TR("Impossibile genereare ") << fn;
|
||||
log.log(2, msg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msg << TR("Impossibile trovare un indirizzo e-mail valido");
|
||||
log.log(2, msg);
|
||||
}
|
||||
|
||||
if (!done)
|
||||
delete m;
|
||||
}
|
||||
}
|
||||
}
|
||||
printer().read_configuration();
|
||||
}
|
||||
|
||||
log.preview();
|
||||
|
||||
if (!mail.empty())
|
||||
{
|
||||
TArray_sheet sheet(-1, -1, 78, 20, TR("Mail"), HR("@1|Destinatario@32|Messaggio@50"), 0, 1);
|
||||
FOR_EACH_ARRAY_ITEM(mail, r, obj)
|
||||
{
|
||||
const TMail_message& m = *(TMail_message*)obj;
|
||||
TToken_string* row = new TToken_string;
|
||||
*row = "X";
|
||||
row->add(m._to);
|
||||
row->add(m._text.before('\n'));
|
||||
sheet.add(row);
|
||||
}
|
||||
if (sheet.run() == K_ENTER)
|
||||
{
|
||||
const long m = sheet.checked();
|
||||
if (m > 0 && yesno_box(FR("Confermare l'invio di %ld mail?"), m))
|
||||
{
|
||||
FOR_EACH_CHECKED_ROW(sheet, r, row)
|
||||
{
|
||||
const TMail_message& m = (const TMail_message&)mail[r];
|
||||
xvt_mail_send(m._to, m._cc, m._ccn, m._subj, m._text, m._attach, m._ui);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TStampaSol_application::create()
|
||||
{
|
||||
TApplication::create();
|
||||
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CAUSALI, LF_MOV, LF_RMOV, 0);
|
||||
open_files(LF_NDITTE, LF_ANAG, LF_COMUNI, LF_RFORM, 0);
|
||||
open_files(LF_CLIFO, LF_PARTITE, LF_SCADENZE, LF_PAGSCA ,0);
|
||||
|
||||
_msk = new TSol_mask("sc2400a");
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TStampaSol_application::destroy()
|
||||
{
|
||||
delete _msk;
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
void TStampaSol_application::on_firm_change()
|
||||
{
|
||||
mask().reset();
|
||||
mask().set(F_STAMPSALDO, "X");
|
||||
|
||||
TApplication::on_firm_change();
|
||||
TConfig c(CONFIG_DITTA, "cg");
|
||||
_lingua_ditta= c.get("CodLin");
|
||||
_gesval= c.get_bool("GesVal");
|
||||
}
|
||||
|
||||
void TStampaSol_application::main_loop()
|
||||
{
|
||||
TSol_mask& m = mask();
|
||||
for(;;)
|
||||
{
|
||||
const KEY key = m.run();
|
||||
if (key == K_QUIT)
|
||||
break;
|
||||
|
||||
const TDate dlimsol(m.get(F_DATALIMSOL));
|
||||
const TDate dsped(m.get(F_DATASEND));
|
||||
if (dlimsol >= dsped)
|
||||
{
|
||||
_form= new TSol_form(m, _gesval, F_DATALIMOP, F_DATALIMSOL);
|
||||
if (key == 'M')
|
||||
mail_selected();
|
||||
else
|
||||
print_selected();
|
||||
delete _form;
|
||||
_form= NULL;
|
||||
}
|
||||
else
|
||||
error_box(TR("La data limite sollecito deve essere specificata e non puo' essere superiore alla data di invio"));
|
||||
}
|
||||
}
|
||||
|
||||
TStampaSol_application::TStampaSol_application(): _lingua_ditta(1), _msk(NULL), _form(NULL) {}
|
||||
|
||||
int sc2400(int argc, char** argv)
|
||||
{
|
||||
TStampaSol_application app;
|
||||
app.run(argc, argv, TR("Stampa solleciti"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -5,9 +5,10 @@
|
||||
#include "sc2100a.h"
|
||||
#endif
|
||||
|
||||
#define F_DATALIMSOL 106
|
||||
#define F_STAMPESP 107
|
||||
#define F_IMPORMIN 108
|
||||
#define F_RIFIMPMIN 109
|
||||
#define F_DATAINISCAD 130
|
||||
#define F_DATALIMSOL 131
|
||||
#define F_STAMPESP 132
|
||||
#define F_IMPORMIN 133
|
||||
#define F_RIFIMPMIN 134
|
||||
|
||||
#endif
|
||||
|
@ -97,16 +97,20 @@ BEGIN
|
||||
PROMPT 2 4 "Data limite operazione "
|
||||
END
|
||||
|
||||
|
||||
DATE F_DATALIMSOL
|
||||
BEGIN
|
||||
PROMPT 2 5 "Data limite sollecito "
|
||||
PROMPT 2 5 "Data limite solleciti "
|
||||
FLAGS "A"
|
||||
// VALIDATE DATE_CMP_FUNC <= F_DATASEND
|
||||
// WARNING "La data limite sollecito deve essere specificata e non puo' essere superiore alla data di invio"
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
DATE F_DATAINISCAD
|
||||
BEGIN
|
||||
PROMPT 42 5 "Dal "
|
||||
VALIDATE DATE_CMP_FUNC <= F_DATALIMSOL
|
||||
WARNING "Inserire una data precedente a quella limite"
|
||||
END
|
||||
|
||||
CURRENCY F_IMPORMIN 18
|
||||
BEGIN
|
||||
PROMPT 2 6 "Importo minimo "
|
||||
|
@ -230,8 +230,8 @@ void TESSL_row::print_on(TPrint_section& body)
|
||||
dare.set("");
|
||||
}
|
||||
|
||||
TForm_item& importo_in_lire = body.find_field(PEC_IMPEURO);
|
||||
set_imp(importo_in_lire, _importo_lire, ""); // In generale va espresso nella valuta della ditta
|
||||
TForm_item& importo_in_euro = body.find_field(PEC_IMPEURO);
|
||||
set_imp(importo_in_euro, _importo_euro, ""); // In generale va espresso nella valuta della ditta
|
||||
|
||||
TForm_item& scaduto = body.find_field(PEC_SCADUTO);
|
||||
set_imp(scaduto, _scaduto, cod_valuta);
|
||||
@ -429,7 +429,7 @@ void TESSL_array::add_row(const TRiga_partite& row)
|
||||
real importo_in_lire;
|
||||
const char sezione = form().sezione_normale();
|
||||
|
||||
const TDate data_op(row.get(PART_DATAREG));
|
||||
const TDate data_op = row.get(PART_DATAREG);
|
||||
if (data_op <= form().data_limite_operazione())
|
||||
{
|
||||
if (row.is_fattura())
|
||||
@ -437,14 +437,13 @@ void TESSL_array::add_row(const TRiga_partite& row)
|
||||
for (int r = 1; r <= row.rate(); r++)
|
||||
{
|
||||
const TRiga_scadenze& rata = row.rata(r);
|
||||
const TDate data_scad(rata.get(SCAD_DATASCAD));
|
||||
const TDate data_scad = rata.get(SCAD_DATASCAD);
|
||||
TESSL_row& rec = new_row(row, data_scad, rata.importo(in_valuta), r);
|
||||
|
||||
if (in_valuta)
|
||||
{
|
||||
TImporto il(rata.importo(FALSE));
|
||||
TImporto il(rata.importo(false));
|
||||
il.normalize(sezione);
|
||||
rec.importo_in_lire(il.valore());
|
||||
rec.importo_in_euro(il.valore());
|
||||
}
|
||||
if (data_scad <= form().data_limite_scaduto())
|
||||
{
|
||||
@ -462,7 +461,7 @@ void TESSL_array::add_row(const TRiga_partite& row)
|
||||
{
|
||||
TImporto i(row.importo(FALSE, 0x1));
|
||||
i.normalize(sezione);
|
||||
riga.importo_in_lire(i.valore());
|
||||
riga.importo_in_euro(i.valore());
|
||||
}
|
||||
|
||||
const int tipo_pag = row.get_int(PART_TIPOPAG);
|
||||
@ -496,7 +495,7 @@ void TESSL_array::add_row(const TRiga_partite& row)
|
||||
if (in_valuta)
|
||||
{
|
||||
ritenute.normalize(sezione);
|
||||
r.importo_in_lire(ritenute.valore());
|
||||
r.importo_in_euro(ritenute.valore());
|
||||
}
|
||||
else
|
||||
r.importo(ritenute);
|
||||
@ -511,7 +510,7 @@ void TESSL_array::add_row(const TRiga_partite& row)
|
||||
{
|
||||
TImporto il(row.importo(FALSE, 0x2));
|
||||
il.normalize(sezione == 'D' ? 'A' : 'D');
|
||||
r.importo_in_lire(il.valore());
|
||||
r.importo_in_euro(il.valore());
|
||||
}
|
||||
}
|
||||
|
||||
@ -670,7 +669,7 @@ void TESSL_form::stampa_riporti(TPrinter& pr)
|
||||
TESSL_row rip(desc, t.importo().normalize(),val);
|
||||
rip.scaduto(t.scaduto());
|
||||
rip.esposto(t.esposto());
|
||||
rip.importo_in_lire(t.importo_euro());
|
||||
rip.importo_in_euro(t.importo_euro());
|
||||
rip.print_on(body);
|
||||
pr.setfooterline(j + 1, body.row(0));
|
||||
}
|
||||
@ -932,7 +931,7 @@ bool TESSL_form::print_game(const TPartita& game)
|
||||
TPrint_section& body = section('B');
|
||||
|
||||
TImporto saldo;
|
||||
real scaduto, esposto, implire;
|
||||
real scaduto, esposto, impeuro;
|
||||
|
||||
// Stampa le righe di partita
|
||||
|
||||
@ -964,12 +963,12 @@ bool TESSL_form::print_game(const TPartita& game)
|
||||
pr.print(body.row(0));
|
||||
|
||||
totali().add(riga.importo(), riga.scaduto(), riga.esposto(),
|
||||
riga.importo_in_lire(), riga.valuta().codice());
|
||||
riga.importo_in_euro(), riga.valuta().codice());
|
||||
|
||||
saldo += riga.importo();
|
||||
scaduto += riga.scaduto();
|
||||
esposto += riga.esposto();
|
||||
implire += riga.importo_in_lire();
|
||||
impeuro += riga.importo_in_euro();
|
||||
ok = TRUE;
|
||||
}
|
||||
|
||||
@ -990,7 +989,7 @@ bool TESSL_form::print_game(const TPartita& game)
|
||||
|
||||
sld.scaduto(scaduto);
|
||||
sld.esposto(esposto);
|
||||
sld.importo_in_lire(implire);
|
||||
sld.importo_in_euro(impeuro);
|
||||
sld.print_on(body);
|
||||
pr.print(body.row(0));
|
||||
}
|
||||
@ -1051,10 +1050,10 @@ TESSL_form::TESSL_form(const TESSL_mask& m, bool gesval, short id_datalim, short
|
||||
TCursor_sheet& cs = m.cur_sheet();
|
||||
_cursore = cs.cursor();
|
||||
|
||||
_dlo = id_datalim > 0 ? TDate(m.get(id_datalim)) : eotime;
|
||||
_dlo = id_datalim > 0 ? m.get_date(id_datalim) : eotime;
|
||||
if (!_dlo.ok())
|
||||
_dlo = eotime;
|
||||
_dls = id_datascad > 0 ? TDate(m.get(id_datascad)) : eotime;
|
||||
_dls = id_datascad > 0 ? m.get_date(id_datascad) : eotime;
|
||||
if (id_giorni_rischio > 0)
|
||||
_giorni_rischio = m.get_int(id_giorni_rischio);
|
||||
|
||||
|
15
sc/sc2401.h
15
sc/sc2401.h
@ -57,12 +57,12 @@ public:
|
||||
};
|
||||
|
||||
class TESSL_form;
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TESSL_row
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TESSL_row : public TSortable
|
||||
|
||||
{
|
||||
TDate _data; // Data scadenza o pagamento
|
||||
int _riga; // Riga della fattura
|
||||
@ -76,7 +76,7 @@ class TESSL_row : public TSortable
|
||||
long _num_prot; // Protocollo IVA
|
||||
long _num_reg; // Numero registrazione
|
||||
TImporto _importo; // Importo in valuta
|
||||
real _importo_lire; // Importo in lire
|
||||
real _importo_euro; // Importo in euro
|
||||
real _scaduto; // Importo scaduto
|
||||
real _esposto; // Importo esposto
|
||||
bool _salvo_buon_fine; // Importo esposto salvo buon fine
|
||||
@ -98,7 +98,7 @@ public:
|
||||
void importo(const TImporto& i) { _importo = i; }
|
||||
void scaduto(const real& s) { _scaduto = s; }
|
||||
void esposto(const real& e) { _esposto = e; }
|
||||
void importo_in_lire(const real& il) { _importo_lire = il; }
|
||||
void importo_in_euro(const real& imp) { _importo_euro = imp; }
|
||||
void salvo_buon_fine(bool sbf) { _salvo_buon_fine = sbf; }
|
||||
|
||||
const TString& causale() const { return _causale; }
|
||||
@ -106,9 +106,9 @@ public:
|
||||
long num_reg() const { return _num_reg; }
|
||||
const TValuta& valuta() const { return _valuta; }
|
||||
const TImporto& importo() const { return _importo; }
|
||||
real importo_in_lire() const { return _importo_lire; }
|
||||
real scaduto() const { return _scaduto; }
|
||||
real esposto() const { return _esposto; }
|
||||
const real& importo_in_euro() const { return _importo_euro; }
|
||||
const real& scaduto() const { return _scaduto; }
|
||||
const real& esposto() const { return _esposto; }
|
||||
const TDate& data() const { return _data; }
|
||||
bool in_valuta() const { return _valuta.in_valuta(); }
|
||||
|
||||
@ -134,7 +134,6 @@ class TESSL_form : public TForm
|
||||
TCursor* _cursore;
|
||||
TTotalizer _totali;
|
||||
|
||||
|
||||
TString _lingua;
|
||||
TDate _dlo, _dls, _dir;
|
||||
|
||||
@ -193,7 +192,7 @@ public:
|
||||
void ultima_pagina();
|
||||
virtual bool print_game(const TPartita& game);
|
||||
|
||||
TESSL_form(const TESSL_mask& m, bool gesval, short id_datalim = 0 , short id_datascad = 0, short id_giorni_rischio = 0);
|
||||
TESSL_form(const TESSL_mask& m, bool gesval, short id_datalim = 0 , short id_datascad = 0, short id_giorni_rischio = 0);
|
||||
virtual ~TESSL_form();
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@ TSol_row::TSol_row(const char* desc, const TImporto& imp, const TValuta& val)
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
TSol_form::TSol_form(const TSol_mask& m, bool gesval, short id_datalim, short id_datascad)
|
||||
:TESSL_form(m, gesval, id_datalim, id_datascad)
|
||||
: TESSL_form(m, gesval, id_datalim, id_datascad)
|
||||
{
|
||||
_sel_tot_saldo = m.get_sel_tot_saldo();
|
||||
_sel_importo = m.get_sel_importo();
|
||||
|
@ -44,8 +44,7 @@ protected:
|
||||
public:
|
||||
bool get_sel_tot_saldo() const { return _sel_tot_saldo;}
|
||||
const real & get_sel_importo() const { return _sel_importo; }
|
||||
TSol_form(const TSol_mask& m, bool gesval, short id_datalim, short id_datascad);
|
||||
virtual ~TSol_form() {}
|
||||
TSol_form(const TSol_mask& m, bool gesval, short id_datalim, short id_datascad);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user