Migliorata gestione split payment
git-svn-id: svn://10.65.10.50/branches/R_10_00@23064 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9c310bdd9e
commit
3c75f5d771
@ -47,7 +47,7 @@ BEGIN
|
||||
PROMPT 62 1 ""
|
||||
STR_EXPR #F_CODICELAV==""
|
||||
MESSAGE RESET,F_CODICELAV
|
||||
WARNING "Il codice e' gia' utilizzato per le lavorazioni"
|
||||
WARNING "Il codice è già utilizzato per le lavorazioni"
|
||||
END
|
||||
|
||||
STRING F_DESCR 50
|
||||
@ -257,7 +257,6 @@ BEGIN
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
/*
|
||||
STRING F_REPARTO 3
|
||||
BEGIN
|
||||
PROMPT 1 6 "Reparto "
|
||||
@ -271,7 +270,6 @@ BEGIN
|
||||
OUTPUT F_REPARTO CODTAB
|
||||
OUTPUT F_DESREPARTO S0
|
||||
CHECKTYPE NORMAL
|
||||
GROUP G_VD
|
||||
END
|
||||
|
||||
STRING F_DESREPARTO 70 50
|
||||
@ -283,7 +281,6 @@ BEGIN
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_REPARTO
|
||||
CHECKTYPE NORMAL
|
||||
GROUP G_VD
|
||||
END
|
||||
|
||||
STRING F_STAGIONE 4
|
||||
@ -292,29 +289,26 @@ BEGIN
|
||||
HELP "Codice stagione"
|
||||
FIELD LF_ANAMAG->STAGIONE
|
||||
FLAGS "UZ"
|
||||
USE %STG
|
||||
USE STG
|
||||
INPUT CODTAB F_STAGIONE
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione @70" S0
|
||||
OUTPUT F_STAGIONE CODTAB
|
||||
OUTPUT F_DESSTAGIONE S0
|
||||
CHECKTYPE NORMAL
|
||||
GROUP G_VD
|
||||
END
|
||||
|
||||
STRING F_DESSTAGIONE 70 50
|
||||
BEGIN
|
||||
PROMPT 23 7 ""
|
||||
HELP "Descrizione stagione"
|
||||
USE %STG KEY 2
|
||||
USE STG KEY 2
|
||||
INPUT S0 F_DESSTAGIONE
|
||||
DISPLAY "Descrizione@70" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_STAGIONE
|
||||
CHECKTYPE NORMAL
|
||||
GROUP G_VD
|
||||
END
|
||||
*/
|
||||
|
||||
STRING F_CATCONV 3
|
||||
BEGIN
|
||||
|
114
ve/ve4100.cpp
114
ve/ve4100.cpp
@ -6,7 +6,7 @@
|
||||
#include <sheet.h>
|
||||
#include <tabutil.h>
|
||||
#include <urldefid.h>
|
||||
#include <viswin.h>
|
||||
#include <reputils.h>
|
||||
|
||||
#include "ve4.h"
|
||||
#include "ve4100.h"
|
||||
@ -19,7 +19,7 @@ class TTable_expression : public TExpression
|
||||
{
|
||||
static TArray _expr;
|
||||
static const TRelation* _rel;
|
||||
static TViswin* _win;
|
||||
static TLog_report* _win;
|
||||
static bool _errors;
|
||||
|
||||
protected:
|
||||
@ -40,7 +40,7 @@ protected:
|
||||
public:
|
||||
static void load_table(bool force = false);
|
||||
static void set_relation(const TRelation* rel) { _rel = rel; load_table(); }
|
||||
static void set_window(TViswin* win) { _win = win; }
|
||||
static void set_window(TLog_report* win) { _win = win; }
|
||||
static void reset_errors() { _errors = false; }
|
||||
static bool errors_found() { return _errors; }
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
|
||||
TArray TTable_expression::_expr;
|
||||
const TRelation* TTable_expression::_rel = NULL;
|
||||
TViswin* TTable_expression::_win = NULL;
|
||||
TLog_report* TTable_expression::_win = NULL;
|
||||
bool TTable_expression::_errors = false;
|
||||
|
||||
void TTable_expression::load_table(bool force)
|
||||
@ -91,13 +91,9 @@ bool TTable_expression::user_func_dirty() const
|
||||
bool TTable_expression::print_error(const char* msg) const
|
||||
{
|
||||
if (_win)
|
||||
{
|
||||
TString s(256);
|
||||
s << "@b$[r,w]" << msg;
|
||||
_win->add_line(s);
|
||||
}
|
||||
_win->log(2, msg);
|
||||
else
|
||||
::error_box("%s", msg);
|
||||
::error_box(msg);
|
||||
return _errors = true;
|
||||
}
|
||||
|
||||
@ -317,7 +313,7 @@ public:
|
||||
TRicalcolo_mask::TRicalcolo_mask()
|
||||
: TMask("ve4100"), _cur_file(0), _relation(NULL), _cursor(NULL)
|
||||
{
|
||||
const int lf[] = { LF_ANAMAG, LF_UMART, LF_DESLIN, LF_CONDV, LF_RCONDV, 0 };
|
||||
const int lf[] = { LF_ANAMAG, LF_UMART, LF_DESLIN, LF_CONDV, LF_RCONDV, LF_CLIFO, LF_CFBAN, 0 };
|
||||
for (int i = 0; lf[i]; i++)
|
||||
{
|
||||
TRelation* rel = new TRelation(lf[i]);
|
||||
@ -520,6 +516,17 @@ TRelation& TRicalcolo_mask::create_relation()
|
||||
_relation->add(LF_RCONDV, "TIPO=TIPO|CATVEN=CATVEN|TIPOCF=TIPOCF|CODCF=CODCF|COD=COD", 1);
|
||||
}
|
||||
break;
|
||||
case LF_CLIFO:
|
||||
{
|
||||
_relation->add(LF_CFVEN, "TIPOCF==TIPOCF|CODCF==CODCF");
|
||||
}
|
||||
break;
|
||||
case LF_CFBAN:
|
||||
{
|
||||
_relation->add(LF_CLIFO, "TIPOCF==TIPOCF|CODCF==CODCF");
|
||||
_relation->add(LF_CFVEN, "TIPOCF==TIPOCF|CODCF==CODCF");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -931,8 +938,7 @@ bool TRicalcolo_mask::elabora()
|
||||
TString val(80); // Valore di campo
|
||||
TString line(128); // Linea di testo
|
||||
|
||||
TIndwin iw(48, "Inizializzazione ...", true, false, 48);
|
||||
begin_wait();
|
||||
TIndwin iw(48, TR("Inizializzazione..."), true, false, 48);
|
||||
|
||||
TCursor& cur = create_cursor(); // Crea e filtra il cursore principale
|
||||
|
||||
@ -947,14 +953,14 @@ bool TRicalcolo_mask::elabora()
|
||||
TTypeexp tipo = _strexpr;
|
||||
switch(cur.curr().type(var))
|
||||
{
|
||||
case _alfafld:
|
||||
case _datefld:
|
||||
case _memofld:
|
||||
tipo = _strexpr;
|
||||
break;
|
||||
default:
|
||||
tipo = _numexpr;
|
||||
break;
|
||||
case _alfafld:
|
||||
case _datefld:
|
||||
case _memofld:
|
||||
tipo = _strexpr;
|
||||
break;
|
||||
default:
|
||||
tipo = _numexpr;
|
||||
break;
|
||||
}
|
||||
line = riga.get(2);
|
||||
TTable_expression* e = new TTable_expression;
|
||||
@ -964,32 +970,25 @@ bool TRicalcolo_mask::elabora()
|
||||
}
|
||||
TToken_string& key_expr = get_key_expr(cur.key());
|
||||
|
||||
TViswin vw(NULL, TR("Ricalcolo valori"), false, true, false, 0, 0, 0, 0, false);
|
||||
|
||||
iw.close_modal();
|
||||
end_wait();
|
||||
|
||||
if (iw.iscancelled())
|
||||
return false;
|
||||
TLog_report vw(TR("Ricalcolo valori"));
|
||||
|
||||
TTable_expression::set_relation(cur.relation());
|
||||
TTable_expression::set_window(&vw);
|
||||
TTable_expression::reset_errors();
|
||||
|
||||
vw.maximize();
|
||||
vw.open_modal();
|
||||
|
||||
|
||||
bool ok = true;
|
||||
|
||||
const TRecnotype items = cur.items();
|
||||
cur.freeze();
|
||||
|
||||
for (cur = 0; cur.pos() < items; ++cur)
|
||||
{
|
||||
line.format("#@b%7ld@r - ", cur.pos()+1);
|
||||
line.format("#%7ld - ", cur.pos()+1);
|
||||
const TRectype& curr = cur.curr();
|
||||
for (const char* f = key_expr.get(0); f; f = key_expr.get())
|
||||
line << curr.get(f) << ' ';
|
||||
vw.add_line(line);
|
||||
vw.log(0, line);
|
||||
|
||||
for (int r = 0; r < osf.items(); r++)
|
||||
{
|
||||
@ -1011,11 +1010,12 @@ bool TRicalcolo_mask::elabora()
|
||||
|
||||
if (e.errors_found())
|
||||
ok = false;
|
||||
else
|
||||
else
|
||||
{
|
||||
cur.curr().put(var, val);
|
||||
|
||||
line.format("- %-10s = %s", (const char*)var, (const char*)val);
|
||||
vw.add_line(line);
|
||||
line.format("- %-10s = %s", (const char*)var, (const char*)val);
|
||||
vw.log(0, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1023,9 +1023,7 @@ bool TRicalcolo_mask::elabora()
|
||||
TTable_expression::set_relation(NULL);
|
||||
TTable_expression::set_window(NULL);
|
||||
|
||||
vw.close_print();
|
||||
vw.run();
|
||||
vw.close_modal();
|
||||
vw.preview();
|
||||
|
||||
if (get_bool(F_SAVE))
|
||||
{
|
||||
@ -1035,18 +1033,18 @@ bool TRicalcolo_mask::elabora()
|
||||
msg << "Si desidera aggiornare effettivamente l'archivio?";
|
||||
ok = yesno_box(msg);
|
||||
if (ok)
|
||||
{
|
||||
TTextfile& txt = vw.text();
|
||||
|
||||
TProgind piw(txt.lines(), "Aggiornamento archivio", false, true, 48);
|
||||
{
|
||||
TRecordset& rs = *vw.recordset();
|
||||
TProgress_monitor piw(rs.items(), TR("Aggiornamento archivio"));
|
||||
|
||||
bool do_rewrite = false;
|
||||
long pos = 0;
|
||||
cur = 0L;
|
||||
for (long r = 0; r < txt.lines(); r++)
|
||||
for (bool ok = rs.move_first(); ok; ok = rs.move_next())
|
||||
{
|
||||
piw.addstatus(1);
|
||||
line = txt.line(r);
|
||||
if (!piw.add_status())
|
||||
break;
|
||||
line = rs.get(1).as_string();
|
||||
if (line[0] == '#' && sscanf(line, "#%ld", &pos) == 1)
|
||||
{
|
||||
if (do_rewrite)
|
||||
@ -1084,40 +1082,28 @@ bool TRicalcolo_mask::elabora()
|
||||
// Ricalcolo di magazzino
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TRicalcola_application : public TApplication
|
||||
class TRicalcola_application : public TSkeleton_application
|
||||
{
|
||||
protected:
|
||||
virtual bool menu(MENU_TAG);
|
||||
virtual bool create();
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
// @cmember Disabilita la verifica del modulo in chiave
|
||||
virtual bool check_autorization() const
|
||||
{return false;}
|
||||
TRicalcola_application() { }
|
||||
virtual ~TRicalcola_application() { }
|
||||
virtual bool check_autorization() const { return false; }
|
||||
};
|
||||
|
||||
bool TRicalcola_application::create()
|
||||
{
|
||||
dispatch_e_menu(MENU_ITEM_ID(1));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TRicalcola_application::menu(MENU_TAG)
|
||||
void TRicalcola_application::main_loop()
|
||||
{
|
||||
TRicalcolo_mask m;
|
||||
m.open();
|
||||
while (m.run() == K_ENTER)
|
||||
m.elabora();
|
||||
m.close();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int ve4100(int argc, char* argv[])
|
||||
{
|
||||
TRicalcola_application r;
|
||||
r.run(argc, argv, "Ricalcolo valori");
|
||||
r.run(argc, argv, TR("Ricalcolo valori"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
// Maschera principale
|
||||
#define F_FILE 101
|
||||
#define F_KEY 102
|
||||
#define F_FIELDS 103
|
||||
#define F_FILTER 104
|
||||
#define F_OUTPUTS 105
|
||||
#define F_SAVE 106
|
||||
#define F_FILTER 103
|
||||
#define F_SAVE 104
|
||||
|
||||
#define F_FIELDS 551
|
||||
#define F_OUTPUTS 552
|
||||
|
||||
#define F_UNITA_MISURA 201
|
||||
#define F_DESC_UNITA_MISURA 202
|
||||
|
@ -1,27 +1,7 @@
|
||||
#include "ve4100.h"
|
||||
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -14 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_INFO 10 2
|
||||
BEGIN
|
||||
PROMPT -24 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_HELP 10 2
|
||||
BEGIN
|
||||
PROMPT -34 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -44 -1 ""
|
||||
END
|
||||
|
||||
#include <elabar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Parametri di calcolo" 0 0 0 0
|
||||
@ -31,7 +11,7 @@ BEGIN
|
||||
PROMPT 1 1 "Archivio da elaborare"
|
||||
END
|
||||
|
||||
LIST F_FILE 32
|
||||
LIST F_FILE 1 32
|
||||
BEGIN
|
||||
PROMPT 2 2 "File "
|
||||
ITEM "0|Anagrafica magazzino"
|
||||
@ -39,6 +19,8 @@ BEGIN
|
||||
ITEM "2|Descrizioni in lingua"
|
||||
ITEM "3|Condizioni di vendita"
|
||||
ITEM "4|Righe condizioni di vendita"
|
||||
ITEM "5|Clienti/Fornitori"
|
||||
ITEM "6|Banche per Clienti/Fornitori"
|
||||
END
|
||||
|
||||
LIST F_KEY 10
|
||||
@ -242,7 +224,7 @@ ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Fields" -1 -1 60 6
|
||||
PAGE "Fields" -1 -1 62 6
|
||||
|
||||
STRING F_FIELD 10
|
||||
BEGIN
|
||||
@ -252,7 +234,7 @@ END
|
||||
|
||||
STRING F_DESCR 70 50
|
||||
BEGIN
|
||||
PROMPT 6 2 ""
|
||||
PROMPT 7 2 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
@ -269,6 +251,10 @@ BEGIN
|
||||
FLAGS "B"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
@ -293,7 +279,7 @@ END
|
||||
|
||||
STRING F_DESCR 70 50
|
||||
BEGIN
|
||||
PROMPT 6 2 ""
|
||||
PROMPT 7 2 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
@ -315,6 +301,10 @@ BEGIN
|
||||
PROMPT 1 4 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -13 -1 ""
|
||||
|
@ -244,14 +244,12 @@ void TArchive_doc::archivia(const TMask& m)
|
||||
|
||||
bool TArchive_doc::restore_file(TIsamtempfile& src, bool update)
|
||||
{
|
||||
TLocalisamfile dst(src.num());
|
||||
TFast_isamfile dst(src.num());
|
||||
|
||||
TString msg; msg << TR("Trasferimento") << ' ' << dst.description();
|
||||
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)
|
||||
{
|
||||
@ -262,6 +260,8 @@ bool TArchive_doc::restore_file(TIsamtempfile& src, bool update)
|
||||
}
|
||||
if (err != NOERR)
|
||||
return cantwrite_box(src.description());
|
||||
if (!pi.add_status(1))
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -274,21 +274,13 @@ bool TArchive_doc::restore_clifo(bool update)
|
||||
|
||||
bool TArchive_doc::restore_docs()
|
||||
{
|
||||
TIsamfile doc(LF_DOC);
|
||||
doc.open();
|
||||
int err = doc.lock();
|
||||
if (err != NOERR)
|
||||
return error_box("Il file documenti non puo' essere bloccato in modo esclusivo."
|
||||
"Nessun documento ricevuto. Errore %d.",err);
|
||||
|
||||
if (restore_file(*_trdoc, true))
|
||||
bool ok = restore_file(*_trdoc, true);
|
||||
if (ok)
|
||||
{
|
||||
_tdoc->set_curr(new TDocumento);
|
||||
restore_file(*_tdoc, false);
|
||||
ok = restore_file(*_tdoc, false);
|
||||
}
|
||||
|
||||
doc.close();
|
||||
return err == NOERR;
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TArchive_doc::ripristina(const TMask& m)
|
||||
@ -314,7 +306,7 @@ void TArchive_doc::ripristina(const TMask& m)
|
||||
delete_tmp_files(true); // Removes temp files!
|
||||
}
|
||||
else
|
||||
error_box(TR("Errore nella ricezione dei file. Nessun documento ricevuto."));
|
||||
error_box(TR("Errore nella scompattazione dei file. Nessun documento ricevuto."));
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ int main( int argc, char** argv )
|
||||
case 3: ve6300(argc, argv); break; // generazione effetti
|
||||
case 4: ve6400(argc, argv); break; // generazione scontrini
|
||||
case 5: ve6500(argc, argv); break; // generazione righe da penna ottica
|
||||
case 6: ve6600(argc, argv); break; // collegamento contabilita' industriosa
|
||||
case 6: ve6600(argc, argv); break; // collegamento contabilità industriosa
|
||||
case 7: ve6700(argc, argv); break; // copia documenti interattiva da ditta a ditta
|
||||
case 8: ve6800(argc, argv); break; // contabilizzazione analitica documenti
|
||||
default: ve6100(argc, argv); break; // contabilizzazione documenti
|
||||
|
@ -1,5 +1,4 @@
|
||||
//#include <progind.h>
|
||||
#include <recset.h>
|
||||
//#include <recset.h>
|
||||
|
||||
#include "velib04.h"
|
||||
#include "ve6200.h"
|
||||
@ -22,7 +21,7 @@ bool TFatturazione_bolle_app::create()
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TFatturazione_bolle_app::process(TIndwin& iw, TElaborazione & eld,
|
||||
bool TFatturazione_bolle_app::process(TProgress_monitor& iw, TElaborazione & eld,
|
||||
TLista_documenti& din, const TDate& data_elab)
|
||||
{
|
||||
// Crea documenti di output
|
||||
@ -50,7 +49,7 @@ bool TFatturazione_bolle_app::process(TIndwin& iw, TElaborazione & eld,
|
||||
|
||||
void TFatturazione_bolle_app::process_by_cli(const TMask& m)
|
||||
{
|
||||
TIndwin iw(0, "Inizializzazione...\n ", TRUE, FALSE, 60);
|
||||
TProgress_monitor iw(0, "Inizializzazione...\n ");
|
||||
|
||||
const TDate data_elab = m.get_date(F_DATA_ELAB);
|
||||
const int anno = data_elab.year();
|
||||
@ -80,7 +79,8 @@ void TFatturazione_bolle_app::process_by_cli(const TMask& m)
|
||||
const int tot_cli = clienti.leggi(dc, ac, da, aa, dz, az);
|
||||
|
||||
TString msg(80);
|
||||
for (int c = 0; c < tot_cli && !iw.iscancelled(); c++)
|
||||
iw.set_max(tot_cli);
|
||||
for (int c = 0; c < tot_cli; c++)
|
||||
{
|
||||
const long codcli = clienti[c]; // Codice cliente in esame
|
||||
msg = TR("Elaborazione documenti del cliente ");
|
||||
@ -90,7 +90,7 @@ void TFatturazione_bolle_app::process_by_cli(const TMask& m)
|
||||
|
||||
TLista_documenti din; // Legge tutti i documenti di input
|
||||
din.read('D', tipocf, codcli, anno, tipidoc, statidoc, dd, ad, codnum, dn, an);
|
||||
if (din.items() > 0 && !iw.iscancelled())
|
||||
if (din.items() > 0)
|
||||
{
|
||||
if (m.get(F_ORDINAMENTO) == "Z")
|
||||
din.sort(DOC_ZONA"|"DOC_DATADOC"|"DOC_NDOC);
|
||||
@ -98,13 +98,16 @@ void TFatturazione_bolle_app::process_by_cli(const TMask& m)
|
||||
if (!ok) // In caso di errore termina qui l'elaborazione.
|
||||
break;
|
||||
}
|
||||
|
||||
if (!iw.add_status())
|
||||
break;
|
||||
}
|
||||
delete e;
|
||||
}
|
||||
|
||||
void TFatturazione_bolle_app::process_by_ragsoc(const TMask& m)
|
||||
{
|
||||
TIndwin iw(0, "Inizializzazione...\n ", TRUE, FALSE, 60);
|
||||
TProgress_monitor iw(0, "Inizializzazione...\n ");
|
||||
|
||||
const TDate data_elab = m.get_date(F_DATA_ELAB);
|
||||
const int anno = data_elab.year();
|
||||
@ -134,7 +137,8 @@ void TFatturazione_bolle_app::process_by_ragsoc(const TMask& m)
|
||||
const int tot_cli = clienti.leggi_ragsoc(dr, ar, da, aa, dz, az);
|
||||
|
||||
TString msg(80);
|
||||
for (int c = 0; c < tot_cli && !iw.iscancelled(); c++)
|
||||
iw.set_max(tot_cli);
|
||||
for (int c = 0; c < tot_cli; c++)
|
||||
{
|
||||
const long codcli = clienti[c]; // Codice cliente in esame
|
||||
msg = TR("Elaborazione documenti del cliente ");
|
||||
@ -144,7 +148,7 @@ void TFatturazione_bolle_app::process_by_ragsoc(const TMask& m)
|
||||
|
||||
TLista_documenti din; // Legge tutti i documenti di input
|
||||
din.read('D', tipocf, codcli, anno, tipidoc, statidoc, dd, ad, codnum, dn, an);
|
||||
if (din.items() > 0 && !iw.iscancelled())
|
||||
if (din.items() > 0)
|
||||
{
|
||||
if (m.get(F_ORDINAMENTO) == "Z")
|
||||
din.sort(DOC_ZONA"|"DOC_DATADOC"|"DOC_NDOC);
|
||||
@ -152,6 +156,9 @@ void TFatturazione_bolle_app::process_by_ragsoc(const TMask& m)
|
||||
if (!ok) // In caso di errore termina qui l'elaborazione.
|
||||
break;
|
||||
}
|
||||
|
||||
if (!iw.add_status())
|
||||
break;
|
||||
}
|
||||
delete e;
|
||||
|
||||
@ -159,7 +166,7 @@ void TFatturazione_bolle_app::process_by_ragsoc(const TMask& m)
|
||||
|
||||
void TFatturazione_bolle_app::process_by_doc(const TMask& m)
|
||||
{
|
||||
TIndwin iw(0, TR("Inizializzazione...\n "), TRUE, FALSE, 60);
|
||||
TProgress_monitor iw(0, TR("Inizializzazione...\n "));
|
||||
|
||||
const TDate data_elab = m.get_date(F_DATA_ELAB);
|
||||
const int anno = data_elab.year();
|
||||
@ -191,7 +198,8 @@ void TFatturazione_bolle_app::process_by_doc(const TMask& m)
|
||||
TLista_documenti din, dout; // Legge tutti i documenti di input
|
||||
|
||||
TString msg(80);
|
||||
for (int c = 0; c < tot_cli && !iw.iscancelled(); c++)
|
||||
iw.set_max(tot_cli);
|
||||
for (int c = 0; c < tot_cli; c++)
|
||||
{
|
||||
const long codcli = clienti[c]; // Codice cliente in esame
|
||||
msg = TR("Elaborazione documenti del cliente");
|
||||
@ -199,8 +207,7 @@ void TFatturazione_bolle_app::process_by_doc(const TMask& m)
|
||||
iw.set_text(msg); // Messaggio sul cliente
|
||||
do_events(); // Attende visualizzazione
|
||||
|
||||
|
||||
TLista_documenti list;
|
||||
TLista_documenti list;
|
||||
list.read('D', tipocf, codcli, anno, tipidoc, statidoc, dd, ad, codnum, dn, an);
|
||||
|
||||
for (int i = list.items()-1; i >= 0; i--)
|
||||
@ -226,8 +233,11 @@ void TFatturazione_bolle_app::process_by_doc(const TMask& m)
|
||||
const int items = list.items();
|
||||
for (int j = 0; j < items; j++)
|
||||
din.add(list[j]);
|
||||
|
||||
if (!iw.add_status())
|
||||
break;
|
||||
}
|
||||
if (din.items() > 0 && !iw.iscancelled())
|
||||
if (din.items() > 0 && !iw.is_cancelled())
|
||||
{
|
||||
if (m.get(F_ORDINAMENTO) == "Z")
|
||||
din.sort(DOC_ZONA"|"DOC_DATADOC"|"DOC_NDOC);
|
||||
@ -306,7 +316,7 @@ void TFatturazione_bolle_app::process_by_fatt(const TMask& m)
|
||||
TISAM_recordset docs(query);
|
||||
const TRectype& head = docs.cursor()->curr();
|
||||
|
||||
TProgind iw(docs.items(), "Elaborazione documenti da fatturare", true, true);
|
||||
TProgress_monitor iw(docs.items(), TR("Elaborazione documenti da fatturare"), true);
|
||||
|
||||
long last_clifo = 0; // Ultimo cliente elaborato
|
||||
TLista_documenti din; // Lista dei documenti dell'ultimo cliente
|
||||
@ -327,15 +337,15 @@ void TFatturazione_bolle_app::process_by_fatt(const TMask& m)
|
||||
last_clifo = clifo;
|
||||
}
|
||||
|
||||
if (!iw.addstatus(1))
|
||||
if (!iw.add_status(1))
|
||||
break;
|
||||
|
||||
// Controlla se il documento e' in uno stato valido per l'elaborazione
|
||||
const TString4 tipodoc = head.get(DOC_TIPODOC);
|
||||
const TString4 statodoc = head.get(DOC_STATO);
|
||||
const char statodoc = head.get_char(DOC_STATO);
|
||||
for (int i = tipidoc.items()-1; i>=0; i--)
|
||||
{
|
||||
if (tipodoc == tipidoc.get(i) && statodoc == statidoc.get(i))
|
||||
if (tipodoc == tipidoc.get(i) && statodoc == statidoc.get_char(i))
|
||||
{
|
||||
din.add(head);
|
||||
break;
|
||||
@ -345,7 +355,7 @@ void TFatturazione_bolle_app::process_by_fatt(const TMask& m)
|
||||
}
|
||||
|
||||
// Termina l'elaborazione dei documenti dell'ultimo cliente
|
||||
if (din.items() > 0 && !iw.iscancelled())
|
||||
if (din.items() > 0 && !iw.is_cancelled())
|
||||
process(iw, eld, din, data_elab);
|
||||
|
||||
delete e;
|
||||
@ -372,10 +382,7 @@ void TFatturazione_bolle_app::main_loop()
|
||||
{
|
||||
const TString& select_from = m.get(F_SELEZIONE);
|
||||
if (select_from != _default_selection)
|
||||
{
|
||||
TConfig cfg(CONFIG_DITTA, "ve");
|
||||
cfg.set("FATBOLSEL", _default_selection = select_from);
|
||||
}
|
||||
ini_set_string(CONFIG_DITTA, "ve", "FATBOLSEL", _default_selection = select_from);
|
||||
|
||||
const TString& orderby = m.get(F_ORDINAMENTO);
|
||||
if (orderby == "R")
|
||||
|
@ -1,3 +1,6 @@
|
||||
#ifndef __VE6200_H
|
||||
#define __VE6200_H
|
||||
|
||||
#ifndef __APPLICATION_H
|
||||
#include <applicat.h>
|
||||
#endif
|
||||
@ -6,8 +9,9 @@
|
||||
#include <progind.h>
|
||||
#endif
|
||||
|
||||
#include "velib.h"
|
||||
#ifndef __VELIB04_H
|
||||
#include "velib04.h"
|
||||
#endif
|
||||
|
||||
class TFatturazione_bolle_app : public TSkeleton_application
|
||||
{
|
||||
@ -19,7 +23,7 @@ protected:
|
||||
virtual TFatturazione_bolle * elab(const TString & cod) const { return new TFatturazione_bolle(cod);}
|
||||
|
||||
bool clifo_da_fatt(const TMask& m) const;
|
||||
bool process(TIndwin& iw, TElaborazione & eld, TLista_documenti& din, const TDate& data_elab);
|
||||
bool process(TProgress_monitor& iw, TElaborazione & eld, TLista_documenti& din, const TDate& data_elab);
|
||||
|
||||
public:
|
||||
void process_by_cli(const TMask& m);
|
||||
@ -28,3 +32,4 @@ public:
|
||||
void process_by_fatt(const TMask& m);
|
||||
};
|
||||
|
||||
#endif
|
@ -175,7 +175,7 @@ int TLista_documenti::write(bool re) const
|
||||
TDocumento& d = (TDocumento&)doc(i);
|
||||
err = d.write(re);
|
||||
d.flush_rows();
|
||||
if (!pi.addstatus(1))
|
||||
if (!pi.add_status(1))
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -261,13 +261,13 @@ 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) const { 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);
|
||||
virtual bool get_num_tip_out(const TDocumento& doc_out, TString& codnum, TString& tipodoc) const;
|
||||
|
||||
public:
|
||||
virtual bool raggruppa(TDocumento& din, TDocumento& dout);
|
||||
|
@ -317,10 +317,10 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
|
||||
|
||||
if (cambia_stato_doc_in)
|
||||
{
|
||||
const char stato_finale_in = get_char("S4");
|
||||
const char stato_finale_in = stato_finale_doc_iniziale()[0];
|
||||
doc_in.stato(stato_finale_in);
|
||||
}
|
||||
const char stato_finale_out = get_char("S9");
|
||||
const char stato_finale_out = stato_finale()[0];
|
||||
doc_out.stato(stato_finale_out);
|
||||
|
||||
if (usa_dcons)
|
||||
@ -329,7 +329,7 @@ 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)
|
||||
bool TFatturazione_bolle::get_num_tip_out(const TDocumento& doc, TString& codnum, TString& tipodoc) const
|
||||
{
|
||||
codnum = codice_numerazione_finale();
|
||||
tipodoc = get_tipo_out(doc);
|
||||
@ -340,7 +340,7 @@ bool TFatturazione_bolle::get_num_tip_out(const TDocumento& doc, TString& codnum
|
||||
tipodoc = tipo_cfv;
|
||||
|
||||
const TCodice_numerazione& cn = cached_numerazione(codnum);
|
||||
bool ok = cn.find_tipo_doc(tipo_cfv) >= 0;
|
||||
bool ok = cn.find_tipo_doc(tipodoc) >= 0;
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
|
@ -1198,7 +1198,7 @@ void TDocumento_mask::cli2mask(bool force_load)
|
||||
const TDate datadoc = doc().get(DOC_DATADOC);
|
||||
|
||||
const bool split_payment = datadoc.year() >= 2015 && c.get_bool(CLI_SPLITPAY);
|
||||
const bool ivadiff = !split_payment && alleg == 7 && ven_rec.get_bool(CFV_FATTSOSP);
|
||||
const bool ivadiff = !split_payment && ven_rec.get_bool(CFV_FATTSOSP);
|
||||
set(F_LIQDIFF, ivadiff ? "X" : "");
|
||||
|
||||
const bool IVAxCassa = !split_payment && !ivadiff && alleg < 5 && gestione_IVAxCassa(datadoc);
|
||||
@ -3591,7 +3591,7 @@ void TElabora_mask::update_ndoc_filter(bool is_tipo_elaborazione)
|
||||
|
||||
for (int i = 0; i < TElaborazione::_max_tipi_doc_elab; i++)
|
||||
{
|
||||
const TString4 tipo_in(e->tipo_iniziale(i));
|
||||
const TString4 tipo_in = e->tipo_iniziale(i);
|
||||
const char stato_in = e->stato_iniziale(i);
|
||||
|
||||
if (tipo == tipo_in && stato_in > '0')
|
||||
@ -3600,7 +3600,7 @@ void TElabora_mask::update_ndoc_filter(bool is_tipo_elaborazione)
|
||||
filter << "||";
|
||||
else
|
||||
filter << "&&(";
|
||||
almost_one = TRUE;
|
||||
almost_one = true;
|
||||
|
||||
filter << "(STATO==\"" << stato_in << "\")";
|
||||
}
|
||||
@ -3689,12 +3689,12 @@ void TElabora_mask::update_ndoc_filter(bool is_tipo_elaborazione)
|
||||
tf.set_tree(&_tree);
|
||||
|
||||
TToken_string header(256, '\n');
|
||||
header.add("Anno Num. N. Data Cli/For Ragione Sociale");
|
||||
header.add(" Codice Articolo Descrizione Riga ");
|
||||
header.add(TR("Anno Num. N. Data Cli/For Ragione Sociale"));
|
||||
header.add(TR(" Codice Articolo Descrizione Riga "));
|
||||
if (aggiungi_doc_att && e->tipo() == _consegna_ordini)
|
||||
header << "Da Evadere Residuo";
|
||||
header << TR("Da Evadere Residuo");
|
||||
else
|
||||
header << " Quantità";
|
||||
header << TR(" Quantità");
|
||||
tf.set_header(header);
|
||||
|
||||
if (aggiungi_doc_att) // GF20059
|
||||
|
Loading…
x
Reference in New Issue
Block a user