Supporto per fattura PA
git-svn-id: svn://10.65.10.50/branches/R_10_00@22985 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c8daf4200d
commit
ee688476cc
@ -50,14 +50,13 @@ COMCF = S_DISABILITATO
|
||||
DENCOM = S_DISABILITATO
|
||||
STATOCF = S_DISABILITATO
|
||||
DESSTATOCF = S_DISABILITATO
|
||||
CONTR122 = S_NORMALE
|
||||
MODPAG = S_NORMALE
|
||||
PACONTRATTO = S_NORMALE
|
||||
PATIPOCON = S_NORMALE
|
||||
CONTSEP = S_NORMALE
|
||||
CODVAL1 = S_NORMALE
|
||||
CODVAL2 = S_NORMALE
|
||||
NOME_VAL1 = S_NORMALE
|
||||
NOME_VAL2 = S_NORMALE
|
||||
// CONTROEURO = S_NORMALE
|
||||
CAMBIO = S_NORMALE
|
||||
DATA_CAMBIO1 = S_NORMALE
|
||||
DATA_CAMBIO2 = S_NORMALE
|
||||
|
@ -48,8 +48,8 @@ COMCF = S_DISABILITATO
|
||||
DENCOM = S_DISABILITATO
|
||||
STATOCF = S_DISABILITATO
|
||||
DESSTATOCF = S_DISABILITATO
|
||||
CONTR122 = S_NORMALE
|
||||
MODPAG = S_NORMALE
|
||||
PACONTRATTO = S_NORMALE
|
||||
PATIPOCON = S_NORMALE
|
||||
CONTSEP = S_NORMALE
|
||||
CODVAL1 = S_NORMALE
|
||||
CODVAL2 = S_NORMALE
|
||||
|
@ -1,3 +1,3 @@
|
||||
33
|
||||
0
|
||||
$doc|0|0|625|0|Documenti di vendita|||
|
||||
$doc|0|0|652|0|Documenti di vendita|||
|
||||
|
@ -52,9 +52,9 @@ DATAPART|5|8|0|Data di partenza
|
||||
ORAPART|1|4|0|Ora di partenza
|
||||
IMPPAGATO|4|18|2|Importo pagato
|
||||
ACCSALDO|8|1|0|Saldato Si/No
|
||||
DOC1|1|16|0|Documento collegato 1
|
||||
DOC2|1|16|0|Documento collegato 2
|
||||
DOC3|1|16|0|Documento collegato 3
|
||||
DOC1|1|25|0|Documento collegato 1
|
||||
DOC2|1|25|0|Documento collegato 2
|
||||
DOC3|1|25|0|Documento collegato 3
|
||||
DATACONS|5|8|0|Data di consegna
|
||||
ASPBENI1|1|3|0|Aspetto beni 1
|
||||
ASPBENI2|1|3|0|Aspetto beni 2
|
||||
@ -90,9 +90,9 @@ DATACOMP|5|8|0|Data inizio competenza in analitica
|
||||
DATAFCOMP|5|8|0|Data fine competenza in analitica
|
||||
CUP|1|15|0|Codice Unico di Progetto
|
||||
CIG|1|10|0|Codice Identificativo di Gara
|
||||
MODPAG|1|1|0|Tipo contratto P.A.
|
||||
CONTRATTO|1|20|0|Contratto fattura P.A.
|
||||
CONTSEP|1|6|0|Contabilita' separata
|
||||
PAF|8|1|0|PAF Generata
|
||||
NOLEGGIO|1|1|0|Tipo noleggio (Spesometro)
|
||||
5
|
||||
PROVV+ANNO+CODNUM+NDOC|
|
||||
|
@ -37,7 +37,7 @@ SCONTO|1|25|0|Sconto
|
||||
PERCPROV|4|5|2|Percentuale di provvigione
|
||||
IMPFISSO|4|18|3|Importo fisso di provvigione
|
||||
IMPFISUN|8|1|0|Flag importo fisso unitario
|
||||
PRECPROV1|4|5|2|Percentuale di provvigione secondo agente
|
||||
PERCPROV1|4|5|2|Percentuale di provvigione secondo agente
|
||||
CODIVA|1|4|0|Codice IVA
|
||||
ADDIVA|8|1|0|Addebito IVA
|
||||
ASPBENI|1|2|0|Aspetto dei beni
|
||||
|
@ -47,8 +47,8 @@ COMCF = S_DISABILITATO
|
||||
DENCOM = S_DISABILITATO
|
||||
STATOCF = S_DISABILITATO
|
||||
DESSTATOCF = S_DISABILITATO
|
||||
CONTR122 = S_NORMALE
|
||||
MODPAG = S_NORMALE
|
||||
PACONTRATTO = S_NORMALE
|
||||
PATIPOCON = S_NORMALE
|
||||
CONTSEP = S_NORMALE
|
||||
CODVAL1 = S_NORMALE
|
||||
CODVAL2 = S_NORMALE
|
||||
|
@ -48,8 +48,8 @@ COMCF = S_DISABILITATO
|
||||
DENCOM = S_DISABILITATO
|
||||
STATOCF = S_DISABILITATO
|
||||
DESSTATOCF = S_DISABILITATO
|
||||
CONTR122 = S_NORMALE
|
||||
MODPAG = S_NORMALE
|
||||
PACONTRATTO = S_NORMALE
|
||||
PATIPOCON = S_NORMALE
|
||||
CONTSEP = S_NORMALE
|
||||
CODVAL1 = S_NORMALE
|
||||
CODVAL2 = S_NORMALE
|
||||
|
@ -44,8 +44,8 @@ COMCF = S_DISABILITATO
|
||||
DENCOM = S_DISABILITATO
|
||||
STATOCF = S_DISABILITATO
|
||||
DESSTATOCF = S_DISABILITATO
|
||||
CONTR122 = S_NORMALE
|
||||
MODPAG = S_NORMALE
|
||||
PATIPOCON = S_NORMALE
|
||||
PACONTRATTO = S_NORMALE
|
||||
CONTSEP = S_NORMALE
|
||||
CODVAL1 = S_NORMALE
|
||||
CODVAL2 = S_NORMALE
|
||||
|
@ -55,8 +55,8 @@ COMCF = S_DISABILITATO
|
||||
DENCOM = S_DISABILITATO
|
||||
STATOCF = S_DISABILITATO
|
||||
DESSTATOCF = S_DISABILITATO
|
||||
CONTR122 = S_NORMALE
|
||||
MODPAG = S_NORMALE
|
||||
PACONTRATTO = S_NORMALE
|
||||
PATIPOCON = S_NORMALE
|
||||
CONTSEP = S_NORMALE
|
||||
CODVAL1 = S_NORMALE
|
||||
CODVAL2 = S_NORMALE
|
||||
|
@ -54,8 +54,8 @@ COMCF = S_DISABILITATO
|
||||
DENCOM = S_DISABILITATO
|
||||
STATOCF = S_DISABILITATO
|
||||
DESSTATOCF = S_DISABILITATO
|
||||
CONTR122 = S_NORMALE
|
||||
MODPAG = S_NORMALE
|
||||
PACONTRATTO = S_NORMALE
|
||||
PATIPOCON = S_NORMALE
|
||||
CONTSEP = S_NORMALE
|
||||
CODVAL1 = S_NORMALE
|
||||
CODVAL2 = S_NORMALE
|
||||
|
@ -1001,14 +1001,34 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
||||
const TMaskmode oldmode= (TMaskmode)msk.mode();
|
||||
|
||||
msk.set_mode(MODE_MOD);
|
||||
for (int i = 1; ini.set_paragraph(format("%d,%d", LF_RIGHEDOC, i)); i++)
|
||||
{
|
||||
if (i == 1) // Se trovo almeno una riga allora cancello tutto, poi aggiungo le righe
|
||||
|
||||
TString_array pl; ini.list_paragraphs(pl);
|
||||
|
||||
if (pl.items() > 2)
|
||||
{
|
||||
bool should_reset = true;
|
||||
FOR_EACH_ARRAY_ROW_BACK(pl, p, pa)
|
||||
{
|
||||
if (pa->starts_with("34,"))
|
||||
{
|
||||
if (pa->find('-') > 0)
|
||||
should_reset = false; // Modalità append righe
|
||||
}
|
||||
else
|
||||
pl.destroy(p);
|
||||
}
|
||||
// Se trovo almeno una riga allora cancello tutto, poi aggiungo le righe
|
||||
if (should_reset && pl.items() > 0)
|
||||
{
|
||||
f.destroy();
|
||||
doc().destroy_rows();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FOR_EACH_ARRAY_ROW(pl, p, pa) if (pa->starts_with("34,"))
|
||||
{
|
||||
ini.set_paragraph(*pa);
|
||||
|
||||
// Considera solo i tipi riga validi
|
||||
const TString4 tipo(ini.get(RDOC_TIPORIGA));
|
||||
if (tr.read(tipo) == NOERR)
|
||||
@ -1071,7 +1091,7 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
||||
const TRectype& art = cache().get(LF_ANAMAG, codart);
|
||||
if (art.empty())
|
||||
{
|
||||
error_box(FR("Articolo non valido sulla riga %d: %s"), i, (const char*)codart);
|
||||
error_box(FR("Articolo non valido sulla riga %d: %s"), f.items(), (const char*)codart);
|
||||
rec.zero(RDOC_CODARTMAG);
|
||||
}
|
||||
}
|
||||
|
@ -254,41 +254,12 @@ TYPE=T_STRINGA
|
||||
PROMPT=""
|
||||
SIZE=50
|
||||
|
||||
[MODPAG]
|
||||
MSKID=F_MODPAG
|
||||
GROUP=100
|
||||
SIZE=14
|
||||
X=2
|
||||
Y=8
|
||||
PROMPT= "Contratto Spesometro: Modalità "
|
||||
ITEMS=1|Non frazionato@2|Frazionato@3|Periodico
|
||||
FIELDNAME=MODPAG
|
||||
TYPE=T_LISTA
|
||||
SPECIAL=MO FE
|
||||
|
||||
[CONTR122]
|
||||
TYPE=T_STRINGA
|
||||
GROUP=100
|
||||
SIZE=18
|
||||
X=51
|
||||
Y=8
|
||||
MSKID=F_CONTR122
|
||||
PROMPT="Codice "
|
||||
FLAG=U
|
||||
FIELDNAME=CONTRATTO
|
||||
USE=&FECON
|
||||
INPUT=CODTAB[1,1] F_TIPOCF SE~CODTAB[2,7] F_CODCF SE~CODTAB[8,25] F_CONTR122
|
||||
DISPLAY="Contratto" CODTAB[8,]~"Descrizione@50" S0
|
||||
OUTPUT=F_CONTR122 CODTAB[8,]
|
||||
HELP=Inserire un codice contratto di importo non inferiore a 3000 Euro
|
||||
SPECIAL=ADD RUN fe0 -1 &CON
|
||||
|
||||
[CONTSEP]
|
||||
TYPE=T_STRINGA
|
||||
GROUP=100
|
||||
SIZE=6
|
||||
X=2
|
||||
Y=9
|
||||
Y=8
|
||||
MSKID=F_CONTSEP
|
||||
PROMPT="Contabilità separata "
|
||||
FLAG=U
|
||||
@ -328,7 +299,7 @@ OUTPUT=@F_ORDDA
|
||||
SIZE=50
|
||||
|
||||
[CODVAL1]
|
||||
//se codice=LIT il campo cambio e' di sola visualizzazione
|
||||
//se codice=EUR il campo cambio e' di sola visualizzazione
|
||||
//se non abilitato archivio cambi
|
||||
GROUP=200
|
||||
X=2
|
||||
@ -348,7 +319,7 @@ HELP=Inserire il codice della valuta
|
||||
SPECIAL=ME CO,F_CODVAL1
|
||||
|
||||
[CODVAL2]
|
||||
//se codice=LIT il campo cambio e' di sola visualizzazione
|
||||
//se codice=EUR il campo cambio e' di sola visualizzazione
|
||||
//se abilitato archivio cambi
|
||||
GROUP=200
|
||||
X=2
|
||||
@ -1961,6 +1932,37 @@ DISPLAY="Descrizione@50" S0~"Codice@10" CODTAB
|
||||
COPY=OU F_CIG
|
||||
SIZE=50 40
|
||||
|
||||
[PATIPOCON]
|
||||
TYPE=T_LISTA
|
||||
GROUP=3000
|
||||
SIZE=111
|
||||
X=2
|
||||
Y=3
|
||||
MSKID=F_PATIPOCON
|
||||
PROMPT="Collegamento documento P.A. "
|
||||
FIELDNAME=MODPAG
|
||||
ITEMS=C|Contratto@V|Convenzione@O|Ordine
|
||||
HELP=Inserire un tipo contratto/convenzione/ordine
|
||||
SPECIAL=MO PA
|
||||
|
||||
[PACONTRATTO]
|
||||
TYPE=T_STRINGA
|
||||
GROUP=3000
|
||||
SIZE=20
|
||||
X=49
|
||||
Y=3
|
||||
MSKID=F_PACONTRATTO
|
||||
PROMPT="Numero "
|
||||
FLAG=U
|
||||
FIELDNAME=CONTRATTO
|
||||
USE=&PACON
|
||||
INPUT=CODTAB[1,1] F_PATIPOCON SE~CODTAB[2,7] F_CODCF SE~CODTAB[8,27] F_PACONTRATTO
|
||||
DISPLAY="Tipo" CODTAB[1,1]~"Codice" CODTAB[8,]~"Descrizione@50" S0
|
||||
OUTPUT=F_PACONTRATTO CODTAB[8,]
|
||||
HELP=Inserire un codice contratto/convenzione/ordine
|
||||
SPECIAL=ADD RUN pa0 -1 &PACON
|
||||
SPECIAL=MO PA
|
||||
|
||||
[CMSH]
|
||||
GROUP=3000
|
||||
X=2
|
||||
|
@ -1,5 +1,5 @@
|
||||
[100]
|
||||
HEIGHT=7
|
||||
HEIGHT=8
|
||||
CONFIGS=
|
||||
|
||||
[101]
|
||||
@ -105,7 +105,7 @@ HEIGHT=1
|
||||
HEIGHT=2
|
||||
|
||||
[3000]
|
||||
HEIGHT=1
|
||||
HEIGHT=3
|
||||
|
||||
[3200]
|
||||
HEIGHT=1
|
||||
|
@ -4,10 +4,14 @@
|
||||
#include <relation.h>
|
||||
#include <archives.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "ve5400.h"
|
||||
#include "velib.h"
|
||||
|
||||
#include <doc.h>
|
||||
|
||||
#include <agasys.h>
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//-------MASCHERA-----------------------------
|
||||
class TArchive_mask : public TMask
|
||||
@ -243,9 +247,11 @@ bool TArchive_doc::restore_file(TIsamtempfile& src, bool update)
|
||||
TLocalisamfile dst(src.num());
|
||||
|
||||
TString msg; msg << TR("Trasferimento") << ' ' << dst.description();
|
||||
TProgind pi(src.items(), msg, true, true);
|
||||
TProgress_monitor pi(src.items(), msg);
|
||||
for (int err = src.first(); err == NOERR; err = src.next())
|
||||
{
|
||||
if (!pi.add_status(1))
|
||||
break;
|
||||
err = src.curr().write(dst);
|
||||
if (err == _isreinsert)
|
||||
{
|
||||
@ -255,10 +261,10 @@ bool TArchive_doc::restore_file(TIsamtempfile& src, bool update)
|
||||
err = NOERR;
|
||||
}
|
||||
if (err != NOERR)
|
||||
return error_box(FR("Errore %d"), err);
|
||||
return cantwrite_box(src.description());
|
||||
}
|
||||
|
||||
return !pi.iscancelled();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TArchive_doc::restore_clifo(bool update)
|
||||
@ -290,26 +296,14 @@ void TArchive_doc::ripristina(const TMask& m)
|
||||
_unit = m.get(F_DRIVE)[0];
|
||||
_path = m.get(F_PATH);
|
||||
|
||||
TFilename unit;
|
||||
unit << _unit << ':' << SLASH;
|
||||
TFilename src;
|
||||
src << _unit << ':' << SLASH;
|
||||
if (!xvt_fsys_is_removable_drive(src) && _path.full())
|
||||
src.add(_path);
|
||||
src.add("ve.z00");
|
||||
|
||||
if (!xvt_fsys_is_removable_drive(unit) && _path != "") //ripristina dalla directory scelta come origine dei dati
|
||||
{
|
||||
TFilename path;
|
||||
path << _unit << ':' << SLASH << _path;
|
||||
for (int i = 0; i<= 1; i++)
|
||||
{
|
||||
TFilename orig = path;
|
||||
TFilename dest = unit;
|
||||
const char * name = i == 0 ? "backup.ini" : "ve.z00";
|
||||
orig << SLASH << name;
|
||||
dest << name;
|
||||
fcopy(orig, dest);
|
||||
}
|
||||
}
|
||||
|
||||
const char* dir = & _tmp_dir[1];
|
||||
if (_arc.restore(dir,_unit,FALSE,TRUE))
|
||||
const char* dst = & _tmp_dir[1];
|
||||
if (::aga_unzip(src, dst))
|
||||
{
|
||||
create_tmp_files(FALSE); // In realta' ci sono gia'
|
||||
|
||||
@ -318,22 +312,9 @@ void TArchive_doc::ripristina(const TMask& m)
|
||||
restore_docs();
|
||||
|
||||
delete_tmp_files(true); // Removes temp files!
|
||||
|
||||
//elimina i files copiati sulla root di un eventuale unita' fissa
|
||||
if (!xvt_fsys_is_removable_drive(unit) && _path != "")
|
||||
{
|
||||
for (int i = 0; i<= 1; i++)
|
||||
{
|
||||
TFilename file_to_erease = unit;
|
||||
const char * name = i == 0 ? "backup.ini" : "ve.z00";
|
||||
file_to_erease << name;
|
||||
xvt_fsys_removefile(file_to_erease);;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
error_box("Errore nella ricezione dei file da dischetto. Nessun documento ricevuto.");
|
||||
error_box(TR("Errore nella ricezione dei file. Nessun documento ricevuto."));
|
||||
}
|
||||
|
||||
|
||||
|
@ -288,4 +288,3 @@ Picture = <ve01>
|
||||
Module = 0
|
||||
Flags = ""
|
||||
Item_01 = "Caffè Hardy", <hamenu.men>, "", 10232
|
||||
Item_02 = "Gestione cooperative pesca", <comenu.men>
|
@ -5,10 +5,6 @@
|
||||
#include <varmask.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MULTIREC_H
|
||||
#include <multirec.h>
|
||||
#endif
|
||||
|
||||
#ifndef __RECSET_H
|
||||
#include <recset.h>
|
||||
#endif
|
||||
@ -25,7 +21,7 @@ class TViswin;
|
||||
#include "../ve/verig.h"
|
||||
#endif
|
||||
|
||||
#ifndef __CGPAGAME_H
|
||||
#ifndef __CGLIB01_H
|
||||
#include "../cg/cglib01.h"
|
||||
#endif
|
||||
|
||||
@ -278,7 +274,6 @@ public:
|
||||
const int dbliv() const { return _liv; }
|
||||
const int dbrow() const { return _row; }
|
||||
|
||||
|
||||
const TString & descrizione() const { return get("S0"); }
|
||||
const TString & riferimento(const TDocumento& doc, TString& rif) const;
|
||||
const TString & imponibile() const { return _imponibile;}
|
||||
@ -377,8 +372,10 @@ public:
|
||||
const TString& tipodocdef() const { return get("S9"); }
|
||||
const int revision_len() const { return get_int("I0"); }
|
||||
|
||||
const int tipo() const { return get_int("I1"); }
|
||||
const TString& tipo_doc(int i) const;
|
||||
int ntipi_doc() const;
|
||||
int find_tipo_doc(const char* cod) const;
|
||||
|
||||
void complete_num(long num, TString& codnum) const;
|
||||
bool ok() const { return !empty(); }
|
||||
|
@ -43,6 +43,14 @@ int TCodice_numerazione::ntipi_doc() const
|
||||
return l ? (((l - 1) / 4) + 1) : 0;
|
||||
}
|
||||
|
||||
int TCodice_numerazione::find_tipo_doc(const char* cod) const
|
||||
{
|
||||
int i = ntipi_doc()-1;
|
||||
while (i >= 0 && tipo_doc(i) != cod)
|
||||
i--;
|
||||
return i;
|
||||
}
|
||||
|
||||
void TCodice_numerazione::complete_num(long num, TString& codnum) const
|
||||
{
|
||||
codnum = prefisso();
|
||||
|
@ -730,9 +730,9 @@ real TRiga_documento::ritenuta(const char tipor, bool lordo, int ndec) const
|
||||
|
||||
if ((tipor != '\0' && tipo_rit == tipor) || (tipor == '\0' && tipo_rit != '\0'))
|
||||
{
|
||||
_rit_calc = TRUE;
|
||||
_rit_calc = true;
|
||||
val = importo(true, lordo, ndec);
|
||||
_rit_calc = FALSE;
|
||||
_rit_calc = false;
|
||||
}
|
||||
}
|
||||
return val;
|
||||
@ -770,7 +770,7 @@ real TRiga_documento::qtaresidua() const
|
||||
{
|
||||
if (!get_bool(RDOC_RIGAEVASA))
|
||||
{
|
||||
real val = quantita() - qtaevasa();
|
||||
const real val = quantita() - qtaevasa();
|
||||
if (val > ZERO)
|
||||
return val;
|
||||
}
|
||||
|
@ -261,12 +261,14 @@ protected:
|
||||
|
||||
virtual void add_rows(TRiga_documento & rout, TRiga_documento & rin) { rout += rin; }
|
||||
virtual void create_row(TDocumento& doc_out, const TRiga_documento & rin);
|
||||
virtual const TString & get_tipo_out(const TDocumento & doc_out) { return get("S8"); }
|
||||
virtual const TString& get_tipo_out(const TDocumento& doc_out) { return get("S8"); }
|
||||
virtual bool da_raggruppare(const TRiga_documento & rin) { return true; }
|
||||
virtual void elabora_riga(TRiga_documento& r, TDocumento& doc_out, bool usa_dcons, bool ragg_rig, bool ignora_desc,
|
||||
TToken_string & campi_riga, const TDate & dcons, const TDate & ddoc);
|
||||
void init();
|
||||
|
||||
bool get_num_tip_out(const TDocumento& doc_out, TString& codnum, TString& tipodoc);
|
||||
|
||||
public:
|
||||
virtual bool raggruppa(TDocumento& din, TDocumento& dout);
|
||||
virtual bool elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
|
||||
|
@ -338,6 +338,39 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TFatturazione_bolle::get_num_tip_out(const TDocumento& doc, TString& codnum, TString& tipodoc)
|
||||
{
|
||||
codnum = codice_numerazione_finale();
|
||||
tipodoc = get_tipo_out(doc);
|
||||
|
||||
const TRectype& cfven = doc.clifor().vendite();
|
||||
const TString& tipo_cfv = cfven.get(CFV_TIPODOCFAT);
|
||||
if (tipo_cfv.full())
|
||||
tipodoc = tipo_cfv;
|
||||
|
||||
const TCodice_numerazione& cn = cached_numerazione(codnum);
|
||||
bool ok = cn.find_tipo_doc(tipo_cfv) >= 0;
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
TISAM_recordset num_recset("USE %NUM SELECT I1=2");
|
||||
for (ok = num_recset.move_first(); ok; ok = num_recset.move_next()) // giro sui vari tipi fattura
|
||||
{
|
||||
const TString4 codtab = num_recset.get("CODTAB").as_string();
|
||||
const TCodice_numerazione cn(codtab);
|
||||
if (cn.find_tipo_doc(tipodoc) >= 0)
|
||||
{
|
||||
codnum = codtab;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ok)
|
||||
tipodoc = get_tipo_out(doc); // Rimette tipo orginale;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
|
||||
const TDate& data_elab, bool interattivo)
|
||||
{
|
||||
@ -347,7 +380,7 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
||||
|
||||
TToken_string campi_doc(128); // Lista di campi che devono essere uguali
|
||||
campi_raggruppamento(campi_doc);
|
||||
|
||||
|
||||
pre_process_input(doc_in);
|
||||
for (int id = 0; id < doc_in.items(); id++)
|
||||
{
|
||||
@ -478,15 +511,14 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
||||
|
||||
if (od >= tot) // Se non ho trovato un documento compatibile ...
|
||||
{ // ... creane uno nuovo (certamente compatibile)
|
||||
const int anno = data_elab.year();
|
||||
const TString4 codnum(campione.get(DOC_CODNUM));
|
||||
const TString4 tipo_out(get("S8")); // Tipo del documento di output
|
||||
const int anno = data_elab.year();
|
||||
char provv = 'D';
|
||||
|
||||
if (cached_numerazione(codice_numerazione_finale()).num_provv())
|
||||
provv = 'P';
|
||||
|
||||
TDocumento* new_doc = new TDocumento(provv, anno, codnum, -1);
|
||||
// Per ora usa la stessa numerazione del documento d'ingresso per copiare tutto compatibilmente
|
||||
const TString4 tmpcodnum = campione.get(DOC_CODNUM);
|
||||
TDocumento* new_doc = new TDocumento(provv, anno, tmpcodnum, -1);
|
||||
|
||||
// Attenzione! Il cambio del tipo documento provocherebbe il reset delle variabili
|
||||
// Per cui lo scrivo temporaneamente nel tipo del documento d'ingresso
|
||||
@ -527,31 +559,28 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
||||
|
||||
post_process_input(doc_in);
|
||||
const int tot = doc_out.items();
|
||||
const TString4 codnum(codice_numerazione_finale());
|
||||
real impminfat;
|
||||
|
||||
if (!interattivo && tot > 0)
|
||||
{
|
||||
impminfat = doc_out[0].clifor().vendite().get_real(CFV_IMPMINFAT);
|
||||
if (impminfat == ZERO)
|
||||
if (impminfat.is_zero())
|
||||
impminfat = _impminfat;
|
||||
}
|
||||
|
||||
for (int i = tot - 1; i >=0; i--) // Forza tipo e numerazione documento.
|
||||
{
|
||||
TDocumento& d = doc_out[i];
|
||||
d.put(DOC_CODNUM, codnum);
|
||||
|
||||
TToken_string key; key.add(d.get(DOC_TIPOCF)); key.add(d.get(DOC_CODCF));
|
||||
const TRectype & cfven = cache().get(LF_CFVEN, key);
|
||||
const TString4 tipo_cli(cfven.get(CFV_TIPODOCFAT));
|
||||
|
||||
const TString& tipo_out = get_tipo_out(d); // Tipo del documento di output
|
||||
TRecfield td(d, DOC_TIPODOC); // Uso il TRecfield per scavalcare tutti gli automatismi
|
||||
td = tipo_cli.empty() ? tipo_out : tipo_cli;
|
||||
TString4 numout, tipout; get_num_tip_out(d, numout, tipout);
|
||||
d.put(DOC_CODNUM, numout);
|
||||
TRecfield td(d.head(), DOC_TIPODOC); // Uso il TRecfield per scavalcare tutti gli automatismi
|
||||
td = tipout;
|
||||
|
||||
const TString& sconto = d.get(DOC_SCONTOPERC);
|
||||
d.put(DOC_SCONTOPERC, sconto);
|
||||
if (change_clifo())
|
||||
|
||||
if (change_clifo())
|
||||
{
|
||||
const TString4 tipodoc(d.tipo().codice());
|
||||
TDocumento_mask m(tipodoc);
|
||||
|
@ -747,6 +747,15 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc, bool interattivo) // b
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (interattivo)
|
||||
{
|
||||
TString msg;
|
||||
msg.format(FR("Ignorata nota di credito %d/%s/%ld"), doc.anno(), (const char*)doc.numerazione(), doc.numero());
|
||||
xvtil_statbar_set(msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (good() && _can_write)
|
||||
change_doc_status(doc);
|
||||
@ -764,7 +773,7 @@ bool TGenerazione_effetti::elabora(TLista_documenti& doc_in, TLista_documenti& d
|
||||
for (int i = 0; i < items ; i++) // Scorriamo tutti i documenti nella lista
|
||||
{
|
||||
TDocumento& doc = doc_in[i];
|
||||
msg.format(FR("Generazione effetti documento %s/%ld."), (const char*) doc.numerazione(), doc.numero());
|
||||
msg.format(FR("Generazione effetti documento %d/%s/%ld"), doc.anno(), (const char*)doc.numerazione(), doc.numero());
|
||||
xvtil_statbar_set(msg);
|
||||
do_events();
|
||||
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
void set_riga_tic();
|
||||
|
||||
// Funzioni per settare i parametri
|
||||
void set_decimals(dec_parm & parm) { _parm = parm ; }
|
||||
void set_decimals(const dec_parm & parm) { _parm = parm ; }
|
||||
// void set_condv(TCli_for * cli); // Cambia le condizioni di vendita
|
||||
TDocumentoEsteso (const TRectype & rec, dec_parm & parm) ;
|
||||
TDocumentoEsteso (const TRectype & rec) ;
|
||||
|
208
ve/velib06.cpp
208
ve/velib06.cpp
@ -309,76 +309,85 @@ TDocumento_mask::TDocumento_mask(const char* td)
|
||||
const TDongle& a = dongle();
|
||||
if (a.active(CTAUT) || a.active(PAAUT))
|
||||
{
|
||||
if (_ges_ca && id2pos(F_CUP) > 0)
|
||||
if (_ges_ca && id2pos(F_CUP) > 0) // Se gestisco l'analtica ...
|
||||
{
|
||||
TBrowse * bp = efield(F_CUP).browse();
|
||||
TRelation * rp = new TRelation(LF_CFCMS);
|
||||
|
||||
rp->add("%CUP", "CODTAB==" CFCMS_CUP);
|
||||
rp->add(LF_CLIFO, "TIPOCF==TIPOCF|CODCF==CODCF");
|
||||
bp->set_cursor(new TCursor(rp, "", 2));
|
||||
bp->set_filter("TIPOCF==\"C\"");
|
||||
bp->remove_input_field();
|
||||
bp->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bp->add_input_field(TOSTRING(F_CUP), CFCMS_CUP);
|
||||
bp->remove_display_field();
|
||||
bp->add_display_field("Codice CUP@15", CFCMS_CUP);
|
||||
bp->add_display_field("Descrizione@50", "%CUP->S0");
|
||||
bp->add_display_field("Codice Cliente", CFCMS_CODCF);
|
||||
bp->add_display_field("Ragione Sociale@50", TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bp->remove_output_field();
|
||||
bp->add_output_field(TOSTRING(F_CUP), CFCMS_CUP);
|
||||
bp->add_output_field(TOSTRING(F_CIG), CFCMS_CIG);
|
||||
bp->add_output_field(TOSTRING(F_DESCRCUP), "%CUP->S0");
|
||||
|
||||
TBrowse * bpd = efield(F_DESCRCUP).browse();
|
||||
TLocalisamfile cfcms(LF_CFCMS);
|
||||
if (cfcms.first() == NOERR) // ... ed i clienti per commessa (alias sono Dinamica)
|
||||
{
|
||||
// Allora impongo la scelta di CIG e CUP in base alla commessa
|
||||
TBrowse* bp = efield(F_CUP).browse();
|
||||
|
||||
bpd->set_cursor(new TSorted_cursor(rp, CFCMS_COMMESSA "|%CUP->S0"));
|
||||
bpd->set_filter("TIPOCF==\"C\"");
|
||||
bpd->remove_input_field();
|
||||
bpd->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bpd->add_input_field(TOSTRING(F_DESCRCUP), "%CUP->S0");
|
||||
bpd->remove_display_field();
|
||||
bpd->add_display_field("Descrizione@50", "%CUP->S0");
|
||||
bpd->add_display_field("Codice CUP@15", CFCMS_CUP);
|
||||
bpd->add_display_field("Codice Cliente", CFCMS_CODCF);
|
||||
bpd->add_display_field("Ragione Sociale@50", TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bpd->copy_output(bp);
|
||||
TRelation * rp = new TRelation(LF_CFCMS);
|
||||
rp->add("%CUP", "CODTAB==" CFCMS_CUP);
|
||||
rp->add(LF_CLIFO, "TIPOCF==TIPOCF|CODCF==CODCF");
|
||||
bp->set_cursor(new TCursor(rp, "", 2));
|
||||
|
||||
TBrowse * bg = efield(F_CIG).browse();
|
||||
TRelation * rg = new TRelation(LF_CFCMS);
|
||||
bp->set_filter("TIPOCF==\"C\"");
|
||||
bp->remove_input_field();
|
||||
bp->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bp->add_input_field(TOSTRING(F_CUP), CFCMS_CUP);
|
||||
bp->remove_display_field();
|
||||
bp->add_display_field(HR("Codice CUP@15"), CFCMS_CUP);
|
||||
bp->add_display_field(HR("Descrizione@50"), "%CUP->S0");
|
||||
bp->add_display_field(HR("Codice Cliente"), CFCMS_CODCF);
|
||||
bp->add_display_field(HR("Ragione Sociale@50"), TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bp->remove_output_field();
|
||||
bp->add_output_field(TOSTRING(F_CUP), CFCMS_CUP);
|
||||
bp->add_output_field(TOSTRING(F_CIG), CFCMS_CIG);
|
||||
bp->add_output_field(TOSTRING(F_DESCRCUP), "%CUP->S0");
|
||||
bp->set_insert("Rca0 -5");
|
||||
|
||||
rg->add("%CIG", "CODTAB==" CFCMS_CIG);
|
||||
rg->add(LF_CLIFO, "TIPOCF==TIPOCF|CODCF==CODCF");
|
||||
bg->set_cursor(new TCursor(rg, "", 3));
|
||||
bg->set_filter("TIPOCF==\"C\"");
|
||||
bg->remove_input_field();
|
||||
bg->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bg->add_input_field(TOSTRING(F_CIG), CFCMS_CIG);
|
||||
bg->remove_display_field();
|
||||
bg->add_display_field("Codice CIG@15", CFCMS_CIG);
|
||||
bg->add_display_field("Descrizione@50", "%CIG->S0");
|
||||
bg->add_display_field("Codice Cliente", CFCMS_CODCF);
|
||||
bg->add_display_field("Ragione Sociale@50", TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bg->remove_output_field();
|
||||
bg->add_output_field(TOSTRING(F_CIG), CFCMS_CIG);
|
||||
bg->add_output_field(TOSTRING(F_CUP), CFCMS_CUP);
|
||||
bg->add_output_field(TOSTRING(F_DESCRCIG), "%CIG->S0");
|
||||
TBrowse* bpd = efield(F_DESCRCUP).browse();
|
||||
bpd->set_cursor(new TSorted_cursor(rp, CFCMS_COMMESSA "|%CUP->S0"));
|
||||
bpd->set_filter("TIPOCF==\"C\"");
|
||||
bpd->remove_input_field();
|
||||
bpd->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bpd->add_input_field(TOSTRING(F_DESCRCUP), "%CUP->S0");
|
||||
bpd->remove_display_field();
|
||||
bpd->add_display_field(HR("Descrizione@50"), "%CUP->S0");
|
||||
bpd->add_display_field(HR("Codice CUP@15"), CFCMS_CUP);
|
||||
bpd->add_display_field(HR("Codice Cliente"), CFCMS_CODCF);
|
||||
bpd->add_display_field(HR("Ragione Sociale@50"), TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bpd->copy_output(bp);
|
||||
bpd->set_insert("Rca0 -5");
|
||||
|
||||
TBrowse * bgd = efield(F_DESCRCIG).browse();
|
||||
TBrowse * bg = efield(F_CIG).browse();
|
||||
TRelation * rg = new TRelation(LF_CFCMS);
|
||||
|
||||
rg->add("%CIG", "CODTAB==" CFCMS_CIG);
|
||||
rg->add(LF_CLIFO, "TIPOCF==TIPOCF|CODCF==CODCF");
|
||||
bg->set_cursor(new TCursor(rg, "", 3));
|
||||
bg->set_filter("TIPOCF==\"C\"");
|
||||
bg->remove_input_field();
|
||||
bg->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bg->add_input_field(TOSTRING(F_CIG), CFCMS_CIG);
|
||||
bg->remove_display_field();
|
||||
bg->add_display_field(HR("Codice CIG@15"), CFCMS_CIG);
|
||||
bg->add_display_field(HR("Descrizione@50"), "%CIG->S0");
|
||||
bg->add_display_field(HR("Codice Cliente"), CFCMS_CODCF);
|
||||
bg->add_display_field(HR("Ragione Sociale@50"), TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bg->remove_output_field();
|
||||
bg->add_output_field(TOSTRING(F_CIG), CFCMS_CIG);
|
||||
bg->add_output_field(TOSTRING(F_CUP), CFCMS_CUP);
|
||||
bg->add_output_field(TOSTRING(F_DESCRCIG), "%CIG->S0");
|
||||
bg->set_insert("Rca0 -5");
|
||||
|
||||
TBrowse * bgd = efield(F_DESCRCIG).browse();
|
||||
|
||||
bgd->set_cursor(new TSorted_cursor(rg, CFCMS_COMMESSA "|%CIG->S0"));
|
||||
bgd->set_filter("TIPOCF==\"C\"");
|
||||
bgd->remove_input_field();
|
||||
bgd->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bgd->add_input_field(TOSTRING(F_DESCRCIG), "%CIG->S0");
|
||||
bgd->remove_display_field();
|
||||
bgd->add_display_field(HR("Descrizione@50"), "%CIG->S0");
|
||||
bgd->add_display_field(HR("Codice CIG@15"), CFCMS_CIG);
|
||||
bgd->add_display_field(HR("Cliente"), CFCMS_CODCF);
|
||||
bgd->add_display_field(HR("Ragione Sociale@50"), TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bgd->copy_output(bg);
|
||||
}
|
||||
bgd->set_cursor(new TSorted_cursor(rg, CFCMS_COMMESSA "|%CIG->S0"));
|
||||
bgd->set_filter("TIPOCF==\"C\"");
|
||||
bgd->remove_input_field();
|
||||
bgd->add_input_field(TOSTRING(F_CMSH), CFCMS_COMMESSA, -1, true);
|
||||
bgd->add_input_field(TOSTRING(F_DESCRCIG), "%CIG->S0");
|
||||
bgd->remove_display_field();
|
||||
bgd->add_display_field(HR("Descrizione@50"), "%CIG->S0");
|
||||
bgd->add_display_field(HR("Codice CIG@15"), CFCMS_CIG);
|
||||
bgd->add_display_field(HR("Cliente"), CFCMS_CODCF);
|
||||
bgd->add_display_field(HR("Ragione Sociale@50"), TOSTRING(LF_CLIFO) "->" CLI_RAGSOC);
|
||||
bgd->copy_output(bg);
|
||||
bgd->set_insert("Rca0 -5");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -388,13 +397,14 @@ TDocumento_mask::TDocumento_mask(const char* td)
|
||||
hide(F_DESCRCIG);
|
||||
}
|
||||
|
||||
const bool gesoff = cfg.get_bool("GES", "ve", 3);
|
||||
const bool gesoff = cfg.get_bool("GES", "ve", 3);
|
||||
enable(F_CODCAMP, gesoff);
|
||||
enable(F_DESCAMP, gesoff);
|
||||
const bool gessco = cfg.get_char("GESSCO") != 'N';
|
||||
|
||||
const bool gessco = cfg.get_char("GESSCO") != 'N';
|
||||
enable(F_SCONTOPERC, gessco);
|
||||
|
||||
const bool gesage = cfg.get_bool("GESAGE");
|
||||
const bool gesage = cfg.get_bool("GESAGE");
|
||||
enable(F_CODAG, gesage);
|
||||
enable(F_DESAG, gesage);
|
||||
enable(F_CODAGVIS, gesage);
|
||||
@ -542,7 +552,7 @@ void TDocumento_mask::insert_anal_page()
|
||||
int newpage = win2page(_sheet->parent());
|
||||
if (newpage == 0)
|
||||
newpage++;
|
||||
create_page("Analitica", newpage); // Inserisce una pagina vuota con un titolo a caso
|
||||
create_page(TR("Analitica"), newpage); // Inserisce una pagina vuota con un titolo a caso
|
||||
|
||||
add_groupbox(DLG_NULL, newpage, "", 1, 0, 78, 6);
|
||||
add_string(DLG_NULL, newpage, TR("Cod. num. "), 2, 1, 4, "D").set_group(2);
|
||||
@ -566,8 +576,9 @@ void TDocumento_mask::insert_anal_page()
|
||||
int y = 7;
|
||||
short dlg = F_CDC1; // id del primo campo da generare
|
||||
short dlgd = F_DESCDC1;
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
|
||||
const bool ca_in_testa = doc().tipo().head_ca_required();
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
const TString& level = ini.get("Level", NULL, i+1); // Legge il livello 1 o 2
|
||||
if (level == "CDC") // Crea centro di costo
|
||||
@ -575,11 +586,11 @@ void TDocumento_mask::insert_anal_page()
|
||||
_cdc_start = dlg;
|
||||
_cdc_end = dlg + ca_multilevel_code_info(LF_CDC).levels()-1;
|
||||
if (use_fsc && fasinfo.parent() == LF_CDC)
|
||||
insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && doc().tipo().head_ca_required());
|
||||
insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && ca_in_testa);
|
||||
else
|
||||
{
|
||||
const bool cdc_req = ini.get_bool("CdcRequired");
|
||||
insert_anal_fields(*this, newpage, LF_CDC, y, dlg, dlgd, cdc_req && doc().tipo().head_ca_required());
|
||||
const bool cdc_req = ca_in_testa && ini.get_bool("CdcRequired");
|
||||
insert_anal_fields(*this, newpage, LF_CDC, y, dlg, dlgd, cdc_req);
|
||||
}
|
||||
} else
|
||||
if (level == "CMS") // Crea commessa
|
||||
@ -587,17 +598,15 @@ void TDocumento_mask::insert_anal_page()
|
||||
_cms_start = dlg;
|
||||
_cms_end = dlg + ca_multilevel_code_info(LF_COMMESSE).levels()-1;
|
||||
if (use_fsc && fasinfo.parent() == LF_COMMESSE)
|
||||
insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && doc().tipo().head_ca_required());
|
||||
insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && ca_in_testa);
|
||||
else
|
||||
{
|
||||
const bool cms_req = ini.get_bool("CmsRequired");
|
||||
|
||||
insert_anal_fields(*this, newpage, LF_COMMESSE, y, dlg, dlgd, cms_req && doc().tipo().head_ca_required());
|
||||
const bool cms_req = false; // ca_in_testa && ini.get_bool("CmsRequired"); // Ora gestisco il REQUIRED da codcms_handler
|
||||
insert_anal_fields(*this, newpage, LF_COMMESSE, y, dlg, dlgd, cms_req);
|
||||
}
|
||||
set_field_handler(_cms_end, codcms_handler);
|
||||
}
|
||||
}
|
||||
if (_cms_start > 0)
|
||||
set_field_handler(_cms_end, codcms_handler);
|
||||
|
||||
if (use_fsc && fasinfo.parent() <= 0)
|
||||
insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && doc().tipo().head_ca_required());
|
||||
@ -741,7 +750,7 @@ void TDocumento_mask::configura_sheet(TSheet_field& sheet)
|
||||
|
||||
for ( i = MAX_COLUMNS - 1; i >= 0; i-- )
|
||||
{
|
||||
if( to_delete[i] )
|
||||
if (to_delete[i])
|
||||
{
|
||||
sheet.enable_column( i + FIRST_FIELD, false);
|
||||
sheet.delete_column( i + FIRST_FIELD);
|
||||
@ -1848,36 +1857,41 @@ void TDocumento_mask::update_giacenza()
|
||||
bool TDocumento_mask::ss_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
bool ok = true;
|
||||
if (key == K_ENTER )
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
const TSheet_field& ss = (TSheet_field&)f;
|
||||
const TSheet_field& ss = (TSheet_field&)f;
|
||||
TDocumento_mask& mask = (TDocumento_mask&)ss.mask();
|
||||
|
||||
TConfig& ini = ca_config();
|
||||
const short cme = mask.cms_end();
|
||||
if (mask.id2pos(cme) > 0 && mask.get(cme).empty() && (ini.get_int("Authorizations") & 0x6))
|
||||
// Se la commessa in testata è vuota controllo che sia presente sulle righe
|
||||
if (!ss.empty() && cme > 0 && mask.efield(cme).empty())
|
||||
{
|
||||
if (ini.get_bool("CmsRequired") || ini.get("FathFasi").full())
|
||||
// Controllo se la commessa è veramente obbligatoria in base alla configurazione
|
||||
TConfig& ini = ca_config();
|
||||
if ((ini.get_int("Authorizations") & 0x6) && (ini.get_bool("CmsRequired") || ini.get("FathFasi").full()))
|
||||
{
|
||||
const int col = ss.cid2index(mask.cms_end_sh());
|
||||
FOR_EACH_SHEET_ROW(ss, r, riga)
|
||||
const short cmes = mask.cms_end_sh();
|
||||
if (cmes > 0) // Puo' succedere che sia < 0 in assenza di righe buone
|
||||
{
|
||||
if (ss.cell_enabled(r, col))
|
||||
const int col = ss.cid2index(cmes);
|
||||
FOR_EACH_SHEET_ROW(ss, r, riga)
|
||||
{
|
||||
const char* cms = riga->get(col);
|
||||
if (!(cms && *cms > ' '))
|
||||
if (ss.cell_enabled(r, col))
|
||||
{
|
||||
ss.error_box(FR("La commessa è obbligatoria alla riga %d"), r+1);
|
||||
break;
|
||||
const char* cms = riga->get(col);
|
||||
if (!(cms && *cms > ' '))
|
||||
{
|
||||
ss.error_box(FR("La commessa è obbligatoria alla riga %d"), r+1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (ok && ss.empty() && mask.insert_mode() && !app().is_transaction())
|
||||
ok = yesno_box(TR("Il documento è privo di righe:\nSi desidera continuare ugualmente?"));
|
||||
*/
|
||||
}
|
||||
/*
|
||||
if (ok && ss.empty() && mask.insert_mode() && !app().is_transaction())
|
||||
ok = yesno_box(TR("Il documento è privo di righe:\nSi desidera continuare ugualmente?"));
|
||||
*/
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
@ -2806,38 +2806,40 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
return true;
|
||||
|
||||
TDocumento_mask& mask = (TDocumento_mask&)f.mask();
|
||||
|
||||
if (f.empty() || f.dlg() < mask.cms_end())
|
||||
if (f.dlg() < mask.cms_end())
|
||||
return true; // Opera solo sull'ultimo livello del codice commessa
|
||||
|
||||
const TRectype& curr = mask.efield(mask.cms_end()).browse()->cursor()->curr();
|
||||
const TString80 codcms = curr.get(COMMESSE_CODCMS);
|
||||
|
||||
if (f.to_check(key, true))
|
||||
TDocumento& doc = mask.doc();
|
||||
TSheet_field& sf = mask.sfield(F_SHEET);
|
||||
const bool req = !sf.empty() && doc.tipo().head_ca_required();
|
||||
f.check_type(req ? CHECK_REQUIRED : CHECK_NORMAL);
|
||||
if (f.empty())
|
||||
{
|
||||
mask.set(F_CMSH, codcms);
|
||||
if (curr.get_bool(COMMESSE_CHIUSA))
|
||||
return f.error_box(FR("Impossibile operare sulla commessa chiusa %s"), (const char*)codcms);
|
||||
if (req)
|
||||
return f.error_box(TR("La commessa è obbligatoria per questo tipo documento"));
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
const TRectype& curr_cms = ((TEdit_field&)f).browse()->cursor()->curr();
|
||||
const TString80 codcms = curr_cms.get(COMMESSE_CODCMS);
|
||||
mask.set(F_CMSH, codcms);
|
||||
if (curr_cms.get_bool(COMMESSE_CHIUSA))
|
||||
return f.error_box(FR("Impossibile operare sulla commessa chiusa %s"), (const char*)codcms);
|
||||
|
||||
if ((key == K_TAB && f.focusdirty()) || key == K_ENTER)
|
||||
{
|
||||
// Controlla se c'e' la gestione dei centri di costo al secondo livello
|
||||
if (mask.codcms() != codcms)
|
||||
{
|
||||
TDocumento & doc = mask.doc();
|
||||
TSheet_field & sf = mask.sfield(F_SHEET);
|
||||
const int rows = doc.physical_rows();
|
||||
|
||||
doc.put(DOC_CODCMS, codcms);
|
||||
for (int r = 1; r <= rows; r++)
|
||||
FOR_EACH_PHYSICAL_RDOC(doc, r, riga)
|
||||
{
|
||||
TRiga_documento & riga = doc[r];
|
||||
const TMask & m = sf.sheet_row_mask(r -1);
|
||||
|
||||
const TMask& m = sf.sheet_row_mask(r -1);
|
||||
if (m.id2pos(FR_TIPODET) >= 0 && m.field(FR_TIPODET).active()) //solo se attivo il campo di indetraibilita'...
|
||||
{
|
||||
riga.cms2tipodet();
|
||||
riga.autoload(sf);
|
||||
riga->cms2tipodet();
|
||||
riga->autoload(sf);
|
||||
sf.force_update(r - 1);
|
||||
}
|
||||
}
|
||||
@ -2846,7 +2848,7 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
if (mask.cdc_start() > 0 && mask.cdc_start() > mask.cms_start() && mask.codcms() != codcms)
|
||||
{
|
||||
mask.codcms() = codcms;
|
||||
const TString codcosto = curr.get(COMMESSE_CODCOSTO);
|
||||
const TString codcosto = curr_cms.get(COMMESSE_CODCOSTO);
|
||||
if (codcosto.full()) // Propone centro di costo solo se specificato
|
||||
{
|
||||
for (short i = mask.cdc_start(); i <= mask.cdc_end(); i++)
|
||||
@ -2861,27 +2863,22 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((key == K_TAB && f.focusdirty()))
|
||||
if ((key == K_TAB && f.focusdirty()) && !doc.bloccato())
|
||||
{
|
||||
TDocumento & doc = mask.doc();
|
||||
|
||||
if (!doc.bloccato())
|
||||
{
|
||||
char name[8] = "CODSP0";
|
||||
TString_array spese;
|
||||
char name[8] = "CODSP0";
|
||||
TString_array spese;
|
||||
|
||||
const TRectype & ven_rec = doc.clifor().vendite();
|
||||
for (int i = 1; i <= 4; i++)
|
||||
{
|
||||
name[5] = '0' + i;
|
||||
const TString& s = ven_rec.get(name);
|
||||
if (s.full())
|
||||
spese.add(s);
|
||||
}
|
||||
mask.mask2doc();
|
||||
doc.put(DOC_SPESEUPD, "");
|
||||
doc.update_spese_aut(spese, false, &mask.sfield(F_SHEET));
|
||||
}
|
||||
const TRectype& ven_rec = doc.clifor().vendite();
|
||||
for (int i = 1; i <= 4; i++)
|
||||
{
|
||||
name[5] = '0' + i;
|
||||
const TString& s = ven_rec.get(name);
|
||||
if (s.full())
|
||||
spese.add(s);
|
||||
}
|
||||
mask.mask2doc();
|
||||
doc.zero(DOC_SPESEUPD);
|
||||
doc.update_spese_aut(spese, false, &mask.sfield(F_SHEET));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2895,8 +2892,7 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
key.add(codcms);
|
||||
key.add("C");
|
||||
key.add(1);
|
||||
const TRectype & cfcms = cache().get(LF_CFCMS, key);
|
||||
|
||||
const TRectype& cfcms = cache().get(LF_CFCMS, key);
|
||||
mask.set(F_CUP, cfcms.get(CFCMS_CUP), 3);
|
||||
mask.set(F_CIG, cfcms.get(CFCMS_CIG), 3);
|
||||
}
|
||||
@ -2954,11 +2950,12 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
const TString& contsep = cache().get(LF_COMMESSE, codcms, COMMESSE_CONTSEP);
|
||||
mask.set(F_CONTSEP, contsep);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key == K_TAB && !mask.is_running())
|
||||
mask.codcms() = mask.doc().get(DOC_CODCMS);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -2991,8 +2988,8 @@ bool evasion_check_handler(TMask_field& f, KEY key )
|
||||
key.add(orig_doc->get(DOC_CODNUM));
|
||||
key.add(orig_doc->get(DOC_NDOC));
|
||||
|
||||
TDocumento & father_doc = cached_doc(key);
|
||||
const TRectype * row = r.find_original_rdoc();
|
||||
TDocumento& father_doc = cached_doc(key);
|
||||
const TRectype* row = r.find_original_rdoc();
|
||||
|
||||
if (row != NULL)
|
||||
{
|
||||
@ -3037,7 +3034,9 @@ bool evasion_check_handler(TMask_field& f, KEY key )
|
||||
|
||||
const real residuo = ordinato - evaso;
|
||||
if (residuo < qta)
|
||||
if (!yesno_box(FR("La quantita' %s e' superiore al residuo %s,\nvuoi continuare ugualmente"), qta.stringa(), residuo.stringa()))
|
||||
{
|
||||
if (!yesno_box(FR("La quantità %s è superiore al residuo %s:\nsi desidera continuare ugualmente?"),
|
||||
qta.stringa(), residuo.stringa()))
|
||||
{
|
||||
if (!f.mask().is_running())
|
||||
{
|
||||
@ -3049,6 +3048,7 @@ bool evasion_check_handler(TMask_field& f, KEY key )
|
||||
else
|
||||
if (!f.mask().is_running())
|
||||
m.set_focus_field(F_SHEET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3074,7 +3074,6 @@ bool distinta_link_handler(TMask_field& f, KEY key )
|
||||
tempfile.temp("ve0");
|
||||
tempfile.ext("ini");
|
||||
|
||||
|
||||
{
|
||||
TConfig configfile(tempfile);
|
||||
TString8 para;
|
||||
|
@ -8,7 +8,8 @@ Item_02 = "Stampe documenti", [VEMENU_053]
|
||||
Item_03 = "Elaborazioni differite", [VEMENU_050]
|
||||
Item_04 = "Servizi", [VEMENU_051]
|
||||
Item_05 = "Configurazione modulo", [VEMENU_052]
|
||||
Item_06 = "Moduli aggiuntivi", <veaddon.men>
|
||||
Item_06 = "Fatture P.A.", <pamenu.men>
|
||||
Item_07 = "Moduli aggiuntivi", <veaddon.men>
|
||||
|
||||
[VEMENU_050]
|
||||
Caption = "Gestione elaborazioni differite"
|
||||
|
@ -118,9 +118,9 @@
|
||||
#define F_CODABIP1 222
|
||||
#define F_CODCABP1 223
|
||||
#define F_PROGBNP1 224
|
||||
#define F_CONTR122 225
|
||||
#define F_PACONTRATTO 225
|
||||
#define F_CONTSEP 226
|
||||
#define F_MODPAG 227
|
||||
#define F_PATIPOCON 227
|
||||
#define F_IVAXCASSA 228
|
||||
|
||||
#define F_CDC1 251
|
||||
|
Loading…
x
Reference in New Issue
Block a user