Patch level :

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
This commit is contained in:
guy 2011-10-12 13:38:42 +00:00
parent 634cd30390
commit 37b49c465c
14 changed files with 237 additions and 59 deletions

View File

@ -276,7 +276,7 @@ HIDDEN bool paiv_handler(TMask_field& f, KEY key)
if (ok)
{
const int alleg = m.get_int(F_ALLEG);
if (alleg != 4)
if (alleg != 4 && alleg != 7)
{
ok = no_dup_iva(f, key);
if (ok)
@ -571,7 +571,7 @@ HIDDEN bool altnewcli_handler(TMask_field& f, KEY key)
TToken_string key;
app().get_next_key(key);
const long cod = (atol(key.get(3)) / divisore + 1) * divisore;
const long cod = (key.get_long(3) / divisore + 1) * divisore;
m.set(F_CODCF, cod);
if (m.mode() == MODE_QUERY)
@ -610,6 +610,7 @@ HIDDEN bool contrlav_handler(TMask_field& f, KEY key)
}
return true;
}
void TClifo_application::on_config_change()
{
TConfig cnf(CONFIG_DITTA);

View File

@ -10,6 +10,8 @@ int cg1600(int argc, char* argv[]);
int cg1700(int argc, char* argv[]);
//int cg1800(int argc, char* argv[]);
#endif // __CG1_H

View File

@ -1,6 +1,10 @@
// cg1100.cpp
// Stampa piano dei conti
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS 1
#endif
#include <execp.h>
#include <mailbox.h>
#include <mask.h>
@ -18,8 +22,6 @@
#include "cg1100.h"
#include "cglib01.h"
const char * TAB_IVD = "%IVD";
enum stampe {
completa=1,
con_IV_direttiva,
@ -1133,26 +1135,22 @@ void CG1100_application::intesta (stampe tipo)
}
const TString & CG1100_application::descrizione_numero(char sezione, char lettera, int numr, const char * numero)
const TString& CG1100_application::descrizione_numero(char sezione, char lettera, int numr, const char * numero)
{
TString key;
TString80 key;
if (numr == 0)
key.format("%c%c %-4s",sezione, lettera, numero);
else
key.format("%1c%1c%04d%-4s",sezione, lettera, numr, numero);
key.trim();
key.rtrim();
const TRectype & ivd = cache().get(TAB_IVD, key);
return ivd.get("S0");
return cache().get("%IVD", key, "S0");
}
const TString & CG1100_application::descrizione_codcbl(const TString& codcbl)
{
const TRectype & abpcon = cache().get(LF_ABPCON, codcbl);
return abpcon.get("DESCRIZ");
return cache().get(LF_ABPCON, codcbl, "DESCRIZ");
}
bool CG1100_application::user_create()
@ -1174,7 +1172,9 @@ bool CG1100_application::user_create()
_cur_senza_ana = add_cursor(new TCursor(rel_ana));
select_cursor(_cur_senza_ana);
TCursor & c = *current_cursor();
c.setfilter("((SOTTOCONTO!=0)&&(CODCBL==\"\")&&(201@->CODCBL==\"\")&&(202@->CODCBL==\"\"))||((SOTTOCONTO==0)&&(201@->CODCBL==\"\")&&(202@->CODCBL==\"\"))||((CONTO==0)&&(202@->CODCBL==\"\"))");
c.setfilter("((SOTTOCONTO!=0)&&(CODCBL==\"\")&&(201@->CODCBL==\"\")&&(202@->CODCBL==\"\"))||"
"((SOTTOCONTO==0)&&(201@->CODCBL==\"\")&&(202@->CODCBL==\"\"))||"
"((CONTO==0)&&(202@->CODCBL==\"\"))");
select_cursor(_cur_std);
_tipo_stampa = completa;
_salto_pag = false;

View File

@ -1,6 +1,11 @@
//********************************
//* Aggiornamento Tipo Attivita' *
//********************************
#include <applicat.h>
#include <isam.h>
#include <mask.h>
#include <progind.h>
#include "cg1.h"
#include "cg1301.h"
#include "cg1302.h"
@ -8,14 +13,8 @@
#include "cg1304.h"
#include "cg1305.h"
#include "cg1306.h"
#include "cg1307.h"
#include "cg1308.h"
#include "cg1309.h"
#include "cglib01.h"
#include <applicat.h>
#include <mask.h>
#include <progind.h>
#include "cglib01.h"
#include <mov.h>
@ -92,13 +91,14 @@ int cg1300(int argc, char* argv[])
case 'A':
{
TAgg_attiv a;
a.run(argc, argv, TR("Aggiornamento tipo attivita' su movimenti iva"));
a.run(argc, argv, TR("Aggiornamento tipo attività su movimenti IVA"));
}
break;
case 'B': agg_iban(argc, argv); break; // cg1310
case 'C':
{
TAgg_codatt a;
a.run(argc, argv,TR("Aggiornamento codice attivita'"));
a.run(argc, argv,TR("Aggiornamento codice attività"));
}
break;
case 'D':
@ -113,15 +113,8 @@ int cg1300(int argc, char* argv[])
a.run(argc, argv,TR("Aggiornamento codice esercizio"));
}
break;
case 'I':
{
TAgg_opintra a;
a.run(argc, argv, TR("Aggiornamento flag op. intracomunitarie"));
}
break;
case 'L':
controlla_PIVA(argc, argv); // cg1309
break;
case 'I': agg_opintra(argc, argv); break;
case 'L': controlla_PIVA(argc, argv); break; // cg1309
case 'P':
{
TAgg_nprot a;

View File

@ -1,6 +1,8 @@
//**************************************************
//* Aggiornamento Flag Operazioni Intracomunitarie *
//**************************************************
#include <applicat.h>
#include <mask.h>
#include <progind.h>
#include <relation.h>
@ -10,7 +12,21 @@
#include <rmoviva.h>
#include <causali.h>
#include "cg1301.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()
{
@ -88,3 +104,8 @@ void TAgg_opintra::look_mov()
}
}
void agg_opintra(int argc, char* argv[])
{
TAgg_opintra aoi;
aoi.run(argc, argv, TR("Aggiornamento flag op. intracomunitarie"));
}

View File

@ -1,17 +1,5 @@
#include <applicat.h>
#include <isam.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() {};
};
void agg_opintra(int argc, char* argv[]);
void elimina_zoppi(int argc, char* argv[]);
void setta_meseliq(int argc, char* argv[]);
void controlla_PIVA(int argc, char* argv[]);
void agg_iban(int argc, char* argv[]);

View File

@ -554,9 +554,8 @@ void TElimina_zoppi::main_loop()
while (m.run() != K_QUIT);
}
int elimina_zoppi(int argc, char* argv[])
void elimina_zoppi(int argc, char* argv[])
{
TElimina_zoppi ez;
ez.run(argc, argv, ez.app_name());
return 0;
}

View File

@ -1 +0,0 @@
int elimina_zoppi(int argc, char* argv[]);

View File

@ -7,7 +7,6 @@
#include <mov.h>
#include "cg1300.h"
#include "cg1308.h"
class TImposta_meseliq : public TSkeleton_application
{
@ -74,9 +73,8 @@ void TImposta_meseliq::main_loop()
}
}
int setta_meseliq(int argc, char* argv[])
void setta_meseliq(int argc, char* argv[])
{
TImposta_meseliq a;
a.run(argc, argv, TR("Impostazione mese liq."));
return 0;
}

View File

@ -1 +0,0 @@
int setta_meseliq(int argc, char* argv[]);

View File

@ -1 +0,0 @@
void controlla_PIVA(int argc, char* argv[]);

139
cg/cg1310.cpp Normal file
View File

@ -0,0 +1,139 @@
#include <applicat.h>
#include <automask.h>
#include <progind.h>
#include <recarray.h>
#include <recset.h>
#include <relation.h>
#include <reputils.h>
#include <clifo.h>
#include "cfban.h"
///////////////////////////////////////////////////////////
// TIBAN_mask
///////////////////////////////////////////////////////////
class TIBAN_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TIBAN_mask() : TAutomask("cg1310") { }
};
bool TIBAN_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
return true;
}
///////////////////////////////////////////////////////////
// TIBAN_app
///////////////////////////////////////////////////////////
class TIBAN_app : public TSkeleton_application
{
protected:
void update(TRecord_array& a, TLog_report& log) const;
void elabora() const;
public:
virtual void main_loop();
};
void TIBAN_app::update(TRecord_array& a, TLog_report& log) const
{
const TRectype& row = a.row(a.last_row());
TString msg;
msg << TR("Aggiornamento banca del ")
<< row.get(CFBAN_TIPOCF) << '/' << row.get_long(CFBAN_CODCF)
<< " : " << row.get(CFBAN_ABI) << '/' << row.get(CFBAN_CAB)
<< " " << row.get(CFBAN_IBAN);
log.log(0, msg);
const int err = a.rewrite();
if (err != NOERR)
{
msg.format(FR("Errore %d durante l'aggiornamento del file delle banche"), err);
log.log(2, msg);
}
}
void TIBAN_app::elabora() const
{
TLog_report log;
TISAM_recordset clifo("USE CLIFO");
TProgind pi(clifo.items(), clifo.cursor()->file(0).description());
TRectype& curr = clifo.cursor()->curr();
for (bool ok = clifo.move_first(); ok; ok = clifo.move_next())
{
if (!pi.addstatus(1))
break;
const TString80 iban = curr.get(CLI_IBAN);
const TString8 abi = curr.get(CLI_CODABI);
const TString8 cab = curr.get(CLI_CODCAB);
if (iban.len() > 15 || atoi(cab) >= 1000)
{
TString16 key; key.format("%c|%ld|V", curr.get_char(CLI_TIPOCF), curr.get_long(CLI_CODCF));
TRecord_array cfban(key, LF_CFBAN);
if (iban.len() > 15)
{
int r = -1;
for (r = cfban.last_row(); r > 0; r = cfban.pred_row(r))
{
const TRectype& row = cfban.row(r);
if (row.get(CFBAN_IBAN) == iban)
break;
}
if (r <= 0)
{
TRectype& row = cfban.row(-1, true);
row.put(CFBAN_IBAN, iban);
if (iban.starts_with("IT"))
{
row.put(CFBAN_ABI, iban.mid(6, 5));
row.put(CFBAN_CAB, iban.mid(11, 5));
row.put(CFBAN_NUMCC, iban.mid(16));
}
update(cfban, log);
}
}
else
{
int r = -1;
for (r = cfban.last_row(); r > 0; r = cfban.pred_row(r))
{
const TRectype& row = cfban.row(r);
if (row.get(CFBAN_ABI) == abi && row.get(CFBAN_CAB) == cab)
break;
}
if (r <= 0)
{
TRectype& row = cfban.row(-1, true);
row.put(CFBAN_ABI, abi);
row.put(CFBAN_CAB, cab);
row.put(CFBAN_NUMCC, curr.get(CLI_NUMCC));
update(cfban, log);
}
}
}
}
log.preview();
}
void TIBAN_app::main_loop()
{
TIBAN_mask m;
if (m.run() == K_ENTER)
elabora();
}
void agg_iban(int argc, char* argv[])
{
TIBAN_app a;
a.run(argc, argv, TR("Allineamento IBAN"));
}

39
cg/cg1310.uml Normal file
View File

@ -0,0 +1,39 @@
PAGE "Allineamento IBAN" -1 -1 60 5
NUMBER 101 5
BEGIN
PROMPT 1 1 "Ditta "
FLAGS "FD"
USE LF_NDITTE
INPUT CODDITTA 101
OUTPUT 102 RAGSOC
CHECKTYPE REQUIRED
END
STRING 102 50
BEGIN
PROMPT 7 2 ""
FLAGS "D"
END
TEXT DLG_NULL
BEGIN
PROMPT 1 3 "Questa procedura allinea il campo IBAN in anagrafica clienti/fornitori "
END
TEXT DLG_NULL
BEGIN
PROMPT 1 4 "con l'elenco delle banche associate alla corrispondente anagrafica"
END
ENDPAGE
TOOLBAR "topbar" 0 0 0 2
#include <elabar.h>
ENDPAGE
ENDMASK

View File

@ -178,7 +178,8 @@ Item_08 = "Riorganizzazione codici esercizio", "cg1 -2 E", "FP"
Item_09 = "Correzione righe di prima nota", "cg1 -2 Z", "FP"
Item_10 = "Impostazione mese liquidazione", "cg1 -2 M", "FP"
Item_11 = "Controllo P.I. e C.F. clienti/fornitori", "cg1 -2 L", "FP"
Item_12 = "Collegamento bilanci", [CGMENU_025]
Item_12 = "Allineamento IBAN su Banche x Cliente", "cg1 -2 B", "FP"
Item_13 = "Collegamento bilanci", [CGMENU_025]
[CGMENU_019]
Caption = "Invio"