Patch level : 10.0 patch 810
Files correlati : ve0.exe ve6.exe Ricompilazione Demo : [ ] Commento Bug 0001692: Gruppo Belegotti è richiesto l'inserimento di un minimo fatturabile, i documenti che anche raggruppati non raggiungeranno detto limite non saranno processati e quindi non cambieranno di stato. E' richiesto che l'importo minimo effetto diventi una dato societario anzichè a livello di cliente. La funzionalità è stata inserita nelle elaborazioni differite e non in quelle interattive, poichè in quest ultime non aveva senso e in modo da permettere di elaborare comunque un documento. git-svn-id: svn://10.65.10.50/branches/R_10_00@20909 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
229d3ac39e
commit
66027944da
@ -366,7 +366,7 @@ BEGIN
|
|||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
HELP "Codice spesa per contributo plastica"
|
HELP "Codice spesa per contributo plastica"
|
||||||
GROUP 7
|
GROUP 7
|
||||||
MESSAGE EMPTY ENABLE,F_CONFPAL
|
MESSAGE EMPTY ENABLE,F_CONFPLA
|
||||||
MESSAGE DISABLE,F_CONFPLA|"X",F_CONFPLA
|
MESSAGE DISABLE,F_CONFPLA|"X",F_CONFPLA
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -80,6 +80,21 @@ BEGIN
|
|||||||
PROMPT 2 14 "Utilizzo lettere d'intento"
|
PROMPT 2 14 "Utilizzo lettere d'intento"
|
||||||
FIELD USELETTERE
|
FIELD USELETTERE
|
||||||
END
|
END
|
||||||
|
|
||||||
|
CURRENCY F_IMPMINFAT 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 15 "Importo minimo fatture "
|
||||||
|
FIELD IMPMINFAT
|
||||||
|
PICTURE "."
|
||||||
|
END
|
||||||
|
|
||||||
|
CURRENCY F_IMPMINEFF 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 16 "Importo minimo per effetti "
|
||||||
|
FIELD IMPMINEFF
|
||||||
|
PICTURE "."
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
@ -28,8 +28,8 @@ bool TFatturazione_bolle_app::process(TIndwin& iw, TElaborazione & eld,
|
|||||||
{
|
{
|
||||||
// Crea documenti di output
|
// Crea documenti di output
|
||||||
TLista_documenti dout;
|
TLista_documenti dout;
|
||||||
bool ok = eld.elabora(din, dout, data_elab);
|
bool ok = true;
|
||||||
if (ok)
|
if (eld.elabora(din, dout, data_elab))
|
||||||
{
|
{
|
||||||
TString msg;
|
TString msg;
|
||||||
msg << din.items() << TR(" documenti raggruppati in ") << dout.items();
|
msg << din.items() << TR(" documenti raggruppati in ") << dout.items();
|
||||||
@ -47,11 +47,6 @@ bool TFatturazione_bolle_app::process(TIndwin& iw, TElaborazione & eld,
|
|||||||
ok = error_box("Errore %d durante l'aggiornamento dei documenti da raggruppare!", err);
|
ok = error_box("Errore %d durante l'aggiornamento dei documenti da raggruppare!", err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
const long codcli = din[0].get_long(DOC_CODCF);
|
|
||||||
ok = error_box("I documenti relativi al cliente %ld non sono stati elaborati.",
|
|
||||||
codcli);
|
|
||||||
}
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -581,7 +581,7 @@ void TGenerazioneEffetti_app::generate()
|
|||||||
}
|
}
|
||||||
// Ogni elemento di _group_array è una TToken_string. Ogni elemento della TToken_string contiene
|
// Ogni elemento di _group_array è una TToken_string. Ogni elemento della TToken_string contiene
|
||||||
// la chiave per identificare il documento che fa parte di quel raggruppamento
|
// la chiave per identificare il documento che fa parte di quel raggruppamento
|
||||||
tot += gen_eff.group_bills(_group_array);// Setta l'elenco dei documenti per generare effetti raggruppati
|
tot += gen_eff.group_bills(_group_array, false);// Setta l'elenco dei documenti per generare effetti raggruppati
|
||||||
|
|
||||||
if (tot > 0L)
|
if (tot > 0L)
|
||||||
message_box("Totale effetti generati: %ld", tot);
|
message_box("Totale effetti generati: %ld", tot);
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
#define F_CONTROEURO_E 108
|
#define F_CONTROEURO_E 108
|
||||||
#define F_LINGUA_ONLY 109
|
#define F_LINGUA_ONLY 109
|
||||||
#define F_USELETTERE 110
|
#define F_USELETTERE 110
|
||||||
|
#define F_IMPMINFAT 111
|
||||||
|
|
||||||
|
|
||||||
// Campi per ve0200c.uml
|
// Campi per ve0200c.uml
|
||||||
@ -164,6 +165,7 @@
|
|||||||
#define F_DESESENZ 143
|
#define F_DESESENZ 143
|
||||||
#define F_SPADD 144
|
#define F_SPADD 144
|
||||||
#define F_MAXADD 145
|
#define F_MAXADD 145
|
||||||
|
#define F_IMPMINEFF 146
|
||||||
|
|
||||||
// Campi per ve0200g.uml
|
// Campi per ve0200g.uml
|
||||||
#define F_EXPLODEDB 101
|
#define F_EXPLODEDB 101
|
||||||
|
10
ve/velib04.h
10
ve/velib04.h
@ -243,6 +243,7 @@ class TFatturazione_bolle : public TElaborazione // velib04a
|
|||||||
{
|
{
|
||||||
TToken_string _cod_desc, _lista_campi, _rowsort;
|
TToken_string _cod_desc, _lista_campi, _rowsort;
|
||||||
bool _cambia_codice;
|
bool _cambia_codice;
|
||||||
|
real _impminfat;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void campi_raggruppamento_righe(TToken_string& campi_riga) const;
|
virtual void campi_raggruppamento_righe(TToken_string& campi_riga) const;
|
||||||
@ -267,7 +268,7 @@ public:
|
|||||||
bool change_clifo() { return get_bool("B14"); }
|
bool change_clifo() { return get_bool("B14"); }
|
||||||
|
|
||||||
TFatturazione_bolle(const char* cod);
|
TFatturazione_bolle(const char* cod);
|
||||||
TFatturazione_bolle(const TRectype& rec) : TElaborazione(rec) { }
|
TFatturazione_bolle(const TRectype& rec);
|
||||||
virtual ~TFatturazione_bolle() { }
|
virtual ~TFatturazione_bolle() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -540,6 +541,7 @@ class TGenerazione_effetti : public TElaborazione // velib04c
|
|||||||
long _total_bills; // Totale effetti generati
|
long _total_bills; // Totale effetti generati
|
||||||
bool _can_write; // se true e' abilitata la scrittura. Non appena rileva un errore rimane a false for this instance
|
bool _can_write; // se true e' abilitata la scrittura. Non appena rileva un errore rimane a false for this instance
|
||||||
TBit_array _valid_array; // array dei tipi di pagamento validi per la generazione di effetti
|
TBit_array _valid_array; // array dei tipi di pagamento validi per la generazione di effetti
|
||||||
|
real _impmin;
|
||||||
|
|
||||||
TLocalisamfile *_efffile, // file effetti
|
TLocalisamfile *_efffile, // file effetti
|
||||||
*_refffile, // file righe di effetti
|
*_refffile, // file righe di effetti
|
||||||
@ -557,11 +559,11 @@ protected:
|
|||||||
// Restituisce true se il tipo di pagamento passato e' valido per generare l'effetto
|
// Restituisce true se il tipo di pagamento passato e' valido per generare l'effetto
|
||||||
bool valid_type(int) const ;
|
bool valid_type(int) const ;
|
||||||
// Genera l'effetto
|
// Genera l'effetto
|
||||||
void generate_bill(TDocumento&);
|
void generate_bill(TDocumento& doc, bool interattivo);
|
||||||
// Istanzia il pagamento corrente
|
// Istanzia il pagamento corrente
|
||||||
void calc_pagamento(TDocumento&);
|
void calc_pagamento(TDocumento&);
|
||||||
// Scrive i record array degli effetti raggruppati
|
// Scrive i record array degli effetti raggruppati
|
||||||
error_type write_groups();
|
error_type write_groups(bool interattivo);
|
||||||
// Cambia lo stato dei gruppi di documenti raggruppati in effetti
|
// Cambia lo stato dei gruppi di documenti raggruppati in effetti
|
||||||
error_type change_group_status(TDocumento&, TAssoc_array&);
|
error_type change_group_status(TDocumento&, TAssoc_array&);
|
||||||
// Cambia lo stato del documento
|
// Cambia lo stato del documento
|
||||||
@ -573,7 +575,7 @@ public:
|
|||||||
const TDate& data_elab, bool interattivo = false);
|
const TDate& data_elab, bool interattivo = false);
|
||||||
|
|
||||||
// Effettua il raggruppamento vero e proprio degli effetti (solo se ci sono elementi nell'assoc_array passato)
|
// Effettua il raggruppamento vero e proprio degli effetti (solo se ci sono elementi nell'assoc_array passato)
|
||||||
long group_bills(TAssoc_array&);
|
long group_bills(TAssoc_array& group_array, bool interattivo);
|
||||||
long bills() const { return _total_bills; }
|
long bills() const { return _total_bills; }
|
||||||
// void set_group(TAssoc_array& a) { _group_array = a; }
|
// void set_group(TAssoc_array& a) { _group_array = a; }
|
||||||
void set_writeable(const bool b) { _can_write = b; }
|
void set_writeable(const bool b) { _can_write = b; }
|
||||||
|
@ -12,10 +12,25 @@ TFatturazione_bolle::TFatturazione_bolle(const char* cod)
|
|||||||
: TElaborazione(cod)
|
: TElaborazione(cod)
|
||||||
{
|
{
|
||||||
TString80 name; name.format("AGGFLD(%s)", cod);
|
TString80 name; name.format("AGGFLD(%s)", cod);
|
||||||
|
|
||||||
_lista_campi = ini_get_string(CONFIG_DITTA, "ve", name);
|
_lista_campi = ini_get_string(CONFIG_DITTA, "ve", name);
|
||||||
|
|
||||||
name.format("ROWSORT(%s)", cod);
|
name.format("ROWSORT(%s)", cod);
|
||||||
_rowsort = ini_get_string(CONFIG_DITTA, "ve", name);
|
_rowsort = ini_get_string(CONFIG_DITTA, "ve", name);
|
||||||
|
_impminfat = real(ini_get_string(CONFIG_DITTA, "ve", "IMPMINFAT"));
|
||||||
|
}
|
||||||
|
|
||||||
|
TFatturazione_bolle::TFatturazione_bolle(const TRectype& rec)
|
||||||
|
: TElaborazione(rec)
|
||||||
|
{
|
||||||
|
TString cod(rec.get("CODTAB"));
|
||||||
|
TString80 name; name.format("AGGFLD(%s)", cod);
|
||||||
|
|
||||||
|
_lista_campi = ini_get_string(CONFIG_DITTA, "ve", name);
|
||||||
|
|
||||||
|
name.format("ROWSORT(%s)", cod);
|
||||||
|
_rowsort = ini_get_string(CONFIG_DITTA, "ve", name);
|
||||||
|
_impminfat = real(ini_get_string(CONFIG_DITTA, "ve", "IMPMINFAT"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFatturazione_bolle::tipi_validi(TToken_string& tipi) const
|
void TFatturazione_bolle::tipi_validi(TToken_string& tipi) const
|
||||||
@ -358,6 +373,7 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
|||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
TToken_string campi_doc(128); // Lista di campi che devono essere uguali
|
TToken_string campi_doc(128); // Lista di campi che devono essere uguali
|
||||||
TBit_array closed;
|
TBit_array closed;
|
||||||
|
TArray docrefs;
|
||||||
|
|
||||||
campi_raggruppamento(campi_doc);
|
campi_raggruppamento(campi_doc);
|
||||||
|
|
||||||
@ -514,19 +530,34 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
|||||||
campione.put(DOC_TIPOCF, orig_t);
|
campione.put(DOC_TIPOCF, orig_t);
|
||||||
campione.put(DOC_CODCF, orig_cod);
|
campione.put(DOC_CODCF, orig_cod);
|
||||||
}
|
}
|
||||||
if (!raggruppa(campione, doc_out[od]) && doc_out[od].physical_rows() == 0)
|
if ((!raggruppa(campione, doc_out[od]) && doc_out[od].physical_rows() == 0))
|
||||||
doc_out.destroy(od);
|
doc_out.destroy(od);
|
||||||
else
|
else
|
||||||
doc_out[od].set_riga_esenzione();
|
doc_out[od].set_riga_esenzione();
|
||||||
|
|
||||||
campione.flush_rows();
|
TBit_array * row = (TBit_array *) docrefs.objptr(od);
|
||||||
|
|
||||||
|
if (row == NULL)
|
||||||
|
{
|
||||||
|
row = new TBit_array;
|
||||||
|
docrefs.add(row, od);
|
||||||
|
}
|
||||||
|
row->set(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
post_process_input(doc_in);
|
post_process_input(doc_in);
|
||||||
int tot = doc_out.items();
|
const int tot = doc_out.items();
|
||||||
const TString4 codnum(codice_numerazione_finale());
|
const TString4 codnum(codice_numerazione_finale());
|
||||||
|
real impminfat;
|
||||||
|
|
||||||
for (int i = 0; i < tot; i++) // Forza tipo e numerazione documento.
|
if (!interattivo && tot > 0)
|
||||||
|
{
|
||||||
|
impminfat = doc_out[0].clifor().vendite().get_real(CFV_IMPMINFAT);
|
||||||
|
if (impminfat == ZERO)
|
||||||
|
impminfat = _impminfat;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = tot - 1; i >=0; i--) // Forza tipo e numerazione documento.
|
||||||
{
|
{
|
||||||
TDocumento& d = doc_out[i];
|
TDocumento& d = doc_out[i];
|
||||||
d.put(DOC_CODNUM, codnum);
|
d.put(DOC_CODNUM, codnum);
|
||||||
@ -560,13 +591,31 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
|||||||
d.sort_rows(_rowsort);
|
d.sort_rows(_rowsort);
|
||||||
}
|
}
|
||||||
post_process(doc_out, doc_in);
|
post_process(doc_out, doc_in);
|
||||||
tot = doc_out.items();
|
for (int i = tot - 1; i >=0; i--) // Forza tipo e numerazione documento.
|
||||||
for (int i = 0; i < tot; i++) // Forza tipo e numerazione documento.
|
|
||||||
{
|
{
|
||||||
TDocumento& d = doc_out[i];
|
TDocumento& d = doc_out[i];
|
||||||
|
|
||||||
|
if (!interattivo && impminfat > ZERO && d.totale_doc() <= impminfat)
|
||||||
|
{
|
||||||
|
doc_out.destroy(i);
|
||||||
|
|
||||||
|
TBit_array & row = (TBit_array &) docrefs[i];
|
||||||
|
|
||||||
|
for (int j = row.last_one(); j >= row.first_one(); j--)
|
||||||
|
if (row[j])
|
||||||
|
doc_in.destroy(j);
|
||||||
|
docrefs.destroy(i);
|
||||||
|
}
|
||||||
|
else
|
||||||
d.put("FATID", 0);
|
d.put("FATID", 0);
|
||||||
}
|
}
|
||||||
|
for (int id = 0; id < doc_in.items(); id++)
|
||||||
|
{
|
||||||
|
TDocumento& d = doc_in[id];
|
||||||
|
|
||||||
return tot > 0;
|
d.flush_rows();
|
||||||
|
}
|
||||||
|
|
||||||
|
return doc_out.items() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ TGenerazione_effetti::TGenerazione_effetti(const char* cod)
|
|||||||
_can_write = TRUE;
|
_can_write = TRUE;
|
||||||
_error = no_error;
|
_error = no_error;
|
||||||
_total_bills = 0L;
|
_total_bills = 0L;
|
||||||
|
_impmin = real(ini_get_string(CONFIG_DITTA, "ve", "IMPMINEFF"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TGenerazione_effetti::TGenerazione_effetti(const TRectype& rec)
|
TGenerazione_effetti::TGenerazione_effetti(const TRectype& rec)
|
||||||
@ -60,6 +61,7 @@ TGenerazione_effetti::TGenerazione_effetti(const TRectype& rec)
|
|||||||
_can_write = TRUE;
|
_can_write = TRUE;
|
||||||
_error = no_error;
|
_error = no_error;
|
||||||
_total_bills = 0L;
|
_total_bills = 0L;
|
||||||
|
_impmin = real(ini_get_string(CONFIG_DITTA, "ve", "IMPMINEFF"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TGenerazione_effetti::~TGenerazione_effetti()
|
TGenerazione_effetti::~TGenerazione_effetti()
|
||||||
@ -161,7 +163,7 @@ error_type TGenerazione_effetti::change_group_status(TDocumento& doc, TAssoc_arr
|
|||||||
return _error;
|
return _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_type TGenerazione_effetti::write_groups()
|
error_type TGenerazione_effetti::write_groups(bool interattivo)
|
||||||
{
|
{
|
||||||
const int items = _effetti_array.items();
|
const int items = _effetti_array.items();
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
@ -180,8 +182,14 @@ error_type TGenerazione_effetti::write_groups()
|
|||||||
TString key;
|
TString key;
|
||||||
|
|
||||||
key.format("%c|%ld", tipocf, codcf);
|
key.format("%c|%ld", tipocf, codcf);
|
||||||
const real impmin(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
real impmin;
|
||||||
|
|
||||||
|
if (!interattivo)
|
||||||
|
{
|
||||||
|
impmin = real(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
||||||
|
if (impmin == ZERO)
|
||||||
|
impmin = _impmin;
|
||||||
|
}
|
||||||
if (importo >= impmin)
|
if (importo >= impmin)
|
||||||
err = effetto.write(*_efffile); // Pensa a tutto lui per rinumerare...
|
err = effetto.write(*_efffile); // Pensa a tutto lui per rinumerare...
|
||||||
else
|
else
|
||||||
@ -246,7 +254,7 @@ error_type TGenerazione_effetti::write_groups()
|
|||||||
// per l'effetto 5 vale la fattura 3.
|
// per l'effetto 5 vale la fattura 3.
|
||||||
// Questo e' quanto ho appreso (Hope I'm right...) ;-)
|
// Questo e' quanto ho appreso (Hope I'm right...) ;-)
|
||||||
|
|
||||||
long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
|
long TGenerazione_effetti::group_bills(TAssoc_array& group_array, bool interattivo)
|
||||||
{
|
{
|
||||||
// Bail out if there aren't items...
|
// Bail out if there aren't items...
|
||||||
const int items = group_array.items();
|
const int items = group_array.items();
|
||||||
@ -478,7 +486,7 @@ long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
|
|||||||
{
|
{
|
||||||
xvtil_statbar_set("Scrittura effetti raggruppati in corso...");
|
xvtil_statbar_set("Scrittura effetti raggruppati in corso...");
|
||||||
do_events();
|
do_events();
|
||||||
if (write_groups() == no_error)
|
if (write_groups(interattivo) == no_error)
|
||||||
{
|
{
|
||||||
tot = _effetti_array.items();
|
tot = _effetti_array.items();
|
||||||
change_group_status(doc, group_array);
|
change_group_status(doc, group_array);
|
||||||
@ -543,7 +551,7 @@ void TGenerazione_effetti::calc_pagamento(TDocumento& doc)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese significa anche effetto eheheh ;-)
|
void TGenerazione_effetti::generate_bill(TDocumento& doc, bool interattivo) // bill in inglese significa anche effetto eheheh ;-)
|
||||||
{
|
{
|
||||||
// That's my JOB!
|
// That's my JOB!
|
||||||
// Ogni rata della fattura (si parla di effetti attivi per ora) genera 1 effetto.
|
// Ogni rata della fattura (si parla di effetti attivi per ora) genera 1 effetto.
|
||||||
@ -662,7 +670,15 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese sig
|
|||||||
|
|
||||||
TString8 key;
|
TString8 key;
|
||||||
key.format("%c|%ld", tipocf, codcf);
|
key.format("%c|%ld", tipocf, codcf);
|
||||||
const real impmin(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
real impmin;
|
||||||
|
|
||||||
|
if (!interattivo)
|
||||||
|
{
|
||||||
|
impmin = real(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
||||||
|
if (impmin == ZERO)
|
||||||
|
impmin = _impmin;
|
||||||
|
}
|
||||||
|
|
||||||
if (importo >= impmin)
|
if (importo >= impmin)
|
||||||
{
|
{
|
||||||
if (valuta)
|
if (valuta)
|
||||||
@ -708,7 +724,7 @@ bool TGenerazione_effetti::elabora(TLista_documenti& doc_in, TLista_documenti& d
|
|||||||
xvtil_statbar_set(msg);
|
xvtil_statbar_set(msg);
|
||||||
do_events();
|
do_events();
|
||||||
|
|
||||||
generate_bill(doc); // Genera gli effetti corrispondenti
|
generate_bill(doc, interattivo); // Genera gli effetti corrispondenti
|
||||||
if (!good())
|
if (!good())
|
||||||
display_error(doc);
|
display_error(doc);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user