Patch level : 12.0 288
Files correlati : Commento : Aggiunto il programma per la gestione degli ordini evasi git-svn-id: svn://10.65.10.50/branches/R_10_00@23301 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d5b125d7e9
commit
eda245be5f
41
src/ve/ve0900.uml
Normal file
41
src/ve/ve0900.uml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#include "veuml.h"
|
||||||
|
|
||||||
|
TOOLBAR "Toolbar" 0 0 0 2
|
||||||
|
|
||||||
|
#include <relapbar.h>
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Forza ordini completati" 0 0 0 0
|
||||||
|
|
||||||
|
STRING F_CODNUM 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Numerazione "
|
||||||
|
FIELD CODNUM
|
||||||
|
HELP "Codice numerazione"
|
||||||
|
USE %NUM
|
||||||
|
INPUT CODTAB F_CODNUM
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
OUTPUT F_CODNUM CODTAB
|
||||||
|
OUTPUT F_DESNUM S0
|
||||||
|
CHECKTYPE FORCED
|
||||||
|
FLAG "UPA"
|
||||||
|
WARNING "Numerazione assente"
|
||||||
|
KEY 1 2
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_ANNO 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "Anno "
|
||||||
|
FIELD ANNO
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
NUM_EXPR #F_ANNO>0
|
||||||
|
FLAG "AP"
|
||||||
|
KEY 1 2
|
||||||
|
WARNING "Inserire un anno valido"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
@ -281,7 +281,7 @@ void TCopydoc_app::main_loop()
|
|||||||
real price = r.get_real(RDOC_PREZZO);
|
real price = r.get_real(RDOC_PREZZO);
|
||||||
if (!price.is_zero())
|
if (!price.is_zero())
|
||||||
{
|
{
|
||||||
price *= (100.0 + perc) / 100.0;
|
price *= (CENTO + perc) / CENTO;
|
||||||
r.put(RDOC_PREZZO, price);
|
r.put(RDOC_PREZZO, price);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ int main( int argc, char** argv )
|
|||||||
case 6: ve6600(argc, argv); break; // collegamento contabilità industriosa
|
case 6: ve6600(argc, argv); break; // collegamento contabilità industriosa
|
||||||
case 7: ve6700(argc, argv); break; // copia documenti interattiva da ditta a ditta
|
case 7: ve6700(argc, argv); break; // copia documenti interattiva da ditta a ditta
|
||||||
case 8: ve6800(argc, argv); break; // contabilizzazione analitica documenti
|
case 8: ve6800(argc, argv); break; // contabilizzazione analitica documenti
|
||||||
|
case 9: ve6900(argc, argv); break; // controllo ordini evasi
|
||||||
default: ve6100(argc, argv); break; // contabilizzazione documenti
|
default: ve6100(argc, argv); break; // contabilizzazione documenti
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -9,5 +9,6 @@ int ve6500 (int, char**);
|
|||||||
int ve6600 (int, char**);
|
int ve6600 (int, char**);
|
||||||
int ve6700 (int, char**);
|
int ve6700 (int, char**);
|
||||||
int ve6800 (int, char**);
|
int ve6800 (int, char**);
|
||||||
|
int ve6900 (int, char**);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
178
src/ve/ve6900.cpp
Normal file
178
src/ve/ve6900.cpp
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
/**************************************************
|
||||||
|
* File: ve6900.cpp *
|
||||||
|
* Programma per il controllo degli ordini evasi *
|
||||||
|
* Authors: Alessandro Bonazzi, Mattia Tollari *
|
||||||
|
**************************************************/
|
||||||
|
|
||||||
|
#include <automask.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <relation.h>
|
||||||
|
#include <sheet.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <defmask.h>
|
||||||
|
|
||||||
|
#include "velib04.h"
|
||||||
|
#include "../cg/cgsaldac.h"
|
||||||
|
|
||||||
|
#include "ve6900a.h"
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////
|
||||||
|
// MASCHERA //
|
||||||
|
///////////////////////////////////////////////
|
||||||
|
class TControllo_ordini_mask : public TAutomask
|
||||||
|
{
|
||||||
|
TString_array _tipi_doc; // Array di stringhe contenente i tipi documenti da elaborare
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Controlla se lo stato ed il tipo del documento sono validi e rispettano la selezione
|
||||||
|
bool doc_tipo_stato_ok(const TRectype& doc);
|
||||||
|
// Constructor and Distructor
|
||||||
|
TControllo_ordini_mask(): TAutomask("ve6900a") {}
|
||||||
|
~TControllo_ordini_mask() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TControllo_ordini_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
|
{
|
||||||
|
switch (o.dlg())
|
||||||
|
{
|
||||||
|
case DLG_USER:
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TControllo_ordini_mask::doc_tipo_stato_ok(const TRectype& doc)
|
||||||
|
// Verifica che il tipo documento corrente esista tra i tipi previsti dalla elaborazione
|
||||||
|
// differita selezionata
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
const TString4 tipo = doc.get(DOC_TIPODOC);
|
||||||
|
const char stato = doc.get_char(DOC_STATO);
|
||||||
|
const int items = _tipi_doc.items();
|
||||||
|
for (int i = 0; i < items && !found; i++)
|
||||||
|
{
|
||||||
|
TToken_string& t = _tipi_doc.row(i);
|
||||||
|
const TString4 tipox(t.get(0));
|
||||||
|
const char statox = t.get(1)[0];
|
||||||
|
if (tipo == tipox && stato == statox)
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////
|
||||||
|
// APPLICAZIONE //
|
||||||
|
/////////////////////////////////////////////
|
||||||
|
|
||||||
|
// TControllo_ordini
|
||||||
|
// Applicazione per il controllo degli ordini evasi
|
||||||
|
class TControllo_ordini_app : public TSkeleton_application
|
||||||
|
{
|
||||||
|
TControllo_ordini_mask* _msk;
|
||||||
|
|
||||||
|
protected: // TApplication
|
||||||
|
// Controlla gli ordini
|
||||||
|
void check();
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual void main_loop();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void TControllo_ordini_app::check()
|
||||||
|
{
|
||||||
|
// Creo la relazione alla tabella del Db
|
||||||
|
TRelation rel(LF_DOC);
|
||||||
|
// Definisco i due TRecType di inizio e fine per lo scorrimento
|
||||||
|
TRectype recini(rel.curr());
|
||||||
|
TRectype recfin(rel.curr());
|
||||||
|
// Imposto il cursore
|
||||||
|
rel.lfile().set_curr(new TDocumento);
|
||||||
|
// Aggiungo dei filtri, in questo caso utilizzando la KEY 1 ho bisogno di
|
||||||
|
// PROVV+ANNO+CODNUM
|
||||||
|
// Inizio
|
||||||
|
recini.put(DOC_PROVV, _msk->get(F_PROVV));
|
||||||
|
recini.put(DOC_ANNO, _msk->get(F_DA_ANNO));
|
||||||
|
recini.put(DOC_CODNUM, _msk->get(F_CODNUM));
|
||||||
|
// Fine
|
||||||
|
recfin.put(DOC_PROVV, _msk->get(F_PROVV));
|
||||||
|
recfin.put(DOC_ANNO, _msk->get(F_A_ANNO));
|
||||||
|
recfin.put(DOC_CODNUM, _msk->get(F_CODNUM));
|
||||||
|
// Salviamo lo stato da impostare
|
||||||
|
const TString4 stato = _msk->get(F_STATO);
|
||||||
|
// Filtro sullo stato del documento
|
||||||
|
TString filter("STATO<");
|
||||||
|
filter << stato;
|
||||||
|
// Istanzio il cursore
|
||||||
|
TCursor cur(&rel, filter, 1, &recini, &recfin);
|
||||||
|
const long total = cur.items();
|
||||||
|
// Se esistono righe
|
||||||
|
if (total > 0)
|
||||||
|
{
|
||||||
|
TString msg = TR("Confermare l'aggiornamento di ");
|
||||||
|
msg.add_plural(total, TR("documento"));
|
||||||
|
if (yesno_box(msg))
|
||||||
|
{
|
||||||
|
TProgress_monitor pi(total, title());
|
||||||
|
// Blocco il cursore per garantire l'integrità dei dati
|
||||||
|
cur.freeze();
|
||||||
|
for (cur = 0; cur.pos() < total; ++cur)
|
||||||
|
{
|
||||||
|
if (!pi.add_status())
|
||||||
|
break;
|
||||||
|
TDocumento& doc = (TDocumento&) cur.curr();
|
||||||
|
bool docEvaso = true;
|
||||||
|
// Controllo che il documento sia completamente evadibile e non già segnato evaso
|
||||||
|
for (int i = doc.physical_rows(); i > 0; i--)
|
||||||
|
{
|
||||||
|
TRiga_documento& r = doc[i];
|
||||||
|
docEvaso &= (!r.is_evadibile() || r.is_evasa());
|
||||||
|
}
|
||||||
|
// Imposto il nuovo stato
|
||||||
|
if(docEvaso)
|
||||||
|
{
|
||||||
|
doc.put(DOC_STATO, stato);
|
||||||
|
int err = doc.rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool TControllo_ordini_app::create()
|
||||||
|
{
|
||||||
|
open_files(LF_TABCOM, LF_TAB, LF_DOC, LF_RIGHEDOC, LF_MOVANA, LF_RMOVANA, 0);
|
||||||
|
_msk = new TControllo_ordini_mask();
|
||||||
|
return TSkeleton_application::create();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TControllo_ordini_app::destroy()
|
||||||
|
{
|
||||||
|
if (_msk) delete _msk;
|
||||||
|
return TSkeleton_application::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TControllo_ordini_app::main_loop()
|
||||||
|
{
|
||||||
|
while (_msk->run() == K_ENTER)
|
||||||
|
check();
|
||||||
|
}
|
||||||
|
|
||||||
|
int ve6900 (int argc, char **argv)
|
||||||
|
{
|
||||||
|
TControllo_ordini_app a;
|
||||||
|
a.run(argc,argv, TR("Gestione ordini evasi"));
|
||||||
|
return true;
|
||||||
|
}
|
10
src/ve/ve6900a.h
Normal file
10
src/ve/ve6900a.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Include file per ve6900a.uml
|
||||||
|
|
||||||
|
#define F_PROVV 101
|
||||||
|
#define F_CODNUM 102
|
||||||
|
#define F_DESNUM 103
|
||||||
|
#define F_DA_ANNO 104
|
||||||
|
#define F_A_ANNO 105
|
||||||
|
#define F_STATO 106
|
||||||
|
#define F_DESCINI 107
|
||||||
|
|
79
src/ve/ve6900a.uml
Normal file
79
src/ve/ve6900a.uml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
#include "ve6900a.h"
|
||||||
|
|
||||||
|
PAGE "Controllo ordini" -1 -1 100 11
|
||||||
|
|
||||||
|
LISTBOX F_PROVV 11
|
||||||
|
BEGIN
|
||||||
|
FIELD PROVV
|
||||||
|
PROMPT 2 1 "Tipo "
|
||||||
|
ITEM "D|Definitiva "
|
||||||
|
ITEM "P|Provvisoria"
|
||||||
|
FLAGS "P"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CODNUM 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 3 "Numerazione"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
USE %NUM SELECT I1==3
|
||||||
|
INPUT CODTAB F_CODNUM
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@60" S0
|
||||||
|
OUTPUT F_CODNUM CODTAB
|
||||||
|
OUTPUT F_DESNUM S0
|
||||||
|
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESNUM 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 23 3 ""
|
||||||
|
FLAGS "UD"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_DA_ANNO 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Da anno "
|
||||||
|
FIELD ANNO
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
NUM_EXPR #F_DA_ANNO>0
|
||||||
|
FLAG "AP"
|
||||||
|
WARNING "Inserire un anno valido"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_A_ANNO 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "A anno "
|
||||||
|
FIELD ANNO
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
NUM_EXPR #F_A_ANNO>=#F_DA_ANNO
|
||||||
|
FLAG "AP"
|
||||||
|
WARNING "Inserire un anno valido"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_STATO 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 9 "Stato evaso"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
USE %STD
|
||||||
|
INPUT CODTAB F_STATO
|
||||||
|
DISPLAY "Stato documento" CODTAB
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
OUTPUT F_STATO CODTAB
|
||||||
|
OUTPUT F_DESCINI S0
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCINI 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 23 9 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
|
|
||||||
|
#include <elabar.h>
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
@ -34,6 +34,7 @@ Item_05 = "Compattamento documenti", "ve5 -4", "F"
|
|||||||
Item_06 = "Invio e ricezione documenti", "ve5 -3", "F"
|
Item_06 = "Invio e ricezione documenti", "ve5 -3", "F"
|
||||||
Item_07 = "Lista ritenute per F24", "ve8 -0", "F"
|
Item_07 = "Lista ritenute per F24", "ve8 -0", "F"
|
||||||
Item_08 = "Controllo IBAN su documenti", "ve4 -2", "F"
|
Item_08 = "Controllo IBAN su documenti", "ve4 -2", "F"
|
||||||
|
Item_09 = "Controllo ordini evasi", "ve6 -9", "F"
|
||||||
|
|
||||||
[VEMENU_052]
|
[VEMENU_052]
|
||||||
Caption = "Configurazione"
|
Caption = "Configurazione"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user