File del prg di servizio
git-svn-id: svn://10.65.10.50/trunk@1508 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5057acfe6e
commit
3c37884731
317
cg/cg1300.cpp
317
cg/cg1300.cpp
@ -1,160 +1,157 @@
|
|||||||
//********************************
|
//********************************
|
||||||
//* Aggiornamento Tipo Attivita' *
|
//* Aggiornamento Tipo Attivita' *
|
||||||
//********************************
|
//********************************
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
#include "conto.h"
|
#include "conto.h"
|
||||||
#include "cg2103.h"
|
#include "cg2103.h"
|
||||||
#include "cg1301.h"
|
#include "cg1301.h"
|
||||||
#include "cg1302.h"
|
#include "cg1302.h"
|
||||||
#include "cg1303.h"
|
#include "cg1303.h"
|
||||||
#include "cg1.h"
|
#include "cg1304.h"
|
||||||
|
#include "cg1.h"
|
||||||
class TAgg_attiv : public TApplication
|
|
||||||
{
|
class TAgg_attiv : public TApplication
|
||||||
TLocalisamfile* _pcon,* _attiv;
|
{
|
||||||
TTable* _reg;
|
TLocalisamfile* _pcon,* _attiv;
|
||||||
|
TTable* _reg;
|
||||||
public:
|
|
||||||
virtual bool create();
|
public:
|
||||||
virtual bool destroy();
|
virtual bool create();
|
||||||
virtual bool menu(MENU_TAG m);
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
void elabora_mov();
|
|
||||||
|
void elabora_mov();
|
||||||
TAgg_attiv() {};
|
|
||||||
virtual ~TAgg_attiv() {};
|
TAgg_attiv() {};
|
||||||
};
|
virtual ~TAgg_attiv() {};
|
||||||
|
};
|
||||||
HIDDEN TAgg_attiv& app() { return (TAgg_attiv&)main_app(); }
|
|
||||||
|
HIDDEN TAgg_attiv& app() { return (TAgg_attiv&)main_app(); }
|
||||||
bool TAgg_attiv::create()
|
|
||||||
{
|
bool TAgg_attiv::create()
|
||||||
TApplication::create();
|
{
|
||||||
|
TApplication::create();
|
||||||
_pcon = new TLocalisamfile(LF_PCON);
|
|
||||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
_pcon = new TLocalisamfile(LF_PCON);
|
||||||
_reg = new TTable("REG");
|
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||||
|
_reg = new TTable("REG");
|
||||||
dispatch_e_menu (BAR_ITEM(1));
|
|
||||||
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
return TRUE;
|
|
||||||
}
|
return TRUE;
|
||||||
|
}
|
||||||
bool TAgg_attiv::destroy()
|
|
||||||
{
|
bool TAgg_attiv::destroy()
|
||||||
delete _pcon;
|
{
|
||||||
delete _attiv;
|
delete _pcon;
|
||||||
delete _reg;
|
delete _attiv;
|
||||||
|
delete _reg;
|
||||||
return TApplication::destroy();
|
|
||||||
}
|
return TApplication::destroy();
|
||||||
|
}
|
||||||
bool TAgg_attiv::menu(MENU_TAG m)
|
|
||||||
{
|
bool TAgg_attiv::menu(MENU_TAG m)
|
||||||
TMask msk("cg1300a");
|
{
|
||||||
|
TMask msk("cg1300a");
|
||||||
while (msk.run() == K_ENTER)
|
|
||||||
{
|
while (msk.run() == K_ENTER)
|
||||||
elabora_mov();
|
{
|
||||||
message_box("Aggiornamento completato");
|
elabora_mov();
|
||||||
//return TRUE;
|
message_box("Aggiornamento completato");
|
||||||
}
|
//return TRUE;
|
||||||
return FALSE;
|
}
|
||||||
}
|
return FALSE;
|
||||||
|
}
|
||||||
void TAgg_attiv::elabora_mov()
|
|
||||||
{
|
void TAgg_attiv::elabora_mov()
|
||||||
TRelation rel (LF_MOV);
|
{
|
||||||
rel.add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
TRelation rel (LF_MOV);
|
||||||
TCursor cursor(&rel,"",1);
|
rel.add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
||||||
|
TCursor cursor(&rel,"",1);
|
||||||
TLocalisamfile& mov = rel.lfile();
|
|
||||||
TLocalisamfile& rmoviva = rel.lfile(LF_RMOVIVA);
|
TLocalisamfile& mov = rel.lfile();
|
||||||
|
TLocalisamfile& rmoviva = rel.lfile(LF_RMOVIVA);
|
||||||
long ditta = get_firm();
|
|
||||||
cursor = 0L;
|
long ditta = get_firm();
|
||||||
const long nitems = cursor.items();
|
cursor = 0L;
|
||||||
|
const long nitems = cursor.items();
|
||||||
TProgind p(nitems ? nitems : 1, "Aggiornamento in corso..." , TRUE, TRUE, 70);
|
|
||||||
|
TProgind p(nitems ? nitems : 1, "Aggiornamento in corso..." , TRUE, TRUE, 70);
|
||||||
for (; cursor.pos() < cursor.items(); ++cursor)
|
|
||||||
{
|
for (; cursor.pos() < cursor.items(); ++cursor)
|
||||||
p.addstatus(1);
|
{
|
||||||
const TString16 reg(mov.get(MOV_REG));
|
p.addstatus(1);
|
||||||
if (reg.empty()) continue;
|
const TString16 reg(mov.get(MOV_REG));
|
||||||
|
if (reg.empty()) continue;
|
||||||
const int annoiva = mov.get_int(MOV_ANNOIVA);
|
|
||||||
TRegistro registro(reg, annoiva);
|
const int annoiva = mov.get_int(MOV_ANNOIVA);
|
||||||
const bool att_mista = registro.attivita_mista();
|
TRegistro registro(reg, annoiva);
|
||||||
|
const bool att_mista = registro.attivita_mista();
|
||||||
if (att_mista)
|
|
||||||
{
|
if (att_mista)
|
||||||
bool ok = rel.is_first_match(LF_RMOVIVA);
|
{
|
||||||
while (ok)
|
bool ok = rel.is_first_match(LF_RMOVIVA);
|
||||||
{
|
while (ok)
|
||||||
const char tipo = rmoviva.get_char("TIPOC");
|
{
|
||||||
if (tipo <= ' ')
|
const char tipo = rmoviva.get_char("TIPOC");
|
||||||
{
|
if (tipo <= ' ')
|
||||||
TBill c(rmoviva.get_int("GRUPPO"), rmoviva.get_int("CONTO"), rmoviva.get_long("SOTTOCONTO"));
|
{
|
||||||
int tipoatt = c.tipo_att();
|
TBill c(rmoviva.get_int("GRUPPO"), rmoviva.get_int("CONTO"), rmoviva.get_long("SOTTOCONTO"));
|
||||||
rmoviva.put("TIPOATT", tipoatt);
|
int tipoatt = c.tipo_att();
|
||||||
rmoviva.rewrite();
|
rmoviva.put("TIPOATT", tipoatt);
|
||||||
}
|
rmoviva.rewrite();
|
||||||
ok = rel.next_match(LF_RMOVIVA);
|
}
|
||||||
}
|
ok = rel.next_match(LF_RMOVIVA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
int cg1300(int argc, char* argv[])
|
|
||||||
{
|
int cg1300(int argc, char* argv[])
|
||||||
switch (*argv[2])
|
{
|
||||||
{
|
switch (*argv[2])
|
||||||
case 'A':
|
{
|
||||||
{
|
case 'A':
|
||||||
TAgg_attiv a;
|
{
|
||||||
a.run(argc, argv, "Aggiornamento tipo attivita' su movimenti iva");
|
TAgg_attiv a;
|
||||||
}
|
a.run(argc, argv, "Aggiornamento tipo attivita' su movimenti iva");
|
||||||
break;
|
}
|
||||||
case 'I':
|
break;
|
||||||
{
|
case 'I':
|
||||||
TAgg_opintra a;
|
{
|
||||||
a.run(argc, argv, "Aggiornamento flag op. intracomunitarie");
|
TAgg_opintra a;
|
||||||
}
|
a.run(argc, argv, "Aggiornamento flag op. intracomunitarie");
|
||||||
break;
|
}
|
||||||
case 'T':
|
break;
|
||||||
{
|
case 'T':
|
||||||
TAgg_tconto a;
|
{
|
||||||
a.run(argc, argv, "Aggiornamento tipo conto");
|
TAgg_tconto a;
|
||||||
}
|
a.run(argc, argv, "Aggiornamento tipo conto");
|
||||||
break;
|
}
|
||||||
case 'P':
|
break;
|
||||||
{
|
case 'P':
|
||||||
TAgg_nprot a;
|
{
|
||||||
a.run(argc, argv,"Rinumerazione numero di protocollo");
|
TAgg_nprot a;
|
||||||
}
|
a.run(argc, argv,"Rinumerazione numero di protocollo");
|
||||||
break;
|
}
|
||||||
/*
|
break;
|
||||||
case 'S':
|
case 'C':
|
||||||
TAgg_progr a;
|
{
|
||||||
title = "Aggiornamento codice attivita' su progressivi";
|
TAgg_codatt a;
|
||||||
break;
|
a.run(argc, argv,"Aggiornamento codice attivita'");
|
||||||
case 'V':
|
}
|
||||||
TVar_data a;
|
break;
|
||||||
title = "Variazione data su stampa bollato registri iva";
|
default:
|
||||||
break;
|
break;
|
||||||
*/
|
}
|
||||||
default:
|
return TRUE;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user