Patch level : 12.0 500

Files correlati     : cg1.exe cg1300n.msk cgmenu.men

Programma di riallineamento tipo conto cliente/fornitore su causali e movimenti

git-svn-id: svn://10.65.10.50/branches/R_10_00@24272 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2018-01-17 18:26:53 +00:00
parent 525a850146
commit 3d1e6dbc64
3 changed files with 138 additions and 100 deletions

View File

@ -34,18 +34,18 @@ END
STRING F_RAGSOC 50 STRING F_RAGSOC 50
BEGIN BEGIN
PROMPT 2 6 "Ragione sociale " PROMPT 2 4 "Ragione sociale "
FLAGS "D" FLAGS "D"
END END
BOOLEAN F_UPDCAUS BOOLEAN F_UPDCAUS
BEGIN BEGIN
PROMPT 2 8 "Aggiorno le causali" PROMPT 2 6 "Aggiorno le causali"
END END
BOOLEAN F_UPDMOV BOOLEAN F_UPDMOV
BEGIN BEGIN
PROMPT 2 10 "Aggiorno i movimenti" PROMPT 2 8 "Aggiorno i movimenti"
END END
ENDPAGE ENDPAGE

View File

@ -4,6 +4,7 @@
#include <mask.h> #include <mask.h>
#include <recarray.h> #include <recarray.h>
#include <nditte.h>
#include <pconti.h> #include <pconti.h>
#include <rcausali.h> #include <rcausali.h>
#include <rmov.h> #include <rmov.h>
@ -12,8 +13,6 @@
#include <lffiles.h> #include <lffiles.h>
#include <recset.h> #include <recset.h>
#include <reprint.h>
#include <reputils.h>
#include "cg1314.h" #include "cg1314.h"
#include "cg1300n.h" #include "cg1300n.h"
#include "cglib01.h" #include "cglib01.h"
@ -25,21 +24,7 @@ bool TAgg_tcontoCF::create()
return TSkeleton_application::create(); return TSkeleton_application::create();
} }
void TAgg_tcontoCF::update_causali(TRectype & pcon, TLog_report & log)
void TAgg_tcontoCF::main_loop()
{
TMask m("cg1300n");
const TString16 arg = argv(3);
const bool force = arg.starts_with("-f");
if (force || m.run() == K_ENTER)
{
bool update_caus = force|| m.get_bool(F_UPDCAUS);
bool update_mov = force || m.get_bool(F_UPDMOV);
TRectype pcon(LF_PCON);
TLog_report log;
if (update_caus)
{ {
TString use("USE "); use << LF_RCAUSALI; TString use("USE "); use << LF_RCAUSALI;
TISAM_recordset rcaus(use); TISAM_recordset rcaus(use);
@ -68,8 +53,9 @@ void TAgg_tcontoCF::main_loop()
log.log(0, msg); log.log(0, msg);
} }
} }
} }
if (update_mov) // CONTABILITA' void TAgg_tcontoCF::update_movimenti(TRectype & pcon, TLog_report & log)
{ {
TString use("USE "); use << LF_RMOV; TString use("USE "); use << LF_RMOV;
TISAM_recordset rmov(use); TISAM_recordset rmov(use);
@ -99,7 +85,8 @@ void TAgg_tcontoCF::main_loop()
} }
} }
} }
if (update_mov) // IVA
void TAgg_tcontoCF::update_movimenti_IVA(TRectype & pcon, TLog_report & log)
{ {
TString use("USE "); use << LF_RMOVIVA; TString use("USE "); use << LF_RMOVIVA;
TISAM_recordset rmoviva(use); TISAM_recordset rmoviva(use);
@ -129,6 +116,52 @@ void TAgg_tcontoCF::main_loop()
} }
} }
} }
void TAgg_tcontoCF::main_loop()
{
TMask m("cg1300n");
const TString16 arg = argv(3);
const bool force = arg.starts_with("-f");
TRectype pcon(LF_PCON);
TLog_report log;
if (force)
{
const int ditta = get_firm();
TString use("USE "); use << LF_NDITTE;
TISAM_recordset d(use);
for (bool ok = d.move_first(); ok; ok = d.move_next())
{
set_firm(d.get(NDT_CODDITTA).as_int());
TString msg("Ditta ");
msg << get_firm();
log.log(0, msg);
log.log(0, "");
update_causali(pcon, log);
update_movimenti(pcon, log);
update_movimenti_IVA(pcon, log);
log.log(0, "");
}
set_firm(ditta);
}
else
{
if (m.run() == K_ENTER)
{
bool update_caus = m.get_bool(F_UPDCAUS);
bool update_mov = m.get_bool(F_UPDMOV);
if (update_caus)
update_causali(pcon, log);
if (update_mov) // CONTABILITA'
{
update_movimenti(pcon, log);
update_movimenti_IVA(pcon, log);
}
}
}
log.print_or_preview(); log.print_or_preview();
} }
}

View File

@ -1,7 +1,12 @@
#include <printapp.h> #include <applicat.h>
#include <reprint.h>
#include <reputils.h>
class TAgg_tcontoCF : public TSkeleton_application class TAgg_tcontoCF : public TSkeleton_application
{ {
void update_causali(TRectype & pcon, TLog_report & log);
void update_movimenti(TRectype & pcon, TLog_report & log);
void update_movimenti_IVA(TRectype & pcon, TLog_report & log);
public: public:
virtual bool create(); virtual bool create();