Patch level :4.0 785

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :riporto della 3.0 / 3.1 alla 984 (elenco clifo)


git-svn-id: svn://10.65.10.50/trunk@15648 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-09-27 15:32:02 +00:00
parent dec44e6fc2
commit 3382066f05
3 changed files with 224 additions and 81 deletions

View File

@ -366,12 +366,12 @@ void TPadoaSchioppa_set::add_trc(int trc)
add_field(trc, 138, 207, 70, "Denominazione" , AN); // Persone NON fisiche
add_field(trc, 208, 247, 40, "ComuneSedeLegale" , AN);
add_field(trc, 248, 249, 2, "ProvinciaSedeLegale" , AN);
add_field(trc, 250, 265, 16, "CodiceFiscaleFornitore" , CF);
add_field(trc, 250, 265, 16, "CodiceSoggettoObbligato" , CF);
add_field(trc, 266, 269, 4, "AnnoRiferimento" , NU, true);
add_field(trc, 270, 273, 4, "ProgressivoTelematico" , NU);
add_field(trc, 274, 277, 4, "NumeroTotaleInvii" , NU);
add_field(trc, 278, 293, 16, "CodiceFiscaleIntermediario", CF);
add_field(trc, 294, 298, 5, "NumeroIscrizioneAlboCAAF" , NU);
add_field(trc, 278, 293, 16, "CodiceIntermediario" , CF);
add_field(trc, 294, 298, 5, "NumeroIscrizioneAlboCAF" , NU);
add_field(trc, 299, 299, 1, "ImpegnoAllaTrasmissione" , NU);
add_field(trc, 300, 307, 8, "DataImpegno" , NU);
break;
@ -490,7 +490,16 @@ bool TPadoaSchioppa_set::set(const char* name, const TVariant& value)
ok = TAS400_recordset::set(name, TVariant(str));
}
else
ok = TAS400_recordset::set(name, value);
{
if (value.is_string())
{
TString80 str = value.as_string();
str.upper();
ok = TAS400_recordset::set(name, TVariant(str));
}
else
ok = TAS400_recordset::set(name, value);
}
CHECKS(ok, "Campo non valido ", name);
}
return ok;
@ -730,10 +739,9 @@ bool TAlleg_mask::scan_iva_rows(const TRecordset& mov, TAssoc_array& clifi, bool
if (!stato.is_empty() && stato.as_string() != "IT") // Scarto gli esteri
return false;
const int tipalleg = clifo.get(CLI_ALLEG).as_int();
const long codalleg = clifo.get(CLI_CODALLEG).as_int();
// Ignoro da subito chi non va in allegato
if (!(tipalleg == 0 || (tipalleg == 4 && codalleg > 0)))
const int tipalleg = clifo.get(CLI_ALLEG).as_int();
if (tipalleg != 0 && tipalleg != 4)
return false;
}
@ -822,7 +830,6 @@ TRecordset* TAlleg_mask::new_recordset(char tipocf, bool strict)
break;
const int annoiva = mov.get(MOV_ANNOIVA).as_int();
const TString& codcaus = mov.get(MOV_CODCAUS).as_string();
const TCausale& caus = _causali.causale(codcaus, annoiva);
@ -936,7 +943,16 @@ void TAlleg_mask::add_0_9(int trc, TPadoaSchioppa_set& pss, TLog_report& log)
pss.set("AnnoRiferimento", get(F_ANNO));
// Compilare solo se diverso da dichiarante
// pss.set("CodiceFiscaleFornitore", codfis);
pss.set("CodiceSoggettoObbligato", get(F_SOGG));
const TString& inter = get(F_INTR);
if (inter.full())
{
pss.set("CodiceIntermediario" , inter);
pss.set("NumeroIscrizioneAlboCAF", get(F_CAF));
pss.set("ImpegnoAllaTrasmissione", get(F_COMP));
pss.set("DataImpegno", get_date(F_DATA));
}
}
void TAlleg_mask::add_3(TPadoaSchioppa_set& pss)
@ -1007,9 +1023,7 @@ void TAlleg_mask::log_error(const char* ragsoc, const char* msg1, const char* ms
TLog_report& errlog, int severity)
{
TString str;
str = ragsoc;
str.strip_double_spaces();
str << " - " << msg1;
str << ragsoc << " - " << msg1;
if (msg2 && *msg2)
str << " : " << msg2;
errlog.log(severity, str);
@ -1020,8 +1034,11 @@ void TAlleg_mask::log_error(const char* ragsoc, const char* msg1, const char* ms
void TAlleg_mask::log_error(const TRecordset& clifo, const char* msg1, const char* msg2,
TLog_report& errlog, int severity)
{
const TString& ragsoc = clifo.get(CLI_RAGSOC).as_string();
log_error(ragsoc, msg1, msg2, errlog, severity);
TString str;
str << clifo.get(CLI_TIPOCF) << clifo.get(CLI_CODCF)
<< ' ' << clifo.get(CLI_RAGSOC);
str.strip_double_spaces();
log_error(str, msg1, msg2, errlog, severity);
}
void TAlleg_mask::add_1_2(int trc, TRecordset& clifo, TPadoaSchioppa_set& pss, TLog_report& log)
@ -1157,15 +1174,26 @@ void TAlleg_mask::generazione()
add_0_9(9, pss, log); // Piede (= Testa)
pss.save_as(get(F_NAME));
bool go_on = true;
if (_red_alert)
{
warning_box(TR("Sono stati rilevati alcuni errori sui dati da trasferire: controllare le ultime pagine del report"));
book.add(log);
if (yesno_box(TR("Sono stati rilevati errori sulla fornitura:\nSi desidera visualizzarli?")))
{
TReport_book errbuc;
errbuc.add(log);
errbuc.preview();
}
go_on = yesno_box("Si desidera generare ugualmente la fornitura?");
}
book.preview();
if (go_on)
{
TFilename fname = get(F_DIR);
fname.add(get(F_NAME));
pss.save_as(fname);
book.preview();
}
}
bool TAlleg_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
@ -1175,7 +1203,13 @@ bool TAlleg_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
case F_ANNO:
if (e == fe_init || e == fe_modify)
{
const int anno = atoi(o.get());
int anno = atoi(o.get());
if (anno < 2006)
{
const TDate oggi(TODAY);
anno = oggi.year()-1;
set(F_ANNO, anno);
}
if (anno >= 2008)
{
set(F_COFI, "X");
@ -1185,6 +1219,56 @@ bool TAlleg_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
enable(F_COFI);
}
break;
case F_DIR:
if (e == fe_init || e == fe_modify)
{
if (o.empty())
{
TFilename fdir; fdir.tempdir();
o.set(fdir);
}
}
break;
case F_NAME:
if (e == fe_init || e == fe_modify)
{
if (o.empty())
{
const TRectype& anag = contribuente();
TFilename ecf = anag.get(ANA_PAIV);
ecf.right_just(11, '0');
ecf << "_ECF00.ecf";
set(F_NAME, ecf);
o.set(ecf);
}
}
break;
case F_CONT:
if (e == fe_init)
{
const TRectype& anag = contribuente();
o.set(anag.get(ANA_COFI));
o.disable();
}
break;
case F_INTR:
if (e == fe_init && o.empty())
{
TString16 key = prefix().firm().get(NDT_FIRMAT);
if (key.full())
{
key.insert("F|");
o.set(cache().get(LF_ANAG, key, ANA_COFI));
}
}
break;
case F_CAF:
if (o.empty())
{
if (e == fe_init)
o.set(prefix().firm().get(NDT_INTCAF));
}
break;
case DLG_SELECT:
if (e == fe_button)
{
@ -1207,13 +1291,8 @@ bool TAlleg_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
if (e == fe_button)
{
TRecordset* rs = new_recordset();
TFilename fname = get(F_NAME);
if (fname.blank())
{
fname.tempdir();
fname.add("clifo");
}
fname.ext("xls");
TFilename fname = get(F_DIR);
fname.add("clifo.xls");
if (rs->save_as(fname, fmt_silk))
xvt_sys_goto_url(fname, "open");
delete rs;
@ -1234,7 +1313,8 @@ bool TAlleg_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
case DLG_ELABORA:
if (e == fe_button)
{
generazione();
if (check_fields())
generazione();
return false;
}
break;
@ -1245,33 +1325,11 @@ bool TAlleg_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
}
TAlleg_mask::TAlleg_mask() : TAutomask("cg3900a")
{
const TDate oggi(TODAY);
set(F_ANNO, oggi.year()-1);
const TRectype& anag = contribuente();
TString paiv = anag.get(ANA_PAIV);
paiv.right_just(11, '0');
paiv << "_ECF00.ecf";
TFilename fname; fname.tempdir();
fname.add(paiv);
set(F_NAME, fname);
make_profile_name(fname);
TConfig ini(fname, "Main");
const int algo = ini.get_int("AllegatiAlgo");
const bool cf = ini.get_bool("AllegatiCoFi");
set(F_ALGO, algo);
set(F_COFI, cf);
}
{ }
TAlleg_mask::~TAlleg_mask()
{
TFilename fname; make_profile_name(fname);
TConfig ini(fname, "Main");
ini.set("AllegatiAlgo", get_int(F_ALGO));
ini.set("AllegatiCoFi", get_bool(F_COFI));
{
save_profile();
}
///////////////////////////////////////////////////////////

View File

@ -1,5 +1,13 @@
#define F_TIPO 101
#define F_ANNO 102
#define F_NAME 103
#define F_COFI 104
#define F_ALGO 105
#define F_ALGO 103
#define F_DIR 104
#define F_NAME 105
#define F_COFI 106
#define F_CONT 109
#define F_SOGG 110
#define F_INTR 111
#define F_CAF 112
#define F_COMP 113
#define F_DATA 114

View File

@ -1,23 +1,33 @@
#include "cg3900a.h"
PAGE "Elenco Clienti/Fornitori" -1 -1 70 8
TOOLBAR "Toolbar" 0 -3 0 3
GROUPBOX DLG_NULL 68 3
BUTTON DLG_ELABORA 10 2
BEGIN
PROMPT 1 0 "@bSelezione"
PROMPT -12 -11 ""
PICTURE BMP_ELABORA
END
LIST F_TIPO 1 10
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT 2 1 "Tipo "
ITEM "C|Clienti"
ITEM "F|Fornitori"
PROMPT -22 -11 ""
END
ENDPAGE
PAGE "Elenco Clienti/Fornitori" 0 0 0 -3
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 0 "@bParametri"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 22 1 "Anno "
PROMPT 2 1 "Anno di riferimento "
CHECKTYPE REQUIRED
NUM_EXPR #F_ANNO>=2006
WARNING "L'anno non puo' essere antecedente al 2006"
END
LISTBOX F_ALGO 1 13
@ -27,50 +37,117 @@ BEGIN
ITEM "1|documento"
END
GROUPBOX DLG_NULL 68 4
BOOLEAN F_COFI
BEGIN
PROMPT 1 3 "@bRisultati"
PROMPT 2 2 "Includere codice fiscale del Cliente/Fornitore (Obbligatorio dal 2008)"
END
STRING F_NAME 128 50
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 2 4 "File "
PROMPT 1 4 "@bFornitura"
END
STRING F_DIR 128 50
BEGIN
PROMPT 2 5 "Cartella "
CHECKTYPE REQUIRED
END
BOOLEAN F_COFI
STRING F_NAME 50
BEGIN
PROMPT 2 5 "Includere codice fiscale del Cliente/Fornitore (Obbligatorio dal 2008)"
PROMPT 2 6 "File "
CHECKTYPE REQUIRED
END
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 8 "@bSoggetto obbligato (se diverso dal contribuente)"
END
STRING F_CONT 16
BEGIN
PROMPT 2 9 "Codice fiscale contribuente "
FLAGS "U"
END
STRING F_SOGG 16
BEGIN
PROMPT 2 10 "Codice fiscale soggetto obbligato "
STR_EXPR #F_SOGG!=#F_CONT
WARNING "Il codice del soggetto deve essere diverso da quello del contribuente"
FLAGS "U"
END
GROUPBOX DLG_NULL 78 5
BEGIN
PROMPT 1 12 "@bIntermediario"
END
STRING F_INTR 16
BEGIN
PROMPT 2 13 "Codice fiscale "
STR_EXPR #F_INTR!=#F_CONT
WARNING "Il codice dell'intermediario deve essere diverso da quello del contribuente"
FLAGS "U"
END
NUMBER F_CAF 5
BEGIN
PROMPT 42 13 "Iscrizione C.A.F. "
VALIDATE REQIF_FUNC 1 F_INTR
WARNING "Numero obbligatorio in presenza di un intermediario"
FLAGS "U"
END
LISTBOX F_COMP 1 20
BEGIN
PROMPT 2 14 "Comunicazione predisposta da "
ITEM "1|contribuente"
ITEM "2|chi effettua l'invio"
END
DATE F_DATA
BEGIN
PROMPT 2 15 "Data dell'impegno alla trasmimssione "
VALIDATE REQIF_FUNC 1 F_INTR
WARNING "Data obbligatoria in presenza di un intermediario"
END
GROUPBOX DLG_NULL 78 5
BEGIN
PROMPT 1 17 "@bControlli preliminari"
END
LIST F_TIPO 1 10
BEGIN
PROMPT 2 18 "Movimenti "
ITEM "C|Clienti"
ITEM "F|Fornitori"
END
BUTTON DLG_SELECT 10 2
BEGIN
PROMPT -15 -1 ""
PROMPT -25 19 ""
PICTURE BMP_FINDREC
END
BUTTON DLG_EDIT 10 2
BEGIN
PROMPT -25 -1 ""
PROMPT -35 19 ""
PICTURE BMP_EDIT
END
BUTTON DLG_PRINT 10 2
BEGIN
PROMPT -35 -1 ""
PROMPT -45 19 ""
PICTURE BMP_PRINT
END
BUTTON DLG_ELABORA 10 2
STRING DLG_PROFILE 30
BEGIN
PROMPT -45 -1 ""
PICTURE BMP_ELABORA
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -55 -1 ""
FLAGS "H"
PROMPT 1 1 ""
PSELECT
END
ENDPAGE