37b49c465c
Files correlati : cg0.exe cg1.exe cg1310.msk cgmenu.men Ricompilazione Demo : [ ] Commento : Permessa duplicazione codice fiscale di enti pubblici in anagrafica clifo Aggiunto programma per allineamento IBAN su CFBAN git-svn-id: svn://10.65.10.50/branches/R_10_00@22452 c028cbd2-c16b-5b4b-a496-9718f37d4682
112 lines
2.4 KiB
C++
Executable File
112 lines
2.4 KiB
C++
Executable File
//**************************************************
|
|
//* Aggiornamento Flag Operazioni Intracomunitarie *
|
|
//**************************************************
|
|
|
|
#include <applicat.h>
|
|
#include <mask.h>
|
|
#include <progind.h>
|
|
#include <relation.h>
|
|
#include <urldefid.h>
|
|
|
|
#include <mov.h>
|
|
#include <rmoviva.h>
|
|
#include <causali.h>
|
|
|
|
|
|
class TAgg_opintra : public TApplication
|
|
{
|
|
TLocalisamfile* _causali;
|
|
|
|
public:
|
|
virtual bool create();
|
|
virtual bool destroy();
|
|
virtual bool menu(MENU_TAG m);
|
|
|
|
void look_mov();
|
|
|
|
TAgg_opintra() {};
|
|
virtual ~TAgg_opintra() {};
|
|
};
|
|
|
|
bool TAgg_opintra::create()
|
|
{
|
|
const bool ok = TApplication::create();
|
|
if (ok)
|
|
{
|
|
_causali = new TLocalisamfile(LF_ATTIV);
|
|
dispatch_e_menu (BAR_ITEM_ID(1));
|
|
}
|
|
return ok;
|
|
}
|
|
|
|
bool TAgg_opintra::destroy()
|
|
{
|
|
delete _causali;
|
|
return TApplication::destroy();
|
|
}
|
|
|
|
bool TAgg_opintra::menu(MENU_TAG m)
|
|
{
|
|
TMask msk("cg1300a");
|
|
|
|
while (msk.run() == K_ENTER)
|
|
{
|
|
look_mov();
|
|
message_box(TR("Aggiornamento completato"));
|
|
//return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
void TAgg_opintra::look_mov()
|
|
{
|
|
TLocalisamfile caus(LF_CAUSALI);
|
|
|
|
TRelation rel (LF_MOV);
|
|
rel.add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
|
TCursor cursor(&rel,"",1);
|
|
|
|
TLocalisamfile& mov = rel.lfile();
|
|
TLocalisamfile& rmoviva = rel.lfile(LF_RMOVIVA);
|
|
|
|
// long ditta = get_firm();
|
|
cursor = 0L;
|
|
const long nitems = cursor.items();
|
|
|
|
TProgind p(nitems ? nitems : 1, TR("Aggiornamento in corso...") , TRUE, TRUE, 70);
|
|
|
|
for (; cursor.pos() < cursor.items(); ++cursor)
|
|
{
|
|
p.addstatus(1);
|
|
const TString16 reg(mov.get(MOV_REG));
|
|
if (reg.empty()) continue;
|
|
|
|
const TDate& datareg = mov.get_date(MOV_DATAREG);
|
|
if (datareg.year() < 1993) continue; // Meglio cosi'
|
|
|
|
const TString16 codcaus(mov.get(MOV_CODCAUS));
|
|
if (codcaus.not_empty())
|
|
{
|
|
caus.setkey(1);
|
|
caus.put(CAU_CODCAUS, codcaus);
|
|
if (caus.read() == NOERR)
|
|
{
|
|
bool intra = caus.get_bool(CAU_INTRACOM);
|
|
bool ok = rel.is_first_match(LF_RMOVIVA);
|
|
while (ok)
|
|
{
|
|
rmoviva.put(RMI_INTRA, intra);
|
|
rmoviva.rewrite();
|
|
ok = rel.next_match(LF_RMOVIVA);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void agg_opintra(int argc, char* argv[])
|
|
{
|
|
TAgg_opintra aoi;
|
|
aoi.run(argc, argv, TR("Aggiornamento flag op. intracomunitarie"));
|
|
}
|