Patch level : xx.414

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Riportata 01.04 patch 414


git-svn-id: svn://10.65.10.50/trunk@8260 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1999-06-18 15:35:05 +00:00
parent a86682531f
commit 974b558363
151 changed files with 14405 additions and 3520 deletions

View File

@ -17,6 +17,10 @@
#include <nditte.h>
#include <windows.h>
#include <compobj.h>
#include <ver.h>
#include "ba0.h"
#include "ba0100a.h"
#include "ba0400a.h"
@ -1133,6 +1137,7 @@ protected:
void manage_preferred();
bool test_programs();
bool test_network();
public:
void reload_images() { _menu.reload_images(); }
@ -1454,6 +1459,42 @@ static int get_module_version(TConfig& cfg, void* jolly)
return FALSE;
}
bool TMenu_application::test_network()
{
word winver = LOWORD(GetVersion());
if (LOBYTE(winver)==3 && HIBYTE(winver)==95)
{
char * VREDIRNAME = "vredir.vxd";
DWORD handle;
BYTE infoBuffer[512];
DWORD dwSize = GetFileVersionInfoSize(VREDIRNAME,&handle);
if (dwSize)
{
GetFileVersionInfo(VREDIRNAME,handle,dwSize,infoBuffer);
long *language;
void * lpBuffer;
char szName[128];
UINT Size;
if (VerQueryValue(infoBuffer, "\\VarFileInfo\\Translation", (void **)&language, &Size) && Size!=0)
{
sprintf(szName, "\\StringFileInfo\\%04x%04x\\FileVersion",LOWORD(*language), HIWORD(*language));
if (VerQueryValue(infoBuffer, szName, &lpBuffer, &Size) && Size!=0)
{
TToken_string v((const char *)lpBuffer,'.');
int subver=atoi(v.get(2));
if (subver >=1111 && subver <=1115)
return error_box("La versione %s del driver di rete '%s' contiene un bug riconosciuto da Microsoft. Consultare la documentazione sul sito AGA per eliminare questo inconveniente.",(const char *)lpBuffer, VREDIRNAME);
else
return TRUE;
}
}
}
message_box("Non riesco a determinare la versione del driver di rete '%s'",VREDIRNAME);
}
return TRUE;
}
bool TMenu_application::test_programs()
{
TToken_string dangerous;
@ -1492,7 +1533,7 @@ bool TMenu_application::test_programs()
const int p1 = mytok ? mytok->get_int() : 0;
const TString16 v2 = histok ? histok->get(0) : "";
const int p2 = histok ? histok->get_int() : 0;
if (compare_version(v1, p1, v2, p2) < 0)
if (!v1.blank() && compare_version(v1, p1, v2, p2) < 0)
{
dangerous.add(code);
const TString& name = scan.token().mid(3);
@ -1519,6 +1560,9 @@ bool TMenu_application::create()
{
TApplication::create();
if (!test_network())
return FALSE;
#ifdef _DEMO_
{
TMask w("Attenzione", 1, 78, 14);

View File

@ -98,6 +98,7 @@ END
BOOLEAN F_NOWRITE
BEGIN
PROMPT 32 -7 "Disabilita registrazioni nell'intero modulo"
GROUP G_SUPERUSER
END
SPREADSHEET F_PROPERTIES
@ -107,6 +108,7 @@ BEGIN
ITEM "Uso"
ITEM "Azione"
ITEM "Espressione"
GROUP G_SUPERUSER
END
ENDPAGE

View File

@ -19,6 +19,8 @@ int main(int argc, char** argv)
ba2400(argc, argv) ; break;
case 4:
ba2500(argc, argv) ; break;
case 5:
ba2600(argc, argv) ; break;
default:
ba2100(argc, argv); break;
}

View File

@ -6,6 +6,7 @@ int ba2200(int argc, char* argv[]);
int ba2300(int argc, char* argv[]);
int ba2400(int argc, char* argv[]);
int ba2500(int argc, char* argv[]);
int ba2600(int argc, char* argv[]);
#endif // __BA2_H

View File

@ -63,3 +63,50 @@ MENU BAR_ITEM(1)
ITEM MENU_ITEM(53) "~Primo"
ITEM MENU_ITEM(54) "~Ultimo"
MENUBAR MENU_BAR(5)
MENU MENU_BAR(5)
SUBMENU BAR_ITEM(51) "~File"
SUBMENU BAR_ITEM(52) "~Modifica"
SUBMENU BAR_ITEM(53) "~Aggiungi"
SUBMENU BAR_ITEM(54) "~Visualizza"
SUBMENU BAR_ITEM(55) "~Test"
MENU BAR_ITEM(51)
ITEM MENU_ITEM(11) "~Nuovo"
ITEM MENU_ITEM(12) "~Apri"
ITEM MENU_ITEM(13) "~Salva"
ITEM MENU_ITEM(14) "Salva ~con nome"
SEPARATOR
ITEM M_FILE_ABOUT+1 "~Informazioni"
ITEM M_FILE_QUIT "Fin~e"
MENU BAR_ITEM(52)
ITEM MENU_ITEM(21) "~Copia-Incolla"
ITEM MENU_ITEM(22) "Ca~ncella CANC"
ITEM MENU_ITEM(23) "S~posta in.. F2"
MENU BAR_ITEM(53)
ITEM MENU_ITEM(31) "~Button"
ITEM MENU_ITEM(32) "~CheckBox"
ITEM MENU_ITEM(33) "Currenc~y"
ITEM MENU_ITEM(34) "~Date"
ITEM MENU_ITEM(35) "Grou~pBox"
ITEM MENU_ITEM(36) "~List"
ITEM MENU_ITEM(37) "~Memo"
ITEM MENU_ITEM(38) "~Number"
ITEM MENU_ITEM(39) "~RadioButton"
ITEM MENU_ITEM(310) "~SpreadSheet"
ITEM MENU_ITEM(311) "S~tringa"
ITEM MENU_ITEM(312) "Te~xt"
ITEM MENU_ITEM(313) "~Zoom"
MENU BAR_ITEM(54)
ITEM MENU_ITEM(41) "~Controlli presenti F3"
ITEM MENU_ITEM(42) "~Maschera di sheet F4"
ITEM MENU_ITEM(43) "Co~ntrolli-maschera sheet F5"
MENU BAR_ITEM(55)
ITEM MENU_ITEM(51) "~Compilazione"
ITEM MENU_ITEM(52) "~Esecuzione"

3469
ba/ba2600.cpp Executable file

File diff suppressed because it is too large Load Diff

889
ba/ba2600.h Executable file
View File

@ -0,0 +1,889 @@
//EDITOR DI MASCHERE: applicazione di supporto alla creazione di maschere
#include <applicat.h>
#include <colors.h>
#include <urldefid.h>
#include <window.h>
#include <controls.h>
#include <xvtility.h>
#include <xvt_defs.h>
#include <strings.h>
#include <mask.h>
#include <msksheet.h>
#include <keys.h>
#include <sheet.h>
#include <execp.h>
//inclusione degli identificatori delle maschere di supporto
#include "ba2600b.h" //per i controlli
#include "ba2600a.h" //per la maschera
class TEditMask_control;
class TEditMask_sheet;
//--------------------------------------------------------------------
// Classe TEditMask_window: classe per la definizione della "maschera"
//--------------------------------------------------------------------
class TEditMask_window : public TWindow
{
// @cmember:(INTERNAL) Array di controlli
TArray _controls;
// @cmember:(INTERNAL) Puntatore alla classe di definizione dei controlli
TEditMask_control* _controllo;
// @cmember:(INTERNAL) Puntatore alla classe di definizione del controllo spreadsheet
TEditMask_sheet* _sheet;
// @cmember:(INTERNAL) Nomi delle pagine della "maschera"
TString_array _name;
// @cmember:(INTERNAL) Presenza(TRUE) della toolbar
bool _tool;
// @cmember:(INTERNAL) Modalità di lettura(FALSE) o creazione(TRUE) della "maschera"
bool _mode;
// @cmember:(INTERNAL) Definizione del tipo di visualizzazione ("a"->centrata|"b"->personalizzata)
TString _type_vz;
// @cmember:(INTERNAL) Pagina della "maschera"
int _page;
// @cmember:(INTERNAL) Coordinata X
int _coordx;
// @cmember:(INTERNAL) Coordinata Y
int _coordy;
// @cmember:(INTERNAL) Dimensione: altezza
int _alt;
// @cmember:(INTERNAL) Dimensione :lunghezza
int _lung;
// @cmember:(INTERNAL) Coordinata Y della toolbar
int _y_tool;
// @cmember:(INTERNAL) Totale pagine
int _total_page;
// @cmember:(INTERNAL) Numero degli sheet presenti(settaggio nella lettura)
int _nsheet;
// @cmember:(INTERNAL) Identificativo dello sheet in considerazione
int _idsheet;
// @cmember:(INTERNAL) Rettangolo di definizione della toolbar
RCT _rt;
// @cmember:(INTERNAL) Rettangolo di definizione della selezione
RCT _rct_sel;
// @cmember:(INTERNAL) File .uml
TFilename _file;
protected:
// @cmember Permette(in una maschera di supporto) il settaggio e la lettura
// dei campi di definizione della "maschera"
KEY main_loop();
public:
// @cmember Aggiunge un controllo di tipo m all'array _controls
void add_control(MENU_TAG m);
// @cmember Aggiunge un controllo di tipo string
TEditMask_control* addstring();
// @cmember Aggiunge un controllo di tipo number
TEditMask_control* addnumber();
// @cmember Aggiunge un controllo di tipo currency
TEditMask_control* addcurrency();
// @cmember Aggiunge un controllo di tipo button
TEditMask_control* addbutton();
// @cmember Aggiunge un controllo di tipo date
TEditMask_control* adddate();
// @cmember Aggiunge un controllo di tipo boolean
TEditMask_control* addboolean();
// @cmember Aggiunge un controllo di tipo text
TEditMask_control* addtext();
// @cmember Aggiunge un controllo di tipo groupbox
TEditMask_control* addgroup();
// @cmember Aggiunge un controllo di tipo radiobutton
TEditMask_control* addradio();
// @cmember Aggiunge un controllo di tipo memo
TEditMask_control* addmemo();
// @cmember Aggiunge un controllo di tipo zoom
TEditMask_control* addzoom();
// @cmember Aggiunge un controllo di tipo spreadsheet
TEditMask_control* addsheet();
// @cmember Aggiunge un controllo di tipo list
TEditMask_control* addlist();
// @cmember Fa una copia dei controlli selezionati
void copy_crt_sel();
// @cmember Distrugge un controllo con "Elimina" della maschera di supporto
void destroy_control(TEditMask_control* c);
// @cmember Cancella i controlli selezionati
void erase_crt_sel();
// @cmember Sposta i controlli selezionati nella pagina richiesta
void move_crt_sel();
// @cmember Ritorna la pagina corrente
int page() { return _page;}
// @cmember Setta il punatatore alla classe del controllo spreadsheet
void set_sheet(TEditMask_sheet* s) { _sheet=s;}
// @cmember Ritorna il puntatore alla classe del controllo spreadsheet
TEditMask_sheet* get_sheet() { return _sheet;}
// @cmember Apri file: ritorna lo spreadsheet corrispondente alla sua maschera
TEditMask_control* find_sheet(int i);
// @cmember Ridisegna il rettangolo di selezione per permettere lo spostamento
bool redesign(RCT* rct,int dx,int dy);
// @cmember Ritorna il controllo avente il punto pnt
TEditMask_control* search(const PNT& pnt);
// @cmember Torna TRUE se sono stati trovati dei controlli selezionati
bool search(RCT* rct);
// @cmember Sposta il o i controllo/i selezionati
void move(RCT* rct,PNT pntinz, PNT pntfin);
// @cmember Deseleziona i controlli selezionati
void deselection();
// @cmember Inizializza il rettangolo di selezione
void inizialition();
// @cmember Disegna una linea nella "maschera"
void line(short x0, short y0, short x1, short y1) const;
// @cmember Converte le coordinate da pixel a caratteri
PNT& logic(const PNT& p, bool& intool);
// @cmember Controlla le pagine(devono essere inserite in ordine crescente +1)
int max_page(int pag);
// @cmember Normalizza rettangoli
void normalize_rect(RCT *norm_rctp, RCT*rctp);
// @cmember Risponde all'evento E_CHAR
void o_key(KEY key);
// @cmember Visualizza i controlli presenti nella pagina corrente
void vision_ctrl();
// @cmember Visualizza la "maschera" relativa allo spreadsheet corrente
void vision_spread();
// @cmember Visualizza i controlli della "maschera" relativa allo spread corrente
void vision_sp_ctl();
// @cmember Aggiunge un controllo del tipo string
RCT& resize_rect(short x, short y, short dx, short dy,
WIN_TYPE wt = WO_TE, bool intool = FALSE) const; //ridimensiona controlli
// @cmember Definisce il rettangolo di selezione
void rubber_rect(WINDOW win, RCT*rctp,PNT p);
// @cmember Crea il rettangolo di selezione in risposta agli eventi del mouse
void selected_crt(WINDOW win, EVENT* ep);
// @cmember Definisce l' appartenenza di un punto al rettangolo di selezione
bool selection(RCT* rct,PNT pnt);
// @cmember Setta la modalità della "maschera"
void set_mod(bool m) { _mode=m; }
// @cmember Ritorna la modalità della "maschera" per evitare controlli impropri
bool get_mod() { return _mode; }
// @cmember Ritorna il nome del file
TFilename filename() { return _file; }
// @cmember Salva il file .uml richiama<save_page(ostream& out)>
void create_file();
// @cmember Salva il file .h
void create_fileh();
// @cmember Controlla la "maschera" in fase di salvataggio(non sono salvate pagine prive di controlli)
int page_null(int page);
// @cmember Salva la disposizione della "maschera" per il file .uml
void save_page(ostream& out);
// @cmember Apre un file .uml e ricrea la "maschera"
void restore_mask(const char* filename);
// @cmember Legge da file le proprietà delle singole pagine
void read_page(TScanner& scanner, int pg, bool tool);
// @cmember Legge da file le proprietà della toolbar
bool read_tool(TScanner& scanner);
// @cmember Legge da file i controlli presenti in ogni singola pagina
void read_control(TScanner& scanner,const TString& k, bool intool=FALSE);
// @cmember Legge le proprietà della "maschera" da quella di supporto
void get_mask(TMask& m);
// @cmember Gestisce gli eventi
virtual void handler(WINDOW win, EVENT* ep);
// @cmember Setta (con i valori salvati precedentemente) la maschera di supporto
void set_mask(TMask& m);
// @cmember Gestisce la scelta da menu : salva come
void save_as_mask();
// @cmember Gestisce la scelta da menu : salva
void save_mask();
// @cmember Crea la "maschera" con o senza toolbar
void set_toolbar(bool tb);
// @cmember Fa l'update della "maschera"
virtual void update();
// @cmember Costruttore
TEditMask_window(short x,short y,short dx,short dy,
const char*title,long flags, WIN_TYPE wt);
// @cmember Distruttore
~TEditMask_window() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_control: definizione della classe base dei controlli
//------------------------------------------------------------------------
class TEditMask_control : public TObject
{
// @cmember:(INTERNAL) Puntatore alla classe di definizione della "maschera"
TEditMask_window* _parent;
// @cmember:(INTERNAL) Rettangolo del controllo
RCT _rct;
// @cmember:(INTERNAL) Definizione della selezione di un controllo
bool _selected;
// @cmember:(INTERNAL) Controllo in toolbar
bool _intool;
// @cmember:(INTERNAL) Coordinata X
int _left;
// @cmember:(INTERNAL) Coordinata Y
int _top;
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Dimensione : altezza
int _latoy;
// @cmember:(INTERNAL) Pagina di appartenenza
int _pag;
// @cmember:(INTERNAL) Definizione della priorità del focus sul controllo
int _focus;
// @cmember:(INTERNAL) Campo KEY
TString _key;
// @cmember:(INTERNAL) Tipo di controllo
TString _type_field;
// @cmember:(INTERNAL) Campo FIELD
TString _field;
// @cmember:(INTERNAL) Campo PROMPT
TString _prompt;
// @cmember:(INTERNAL) Identificativo del controllo
TString _id;
// @cmember:(INTERNAL) Campo WARNING
TString _warning;
// @cmember:(INTERNAL) Campo CHECKTYPE
TString _check;
// @cmember:(INTERNAL) Campo FLAGS
TString _flag;
// @cmember:(INTERNAL) Campo GROUP
TString _group;
// @cmember:(INTERNAL) Campo MESSAGE
TString_array _message;
public:
// @cmember Setta il campo: CHECKTYPE
const TString& set_check(const TString& ck);
// @cmember Setta le coordinate del controllo
void set_crd(int x, int y);
// @cmember Setta le dimensioni dei controlli
void set_dim(int ln, int lg);
// @cmember Setta i campi principali(_prompt,_pag,_focus,_id,_left,_top) della maschera di supporto
void set_field(TMask& mask);
// @cmember Setta il campo FLAGS
const TString& set_flag(const TString& fl);
// @cmember Setta la priorità del focus
void set_focus(int f) { _focus=f; }
// @cmember Setta il campo GROUP
const TString& set_group(const TString& gr);
// @cmember Setta il numero di riconoscimento degli spreadsheet <find_sheet()>
virtual void set_idsheet(int n) { }
// @cmember Setta una proprietà degli spreadsheet
virtual void set_hismask(bool b) { }
// @cmember Setta l'identificativo
const TString& set_id(const TString& id);
// @cmember Setta il campo MESSAGE
void set_message(TSheet_field& sp);
// @cmember Setta i campi opzionali(_flag,_group,_warning,_check,_key,_field) della maschera di supporto
void set_option(TMask& mask);
// @cmember Setta la pagina di appartenenza del controllo
void set_page(int p) { _pag=p; }
// @cmember Setta il campo PROMPT
const TString& set_prompt(const TString& prompt);
// @cmember Setta la selezione dei controlli
bool set_selected(bool sl);
// @cmember Setta il tipo di controllo
const TString& set_type(const TString& fld);
// @cmember Ritorna il numero di identificazione dello spreadsheet <find_sheet()>
virtual int get_idsheet() { return -1;}
// @cmember Ritorna una proprietà dello spreadsheet
virtual bool get_hismask() {return -1; }
// @cmember Legge i campi principali dalla maschera di supporto
void get_field(TMask& mask);
// @cmember Ritorna la priorità del focus
int get_focus() { return _focus; }
// @cmember Legge dalla maschera di supporto il campo MESSAGE
void get_message(TSheet_field& sp);
// @cmember Legge i campi opzionali dalla maschera di supporto
void get_option(TMask& mask);
// @cmember Verifica se un controllo è stato selezionato
bool get_selected() { return _selected; }
// @cmember Stampa su file .uml il campo MESSAGE
void print_message(ostream& out)const;
// @cmember Stampa il file .uml
virtual void print_on(ostream& out) const;
// @cmember Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool) {};
// @cmember Legge le proprietà comuni(principali e opzionali) da file .uml
void read_field(TScanner& scanner,const TString& tok, bool intool);
// @cmember Intercetta un punto
bool contains(const PNT pnt);
// @cmember Scrive il prompt sul controllo
void frase(short x, short y) const;
// @cmember Nasconde o disabilita un controllo
int flag_crt() const;
// @cmember Disegna una linea sulla "maschera"
void line(short x0, short y0, short x1, short y1) const;
// @cmember Ritorna l'offset(nullo per campi non editabili)
virtual int off()const { return 0; }
// @cmember Ridisegna il controllo per permettere lo spostamento
bool redesign(int dx, int dy);
// @cmember Ridimensiona i controlli richiama<RCT& resize_rect(....)>
void resize_rect();
// @cmember Ridimensiona i controlli
RCT& resize_rect(short x, short y, short dx, short dy, WIN_TYPE wt,bool intool=FALSE)const;
// @cmember Ritorna il prompt del controllo
const TString& prt()const { return _prompt; }
// @cmember Ritorna l'identificativo
const TString& ident()const { return _id; }
// @cmember Ritorna il tipo del controllo
const TString& type()const { return _type_field; }
// @cmember Ritorna il campo FLAGS
const TString& flag()const { return _flag; } //ritorna il flags
// @cmember Ritorna la lunghezza del prompt
int prompt_len()const { return _prompt.len();}
// @cmember Ritorna la pagina corrente del controllo
int page() { return _pag;}
// @cmember Ritorna il campo MESSAGE
const TString_array& message()const { return _message;} //ritorna message
// @cmember Definisce la finestra figlio (non NULL solo per spreadsheet)
virtual TEditMask_window* figlio() { return NULL; }
// @cmember Setta,apre,legge la maschera di supporto
virtual KEY main_loop() { return 0;}
// @cmember Definisce il parent
TEditMask_window& padre()const;
// @cmember Definisce la finestra ("maschera")
WINDOW maschera() const { return _parent->win(); }
// @cmember Ritorna il rettangolo del controllo
RCT rectangle()const { return _rct; }
// @cmember Fa l'update del controllo
virtual void update() const {}
// @cmember Duplica il controllo o controlli selezionati
virtual TObject* dup()const { return new TEditMask_control(*this);}
// @cmember Costruttore
TEditMask_control(TEditMask_window* parent);
// @cmember Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_control(const TEditMask_control& ctl);
// @cmember Distruttore
virtual ~TEditMask_control() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_string: definizione della classe per il controllo
// di tipo STRING
//------------------------------------------------------------------------
class TEditMask_string: public TEditMask_control
{
// @cmember:(INTERNAL) Lunghezza effettiva del controllo
int _lungsz;
// @cmember:(INTERNAL) Lunghezza a video del controllo
int _lungvd;
// @cmember:(INTERNAL) Offset: spazi terminali del prompt
int _offset;
// @cmember:(INTERNAL) Lunghezza di supporto
int _lngspt;
// @cmember:(INTERNAL) Browse(use,input,join,output,diplay,copy)
TString _use;
// @cmember:(INTERNAL) Add Run
TString _addr;
public:
// @cmember Ritorna la lunghezza a video
int dim_video()const { return _lungvd;}
// @cmember Controlla la lunghezza in caso di valoti nulli
void error_lung(int lsz, int lvd);
// @cmember Setta i campi relativi ad _use ed _offset sulla maschera di supporto
void set_bwoff(TMask& m);
// @cmember Legge i campi _use e _offset dalla maschera di supporto
void get_bwoff(TMask& m);
// @cmember Legge dalla maschera di supporto le lunghezze
void get_lngz(TMask& m);
// @cmember Setta le lunghezze sulla maschera di supporto
void set_lngz(TMask& m);
// @cmember Setta l'offset
void set_offset(int d);
// @cmember Ritorna l'offset
virtual int off()const { return _offset;}
// @member Fa l'update del controllo
virtual void update() const;
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Legge da file le lunghezze
void read_lngz(TScanner& scanner);
// @member Legge da file l'offset
int read_off(const TString& prt);
// @member Legge da file la combinazione del browse(use,input,join,output,display,copy)
void read_use(TScanner& scanner,const TString& tok);
// @member Stampa su file la lunghezza
void print_lngz(ostream& out) const;
// @member Stampa su file il browse
void print_use(ostream& out)const;
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Setta,apre,legge i campi della maschera di supporto
virtual KEY main_loop();
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_string(*this);}
// @member Costruttore
TEditMask_string(TEditMask_window* parent);
// @member Costruttore.Copia tutte le caratteristiche del controllo
TEditMask_string(const TEditMask_string& ctl);
// @member Distruttore
virtual ~TEditMask_string() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_number: definizione della classe per il controllo
// di tipo NUMBER
//------------------------------------------------------------------------
class TEditMask_number: public TEditMask_string
{
// @cmember:(INTERNAL) Numero di decimali
int _decimals;
// @cmember:(INTERNAL) Lunghezza
int _latox;
// @cmember:(INTERNAL) Campo PICTURE
TString _picture;
public:
// @member Setta i decimali
void set_decimal(int d);
// @member Setta il campo PICTURE
const TString& set_picture(const TString& pic);
// @member Legge il file.uml
virtual void read_from(TScanner& scanner, bool intool);
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_number(*this);}//per duplicare
// @member Costruttore
TEditMask_number(TEditMask_window* parent) ;
// @member Costruttore. Copia tutte le proprietà del controllo
TEditMask_number(const TEditMask_number& ctl);
// @member Distruttore
virtual ~TEditMask_number() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_currency: definizione della classe per il controllo
// di tipo CURRENCY
//------------------------------------------------------------------------
class TEditMask_currency: public TEditMask_number
{
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Campo PICTURE
TString _picture;
public:
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_currency(*this);}//per duplicare
// @member Costruttore
TEditMask_currency(TEditMask_window* parent) ;
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_currency(const TEditMask_currency& ctl);
// @member Distruttore
virtual ~TEditMask_currency() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_date: definizione della classe per il controllo
// di tipo DATE
//------------------------------------------------------------------------
class TEditMask_date: public TEditMask_string
{
public:
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Setta.apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_date(*this);}//per duplicare
// @member Costruttore
TEditMask_date(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_date(const TEditMask_date& ctl);
// @member Distruttore
virtual ~TEditMask_date() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_boolean: definizione della classe per il controllo
// di tipo BOOLEAN
//------------------------------------------------------------------------
class TEditMask_boolean: public TEditMask_control
{
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_boolean(*this);}//per duplicare
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update()const;
// @member Costruttore
TEditMask_boolean(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_boolean(const TEditMask_boolean& ctl);
// @member Distruttore
virtual ~TEditMask_boolean() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_text: definizione della classe per il controllo
// di tipo TEXT
//------------------------------------------------------------------------
class TEditMask_text: public TEditMask_string
{
// @cmember:(INTERNAL) Campo FLAGS
TString _flag;
// @cmember:(INTERNAL) Campo GROUP
TString _group;
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_text(*this);}
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update() const;
// @member Costruttore
TEditMask_text(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_text(const TEditMask_text& ctl);
// @member Distruttore
virtual ~TEditMask_text() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_button: definizione della classe per il controllo
// di tipo BUTTON
//------------------------------------------------------------------------
class TEditMask_button: public TEditMask_control
{
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Dimensione : altezza
int _latoy;
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_button(*this);}//per duplicare
// @member Definisce il tipo standard del controllo
void type_button(const TString& id,const TString& pr);
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update()const;
// @member Costruttore
TEditMask_button(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_button(const TEditMask_button& ctl);
// @member Distruttore
virtual ~TEditMask_button() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_group: definizione della classe per il controllo
// di tipo GROUP
//------------------------------------------------------------------------
class TEditMask_group: public TEditMask_control
{
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Dimensione : altezza
int _latoy;
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_group(*this);}
// @member Verifica la presenza del flags "R"
bool fl_crt()const ;
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update() const;
// @member Costruttore
TEditMask_group(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_group(const TEditMask_group& ctl);
// @member Distruttore
virtual ~TEditMask_group() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_list: definizione della classe per il controllo
// di tipo LIST
//------------------------------------------------------------------------
class TEditMask_list: public TEditMask_string
{
// @cmember:(INTERNAL) Offset
int _offset;
// @cmember:(INTERNAL) Item
TString_array _item;
// @cmember:(INTERNAL) Numero degli item
int _num_item;
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_list(*this);}
// @member Legge dalla maschera di supporto il campo ITEM
void get_item(TSheet_field& sp);
// @member Setta sulla maschera di supporto il campo ITEM
void set_item(TSheet_field& sp);
// @member Stampa il campo ITEM su file .uml
void print_item(ostream& out)const;
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Legge da file il campo item
TString& read_item(TScanner& scanner,TString& tok);
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update() const;
// @member Disegna parte del controllo(freccia)
void image()const;
// @member Ritorna il numero degli item
int n_item()const { return _num_item;}
// @member Ritorna _item
const TString_array& item()const { return _item;}
// @member Costruttore
TEditMask_list(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_list(const TEditMask_list& ctl);
// @member Distruttore
virtual ~TEditMask_list() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_radio: definizione della classe per il controllo
// di tipo RADIOBUTTON
//------------------------------------------------------------------------
class TEditMask_radio: public TEditMask_list
{
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Dimensione : altezza
int _latoy;
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_radio(*this);}
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update()const;
// @member Costruttore
TEditMask_radio(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_radio(const TEditMask_radio& ctl);
// @member Distruttore
virtual ~TEditMask_radio() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_memo: definizione della classe per il controllo
// di tipo MEMO
//------------------------------------------------------------------------
class TEditMask_memo: public TEditMask_control
{
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Dimensione : altezza
int _latoy;
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_memo(*this);}//per duplicare
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Stampa il file .uml
virtual void print_on(ostream& out)const;
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update()const;
// @member Costruttore
TEditMask_memo(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_memo(const TEditMask_memo& ctl);
// @member Distruttore
virtual ~TEditMask_memo() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_sheet: definizione della classe per il controllo
// di tipo SPREADSHEET
//------------------------------------------------------------------------
class TEditMask_sheet: public TEditMask_control
{
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Dimensione : altezza
int _latoy;
// @cmember:(INTERNAL) Numero degli item
int _num_item;
// @cmember:(INTERNAL) Identificativo di maschera
int _idsheet;
// @cmember:(INTERNAL) Campo ITEM
TString_array _item;
// @cmember:(INTERNAL) Browse(use,input,join,output,display,copy)
TString _browse;
// @cmember:(INTERNAL) "Maschera" legata allo spreadsheet
TEditMask_window _sheetmask;
// @cmember:(INTERNAL) Permette di aggiungere campi alla "maschera" dello spread
bool _is_mask;
public:
// @member Ritorna la "maschera" figlio
virtual TEditMask_window* figlio() { return &_sheetmask; }
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_sheet(*this);}
// @member Setta l'identificativo di maschera
void set_idsheet(int n) { _idsheet=n; }
// @member Ritorna l'identificativo di maschera
int get_idsheet() { return _idsheet; }
// @member Setta la possibiltà di aggiungere controlli alla sua "maschera"
void set_hismask(bool b) { _is_mask=b; }
// @member Ritorna _is_mask
bool get_hismask() { return _is_mask; }
// @member Crea i buttons(conferma,annulla,elimina) per la sua maschera
void window_sheet();
// @member Setta sulla maschera di supporto i campi ITEM e il browse
void set_itbr(TMask& m,TSheet_field& sp);
// @member Legge dalla maschera di supporto i campi ITEM e browse
void getitbr(TMask& m,TSheet_field& sp);
// @member Stampa su file.uml il browse(use,input,join,output,display,copy)
void print_browse(ostream& out)const;
// @member Stampa su file.uml il campo ITEM
void print_item(ostream& out)const;
// @member Stampa il file .uml
virtual void print_on(ostream& out)const;
// @member Legge da file il campo _item
TString& read_item(TScanner& scanner,TString& tok);
// @member Legge da file il campo relativo a browse
void read_browse(TScanner& scanner,const TString& tok);
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Fa l'update del controllo
virtual void update() const;
// @member Costruttore
TEditMask_sheet(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_sheet(const TEditMask_sheet& ctl);
// @member Distruttore
virtual ~TEditMask_sheet() {}
};
//------------------------------------------------------------------------
// Classe TEditMask_zoom: definizione della classe per il controllo
// di tipo ZOOM
//------------------------------------------------------------------------
class TEditMask_zoom: public TEditMask_list
{
// @cmember:(INTERNAL) Dimensione : lunghezza
int _latox;
// @cmember:(INTERNAL) Offset
int _offset;
public:
// @member Duplica il controllo
virtual TObject* dup()const { return new TEditMask_zoom(*this);}
// @member Legge il file .uml
virtual void read_from(TScanner& scanner,bool intool);
// @member Stampa il file .uml
virtual void print_on(ostream& out) const;
// @member Setta,apre,legge la maschera di supporto
virtual KEY main_loop();
// @member Costruttore
TEditMask_zoom(TEditMask_window* parent);
// @member Costruttore. Copia tutte le caratteristiche del controllo
TEditMask_zoom(const TEditMask_zoom& ctl);
// @member Distruttore
virtual ~TEditMask_zoom() {}
};
//-------------------------------------------------------------------------
// CLASSE TEDITMASK_APPLICATION: classe per l'esecuzione dell'applicazione
//-------------------------------------------------------------------------
class TMaskEditor_application : public TApplication
{
// @cmember:(INTERNAL) Puntatore alla finestra("maschera")corrente
TEditMask_window * _window;
// @cmember:(INTERNAL) Esistenza di una finestra
bool _dirty;
// @cmember:(INTERNAL) Se la "maschera" è stata salvata
bool _save;
protected:
// @cmember Richiama <Tapplication::create>
virtual bool create();
// @cmember Richiama <TApplication::destroy>
virtual bool destroy();
// @cmember Gestisce le scelte da menu
virtual bool menu(MENU_TAG);
public:
// @cmember Visualizza la maschera dello spreadsheet della pagina corrente
void vision_spread();
// @cmember Visualizza i controlli della pagina corrente
void vision_ctrl();
// @cmember Visualizza i controlli della maschera dello spreadsheet corrente
void vision_sp_ctl();
// @cmember Distrugge la "maschera"
void destroy_window();
// @cmember Crea una nuova "maschera"
void new_mask();
// @cmember Apre una "maschera" già predefinita
void open_mask();
// @cmember Salva come..la "maschera" su file .uml
void save_as_mask();
// @cmember Risalva la "maschera" su file .uml
void save_mask();
// @cmember Aggiunge un controllo
void add_control(MENU_TAG m);
// @cmember Copia i controlli selezionati
void copy_crt_sel();
// @cmember Cancella i controlli selezionati
void erase_crt_sel();
// @cmember Sposta in un'altra pagina i controlli selezionati
void move_crt_sel();
// @cmember Permette di compilare la "maschera" creata con l'applicazione
void build();
// @cmember Permette di eseguire la "maschera" creata con l'applicazione
void execute();
// @cmember Costruttore
TMaskEditor_application() { _window = NULL; _dirty = FALSE; _save=FALSE; }
// @cmember Distruttore
virtual ~TMaskEditor_application() {}
};

14
ba/ba2600a.h Executable file
View File

@ -0,0 +1,14 @@
#define F_PRT 101
#define F_Y 102
#define F_LN 103
#define F_X 104
#define F_LG 105
#define F_PAG 106
#define F_TOTALP 107
#define F_TYPE 108
#define F_TOOL 109
#define F_TOOLX 110
#define F_TOOLY 111
#define F_TOOLH 112
#define F_TOOLW 113
#define F_NAME 114

25
ba/ba2600b.h Executable file
View File

@ -0,0 +1,25 @@
#define F_PROMPT 101
#define F_UPPER 102
#define F_LONGEFF 103
#define F_FIELD 104
#define F_FLAG 105
#define F_REAL 106
#define F_DECIMAL 107
#define F_PICTURE 108
#define F_LEFT 109
#define F_OFFSET 110
#define F_LARGE 111
#define F_PAGE 112
#define F_GROUP 113
#define F_CHECK 114
#define F_WARNING 115
#define F_MESSAGE 116
#define F_ADDR 117
#define F_KEY 118
#define F_USE 119
#define F_IDENT 120
#define F_ITEM 121
#define F_LONGEVD 122
#define F_VAR 123
#define F_FOCUS 124
#define F_INTOOL 125

230
ba/ba2600d.uml Executable file
View File

@ -0,0 +1,230 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Spreadsheet" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo spreadsheet"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
FLAGS "H"
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza: "
GROUP 2
END
NUMBER F_LARGE 5
BEGIN
PROMPT 40 12 "Altezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Item" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 2 "Digitare gli item che si vogliono."
END
SPREADSHEET F_ITEM 0 -3
BEGIN
PROMPT 1 4 ""
ITEM "ITEM@80"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
GROUPBOX DLG_NULL -1 5
BEGIN
PROMPT 2 7 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 9 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
GROUP 2
END
STRING F_CHECK 15
BEGIN
PROMPT 3 12 ""
FLAGS "H"
END
STRING F_MESSAGE 10
BEGIN
PROMPT 3 15 ""
FLAGS "H"
END
ENDPAGE
PAGE "Browse" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Occorre definire le istruzioni per permettere il browse."
END
TEXT DLG_NULL
BEGIN
PROMPT 3 2 "Per gli intervalli occorre andare a capo."
END
MEMO F_USE 0 -3
BEGIN
PROMPT 1 3 ""
END
ENDPAGE
ENDMASK
PAGE "Item" -1 -1 78 20
STRING 101 7
BEGIN
PROMPT 3 6 "Item:"
CHECKTYPE REQUIRED
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

222
ba/ba2600e.uml Executable file
View File

@ -0,0 +1,222 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Date" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo date"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
GROUP 1
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 4
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 13 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 13 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 15 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 5
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 7 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 9 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 11 "Checktype: "
GROUP 2
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
ITEM "a| "
ITEM "b|NORMAL"
ITEM "c|REQUIRED"
ITEM "d|SEARCH"
ITEM "e|FORCED"
GROUP 2
END
ENDPAGE
PAGE "Message" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 3 ""
ITEM "MESSAGE@76"
END
ENDPAGE
PAGE "Browse" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Occorre definire le istruzioni per permettere il browse."
END
TEXT DLG_NULL
BEGIN
PROMPT 3 2 "Per gli intervalli occorre andare a capo."
END
MEMO F_USE 0 -3
BEGIN
PROMPT 1 3 ""
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

259
ba/ba2600g.uml Executable file
View File

@ -0,0 +1,259 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "String" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo stringa"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
GROUP 1
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza-size: "
GROUP 2
END
NUMBER F_LONGEVD 5
BEGIN
PROMPT 42 12 "Lunghezza-video: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 8
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
STRING F_ADDR 20
BEGIN
PROMPT 3 8 "Add RUN: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 9 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 11 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 12 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 13 "Checktype: "
GROUP 2
END
LIST F_CHECK 15
BEGIN
PROMPT 3 14 ""
ITEM "a| "
ITEM "b|NORMAL"
ITEM "c|REQUIRED"
ITEM "d|SEARCH"
ITEM "e|FORCED"
GROUP 2
END
ENDPAGE
PAGE "Message" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 3 ""
ITEM "MESSAGE@80"
END
ENDPAGE
PAGE "Browse" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Occorre definire le istruzioni per permettere il browse."
END
TEXT DLG_NULL
BEGIN
PROMPT 3 2 "Per gli intervalli occorre andare a capo."
END
MEMO F_USE 0 -3
BEGIN
PROMPT 1 3 ""
END
ENDPAGE
PAGE "Varie" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 9 1 "Per ulteriori comandi futuri."
END
TEXT DLG_NULL
BEGIN
PROMPT 9 2 "Per gli intervalli occorre andare a capo."
END
MEMO F_VAR 0 -3
BEGIN
PROMPT 1 3 ""
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
ENDPAGE
ENDMASK

192
ba/ba2600k.uml Executable file
View File

@ -0,0 +1,192 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Check Box" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo check box"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 30
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
FLAGS "H"
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 4
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 13 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 13 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 15 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
GROUPBOX DLG_NULL -1 5
BEGIN
PROMPT 2 7 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 9 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
GROUP 2
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
FLAGS "H"
END
ENDPAGE
PAGE "Message" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 3 ""
ITEM "MESSAGE@78"
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

31
ba/ba2600l.uml Executable file
View File

@ -0,0 +1,31 @@
PAGE "Sposta in.." -1 -1 60 10
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -22 -1 ""
END
TEXT DLG_NULL
BEGIN
PROMPT 2 2 "Digita in quale pagina vorresti spostare "
END
TEXT DLG_NULL
BEGIN
PROMPT 2 3 "i controlli selezionati "
END
NUMBER 101 5
BEGIN
PROMPT 2 5 "Pagina: "
END
ENDPAGE
ENDMASK

183
ba/ba2600m.uml Executable file
View File

@ -0,0 +1,183 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Memo" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo memo"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 80 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
FLAGS "H"
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza: "
GROUP 2
END
NUMBER F_LARGE 5
BEGIN
PROMPT 40 12 "Altezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
STRING F_FLAG 15
BEGIN
PROMPT 3 3 "Flags: "
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 3 "Gruppi: "
END
TEXT DLG_NULL
BEGIN
PROMPT 3 6 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 7 ""
ITEM "MESSAGE@80"
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
FLAGS "H"
END
NUMBER F_KEY 5
BEGIN
PROMPT 45 6 "Key: "
FLAGS "H"
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
FLAGS "H"
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
FLAGS "H"
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

191
ba/ba2600n.uml Executable file
View File

@ -0,0 +1,191 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Button" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo button"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
FLAGS "H"
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza: "
GROUP 2
END
NUMBER F_LARGE 5
BEGIN
PROMPT 40 12 "Altezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 3
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 3 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 3 "Gruppi: "
GROUP 1
END
TEXT DLG_NULL
BEGIN
PROMPT 3 6 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 7 ""
ITEM "MESSAGE@85"
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
FLAGS "H"
END
NUMBER F_KEY 5
BEGIN
PROMPT 45 6 "Key: "
FLAGS "H"
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
FLAGS "H"
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
FLAGS "H"
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

233
ba/ba2600o.uml Executable file
View File

@ -0,0 +1,233 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Radio" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo radio button"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
FLAGS "H"
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 7 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 9 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 11 "Checktype: "
GROUP 2
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
ITEM "a| "
ITEM "b|NORMAL"
ITEM "c|REQUIRED"
ITEM "d|SEARCH"
ITEM "e|FORCED"
GROUP 2
END
STRING F_MESSAGE 10
BEGIN
PROMPT 3 15 ""
FLAGS "H"
END
ENDPAGE
PAGE "Item/Msg" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Digitare i vari item che si vogliono con relativi messaggi."
END
SPREADSHEET F_ITEM 0 -3
BEGIN
PROMPT 1 3 ""
ITEM "CODICE"
ITEM "DESCRIZIONE@24"
ITEM "MESSAGE@50"
END
ENDPAGE
ENDMASK
PAGE "Item/Msg" -1 -1 78 20
STRING 101 7
BEGIN
PROMPT 3 3 "Codice:"
CHECKTYPE REQUIRED
END
STRING 102 24
BEGIN
PROMPT 3 6 "Descrizione:"
CHECKTYPE REQUIRED
END
STRING 103 40
BEGIN
PROMPT 3 9 "Messaggio:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

184
ba/ba2600p.uml Executable file
View File

@ -0,0 +1,184 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Groupbox" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo groupbox"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 80 30
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
FLAGS "H"
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza: "
GROUP 2
END
NUMBER F_LARGE 5
BEGIN
PROMPT 40 12 "Altezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
FLAGS "H"
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
STRING F_FLAG 15
BEGIN
PROMPT 3 3 "Flags: "
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 3 "Gruppi: "
END
TEXT DLG_NULL
BEGIN
PROMPT 3 6 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 7 ""
ITEM "MESSAGE@80"
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
FLAGS "H"
END
NUMBER F_KEY 5
BEGIN
PROMPT 45 6 "Key: "
FLAGS "H"
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
FLAGS "H"
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
FLAGS "H"
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

240
ba/ba2600r.uml Executable file
View File

@ -0,0 +1,240 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Number" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo number"
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
GROUP 1
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 8
BEGIN
PROMPT 2 7 ""
GROUP 2
END
NUMBER F_DECIMAL 5
BEGIN
PROMPT 3 9 "N. decimali "
GROUP 2
END
STRING F_PICTURE 30
BEGIN
PROMPT 3 11 "Picture: "
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 13 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 45 9 "Lunghezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
GROUPBOX DLG_NULL -1 8
BEGIN
PROMPT 2 9 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 11 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 12 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 13 "Checktype: "
GROUP 2
END
LIST F_CHECK 15
BEGIN
PROMPT 3 14 ""
ITEM "a| "
ITEM "b|NORMAL"
ITEM "c|REQUIRED"
ITEM "d|SEARCH"
ITEM "e|FORCED"
GROUP 2
END
ENDPAGE
PAGE "Message" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 3 ""
ITEM "MESSAGE@80"
END
ENDPAGE
PAGE "Browse" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Occorre definire le istruzioni per permettere il browse."
END
TEXT DLG_NULL
BEGIN
PROMPT 3 2 "Per gli intervalli occorre andare a capo."
END
MEMO F_USE 0 -3
BEGIN
PROMPT 1 3 ""
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

133
ba/ba2600s.uml Executable file
View File

@ -0,0 +1,133 @@
#include "ba2600a.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Maschera" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura della maschera"
END
GROUPBOX DLG_NULL -1 8
BEGIN
PROMPT 2 2 ""
GROUP 1
END
TEXT DLG_NULL
BEGIN
PROMPT 3 3 "Titolo della pagina:"
GROUP 1
END
STRING F_PRT 25 15
BEGIN
PROMPT 3 4 ""
GROUP 1
END
TEXT DLG_NULL
BEGIN
PROMPT 40 3 "Numero pagina:"
GROUP 1
END
NUMBER F_PAG 10
BEGIN
PROMPT 40 4 ""
GROUP 1
END
TEXT DLG_NULL
BEGIN
PROMPT 3 6 "Totale pagine:"
GROUP 1
END
NUMBER F_TOTALP 10
BEGIN
PROMPT 3 7 ""
FLAGS "D"
GROUP 1
END
TEXT DLG_NULL
BEGIN
PROMPT 3 10 "Tipo di visualizzazione: "
END
GROUPBOX DLG_NULL 27 6
BEGIN
PROMPT 40 10 ""
GROUP 2
END
RADIOBUTTON F_TYPE 25
BEGIN
PROMPT 3 10 ""
ITEM "a|Centrato "
MESSAGE SHOW,2@
MESSAGE DISABLE,F_X|DISABLE,F_Y
ITEM "b|Personalizzato "
MESSAGE SHOW,2@
MESSAGE ENABLE,F_X|ENABLE,F_Y
END
NUMBER F_X 10
BEGIN
PROMPT 41 11 "Coordinata X:"
GROUP 2
END
NUMBER F_Y 10
BEGIN
PROMPT 41 12 "Coordinata Y:"
GROUP 2
END
NUMBER F_LG 10
BEGIN
PROMPT 41 13 "Altezza: "
GROUP 2
END
NUMBER F_LN 10
BEGIN
PROMPT 41 14 "Lunghezza: "
GROUP 2
END
BOOLEAN F_TOOL
BEGIN
PROMPT 3 17 "Con la presenza della toolbar la visualizzazione sara' a pieno schermo"
MESSAGE TRUE ENABLE,F_TOOLY
MESSAGE FALSE DISABLE,F_TOOLY
END
NUMBER F_TOOLY 10
BEGIN
PROMPT 3 19 "Coordinata Y:"
END
ENDPAGE
ENDMASK

107
ba/ba2600t.uml Executable file
View File

@ -0,0 +1,107 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Text" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo testo"
END
GROUPBOX DLG_NULL -1 5
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 80 55
BEGIN
PROMPT 3 3 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 3 4 "Offset: "
FLAGS "H"
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 5 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 5 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 3
BEGIN
PROMPT 2 6 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 7 "Identificativo: "
GROUP 2
END
GROUPBOX DLG_NULL -1 3
BEGIN
PROMPT 2 8 ""
GROUP 3
END
STRING F_FLAG 15
BEGIN
PROMPT 3 9 "Flags: "
GROUP 3
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 9 "Gruppi: "
GROUP 3
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 12 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 12 "Priorita' focus: "
FLAGS "H"
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 14 "Si vuole il controllo nella toolbar"
END
ENDPAGE
ENDMASK

237
ba/ba2600x.uml Executable file
View File

@ -0,0 +1,237 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "List" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo listbox"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
GROUP 1
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza: "
GROUP 2
END
NUMBER F_LONGEVD 5
BEGIN
PROMPT 42 12 "Lunghezza-video: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 7 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 9 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 11 "Checktype: "
GROUP 2
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
ITEM "a| "
ITEM "b|NORMAL"
ITEM "c|REQUIRED"
ITEM "d|SEARCH"
ITEM "e|FORCED"
GROUP 2
END
STRING F_MESSAGE 10
BEGIN
PROMPT 3 15 ""
FLAGS "H"
END
ENDPAGE
PAGE "Item/Msg" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 2 "Scrivere gli item con i relativi messaggi."
END
SPREADSHEET F_ITEM 0 -3
BEGIN
PROMPT 1 4 ""
ITEM "CODICE"
ITEM "DESCRIZIONE@24"
ITEM "MESSAGE@50"
END
ENDPAGE
ENDMASK
PAGE "Item/Msg" -1 -1 78 20
STRING 101 7
BEGIN
PROMPT 3 3 "Codice:"
CHECKTYPE REQUIRED
END
STRING 102 24
BEGIN
PROMPT 3 6 "Descrizione:"
CHECKTYPE REQUIRED
END
STRING 103 40
BEGIN
PROMPT 3 9 "Messaggio:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

234
ba/ba2600y.uml Executable file
View File

@ -0,0 +1,234 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Currency" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo currency"
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
GROUP 1
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 6
BEGIN
PROMPT 2 7 ""
GROUP 2
END
STRING F_PICTURE 20
BEGIN
PROMPT 3 9 "Picture: "
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 11 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 45 9 "Lunghezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 13 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 13 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 15 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_FLAG 15
BEGIN
PROMPT 3 4 "Flags: "
GROUP 1
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 4 "Gruppi: "
GROUP 1
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
GROUP 1
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
GROUP 1
END
GROUPBOX DLG_NULL -1 8
BEGIN
PROMPT 2 9 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 11 "Warning: "
GROUP 2
END
STRING F_WARNING 55
BEGIN
PROMPT 3 12 ""
GROUP 2
END
TEXT DLG_NULL
BEGIN
PROMPT 3 13 "Checktype: "
GROUP 2
END
LIST F_CHECK 15
BEGIN
PROMPT 3 14 ""
ITEM "a| "
ITEM "b|NORMAL"
ITEM "c|REQUIRED"
ITEM "d|SEARCH"
ITEM "e|FORCED"
GROUP 2
END
ENDPAGE
PAGE "Message" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 3 ""
ITEM "MESSAGE@80"
END
ENDPAGE
PAGE "Browse" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Occorre definire le istruzioni per permettere il browse."
END
TEXT DLG_NULL
BEGIN
PROMPT 3 2 "Per gli intervalli occorre andare a capo."
END
MEMO F_USE 0 -3
BEGIN
PROMPT 1 3 ""
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

177
ba/ba2600z.uml Executable file
View File

@ -0,0 +1,177 @@
#include "ba2600b.h"
TOOLBAR "" 0 20 0 0
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
PAGE "Zoom" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "E' possibile personalizzare la struttura del campo zoom"
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 2 ""
GROUP 1
END
STRING F_PROMPT 60 25
BEGIN
PROMPT 3 4 "Prompt: "
GROUP 1
END
NUMBER F_OFFSET 5
BEGIN
PROMPT 48 4 "Offset: "
GROUP 1
END
NUMBER F_LEFT 5
BEGIN
PROMPT 3 6 "Coordinata X: "
GROUP 1
END
NUMBER F_UPPER 5
BEGIN
PROMPT 42 6 "Coordinata Y: "
GROUP 1
END
GROUPBOX DLG_NULL -1 7
BEGIN
PROMPT 2 8 ""
GROUP 2
END
STRING F_IDENT 20
BEGIN
PROMPT 3 10 "Identificativo: "
GROUP 2
END
NUMBER F_LONGEFF 5
BEGIN
PROMPT 3 12 "Lunghezza: "
GROUP 2
END
NUMBER F_PAGE 5
BEGIN
PROMPT 3 15 "Numero della pagina: "
END
NUMBER F_FOCUS 5
BEGIN
PROMPT 40 15 "Priorita' focus: "
END
BOOLEAN F_INTOOL
BEGIN
PROMPT 3 17 "Si vuole il controllo nella toolbar"
END
ENDPAGE
PAGE "Opzioni" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 3 1 "Scelta delle opzioni"
END
STRING F_FLAG 15
BEGIN
PROMPT 3 3 "Flags: "
END
STRING F_GROUP 25 15
BEGIN
PROMPT 45 3 "Gruppi: "
END
TEXT DLG_NULL
BEGIN
PROMPT 3 6 "Ogni riga verra' considerata un messaggio a se' stante."
END
SPREADSHEET F_MESSAGE 0 -3
BEGIN
PROMPT 1 7 ""
ITEM "MESSAGE@80"
END
STRING F_FIELD 25
BEGIN
PROMPT 3 6 "Field: "
FLAGS "H"
END
STRING F_KEY 15
BEGIN
PROMPT 45 6 "Key: "
FLAGS "H"
END
STRING F_WARNING 55
BEGIN
PROMPT 3 10 ""
FLAGS "H"
END
LIST F_CHECK 15
BEGIN
PROMPT 3 12 ""
FLAGS "H"
END
ENDPAGE
ENDMASK
PAGE "Messaggi" -1 -1 78 20
STRING 101 50
BEGIN
PROMPT 4 4 "Messaggi:"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -204,7 +204,7 @@ END
NUMBER SK_CAMBIO 15 5
BEGIN
PROMPT 54 11 "Cambio "
PROMPT 52 11 "Cambio "
FIELD CAMBIO
FLAGS "RU"
GROUP 3 5

View File

@ -205,7 +205,7 @@ BEGIN
OUTPUT S_CONTO CONTO
OUTPUT S_SOTTOCONTO SOTTOCONTO
OUTPUT S_DESCRCONTO DESCR
CHECKTYPE NORMAL
CHECKTYPE REQUIRED
WARNING "Contropartita assente"
GROUP 2
END

View File

@ -471,11 +471,14 @@ bool TPrimanota_application::valuta_handler(TMask_field& f, KEY key)
}
}
TEdit_field& vi = m.efield(F_VALUTAINTRA);
if (vi.active() && vi.empty())
{
m.set(F_VALUTAINTRA, val);
m.set(F_CAMBIOINTRA, m.get(SK_CAMBIO), TRUE);
if (m.id2pos(F_VALUTAINTRA) >= 0)
{
TEdit_field& vi = m.efield(F_VALUTAINTRA);
if (vi.active() && vi.empty())
{
m.set(F_VALUTAINTRA, val);
m.set(F_CAMBIOINTRA, m.get(SK_CAMBIO), TRUE);
}
}
}
}

View File

@ -117,7 +117,6 @@ protected:
static bool descr_handler(TMask_field& f, KEY k);
void gioca_cambi(int force = 0x0);
static bool sottoconto_handler(TMask_field& f, KEY k);
#ifdef __EXTRA__
static bool datareg_handler(TMask_field& f, KEY k);
static bool datadoc_handler(TMask_field& f, KEY k);
@ -151,7 +150,6 @@ TPay_mask::TPay_mask(const TGame_mask& parent, int mod)
{
set_mode(mod);
enable(DLG_DELREC, edit_mode());
set_handler(S_SOTTOCONTO, sottoconto_handler);
#ifdef __EXTRA__
xvt_statbar_set(mod == MODE_MOD ? "Modifica" : "Inserimento", TRUE);
@ -506,14 +504,6 @@ bool TPay_mask::saldo_handler(TMask_field& f, KEY k)
return TRUE;
}
bool TPay_mask::sottoconto_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
if (k == K_ENTER && f.mask().insert_mode() && f.get().empty())
ok = f.error_box("Contropartita obbligatoria");
return ok;
}
bool TPay_mask::datapag_handler(TMask_field& f, KEY k)
{
if (f.to_check(k))

View File

@ -21,6 +21,48 @@
#include "cglib02.h"
#include "cglib03.h"
class TMastrini_record : public TRectype
{
TBill _bill;
protected:
virtual const TString& get_str(const char* fieldname) const;
virtual int length(const char* fieldname) const;
virtual TFieldtypes type(const char* fieldname) const;
public:
TMastrini_record() : TRectype(LF_SALDI) { }
virtual ~TMastrini_record() { }
};
const TString& TMastrini_record::get_str(const char* fieldname) const
{
if (stricmp(fieldname, "DESCR") == 0)
{
int g = atoi(TRectype::get_str("GRUPPO"));
int c = atoi(TRectype::get_str("CONTO"));
long s = atol(TRectype::get_str("SOTTOCONTO"));
((TBill&)_bill).set(g, c, s);
const TString& descr = _bill.descrizione();
return descr;
}
return TRectype::get_str(fieldname);
}
int TMastrini_record::length(const char* fieldname) const
{
if (stricmp(fieldname, "DESCR") == 0)
return 50;
return TRectype::length(fieldname);
}
TFieldtypes TMastrini_record::type(const char* fieldname) const
{
if (stricmp(fieldname, "DESCR") == 0)
return _alfafld;
return TRectype::type(fieldname);
}
class TMastrini_application : public TPrintapp
{
static bool data_inizio (TMask_field& f, KEY k);
@ -50,7 +92,7 @@ class TMastrini_application : public TPrintapp
TDate _data_ini,_data_fine,_data_finese,_data_finesesucc,_ultima_data_reg;
TDate _datareg,_datadoc,_data_inizioese,_datareg_stampa,_inizioes;
int _cur1,_gruppo,_conto,_numcarat,_stampanum,_numivd,_annoiva;
int _cur1,_cur2,_gruppo,_conto,_numcarat,_stampanum,_numivd,_annoiva;
int _numrig,_natdoc,_tipo,_tipostampa,_g_prec,_c_prec,_numrivd_int;
real _progredare,_progreavere,_totprogre_dare_al,_totprogre_avere_al;
real _totprogre_dare,_totprogre_avere,_importo;
@ -2464,7 +2506,11 @@ bool TMastrini_application::set_print(int)
reset_files(); //resetta l'albero di stampa
add_file(LF_SALDI);
add_file(LF_RMOV,LF_SALDI);
select_cursor(_cur1);
if (_msk->get_bool(F_SORTDESC))
select_cursor(_cur2);
else
select_cursor(_cur1);
TRectype da(LF_SALDI), a(LF_SALDI);
da.put(SLD_GRUPPO,gruppoini);
@ -3956,7 +4002,8 @@ bool TMastrini_application::user_create()
{
TToken_string exp;
_rel = new TRelation (LF_SALDI);
_rel = new TRelation(LF_SALDI);
_rel->lfile().set_curr(new TMastrini_record);
exp.add("GRUPPO=GRUPPO");
exp.add("CONTO=CONTO");
@ -3964,6 +4011,8 @@ bool TMastrini_application::user_create()
_rel->add(LF_RMOV,exp,2,LF_SALDI);
_cur1=add_cursor(new TCursor(_rel,"FLSCA=\" \"",2));
_cur2=add_cursor(new TSorted_cursor(_rel,"DESCR","FLSCA=\" \"",2));
_nditte = new TLocalisamfile (LF_NDITTE);
_unloc = new TLocalisamfile (LF_UNLOC);
_comuni = new TLocalisamfile (LF_COMUNI);

View File

@ -39,7 +39,7 @@
#define F_SEPARATOR 117
#define F_VALUTA 118
#define F_DESVALUTA 119
#define F_SORTDESC 120
#define F_MEMORIZZA 500
#define F_NUMCARAT 501
#define F_NUMMAST 502

View File

@ -163,9 +163,9 @@ BEGIN
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_SOTTOCINI_CONTO SOTTOCONTO
OUTPUT F_GRUPPOINI GRUPPO
OUTPUT F_CONTOINI_CONTO CONTO
OUTPUT F_SOTTOCINI_CONTO SOTTOCONTO
OUTPUT F_DESCRINI_CONTO DESCR
CHECKTYPE NORMAL
GROUP 1 9
@ -337,9 +337,9 @@ BEGIN
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_SOTTOCFINE_CONTO SOTTOCONTO
OUTPUT F_GRUPPOFINE GRUPPO
OUTPUT F_CONTOFINE_CONTO CONTO
OUTPUT F_SOTTOCFINE_CONTO SOTTOCONTO
OUTPUT F_DESCRFINE_CONTO DESCR
CHECKTYPE NORMAL
WARNING "Sottoconto inesistente o mancante"
@ -351,7 +351,7 @@ BEGIN
PROMPT 4 9 "Descrizione "
USE LF_PCON KEY 2
CHECKTYPE NORMAL
INPUT DESCR F_DESCRINI_CONTO
INPUT DESCR F_DESCRFINE_CONTO
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
@ -454,6 +454,11 @@ BEGIN
PROMPT 4 13 "Stampa movimenti provvisori"
END
BOOLEAN F_SORTDESC
BEGIN
PROMPT 44 13 "Stampa ordinata per descrizione"
END
BOOLEAN F_SEPARATOR
BEGIN
PROMPT 4 14 "Non stampare il separatore delle migliaia"

View File

@ -30,6 +30,8 @@ int main(int argc,char** argv)
cg4800(argc,argv); break; // Creazione versamenti per acconto
case 8:
cg4900(argc,argv); break; // Visualizzazione liquidazione acconti
case 9:
cg4a00(argc,argv); break; // Gestione Autotrasportatori
default:
error_box(usage, argv[0]);
}

View File

@ -14,6 +14,7 @@ int cg4600(int argc, char* argv[]);
int cg4700(int argc, char* argv[]);
int cg4800(int argc, char* argv[]);
int cg4900(int argc, char* argv[]);
int cg4a00(int argc, char* argv[]);
#ifdef __MAIN__
#define extern

View File

@ -1,8 +1,7 @@
// Apertura nuovo esercizio
#include "cg4501.h"
#include "cg4500a.h"
class TAp_eser : public TApplication
class TAp_eser : public TSkeleton_application
{
TTable* _esc, * _reg;
int _anno, _newanno;
@ -17,7 +16,7 @@ protected:
public:
virtual bool create();
virtual bool destroy();
virtual bool menu(MENU_TAG m);
virtual void main_loop();
bool set();
bool apertura_es();
@ -59,18 +58,14 @@ public:
bool TAp_eser::mask_newanno (TMask_field& f, KEY k)
{
TTable TabEs("ESC");
TString codtab;
if ( (k == K_ENTER) && f.to_check(k) )
{
int newanno = f.mask().get_int(F_NUOVOANNO);
int anno = f.mask().get_int(F_ANNO);
TabEs.zero();
codtab.format ("%04d", newanno);
TString16 codtab; codtab.format ("%04d", newanno);
TTable TabEs("ESC");
TabEs.put ("CODTAB", codtab);
TabEs.read();
if ( TabEs.good() )
if (TabEs.read() != NOERR)
{
f.warning_box ("Il codice inserito e' gia' presente nella tabella degli esercizi!");
return FALSE;
@ -96,14 +91,11 @@ bool TAp_eser::mask_dataini (TMask_field& f, KEY k)
bool TAp_eser::create()
{
_esc = new TTable("ESC");
_reg = new TTable("REG");
_esc = new TTable("ESC");
_reg = new TTable("REG");
enable_menu_item(M_FILE_NEW, FALSE);
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
return TSkeleton_application::create();
}
bool TAp_eser::destroy()
@ -114,13 +106,16 @@ bool TAp_eser::destroy()
return TRUE;
}
bool TAp_eser::menu(MENU_TAG m)
void TAp_eser::main_loop()
{
TTable TabEs ("ESC");
TMask msk ("cg4500a");
if (TabEs.last() != NOERR)
return error_box("Non e' ancora stato aperto alcun esercizio!");
{
error_box("Non e' ancora stato aperto alcun esercizio!");
return;
}
TabEs.first();
TRecnotype rn = TabEs.recno();
int anno = TabEs.get_int ("CODTAB");
@ -160,7 +155,6 @@ bool TAp_eser::menu(MENU_TAG m)
apertura_es();
}
return FALSE;
}
bool TAp_eser::apertura_es()
@ -175,7 +169,7 @@ bool TAp_eser::apertura_es()
//viene aggiornata la tabella dei registri. Se esisteva gia' un record relativo al nuovo esercizio, viene cancellato.
//In ogni caso ne viene creato uno nuovo relativo al nuovo esercizio.
TabReg.zero();
annonew = format ("%04d", _datafin.year());
annonew.format("%04d", _datafin.year());
TabReg.put ("CODTAB", annonew);
TRectype r (TabReg.curr());
@ -193,7 +187,7 @@ bool TAp_eser::apertura_es()
TabReg.zero();
TRectype nuovo (TabReg.curr());
anno = format ("%04d", _datafip.year());
anno.format ("%04d", _datafip.year());
TabReg.put ("CODTAB", anno);
TRectype rec (TabReg.curr());
@ -212,7 +206,7 @@ bool TAp_eser::apertura_es()
ok = TRUE;
nuovo = TabReg.curr();
TString16 cod;
annonew = format ("%04d", _datafin.year());
annonew.format ("%04d", _datafin.year());
cod << annonew << cod_reg;
nuovo.put("CODTAB", cod);
nuovo.put("D0", data);
@ -231,7 +225,7 @@ bool TAp_eser::apertura_es()
if (check_esercizio(annonew, _dataini, _datafin))
{
TabEs.zero();
annonew = format ("%04d", _newanno);
annonew.format ("%04d", _newanno);
TabEs.put ("CODTAB", annonew);
TabEs.put ("D0", _dataini);
TabEs.put ("D1", _datafin);

View File

@ -1,8 +1,8 @@
//Apertura nuovo esercizio IVA
#include "nditte.h"
#include "cg4501.h"
#include "cg4500b.h"
#include "nditte.h"
bool TAp_iva::mask_annoiva (TMask_field& f, KEY k)
{
if ( (k == K_ENTER) && f.to_check(k) )
@ -28,10 +28,7 @@ bool TAp_iva::create()
_lbu = new TTable("%LBU");
enable_menu_item(M_FILE_NEW, FALSE);
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
return TSkeleton_application::create();
}
bool TAp_iva::destroy()
@ -50,28 +47,31 @@ bool TAp_iva::apertura_iva()
TTable TabLia ("%LIA");
TTable TabLbu ("%LBU");
TLocalisamfile nditte (LF_NDITTE);
TString annoiva (4);
TString annoiva (4), codlia(10);
TDate data;
bool ok = FALSE;
int annop = atoi(_annop);
annoiva = format("%04d", _annoiva);
annoiva.format("%04d", _annoiva);
//viene aggiornata la tabella LIA (liquidazione iva annuale)
TabLia.zero();
TabLia.put ("CODTAB", format("%05ld%04d", get_firm(), _annoiva));
codlia.format("%05ld%04d", get_firm(), _annoiva);
TabLia.put ("CODTAB", codlia);
if (TabLia.read() == NOERR)
TabLia.remove();
TabLia.zero();
TRectype newrec (TabLia.curr());
TabLia.put ("CODTAB", format("%05ld%04d", get_firm(), annop));
TRectype newrec (TabLia.curr());
codlia.format("%05ld%04d", get_firm(), annop);
TabLia.put ("CODTAB", codlia);
if (TabLia.read() == NOERR)
{
ok = TRUE;
newrec = TabLia.curr();
newrec.put("CODTAB", format("%05ld%04d", get_firm(), _annoiva));
codlia.format("%05ld%04d", get_firm(), _annoiva);
newrec.put("CODTAB", codlia);
newrec.put("S7", _frequenza);
newrec.put("B2", _is_minagr);
newrec.zero("R0");
@ -216,7 +216,7 @@ bool TAp_iva::apertura_iva()
return TRUE;
}
bool TAp_iva::menu(MENU_TAG m)
void TAp_iva::main_loop()
{
TTable TabLia ("%LIA");
TLocalisamfile nditte (LF_NDITTE);
@ -268,5 +268,4 @@ bool TAp_iva::menu(MENU_TAG m)
apertura_iva();
}
return FALSE;
}

View File

@ -1,12 +1,16 @@
#include <relation.h>
#include <tabutil.h>
#include <printapp.h>
#include <mask.h>
#include <utility.h>
#include <config.h>
#include <urldefid.h>
#ifndef __APPLICAT_H
#include <applicat.h>
#endif
class TAp_iva : public TApplication
#ifndef __MASK_H
#include <mask.h>
#endif
#ifndef __TABUTIL_H
#include <tabutil.h>
#endif
class TAp_iva : public TSkeleton_application
{
TTable* _reg, * _lia, * _lbu;
TLocalisamfile* _nditte;
@ -22,10 +26,11 @@ protected:
public:
virtual bool create();
virtual bool destroy();
virtual bool menu(MENU_TAG m);
virtual void main_loop();
bool setta();
bool apertura_iva();
TAp_iva() {}
virtual ~TAp_iva() {}
};

View File

@ -913,6 +913,7 @@ void TApertura_chiusura::costi()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcproper.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sez_rmov,_saldo)); //l'oggetto TSaldo_agg
@ -1066,6 +1067,7 @@ void TApertura_chiusura::ricavi()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcproper.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sez_rmov,_saldo)); //l'oggetto TSaldo_agg
@ -1102,10 +1104,13 @@ void TApertura_chiusura::chiusura_conto_economico()
TRectype& rmov1 = _pn->cg(j);
long numrig = 1;
rmov_proper(_annoesch,numrig,_dataregch,rmov1,_tcproper,_totale_saldo,TRUE);
_tcperde.put(rmov1, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov2 = _pn->cg(j);
rmov_proper(_annoesch,numrig,_dataregch,rmov2,_tcperde,_totale_saldo,FALSE);
_tcproper.put(rmov2, TRUE); // Contropartita
_pn->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
@ -1123,10 +1128,13 @@ void TApertura_chiusura::chiusura_conto_economico()
TRectype& rmov3 = _pn->cg(j);
numrig = 1;
rmov_proper(_annoesch,numrig,_dataregch,rmov3,_tcperde,_totale_saldo,TRUE);
_tcperdp.put(rmov3, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov4 = _pn->cg(j);
rmov_proper(_annoesch,numrig,_dataregch,rmov4,_tcperdp,_totale_saldo,FALSE);
_tcperde.put(rmov4, TRUE); // Contropartita
_pn->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
@ -1146,10 +1154,13 @@ void TApertura_chiusura::chiusura_conto_economico()
TRectype& rmov1 = _pn->cg(j);
long numrig = 1;
rmov_proper(_annoesch,numrig,_dataregch,rmov1,_tcutile,_totale_saldo,FALSE);
_tcproper.put(rmov1, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov2 = _pn->cg(j);
rmov_proper(_annoesch,numrig,_dataregch,rmov2,_tcproper,_totale_saldo,TRUE);
_tcutile.put(rmov2, TRUE); // Contropartita
_pn ->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
@ -1166,10 +1177,13 @@ void TApertura_chiusura::chiusura_conto_economico()
TRectype& rmov3 = _pn->cg(j);
numrig = 1;
rmov_proper(_annoesch,numrig,_dataregch,rmov3,_tcutilp,_totale_saldo,FALSE);
_tcutile.put(rmov3, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov4 = _pn->cg(j);
rmov_proper(_annoesch,numrig,_dataregch,rmov4,_tcutile,_totale_saldo,TRUE);
_tcutilp.put(rmov4, TRUE); // Contropartita
_pn ->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
@ -1310,6 +1324,7 @@ void TApertura_chiusura::chiudi_attivita()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcbilch.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sez_rmov,_saldo)); //l'oggetto TSaldo_agg
@ -1463,6 +1478,7 @@ void TApertura_chiusura::chiudi_passivita()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcbilch.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sez_rmov,_saldo)); //l'oggetto TSaldo_agg
@ -1616,6 +1632,7 @@ void TApertura_chiusura::chiudi_conti_ordine()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcbilch.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sez_rmov,_saldo)); //l'oggetto TSaldo_agg
@ -1651,10 +1668,13 @@ void TApertura_chiusura::chiusura_conto_patrimoniale()
TRectype& rmov1 = _pn->cg(j);
numrig = 1;
rmov_proper(_annoesch,numrig,_dataregch,rmov1,_tcutilp,_totale_saldo,FALSE);
_tcbilch.put(rmov1, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov2 = _pn->cg(j);
rmov_proper(_annoesch,numrig,_dataregch,rmov2,_tcbilch,_totale_saldo,TRUE);
_tcutilp.put(rmov2, TRUE); // Contropartita
_pn->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
@ -1674,10 +1694,13 @@ else
TRectype& rmov1 = _pn->cg(j);
numrig = 1;
rmov_proper(_annoesch,numrig,_dataregch,rmov1,_tcbilch,_totale_saldo,TRUE);
_tcperdp.put(rmov1, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov2 = _pn->cg(j);
rmov_proper(_annoesch,numrig,_dataregch,rmov2,_tcperdp,_totale_saldo,FALSE);
_tcbilch.put(rmov2, TRUE); // Contropartita
_pn ->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
@ -1814,6 +1837,8 @@ void TApertura_chiusura::apri_attivita()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcbilap.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sezione,_saldo)); //l'oggetto TSaldo_agg
@ -1961,6 +1986,7 @@ void TApertura_chiusura::apri_passivita()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcbilap.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sezione,_saldo)); //l'oggetto TSaldo_agg
@ -2108,6 +2134,7 @@ void TApertura_chiusura::apri_conti_ordine()
rmov.put(RMV_NUMREG, _numreg);
rmov.put(RMV_NUMRIG, numrig);
rmov.put(RMV_TIPOC, tmcf);
_tcbilap.put(rmov, TRUE); // Contropartita
TBill tc(g,c,s);
_sld->aggiorna(tc,TImporto(sezione,_saldo)); //l'oggetto TSaldo_agg
@ -2143,10 +2170,13 @@ void TApertura_chiusura::apertura_capitale_netto()
TRectype& rmov1 = _pn->cg(j);
numrig = 1;
rmov_proper(_annoesap,numrig,_dataregap,rmov1,_tcbilap,_capitale_netto,TRUE);
_tcperdp.put(rmov1, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov2 = _pn->cg(j);
rmov_proper(_annoesap,numrig,_dataregap,rmov2,_tcperdp,_capitale_netto,FALSE);
_tcbilap.put(rmov2, TRUE); // Contropartita
_pn->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
@ -2165,10 +2195,13 @@ void TApertura_chiusura::apertura_capitale_netto()
TRectype& rmov1 = _pn->cg(j);
numrig = 1;
rmov_proper(_annoesap,numrig,_dataregap,rmov1,_tcbilap,_capitale_netto,TRUE);
_tcutilp.put(rmov1, TRUE); // Contropartita
numrig++;
j++;
TRectype& rmov2 = _pn->cg(j);
rmov_proper(_annoesap,numrig,_dataregap,rmov2,_tcutilp,_capitale_netto,FALSE);
_tcbilap.put(rmov2, TRUE); // Contropartita
_pn->write();
_pn->destroy_rows(_numreg); //Azzero l'oggetto pn.

515
cg/cg4a00.cpp Executable file
View File

@ -0,0 +1,515 @@
// Programma di gestione autotrasportatori.
#include <applicat.h>
#include <automask.h>
#include <progind.h>
#include <relation.h>
#include <tabutil.h>
#include <causali.h>
#include <rcausali.h>
#include <mov.h>
#include <rmoviva.h>
#include "cg2101.h"
#include "cg2103.h"
#include "cg4a00a.h"
static int __anno;
bool cau_filter1 (const TRelation *r)
{
bool rt = FALSE;
const TRectype& rec = r->curr(LF_CAUSALI);
if (rec.get(CAU_TIPODOC) == "ST") // Solo i tipi documento STorno
{
TTable& reg = (TTable&) r->lfile("REG");
TString16 cod;
cod << __anno;
cod << rec.get(CAU_REG);
reg.put("CODTAB", cod);
if (reg.read() == NOERR )
{
const int i9 = reg.get_int("I9");
const bool b1 = reg.get_bool("B1");
if (i9 == 1 || i9 == 0 && b1) // Il registro deve avere la X di sospensione NORMALE
{
TLocalisamfile& rcau = r->lfile(LF_RCAUSALI); // La riga 1 (gia' posizionata nella relazione) deve essere di tipo cliente
if (rcau.get(RCA_TIPOCF) == "C")
rt = TRUE;
}
}
}
return rt;
}
bool cau_filter2 (const TRelation *r)
{
bool rt = FALSE;
const TRectype& rec = r->curr(LF_CAUSALI);
if (rec.get(CAU_TIPODOC) == "FV") // Solo i tipi documento Fatture Vendita
{
TTable& reg = (TTable&) r->lfile("REG");
TString16 cod;
cod << __anno;
cod << rec.get(CAU_REG);
reg.put("CODTAB", cod);
if (reg.read() == NOERR )
rt = ! reg.get_bool("B1");
}
return rt;
}
class TGestAutoTrasp_mask : public TAutomask
{
TAssoc_array _caudef;
TCursor *_cur;
TRelation *_rel;
TTable *_reg;
protected:
void fill_sheet(const short id);
const long get_last_nreg();
const long get_last_nprot();
void swap_sign(TMovimentoPN&);
public:
virtual bool on_key(KEY k);
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
void write_movs();
TGestAutoTrasp_mask();
virtual ~TGestAutoTrasp_mask();
};
TGestAutoTrasp_mask::TGestAutoTrasp_mask() : TAutomask("cg4a00a")
{
_rel = new TRelation(LF_MOV);
_cur = NULL;
_reg = new TTable("REG");
}
TGestAutoTrasp_mask::~TGestAutoTrasp_mask()
{
if (_cur)
delete _cur;
delete _rel;
delete _reg;
}
bool TGestAutoTrasp_mask::on_key(KEY k)
{
if (k == K_SHIFT + K_F12)
{
// Abilita la cella del numero prot. registro corrispondente alla riga
// corrente dello spreadsheet
if (focus_field().dlg() == F_SHEET_CAUSALI)
{
TSheet_field& sf = sfield(F_SHEET_CAUSALI);
const int rs = sf.selected();
sf.enable_column(F_NUMPROT - F_CAUMOV);
const int items = sf.items();
for (int i=0; i<items;i++)
sf.disable_cell(i, F_NUMPROT - F_CAUMOV);
sf.enable_cell(rs, F_NUMPROT - F_CAUMOV);
sf.force_update(rs);
}
}
return TAutomask::on_key(k);
}
void TGestAutoTrasp_mask::fill_sheet(const short id)
{
TDate fromdate, todate;
TString16 codreg;
fromdate = get_date(F_DADATA);
todate = get_date(F_ADATA);
codreg = get(F_CODREG);
if (fromdate.ok() && todate.ok() && codreg.not_empty())
{
TRectype fromrec(LF_MOV);
TRectype torec(LF_MOV);
TString filter;
TString16 caus;
filter << "(REG==\"" << codreg << "\")";
filter << "&&((STAMPATO!=\"X\")&&(REGST!=\"X\"))";
fromrec.put(MOV_DATAREG, fromdate);
torec.put(MOV_DATAREG, todate);
if (_cur)
delete _cur;
_cur = new TCursor(_rel, filter, 2, &fromrec, &torec);
TRectype& rc = _cur->curr();
const TRecnotype items = _cur->items();
TProgind* pi = NULL;
if (items > 10)
pi = new TProgind(items, "Selezione movimenti...", FALSE, TRUE);
TLocalisamfile causali(LF_CAUSALI);
// Azzera lo sheet
TSheet_field& sf = sfield(F_SHEET_CAUSALI);
TString_array& sa = sf.rows_array();
sa.destroy();
//azzera l'array
_caudef.destroy();
for (*_cur = 0L; _cur->pos() < items; ++(*_cur))
{
if (pi)
pi->addstatus(1L);
caus = rc.get(MOV_CODCAUS);
if (!_caudef.is_key(caus)) // Se non è stata ancora aggiunta questa causale...
{
TToken_string* tt = new TToken_string;
tt->add(caus, 0);
_caudef.add(caus, new TString16);
causali.put(CAU_CODCAUS, caus);
const bool ok = causali.read() == NOERR;
tt->add(ok ? causali.get(CAU_DESCR) : "** Non presente **", 1);
tt->add(ok ? causali.get(CAU_TIPODOC) : "**", 2);
sa.add(tt);
}
}
if (pi)
delete pi;
sf.force_update(); // Aggiorna lo sheet
if (items == 0)
{
warning_box("Non vi sono operazioni da effettuare nell'intervallo specificato.");
set_focus_field(id);
}
}
}
bool TGestAutoTrasp_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
{
case F_DADATA:
if (e == fe_modify || e == fe_init)
{
__anno = e == fe_modify ? atoi(o.get().right(4)) : 0;
set(F_ANNO, __anno);
TCursor* cur1 = efield(F_CAUS).browse()->cursor();
cur1->set_filterfunction(cau_filter1, TRUE);
TCursor* cur2 = sfield(F_SHEET_CAUSALI).sheet_mask().efield(F_CAUDEF).browse()->cursor();
cur2->set_filterfunction(cau_filter2, TRUE);
if (e == fe_modify)
fill_sheet(o.dlg());
}
break;
case F_ADATA:
case F_CODREG:
if (e == fe_modify)
fill_sheet(o.dlg());
break;
case F_SHEET_CAUSALI:
if (e == se_query_add)
return FALSE;
else
if (e == fe_close) // Controllo sulla presenza dei codici causale nello spreadsheet
{
TSheet_field& sf = sfield(F_SHEET_CAUSALI);
TString16 c;
bool error = FALSE;
for (int i=0; i < sf.items(); i++)
{
TToken_string& tt = sf.row(i);
c = tt.get(F_CAUDEF - F_CAUMOV);
if (c.empty())
{
error = TRUE;
break;
}
}
if (sf.items() == 0)
error = TRUE;
if (error)
if (sf.items() == 0)
error_box("E' necessario indicare tutte le causali definitive per ogni causale del movimento in sospensione.");
else
error_box("Non vi sono movimenti in sospensione da stornare nel periodo indicato.");
return !error;
}
break;
case F_NUMPROT:
case F_CAUDEF:
if (e == fe_modify)
{
TString16 cod;
cod << __anno;
cod << o.mask().get(F_CAUDEFREG);
_reg->put("CODTAB", cod);
if (_reg->read() == NOERR)
{
if (o.dlg() == F_NUMPROT)
{
_reg->put("I5", o.mask().get_long(F_NUMPROT));
_reg->rewrite();
TSheet_field& sf = sfield(F_SHEET_CAUSALI);
const int rs = sf.selected();
sf.enable_column(F_NUMPROT - F_CAUMOV, FALSE);
sf.force_update(rs);
}
o.mask().set(F_NUMPROT, _reg->get_long("I5"));
}
}
break;
default:
break;
}
return TRUE;
}
const long TGestAutoTrasp_mask::get_last_nreg()
{
TLocalisamfile& mov = _rel->lfile();
long nr = 1L;
if (!mov.empty())
{
mov.last();
nr = mov.get_long(MOV_NUMREG) + 1L;
}
return nr;
}
const long TGestAutoTrasp_mask::get_last_nprot()
{
long rt = 0l;
TString16 cod;
cod << __anno;
cod << get(F_CODREG);
_reg->put("CODTAB", cod);
if (_reg->read() == NOERR)
rt = _reg->get_long("I5");
return rt;
}
void TGestAutoTrasp_mask::swap_sign(TMovimentoPN& m)
{
// Scambia il segno sulla testata
TRectype& h = m.curr();
real r;
r = ZERO - h.get_real(MOV_TOTDOC);
h.put(MOV_TOTDOC, r);
r = ZERO - h.get_real(MOV_TOTDOCVAL);
h.put(MOV_TOTDOCVAL, r);
// e su tutte le righe iva
const int items = m.iva_items();
for (int i=0; i<items;i++)
{
TRectype& rec = m.iva(i);
r = ZERO - rec.get_real(RMI_IMPONIBILE);
rec.put(RMI_IMPONIBILE, r);
r = ZERO - rec.get_real(RMI_IMPOSTA);
rec.put(RMI_IMPOSTA, r);
}
}
void TGestAutoTrasp_mask::write_movs()
{
TSheet_field& sf = sfield(F_SHEET_CAUSALI);
// Compila _caudef, per la corrispondenza con le causali definitive
const int items = sf.items();
for (int i=0; i<items;i++)
{
TToken_string& tt = sf.row(i);
TString& s = (TString&) _caudef[tt.get(0)];
s = tt.get(F_CAUDEF - F_CAUMOV);
}
TDate dataop(get_date(F_DATAOP));
// Riutilizzo del cursore
const TRecnotype cur_items = _cur->items();
TRectype& curr_rec = _cur->curr();
TMovimentoPN mpn_sosp; // Movimento di prima nota in sospensione
TMovimentoPN mpn_storno; // Movimento di prima nota di storno sul reg. sospensione
TMovimentoPN mpn_definitivo; // Movimento di prima nota solo IVA sul registro definitivo
TRectype& mpn_sosp_rec = mpn_sosp.curr();
TRectype& mpn_storno_rec = mpn_storno.curr();
TRectype& mpn_definitivo_rec = mpn_definitivo.curr();
_cur->freeze();
TProgind pi(cur_items, "Creazione movimenti...", FALSE, TRUE);
int err = NOERR;
int movs = 0;
// Scorre i movimenti selezionati sul registro in sospensione
for (*_cur = 0L; _cur->pos() < cur_items && err == NOERR; ++(*_cur))
{
pi.addstatus(1L);
mpn_sosp_rec = curr_rec;
if (mpn_sosp.read(_isequal) == NOERR)
{
// Il prossimo numero di registrazione è...
long nr = get_last_nreg();
long nsosp = mpn_sosp_rec.get_long(MOV_NUMREG);
// Azzera le righe dei movimenti da scrivere
mpn_storno.destroy_rows(nr);
mpn_definitivo.destroy_rows(nr+1);
// Sistema il movimento definitivo
TCausale def_caus((TString&)_caudef[mpn_sosp_rec.get(MOV_CODCAUS)], __anno);
mpn_definitivo_rec = mpn_sosp_rec;
mpn_definitivo_rec.put(MOV_NUMREG, nr+1);
mpn_definitivo_rec.put(MOV_PROTIVA, def_caus.reg().protocol()+1);
mpn_definitivo_rec.put(MOV_DATAREG, dataop);
mpn_definitivo_rec.put(MOV_DATACOMP, dataop);
mpn_definitivo_rec.put(MOV_CODCAUS, def_caus.codice());
mpn_definitivo_rec.put(MOV_REG, def_caus.reg().name());
mpn_definitivo_rec.put(MOV_TIPODOC, def_caus.tipo_doc());
// Flag operazione stampata in definitiva, solo per quelli in sospensione ed il movimento di storno,
// il movimento definitivo non va flaggato.
mpn_sosp_rec.put(MOV_STAMPATO, TRUE);
mpn_sosp_rec.put(MOV_REGST, TRUE);
// Sistema il movimento di storno a partire da quello in sospensione
TCausale storno_caus(get(F_CAUS), __anno); // Forse è ridondante ma serve per tener aggiornato il nr. protocollo
mpn_storno_rec = mpn_sosp_rec;
mpn_storno_rec.put(MOV_NUMREG, nr);
mpn_storno_rec.put(MOV_PROTIVA, storno_caus.reg().protocol()+1);
mpn_storno_rec.put(MOV_DATAREG, dataop);
mpn_storno_rec.put(MOV_DATACOMP, dataop);
mpn_storno_rec.put(MOV_CODCAUS, storno_caus.codice());
mpn_storno_rec.put(MOV_REG, storno_caus.reg().name());
mpn_storno_rec.put(MOV_TIPODOC, storno_caus.tipo_doc());
// Aggiunge le righe IVA
const int iva_items = mpn_sosp.iva_items();
for (int j=0; j<iva_items; j++)
{
TRectype& vv = mpn_storno.iva(j);
TRectype& ff = mpn_definitivo.iva(j);
vv = mpn_sosp.iva(j);
ff = mpn_sosp.iva(j);
vv.put(RMI_NUMREG, nr);
vv.zero(RMI_RIGAIMP);
ff.put(RMI_NUMREG, nr+1);
ff.zero(RMI_RIGAIMP);
}
// Se è effettivamente una causale di storno, cambia il segno al totale documento ed alle righe IVA
if (storno_caus.sezione_clifo() == 'A')
swap_sign(mpn_storno);
// Scrive il movimento di storno solo IVA sul reg in sospensione
while ((err = mpn_storno.write()) == _isreinsert)
mpn_storno_rec.put(MOV_NUMREG, ++nr); // Gestisce la rinumerazione
if (err == NOERR)
{
movs++;
// Scrive il movimento definitivo
while ((err = mpn_definitivo.write()) == _isreinsert)
mpn_definitivo_rec.put(MOV_NUMREG, ++nr);
if (err == NOERR)
{
movs++;
err = mpn_sosp.rewrite(); // Aggiorna il movimento in sospensione con i flags aggiornati
if (err != NOERR)
error_box("Errore %d in fase di riscrittura del movimento di sospensione nr. %d.", err, nsosp);
}
else
error_box("Errore %d in fase di scrittura del movimento definitivo. Movimento di sospensione nr. %d.", err, nsosp);
}
else
error_box("Errore %d in fase di scrittura del movimento di storno. Movimento di sospensione nr. %d.", err, nsosp);
}
}
_cur->freeze(FALSE);
message_box("Totale movimenti generati: %d", movs);
}
class TGestAutoTrasp_app : public TSkeleton_application
{
TGestAutoTrasp_mask * _msk;
protected:
virtual bool create();
virtual bool destroy();
virtual void main_loop();
public:
TGestAutoTrasp_app () {};
virtual ~TGestAutoTrasp_app () {};
};
bool TGestAutoTrasp_app::create()
{
_msk = new TGestAutoTrasp_mask();
open_files(LF_MOV, LF_ATTIV, 0);
return TSkeleton_application::create();
}
bool TGestAutoTrasp_app::destroy()
{
delete _msk;
return TSkeleton_application::destroy();
}
void TGestAutoTrasp_app::main_loop()
{
while (_msk->run() != K_QUIT)
{
if (yesno_box("Procedo con la creazione dei movimenti?"))
{
_msk->write_movs();
_msk->reset();
}
}
}
int cg4a00(int argc, char* argv[])
{
TGestAutoTrasp_app app;
app.run(argc, argv, "Gestione Autotrasportatori");
return 0;
}

22
cg/cg4a00a.h Executable file
View File

@ -0,0 +1,22 @@
#define F_CODDITTA 201
#define F_RAGSOC 202
#define F_DADATA 203
#define F_ADATA 204
#define F_ANNO 205
#define F_CODREG 206
#define F_DESREG 207
#define F_DATAOP 208
#define F_CAUS 209
#define F_DESCRCAUS 210
#define F_SHEET_CAUSALI 200
#define F_CAUMOV 101
#define F_DESCAUMOV 102
#define F_TIPODOC 103
#define F_CAUDEF 104
#define F_DESCAUDEF 105
#define F_CAUDEFREG 106
#define F_NUMPROT 107

208
cg/cg4a00a.uml Executable file
View File

@ -0,0 +1,208 @@
#include "cg4a00a.h"
TOOLBAR "" 0 20 0 3
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
PAGE "Gestione Autotrasportatori" -1 -1 78 14
GROUPBOX DLG_NULL 76 3
BEGIN
PROMPT 1 1 "@bDitta"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 3 2 "Codice "
FLAGS "FRD"
USE LF_NDITTE
CHECKTYPE NORMAL
INPUT CODDITTA F_CODDITTA
OUTPUT F_RAGSOC RAGSOC
END
STRING F_RAGSOC 50
BEGIN
PROMPT 17 2 "Ragione "
FLAGS "D"
END
GROUPBOX DLG_NULL 76 4
BEGIN
PROMPT 1 4 "Selezione movimenti"
END
DATE F_DADATA
BEGIN
PROMPT 2 5 "Dal "
CHECKTYPE REQUIRED
END
DATE F_ADATA
BEGIN
PROMPT 37 5 "Al "
VALIDATE DATE_CMP_FUNC >= F_DADATA
CHECKTYPE REQUIRED
WARNING "La data finale deve essere maggiore di quella iniziale"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 1 1 ""
FLAGS "H"
END
STRING F_CODREG 3
BEGIN
PROMPT 2 6 "Codice registro "
USE REG SELECT ((B1=="X")&&((I9==1)||(I9==0)))
INPUT CODTAB[1,4] F_ANNO
INPUT CODTAB[5,7] F_CODREG
DISPLAY "Anno " CODTAB[1,4]
DISPLAY "Codice " CODTAB[5,7]
DISPLAY "Descrizione @40" S0
OUTPUT F_CODREG CODTAB[5,7]
OUTPUT F_DESREG S0
FLAGS "U"
CHECKTYPE REQUIRED
END
STRING F_DESREG 50 30
BEGIN
PROMPT 40 6 ""
FLAGS "D"
END
GROUPBOX DLG_NULL 76 4
BEGIN
PROMPT 1 8 "Generazione movimenti"
END
DATE F_DATAOP
BEGIN
PROMPT 2 9 "Data operazione "
VALIDATE DATE_CMP_FUNC >= F_DADATA
CHECKTYPE REQUIRED
WARNING "La data operazione deve essere maggiore di quella iniziale"
END
STRING F_CAUS 3
BEGIN
PROMPT 2 10 "Causale di storno "
FLAGS "UZ"
USE LF_CAUSALI
JOIN REG INTO CODTAB==TIPODOC
JOIN LF_RCAUSALI INTO CODCAUS==CODCAUS NRIGA=="1"
INPUT CODCAUS F_CAUS
DISPLAY "Codice" CODCAUS
DISPLAY "Descrizione@50" DESCR
DISPLAY "Tipo" TIPODOC
DISPLAY "Registro" REG
OUTPUT F_CAUS CODCAUS
OUTPUT F_DESCRCAUS DESCR
CHECKTYPE REQUIRED
WARNING "Causale indicata non completa od errata"
END
STRING F_DESCRCAUS 50 40
BEGIN
PROMPT 35 10 ""
FLAGS "D"
END
SPREADSHEET F_SHEET_CAUSALI 78
BEGIN
PROMPT 1 12 "Selezione causali"
ITEM "C.sos."
ITEM "Descrizione@15"
ITEM "T.D."
ITEM "C.def."
ITEM "Descrizione@15"
ITEM "C.Reg."
ITEM "Nr.\nProt."
END
ENDPAGE
ENDMASK
PAGE "" -1 -1 65 16
STRING F_CAUMOV 3
BEGIN
PROMPT 1 1 "Causale mov. in sosp. "
FLAGS "D"
END
STRING F_DESCAUMOV 50 15
BEGIN
PROMPT 1 2 "Descrizione "
FLAGS "D"
END
STRING F_TIPODOC 2
BEGIN
PROMPT 1 3 "Tipo documento "
FLAGS "D"
END
STRING F_CAUDEF 3
BEGIN
PROMPT 1 4 "Caus. mov. definitivo "
FLAGS "UZ"
USE LF_CAUSALI
JOIN REG INTO CODTAB==TIPODOC
INPUT CODCAUS F_CAUDEF
DISPLAY "Codice" CODCAUS
DISPLAY "Descrizione@50" DESCR
DISPLAY "Tipo" TIPODOC
DISPLAY "Registro" REG
OUTPUT F_CAUDEF CODCAUS
OUTPUT F_DESCAUDEF DESCR[1,15]
OUTPUT F_CAUDEFREG REG
CHECKTYPE NORMAL
WARNING "La causale definitiva è obbligatoria"
END
STRING F_DESCAUDEF 15
BEGIN
PROMPT 1 5 "Descrizione "
FLAGS "D"
END
STRING F_CAUDEFREG 3
BEGIN
PROMPT 1 6 "Cod. registro "
FLAGS "D"
END
NUMBER F_NUMPROT 7
BEGIN
PROMPT 1 7 "Ultimo nr. protocollo "
FLAGS "D"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_CANCEL 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -1666,8 +1666,7 @@ void TPagamento::set_rate_auto()
set_imprata(0, importo_rata(0,v) + importo_da_non_dividere(v), v);
}
// risistema rate per scadenze fisse
adjust_fixed_scad();
// adjust_fixed_scad(); // Gia' fatto dalla set_inizio
}
const real& TPagamento::importo_da_dividere(bool v) const

View File

@ -166,6 +166,9 @@ public:
void set_numero_rate(int n, int sscad = -1, int rdiff = 1);
void set_inizio(const TDate& d, bool rispetta_date = FALSE); // resetta tutto
const TDate& get_inizio() const { return _inizio; }
const TDate& get_datadoc() const { return _datadoc; }
void set_datadoc(const TDate & d) { _datadoc = d;}
void set_inizio_scadenza(char v) { _inscad = v; }
void set_code(const char* c) { _code = c; }

View File

@ -110,6 +110,7 @@ Item_05 = "Stampa registri", "cg4 -3", "F"
Item_06 = "Liste fatture", [PRASSICG_026]
Item_07 = "Gestione acconti IVA", [PRASSICG_027]
Item_08 = "Gestione versamenti IVA", [PRASSICG_022]
Item_09 = "Gestione autotrasportatori", "cg4 -9", "F"
[PRASSICG_011]
Caption = "Tabelle ministeriali"

View File

@ -1140,7 +1140,7 @@ bool TPartita::write(bool re) const
{
chiusa(TRUE); // Aggiorna flag di chiusura (non si sa mai)
if (conto().tipo() > ' ')
if (conto().tipo() > ' ' && conto().gruppo() > 0)
{
// Aggiunge conti cliente/fornitore mancanti
for (int r = last(); r > 0; r = pred(r))

View File

@ -135,6 +135,8 @@ void TQuery_mask::restart_tree()
_tree.restart();
while (!_tree.is_leaf())
{
if (_tree.is_cyclic())
break;
_tree.expand();
_tree.goto_firstson();
if (_tree.has_rbrother())
@ -317,7 +319,7 @@ bool TQuery_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
if (m.get_bool(F_GHOST)) fi << 'G';
_tree.goto_root();
_tree.explode(a.rows_array(), mb, gr, md, fi, sk, lq);
_tree.explode(a.rows_array(), mb, gr, md, fi, sk);
a.run();
}
}
@ -719,6 +721,7 @@ bool TDistinta_mask::on_field_event(TOperable_field& o, TField_event e, long jol
if (code.not_empty())
{
const char type = _tree.get_type(code);
bool is_virtual=type == 'V';
switch(type)
{
case 'A':
@ -747,6 +750,7 @@ bool TDistinta_mask::on_field_event(TOperable_field& o, TField_event e, long jol
break;
default:
set(F_TIPO, "V", TRUE);
// le distinte virtuali non possono essere master
break;
}
load_um();
@ -906,9 +910,9 @@ void TDistinta_app::init_insert_mode(TMask &m)
TSheet_field &f= (TSheet_field &)m.field(F_UNITA);
if (f.items() == 0)
f.row(0) = " |1"; // aggiunge una riga allo sheet
m.set(F_MASTER,"X");
}
bool TDistinta_app::changing_mask(int mode)
{
bool was_query = _mode == MODE_QUERY || _mode == MODE_QUERYINS;
@ -952,7 +956,7 @@ int TDistinta_app::read(TMask& m)
memo.get(i, row);
int equal = row.find('=');
if (equal > 0)
row[equal] = '|';
row[equal] = SAFE_PIPE_CHR;
}
}

View File

@ -70,19 +70,19 @@ LIST F_TIPO 1 12
BEGIN
PROMPT 54 2 "Tipo "
ITEM "A|Articolo"
MESSAGE "",F_VIRTUALE
MESSAGE "",F_VIRTUALE|ENABLE,F_MASTER|ENABLE,F_ARTACQ|ENABLE,F_ARTPROD
ITEM "L|Lavorazione"
MESSAGE "",F_VIRTUALE
MESSAGE "",F_VIRTUALE|CLEAR,F_MASTER|CLEAR,F_ARTACQ|CLEAR,F_ARTPROD
ITEM "V|Virtuale"
MESSAGE "X",F_VIRTUALE
MESSAGE "X",F_VIRTUALE|CLEAR,F_MASTER|CLEAR,F_ARTACQ|ENABLE,F_ARTPROD
FLAGS "DG"
END
BOOLEAN F_VIRTUALE
BEGIN
PROMPT 50 50 "Virtuale"
MESSAGE FALSE DISABLE,1@|ENABLE,F_ARTACQ
MESSAGE TRUE ENABLE,1@|CLEAR,F_ARTACQ
MESSAGE FALSE DISABLE,1@
MESSAGE TRUE ENABLE,1@
FLAGS "DG"
FIELD VIRTUALE
END
@ -255,9 +255,10 @@ END
SPREADSHEET F_PARAMS
BEGIN
FLAGS "|"
PROMPT 0 10 ""
ITEM "Variabile@20"
ITEM "Valore@70"
ITEM "Valore@120"
END
ENDPAGE
@ -561,7 +562,7 @@ ENDPAGE
ENDMASK
PAGE "Variabili" -1 -1 64 5
PAGE "Variabili" -1 -1 70 5
STRING FV_PARAM 20
BEGIN
@ -576,7 +577,7 @@ BEGIN
FLAGS "U"
END
STRING FV_VALUE 70 50
STRING FV_VALUE 120 55
BEGIN
PROMPT 1 2 "Valore "
END

View File

@ -299,6 +299,7 @@ void TLavorazione::get_linee()
esse[1]=s;
_linee << get(esse);
}
_linee.replace(SAFE_PIPE_CHR,'|');
}
void TLavorazione::put_linee()
@ -311,6 +312,7 @@ void TLavorazione::put_linee()
if (s > '3') len=20;
esse[1]=s;
str=_linee.mid(from,len);
str.replace('|',SAFE_PIPE_CHR);
put(esse, str);
from+=len;
}
@ -414,6 +416,7 @@ TLavorazione::TLavorazione(const char* cod)
if (cod && *cod)
{
TTable lav("LAV");
put("COD", "LAV");
put("CODTAB", cod);
read(lav);
} else
@ -1184,12 +1187,12 @@ TObject * TDistinta_tree::get_global(const char* name, word classname)
return NULL;
if (classname==CLASS_STRING )
{
if (((TString *)val)->blank())
if (!val || ((TString *)val)->blank())
val = global_default_str(name);
}
else
{
if (((real *)val)->is_zero())
if (!val || ((real *)val)->is_zero())
val = global_default_real(name);
}
return val;
@ -1508,7 +1511,19 @@ TDistinta_tree::~TDistinta_tree()
TRiga_esplosione *TDistinta_tree::first_critical_labor(TArray & labors, TExplosion_grouping raggum)
{
return first_labor(labors,raggum);
TRiga_esplosione *l=first_labor(labors, raggum);
while (l)
{
TLavorazione labor(l->articolo());
for (int lnp=0 ; lnp < labor.linee();lnp++)
{
if (!cache().get("LNP",labor.cod_linea(lnp)).get_bool("B9"))
// escluso dal CRP
return l;
}
l=(TRiga_esplosione *)labors.succ_item();
}
return NULL;
}
TRiga_esplosione *TDistinta_tree::next_critical_labor(TArray & labors)
@ -1519,7 +1534,6 @@ TRiga_esplosione *TDistinta_tree::next_critical_labor(TArray & labors)
TRiga_esplosione *TDistinta_tree::first_labor(TArray & labors, TExplosion_grouping raggum)
{
static TLavorazione *curr_labor=NULL;
explode(labors,FALSE,raggum, 1,"L");
TRiga_esplosione *l=(TRiga_esplosione *)labors.first_item();
return l;
@ -1527,6 +1541,8 @@ TRiga_esplosione *TDistinta_tree::first_labor(TArray & labors, TExplosion_groupi
TRiga_esplosione *TDistinta_tree::next_labor(TArray & labors)
{
if (labors.items()==0)
return NULL;
TRiga_esplosione *l=(TRiga_esplosione *)labors.succ_item();
return l;
}

View File

@ -399,6 +399,8 @@ bool TVariazione_effetti::contab_handler(TMask_field& f, KEY k)
TMask &m = f.mask();
const bool da_contab = f.get().empty();
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_RIGHE);
/* Cavolata di dimensioni bibliche o cosa?
if (da_contab)
{
for (int i = sf.items() - 1; i >= 0; i--)
@ -407,6 +409,7 @@ bool TVariazione_effetti::contab_handler(TMask_field& f, KEY k)
row.add(" ", sf.cid2index(F_NUMRIGA));
}
}
*/
sf.enable_column(F_ANNO, da_contab);
sf.enable_column(F_NUMPART, da_contab);
if (f.focusdirty())

View File

@ -58,7 +58,8 @@ protected:
bool user_create();
bool user_destroy();
void aggiorna();
TToken_string* common_f(const TMask& m);
TToken_string* common_f(const TMask& m, TToken_string& datidist);
public:
virtual TRelation* get_relation() const {return _rel;}
TVariazione_distinte() {};
@ -157,7 +158,6 @@ void TVariazione_distinte::aggiorna()
TEffetto* effetto = new TEffetto(rec);
TArray& righedist = _distinta->righe();
righedist.add(effetto);
}
}
@ -165,7 +165,7 @@ void TVariazione_distinte::aggiorna()
// Metodo che permette di prendere i dati dalla maschera e metterli in
// una TToken_string che servirà per passarli alla write della distinta
TToken_string* TVariazione_distinte::common_f(const TMask& m)
TToken_string* TVariazione_distinte::common_f(const TMask& m, TToken_string& datidist)
{
char tipodist = m.get(F_TIPODIST)[0];// prendo i dati
long ndist = m.get_long(F_NUMBER); // identificatvi della
@ -173,13 +173,13 @@ TToken_string* TVariazione_distinte::common_f(const TMask& m)
long codabi = m.get_long(F_CODABIP); // dalla maschera
long codcab = m.get_long(F_CODCABP);
m.autosave(*_rel);
TToken_string * datidist= new TToken_string; // creo la token string
datidist->add(tipodist); // inserisco i dati nella
datidist->add(ndist); // token string
datidist->add(datadist);
datidist->add(codabi);
datidist->add(codcab);
return datidist;
datidist.add(tipodist); // inserisco i dati nella
datidist.add(ndist); // token string
datidist.add(datadist);
datidist.add(codabi);
datidist.add(codcab);
return &datidist;
}
// carica nella maschera i dati dai files
@ -327,8 +327,10 @@ int TVariazione_distinte::rewrite(const TMask& m)
}
//resetto l'array che contiene gli effetti nella distinta
int err = _distinta->reset();
aggiorna();
err = _distinta->rewrite(common_f(m));
aggiorna();
TToken_string datidist;
err = _distinta->rewrite(common_f(m, datidist));
if (err == NOERR)
{ // riposiziono la relazione
_rel->lfile().setkey(4);
@ -348,8 +350,10 @@ int TVariazione_distinte::write(const TMask& m)
int err = _distinta->reset();
char tipodist = m.get(F_TIPODIST)[0];
long ndist = m.get_long(F_NUMBER);
aggiorna();
err = _distinta->write(TRUE, common_f(m));
aggiorna();
TToken_string datidist;
err = _distinta->write(TRUE, common_f(m, datidist));
if (err == NOERR)
{ //riposiziono la relazione
_rel->lfile().setkey(4);

View File

@ -159,8 +159,8 @@ BEGIN
ITEM "Da elim."
ITEM "Nr. Ri.Ba."
ITEM "Scadenza"
ITEM "Cliente/Fornitore@30"
ITEM "Banca d'appoggio@30"
ITEM "Cliente/Fornitore@50"
ITEM "Banca d'appoggio@40"
ITEM "Nr. Fattura"
ITEM "Data Fattura"
ITEM "Nr. Rata"

View File

@ -26,22 +26,25 @@ TDistinta::~TDistinta()
// permette di leggere la distinta del tipo e numero passati
int TDistinta::read(const char tipo, const long numero, word lockop)
{
int err = NOERR;
CHECK(tipo!='\0' && numero > 0,"Can't read distinta from NULL elements");
int err = _iskeynotfound;
TLocalisamfile f(LF_EFFETTI); f.setkey(4);
if (_righe_dist.items() > 0) // Se ha letto una distinta precedente, sblocca la prima riga
{
f.read((TRectype&)_righe_dist[0],_isequal,_unlock);
_righe_dist.destroy(); // Rimuove tutte le righe precedenti
}
for (int i=0; err == NOERR ; i++)
if (tipo >= ' ' && numero > 0)
{
TEffetto* effetto = new TEffetto;
word lock = (i == 0 && lockop == _lock) ? _lock : _nolock; // Lock solo sulla prima riga
err = effetto->read(f, tipo, numero, i+1, lock);//legge un effetto per chiave 4
if (err == NOERR)
_righe_dist.add(effetto);
}
err = NOERR;
for (int i=0; err == NOERR ; i++)
{
TEffetto* effetto = new TEffetto;
word lock = (i == 0 && lockop == _lock) ? _lock : _nolock; // Lock solo sulla prima riga
err = effetto->read(f, tipo, numero, i+1, lock);//legge un effetto per chiave 4
if (err == NOERR)
_righe_dist.add(effetto);
}
}
// se ho letto degli effetti della distinta ed ho
// trovato la fine file elimino l'errore
if ((_righe_dist.items()>0)||(err == _iseof) )
@ -78,6 +81,7 @@ int TDistinta::write(bool force, TToken_string* dati_dist)
effetto.put(EFF_DATADIST, dati_dist->get());
effetto.put(EFF_CODABIP, dati_dist->get());
effetto.put(EFF_CODCABP, dati_dist->get());
effetto.put(EFF_NRIGADIST, i+1);
}
//riscrivo l'effetto con i dati della distinta a cui appartiene

View File

@ -9,7 +9,7 @@
// Definizione dell'oggetto Distinta con la classe TDistinta //
///////////////////////////////////////////////////////////////
class TDistinta:public TObject
class TDistinta : public TObject
{
//array che contiene puntatori agli effetti nella distinta
TArray _righe_dist;
@ -20,7 +20,7 @@ protected:
public:
//ritorna un riferimento all'array degli effetti nella distinta
TArray& righe(){ return _righe_dist;}
TArray& righe() { return _righe_dist; }
//ritorna il numero degli effetti nella distinta (nell'array)
const int items() const{ return _righe_dist.items(); }
//elimina tutti gli effetti nella distinta (appartenti all'array)
@ -51,6 +51,8 @@ public:
TDate data_cam() const { return eff(0).get_date(EFF_DATACAMBIO); }
//restituisce il cambio delle distinta
real cambio() const { return eff(0).get_real(EFF_CAMBIO); }
//restituisce TRUE se il cambio delle distinta e' contro euro
bool contro_euro() const { return eff(0).get_bool(EFF_CONTROEURO); }
//restituisce il codice abi di presentazione effetti
const TString& abip()const { return eff(0).get(EFF_CODABIP); }
//restituisce il codice cab di presentazione effetti
@ -58,7 +60,7 @@ public:
// restituisce l'effetto n-esimo
TEffetto& operator[](const int index) { return eff(index); }
//costruttore di default
TDistinta() {};
TDistinta() { }
//costruttore distinta del tipo e numero passato
TDistinta(const char tipo, const long numero, word lockop = _nolock);
//costruttore distinta utilizzando il record passato

View File

@ -304,7 +304,7 @@ void TEmissione::inizializza_file()
TFilename fileriba = _msk->get(F_UNITA);
fileriba << ":\\" << _msk->get(F_NOMEFILE);
_trasfile->open(fileriba,'w');
_trasfile->set_tot_importi(0.0);
_trasfile->set_tot_importi(ZERO);
_foutput = (fo)_msk->get_int(F_FOR_OUT);
}
@ -637,7 +637,7 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
picture << ",@@@";
real importo(dati->get(2));
cf.set(importo.string(picture));
}
}
}
}
valore = cf.get();
@ -1028,10 +1028,10 @@ void TRiba_file:: validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TSt
TString descfatt;
for (int i = 0; i < elem; i+=3)
{
descfatt << dati->get(i);
descfatt << " ";
descfatt << dati->get(i+1);
descfatt << " ";
descfatt << dati->get(i);
descfatt << " ";
descfatt << dati->get(i+1);
descfatt << " ";
}
int l = descfatt.len();
TString in(s.get());
@ -1056,30 +1056,27 @@ void TRiba_file:: validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TSt
// dove: <macro> è uno delle macro seguenti:
// "!ADD" aggiunge l'importo dell'effetto corrente al totale
// "!TOT" emette il totale
TString in(s.get());
const TString in(s.get());
CHECK(in[0]=='!',"Macro _IMPORTO senza carattere '!'");
in.ltrim(1);
if (in=="ADD")
if (in=="!ADD")
{
real importo(str);
add_tot_importi(importo);
valore.cut(0);
valore << importo.string(13,0);
valore = importo.string(13,0);
}
else if (in=="TOT")
else if (in=="!TOT")
{
valore.cut(0);
real importo = tot_importi();
valore << importo.string("##############@");
set_tot_importi(0.0);
valore = importo.string("##############@");
set_tot_importi(ZERO);
}
else
CHECKS (TRUE,"Sotto-Macro _IMPORTO non definita",(const char *)in);
} else
if (code == "_CODSIA")
{
TConfig cnf(CONFIG_DITTA);
valore = cnf.get("CODSIA", "ef");
TConfig cnf(CONFIG_DITTA, "ef");
valore = cnf.get("CODSIA");
}
else
CHECKS (TRUE,"Macro non definita",(const char *)code);

View File

@ -331,7 +331,8 @@ print_action TPrint_effetti_app::postprocess_print(int file, int counter)
_pr.reset();
}
if (_tot_cliente != 0.0)
{
{
TString ragsoc;
_pr.put("TOTALE",50);
_pr.put(_tot_cliente.string("###.###.##@,@@"),72);
printer().print(_pr);
@ -807,25 +808,28 @@ bool TPrint_effetti_app::set_print(int)
select_cursor(_cur_2);
break;
case st_distinta:
cod_from = mask.get(F_DA_DATA3);
cod_to = mask.get(F_A_DATA3);
from.put(EFF_DATASCAD,cod_from);
to.put(EFF_DATASCAD,cod_to);
cod_from = mask.get(F_DADIST);
cod_to = mask.get(F_ADIST);
filter.cut(0);
if (mask.get(F_DATIPODIST).empty())
filter << "(NDIST==\"\")";
else
{
if (cod_from.empty())
cod_from = "1";
filter << "(NDIST>=" << cod_from << ")";
if (cod_to.not_empty())
filter << "&&(NDIST<=" << cod_to << ")";
filter << "&&(TIPODIST==\"" << mask.get(F_DATIPODIST) << "\")";
}
select_cursor(_cur_3);
{
cod_from = mask.get(F_DA_DATA3);
cod_to = mask.get(F_A_DATA3);
from.put(EFF_DATASCAD,cod_from);
to.put(EFF_DATASCAD,cod_to);
cod_from = mask.get(F_DADIST);
cod_to = mask.get(F_ADIST);
filter.cut(0);
const TString16 tipodist(mask.get(F_DATIPODIST));
if (tipodist.not_empty())
{
if (cod_from.not_empty())
filter << "(NDIST>=" << cod_from << ") &&";
if (cod_to.empty()) // le distinte
cod_to = "99999999";
filter << "(NDIST<=" << cod_to << ")&&(TIPODIST==\"" << tipodist << "\")";
}
else
filter << "(NDIST<=\"\")";
select_cursor(_cur_3);
}
break;
case st_cliente:
{
@ -873,10 +877,10 @@ bool TPrint_effetti_app::user_create()
TString ordine = "CODABIP|DATASCAD|NPROGTR";
_cur_2 = add_cursor(new TSorted_cursor(_rel,ordine,"",3));
//STAMPA PER DISTINTA
ordine = "TIPODIST|NDIST|NRIGADIST|DATASCAD|NPROGTR";
ordine = "TIPODIST|NDIST|NRIGADIST|DATASCAD|NPROGTR";
_cur_3 = add_cursor(new TSorted_cursor(_rel,ordine,"",3));
//STAMPA PER CLIENTE
ordine = "CODCF|NPROGTR";
ordine = "CODCF|NPROGTR";
_cur_4 = add_cursor(new TSorted_cursor(_rel,ordine,"",3));;
add_file(LF_EFFETTI);
enable_print_menu();

View File

@ -395,8 +395,11 @@ bool TContabilizzazione_effetti_app::add_cg_row(const TEffetto& eff, TArray& cus
{
const TRectype& riga = eff.row_r(n);
desc << ' ' << riga.get(REFF_NFATT);
if (desc.len() >= 40)
break;
}
if (desc.len() > 50) desc.cut(50);
if (n < eff.rows_r())
desc << " ...";
c_rec->put(RMV_DESCR, desc);
// setta i valori per la riga banca
@ -597,6 +600,7 @@ void TContabilizzazione_effetti_app::compile_head_mov()
const TDate datacam = _distinta->data_cam();
const TString16 codval = _distinta->codval();
const real cambio = _distinta->cambio();
const bool eurocambio = _distinta->contro_euro();
const long ndist = _distinta->ndist();
TString des;
@ -630,8 +634,14 @@ void TContabilizzazione_effetti_app::compile_head_mov()
mov.put(MOV_CODVAL,codval);
mov.put(MOV_DATACAM,datacam);
mov.put(MOV_CAMBIO,cambio);
if (eurocambio && cambio > ZERO)
{
if (mov.curr().exist(MOV_CONTROEURO))
mov.put(MOV_CONTROEURO, eurocambio);
else
mov.put(MOV_CAMBIO, real(1936.27) / cambio);
}
// MOV_TOTDOC e MOV_TOTDOCVAL vengono completati prima della scrittura del movimento
// e solo nel caso di saldaconto abilitato
}
void TContabilizzazione_effetti_app::compile_riga_partita(TRiga_partite& riga, const TEffetto& effetto, const TRectype& riga_effetto)
@ -646,21 +656,36 @@ void TContabilizzazione_effetti_app::compile_riga_partita(TRiga_partite& riga, c
riga.put(PART_DATADOC,head_mov.get_date(MOV_DATADOC));
riga.put(PART_DATAPAG,effetto.get_date(EFF_DATASCAD));
riga.put(PART_NUMDOC,head_mov.get(MOV_NUMDOC)); // Sarebbe il numero della distinta...
// La descrizione della riga (PART_DESCR) la lascio vuota. Verificare con Guy le regole necessarie per la sua compilazione eventuale
real imp = riga_effetto.get_real(REFF_IMPORTO);
real imp_val = riga_effetto.get_real(REFF_IMPORTOVAL);
// La descrizione della riga (PART_DESCR) la lascio vuota.
// Verificare con Guy le regole necessarie per la sua compilazione eventuale
riga.put(PART_SEZ,sezione());
const real imp = riga_effetto.get_real(REFF_IMPORTO);
const real imp_val = riga_effetto.get_real(REFF_IMPORTOVAL);
/* Non scrivo qui gli importi: li sommo quando faccio i pagamenti
riga.put(PART_IMPORTO,imp);
riga.put(PART_IMPORTOVAL,imp_val);
*/
riga.put(PART_CODVAL,effetto.get(EFF_CODVAL));
riga.put(PART_CAMBIO,effetto.get_real(EFF_CAMBIO));
riga.put(PART_DATACAM,effetto.get_date(EFF_DATACAMBIO));
real cambio = effetto.get(EFF_CAMBIO);
riga.put(PART_CAMBIO, cambio);
if (effetto.get_bool(EFF_CONTROEURO))
{
if (!((TRectype&)riga).exist(PART_CONTROEURO))
{
if (cambio > ZERO)
{
cambio = real(1936.27) / cambio;
riga.put(PART_CAMBIO, cambio);
}
}
else
riga.put(PART_CONTROEURO, TRUE);
}
riga.put(PART_TIPOCF,_cliente.tipo());
riga.put(PART_SOTTOCONTO,_cliente.sottoconto());
riga.put(PART_IMPTOTDOC,effetto.get_real(EFF_IMPORTO));
riga.put(PART_IMPTOTVAL,effetto.get_real(EFF_IMPORTOVAL));
riga.put(PART_IMPTOTDOC,effetto.get(EFF_IMPORTO));
riga.put(PART_IMPTOTVAL,effetto.get(EFF_IMPORTOVAL));
// PART_GRUPPOCL e PART_CONTOCL sono gia' compilati dalla TPartita::new_row()
// Aggiorna il totale movimento in lire e totale movimento in valuta (solo con saldaconto abilitato)
if (_sc_enabled)
@ -698,8 +723,9 @@ void TContabilizzazione_effetti_app::compile_riga_pagamento(TRectype& riga_pagam
error_type TContabilizzazione_effetti_app::write_all(bool change_status)
{
TRectype& head = _movimento->lfile().curr();
head.put(MOV_TOTDOC,_total_mov); // Se il saldaconto non e' abilitato sono entrambi a 0.0
head.put(MOV_TOTDOC,_total_mov);
head.put(MOV_TOTDOCVAL,_total_mov_val);
long orig_numreg, numreg = head.get_long(MOV_NUMREG);
orig_numreg = numreg;
while (_movimento->write() == _isreinsert)
@ -839,7 +865,9 @@ void TContabilizzazione_effetti_app::contabilize_bill(const char tipo, const lon
const TString16 codval = eff.get(EFF_CODVAL);
const TDate datacam = eff.get(EFF_DATACAMBIO);
const real cambio = eff.get(EFF_CAMBIO);
real cambio = eff.get(EFF_CAMBIO);
if (cambio > ZERO && eff.get_bool(EFF_CONTROEURO))
cambio = real(1936.27) / cambio;
const TValuta valuta_eff(codval, datacam, cambio);
if (!good()) break;

View File

@ -1,3 +1,3 @@
31
0
$effetti|0|0|162|34|Effetti|NEFF||
$effetti|12|12|163|34|Effetti|NEFF||

View File

@ -1,5 +1,5 @@
31
29
30
NPROGTR|3|7|0|Numero progressivo effetto
DATASCAD|5|8|0|Data di scadenza
TIPOPAG|2|1|0|Tipo pagamento
@ -11,6 +11,7 @@ DATAEMISS|5|8|0|Data emissione
CODVAL|1|3|0|Codice valuta
DATACAMBIO|5|8|0|Data cambio
CAMBIO|4|15|5|Cambio
CONTROEURO|8|1|0|Cambio espresso contro Euro
CODABI|10|5|0|Codice ABI banca
CODCAB|10|5|0|Codice CAB banca
ULTRATA|8|1|0|Ultima rata

View File

@ -192,15 +192,18 @@ static void prep_merge()
rr->rc = bf1;
/* --- the last seq has fewer rcds than the rest --- */
if (i == no_seq-1) {
if (totrcd % nrcds > rcds_seq) {
unsigned nrcd_last = (unsigned) totrcd % nrcds;
if (nrcd_last == 0)
nrcd_last = nrcds;
if (nrcd_last > rcds_seq) {
rr->rbuf = rcds_seq;
/* @(!) 2.3.00.112 */
rr->rdsk = (unsigned) (totrcd % nrcds) - rcds_seq;
rr->rdsk = nrcd_last - rcds_seq;
/* @(:) 2.3.00.112 */
}
else {
/* @(!) 2.3.00.112 */
rr->rbuf = (unsigned) (totrcd % nrcds);
rr->rbuf = nrcd_last;
/* @(:) 2.3.00.112 */
rr->rdsk = 0;
}

View File

@ -45,11 +45,11 @@ public:
const char* expand_value(const char* val);
real exchange(const real& num,
const char* fromval, const real& fromchg,
const char* toval, const real& tochg,
const char* fromval, const real& fromchg, bool fromeuro,
const char* toval, const real& tochg, bool toeuro,
bool price = FALSE);
int get_dec(const char* val, bool prices = FALSE);
const real& get_change(const char* val);
const real& get_change(const char* val, bool& contro_euro);
TDowJones() : TFile_cache("%VAL") { }
virtual ~TDowJones() { }
@ -65,8 +65,9 @@ TObject* TDowJones::rec2obj(const TRectype& rec) const
{
data->_chg = rec.get_real("R10");
if (data->_chg <= ZERO)
{
NFCHECK("Codice valuta senza cambio: '%s'", (const char*)codval);
{
if (codval.not_empty())
NFCHECK("Codice valuta senza cambio: '%s'", (const char*)codval);
data->_chg = 1.0;
}
}
@ -100,9 +101,9 @@ void TDowJones::test_cache()
FOR_EACH_ASSOC_OBJECT(_cache, hash, key, obj) if (*key)
{
const TExchangeData& data = *(const TExchangeData*)obj;
if (_base_val.empty() && data._chg == 1.0)
if ((_base_val.empty() || stricmp(key, "LIT") == 0) && data._chg == 1.0)
_base_val = key; else
if (_euro_val.empty() && data._is_euro)
if (data._is_euro && _euro_val.empty())
_euro_val = key;
}
@ -118,13 +119,14 @@ void TDowJones::test_cache()
if (_base_val.empty()) // Si son dimenticati delle LIRE?
{
TExchangeData* lira = new TExchangeData;
lira->_chg = 1.0; lira->_dec = lira->_dec_prices = 0;
lira->_chg = 1.0; lira->_dec = 0; lira->_dec_prices = 2;
lira->_is_euro = lira->_contro_euro = FALSE;
_base_val = "LIT";
_cache.add(_base_val, lira);
}
_firm_val = prefix().firm().codice_valuta();
_euro_chg = get_change(_euro_val);
bool dummy_ce;
_euro_chg = get_change(_euro_val, dummy_ce);
}
}
@ -177,8 +179,10 @@ const TString& TDowJones::get_euro_val()
real TDowJones::exchange(const real& num, // Importo da convertire
const char* frval, // Dalla valuta
const real& frchg, // Dal cambio
bool freur, // Dal cambio in euro
const char* toval, // Alla valuta
const real& tochg, // Al cambio
bool toeur, // Al cambio in euro
bool price) // e' un prezzo ?
{
real n = num;
@ -186,13 +190,15 @@ real TDowJones::exchange(const real& num, // Importo da convertire
{
const TExchangeData& datafr = get(frval);
const TExchangeData& datato = get(toval);
const real fr = frchg <= ZERO ? datafr._chg : frchg;
const real to = tochg <= ZERO ? datato._chg : tochg;
const int mode = (datafr._contro_euro ? 1 : 0)+(datato._contro_euro ? 2 : 0);
real fr = frchg;
if (fr <= ZERO) { fr = datafr._chg; freur = datafr._contro_euro; }
real to = tochg;
if (to <= ZERO) { to = datato._chg; toeur = datato._contro_euro; }
const int mode = (freur ? 1 : 0) + (toeur ? 2 : 0);
switch (mode)
{
case 1:
n = n * _euro_chg / (fr * to); // Modo misto 1
n = (n * _euro_chg) / (fr * to); // Modo misto 1
break;
case 2:
n = n * (fr * to) / _euro_chg; // Modo misto 2
@ -215,13 +221,13 @@ int TDowJones::get_dec(const char* val, bool price)
return price ? data._dec_prices : data._dec;
}
const real& TDowJones::get_change(const char* val)
const real& TDowJones::get_change(const char* val, bool& contro_euro)
{
const TExchangeData& data = get(val);
contro_euro = data._contro_euro;
return data._chg;
}
///////////////////////////////////////////////////////////
// TCurrency
///////////////////////////////////////////////////////////
@ -256,7 +262,7 @@ int TCurrency::get_euro_dec(bool price)
return DowJones.get_dec(get_euro_val(), price);
}
void TCurrency::force_value(const char* newval, const real& newchange)
void TCurrency::force_value(const char* newval, const real& newchange, bool neweuro)
{
newval = DowJones.expand_value(newval);
if (newval && *newval)
@ -264,22 +270,25 @@ void TCurrency::force_value(const char* newval, const real& newchange)
strncpy(_val, newval, 4);
_val[3] = '\0';
_exchange = newchange;
_euro = neweuro;
}
else
{
*_val = '\0';
_exchange = ZERO;
_euro = FALSE;
}
}
void TCurrency::change_value(const char* val, const real& newchange)
void TCurrency::change_value(const char* val, const real& newchange, bool to_euro)
{
val = DowJones.expand_value(val);
if (!_num.is_zero() && stricmp(_val, val) != 0)
{
_num = DowJones.exchange(_num, _val, _exchange, val, newchange, is_price());
_num = DowJones.exchange(_num, _val, _exchange, _euro,
val, newchange, to_euro, is_price());
}
force_value(val, newchange);
force_value(val, newchange, to_euro);
}
int TCurrency::decimals() const
@ -302,7 +311,7 @@ int TCurrency::compare(const TSortable& s) const
void TCurrency::copy(const TCurrency& cur)
{
_num = cur._num;
force_value(cur._val, cur._exchange);
force_value(cur._val, cur._exchange, _euro);
}
const char* TCurrency::string(bool dotted) const
@ -325,8 +334,8 @@ TCurrency& TCurrency::operator+=(const TCurrency& cur)
}
else
{
real n = DowJones.exchange(cur._num, cur._val, cur._exchange,
_val, _exchange, is_price());
real n = DowJones.exchange(cur._num, cur._val, cur._exchange, cur._euro,
_val, _exchange, _euro, is_price());
_num += n;
}
return *this;
@ -346,8 +355,8 @@ TCurrency& TCurrency::operator-=(const TCurrency& cur)
_num -= cur._num;
else
{
real n = DowJones.exchange(cur._num, cur._val, cur._exchange,
_val, _exchange, is_price());
real n = DowJones.exchange(cur._num, cur._val, cur._exchange, cur._euro,
_val, _exchange, _euro, is_price());
_num -= n;
}
return *this;
@ -383,9 +392,9 @@ bool TCurrency::same_value_as(const TCurrency& cur) const
return FALSE;
}
TCurrency::TCurrency(const real& num, const char* val, const real& exchg, bool price)
TCurrency::TCurrency(const real& num, const char* val, const real& exchg, bool euro, bool price)
: _num(num), _price(price)
{
force_value(val, exchg);
force_value(val, exchg, euro);
}

View File

@ -14,7 +14,8 @@ class TCurrency : public TSortable
real _num; // Valore assoluto
char _val[4]; // Codice valuta
real _exchange; // Cambio personalizzato
bool _price;
bool _euro; // Cambio personalizzato contro Euro
bool _price; // Prezzo unitario o no
protected:
virtual int compare(const TSortable& s) const;
@ -31,8 +32,8 @@ public:
void set_price(bool p) { _price = p; }
bool is_price() const { return _price; }
void force_value(const char* newval, const real& newchange = ZERO);
void change_value(const char* newval, const real& newchange = ZERO);
void force_value(const char* newval, const real& newchange = ZERO, bool neweuro = FALSE);
void change_value(const char* newval, const real& newchange = ZERO, bool neweuro = FALSE);
void change_to_base_val() { change_value(get_base_val()); }
void change_to_firm_val() { change_value(get_firm_val()); }
void change_to_euro_val() { change_value(get_euro_val()); }
@ -62,7 +63,7 @@ public:
TCurrency(bool price = FALSE) : _price(price) { _val[0] = '\0'; }
TCurrency(const TCurrency& cur) { copy(cur); }
TCurrency(const real& num, const char* val = "", const real& exchg = ZERO, bool price = FALSE);
TCurrency(const real& num, const char* val = "", const real& exchg = ZERO, bool euro = FALSE, bool price = FALSE);
virtual ~TCurrency() { }
};
@ -73,8 +74,8 @@ public:
TPrice() : TCurrency(TRUE) { }
TPrice(const TPrice& price) { copy(price); }
TPrice(const real& num, const char* val = "", const real& exc = ZERO)
: TCurrency(num, val, exc, TRUE) { }
TPrice(const real& num, const char* val = "", const real& exc = ZERO, bool euro = FALSE)
: TCurrency(num, val, exc, euro, TRUE) { }
virtual ~TPrice() { }
};

View File

@ -12,6 +12,7 @@
#define EFF_CODVAL "CODVAL"
#define EFF_DATACAMBIO "DATACAMBIO"
#define EFF_CAMBIO "CAMBIO"
#define EFF_CONTROEURO "CONTROEURO"
#define EFF_CODABI "CODABI"
#define EFF_CODCAB "CODCAB"
#define EFF_ULTRATA "ULTRATA"

View File

@ -192,8 +192,9 @@ void TFile_text::set_gen_parm(TConfig& config, const TString& section)
_typefield = config.get_int("TYPEFIELD",section); // Numero del campo tipo (puo' essere -1)
_fixedlen = _fieldsep <= ' '; // && _recordsep.blank();
_typepos = config.get_int("TYPEPOS", section, -1, -1);
_typelen = config.get_int("TYPELEN", section, -1, -1);
CHECKD(_typelen <= 16, "Tipo record di lunghezza spropositata: ", _typelen);
_typelen = config.get_int("TYPELEN", section, -1, 0);
if (_typelen > 16)
NFCHECK("Tipo record di lunghezza spropositata: %d", _typelen);
}
void TFile_text::set_type_parm(TConfig& config, TString& section)
@ -505,18 +506,21 @@ int TFile_text::read(TRecord_text& rec)
TArray& a_tc = tr.tracciati_campo();
const int items = a_tc.items();
buffer.restart();
TString lavoro;
for (int i = 0; i < items; i++)
{
const char* lavoro = buffer.get();
if (lavoro == NULL)
lavoro = "";
buffer.get(i, lavoro);
rec.add(lavoro, i);
}
}
else
{
TString16 tipo = buffer.mid(_typepos, _typelen);
tipo.trim();
TString16 tipo;
if (_typepos >= 0 && _typelen > 0)
{
tipo = buffer.mid(_typepos, _typelen);
tipo.trim();
}
rec.set_type(tipo);//istanzio il tipo del record text
TTracciato_record* tr = t_rec(tipo);
if (tr != NULL)
@ -529,7 +533,7 @@ int TFile_text::read(TRecord_text& rec)
TTracciato_campo& tc = tr->get(i);
const int pos = tc.position();
const int len = tc.length();
const char* lavoro = buffer.mid(pos, len);
const TString& lavoro = buffer.mid(pos, len);
rec.add(lavoro, i);
}
}
@ -706,7 +710,7 @@ int TFile_text::_autosave(TRelation& rel, const TRecord_text& rec, TTracciato_re
if (field.name().not_empty())
{
if (field.file()==0)
field.set_file(rel.lfile().num());
field.set_file(rel.lfile().num());
valore = rec.row(i);
// formatta il campo del file di testo secondo le specifiche del campo su file isam
preformat_field(field,valore,rel,tr.type());
@ -787,16 +791,18 @@ const TString& TFile_text::get_field(const TRecord_text& rec, const char* name)
//Carica nel record_text il campo alla posizione <ncampo> con il valore <val> già formattato
void TFile_text::add_field(TRecord_text& rec, const int ncampo, const char* val)
{
TTracciato_record& tr = *t_rec(rec.type());
TTracciato_campo& tc = tr.get(ncampo);
TTracciato_record* tr = t_rec(rec.type());
CHECKS(tr, "Tracciato inesistente ", (const char*)rec.type());
TTracciato_campo& tc = tr->get(ncampo);
rec.add(val, ncampo);
}
//Carica nel record_text il campo <name> con il valore <val> già formattato
void TFile_text::add_field(TRecord_text& rec, const char* name, const char* val)
{
TTracciato_record& tr = *t_rec(rec.type());
int ncampo = tr.get_pos(name);
TTracciato_record* tr = t_rec(rec.type());
CHECKS(tr, "Tracciato inesistente ", (const char*)rec.type());
int ncampo = tr->get_pos(name);
CHECKS(ncampo >= 0, "Campo inesistente ", name);
rec.add(val, ncampo);
}
@ -909,11 +915,15 @@ TString& TFile_text::format_textfield(const TTracciato_campo& tc, TString& campo
campo.left_just(length, fillch);
}
else
{
if (length > 0)
{
if (tc.align() == 'R')
campo=campo.right(length);
else
campo.cut(length);
}
}
return campo;
}
@ -928,7 +938,8 @@ TString& TFile_text::format_field(const TTracciato_campo& tc, short lfile, TStri
const bool is_memo = record.type(tc.field().name()) == _memofld;
if (!fpicture(tc).blank())
{ TString tmp;
{
TString tmp;
tmp.picture(fpicture(tc), campo);
campo=tmp;
}
@ -940,11 +951,15 @@ TString& TFile_text::format_field(const TTracciato_campo& tc, short lfile, TStri
campo.left_just(length, ffiller(tc));
}
else
{
if (length > 0)
{
if (falign(tc) == 'R')
campo=campo.right(length);
else
campo.cut(length);
campo.cut(length);
}
}
return campo;
}

View File

@ -136,7 +136,6 @@ int findfld(const RecDes *recd, const char *s)
}
void __getfieldbuff(byte l, byte t, const char * recin, char *s)
{
CHECK(recin, "Can't read from a Null record");
@ -619,6 +618,7 @@ void set_autoload_new_files(
TBaseisamfile::TBaseisamfile(int logicnum)
{
CHECK(openrec, "This applications lies, it really do use files!");
_logicnum = logicnum;
_isam_handle = 0;
_curr_key = 0;
@ -3052,8 +3052,8 @@ void TRecfield::set(int from, int to)
if (nf == FIELDERR)
{
NFCHECK("File n. %d unknown field %s", _rec->num(), _name);
_p = _isam_string;
_len = 50;
_p = _rec->string();
_len = 0;
_dec = 0;
_type = _alfafld;
}

View File

@ -24,6 +24,7 @@
#define MOV_MESELIQ "MESELIQ"
#define MOV_CODVAL "CODVAL"
#define MOV_CAMBIO "CAMBIO"
#define MOV_CONTROEURO "CONTROEURO"
#define MOV_DATACAM "DATACAM"
#define MOV_STAMPATO "STAMPATO"
#define MOV_REGST "REGST"

View File

@ -220,7 +220,7 @@ bool os_test_disk_free_space(const char* path, unsigned long filesize)
if (path && *path && path[1] == ':')
{
const char letter = toupper(path[0]);
disk = 'A' - letter + 1;
disk = letter - 'A' + 1;
}
bool space_ok = FALSE;
struct _diskfree_t drive;
@ -238,14 +238,14 @@ unsigned long os_get_disk_size(const char* path)
if (path && *path && path[1] == ':')
{
const char letter = toupper(path[0]);
disk = 'A' - letter + 1;
disk = letter - 'A' + 1;
}
unsigned long bytes = 0;
struct _diskfree_t drive;
if (_dos_getdiskfree(disk, &drive) == 0)
{
unsigned long bytes = drive.total_clusters;
bytes = drive.total_clusters;
bytes *= drive.sectors_per_cluster;
bytes *= drive.bytes_per_sector;
}

View File

@ -29,6 +29,7 @@
#define PART_CODPAG "CODPAG"
#define PART_CODVAL "CODVAL"
#define PART_CAMBIO "CAMBIO"
#define PART_CONTROEURO "CONTROEURO"
#define PART_DATACAM "DATACAM"
#define PART_IMPORTOVAL "IMPORTOVAL"
#define PART_IMPTOTDOC "IMPTOTDOC"

View File

@ -242,7 +242,7 @@ void TPostman::load_filters()
if ((is_mod && app.compare(appmod, 2, TRUE) == 0) ||
app.compare(appmod, -1, TRUE) == 0)
{
TString80 key = row.get(); key.trim(); // Tipo di filtro
TString80 key = row.get(2); key.trim(); // Tipo di filtro
if (is_mod) key << "-MOD";
row = row.get(); row.trim(); // Espressione di filtro
if (key.not_empty() && row.not_empty() && row != "1")

View File

@ -686,15 +686,25 @@ int TRelation_application::delete_mode()
rec_to.put(fn, str);
}
}
}
}
cur.curr() = rec_from;
cur.read();
while (cur.file().status() == NOERR && cur.curr() <= rec_to)
{
sht.check(cur.pos());
++cur;
if (rec_from.empty() && rec_to.empty())
{
sht.check(-1);
}
else
{
const long totit = cur.items();
cur.freeze(TRUE);
cur.curr() = rec_from;
cur.read();
while (cur.pos() < totit && cur.curr() <= rec_to)
{
sht.check(cur.pos());
++cur;
}
cur.freeze(FALSE);
}
}
else
{

View File

@ -890,21 +890,17 @@ bool TRelation::exist(int logicnum) const
return lucky;
}
///////////////////////////////////////////////////////////
// TCursor
///////////////////////////////////////////////////////////
HIDDEN bool __evalcondition(const TRelation& r,TExpression* cond, const TArray & frefs)
HIDDEN bool __evalcondition(const TRelation& /* r */,TExpression* cond, const TArray& frefs)
{
// TFieldref f;
for (int i = cond->numvar() - 1; i >= 0; i--)
{
// const TFixed_string s(cond->varname(i));
// f = s;
// f = cond->varname(i);
cond->setvar(i, (const char *) (TRecfield &)frefs[i]);
const TRecfield* fr = (const TRecfield*)frefs.objptr(i);
if (fr)
cond->setvar(i, (const char*)*fr);
}
return cond->as_bool();
}
@ -954,6 +950,33 @@ void TCursor::close_index(FILE* f)
}
}
bool TCursor::has_simple_filter() const
{
bool yes = _filterfunction == NULL;
if (yes && _fexpr && _fexpr->numvar() > 0)
{
const RecDes& recd = *curr().rec_des(); // Descrizione del record della testata
const KeyDes& kd = recd.Ky[_nkey-1]; // Elenco dei campi della chiave del cursore
for (int i = _fexpr->numvar()-1; yes && i >= 0; i--)
{
const TString& vn = _fexpr->varname(i);
TFieldref f(vn, 0);
yes = f.file() == 0;
if (yes)
{
for (int k = kd.NkFields-1; k >= 0; k--)
{
const int nf = kd.FieldSeq[k] % MaxFields;
const RecFieldDes& rf = recd.Fd[nf];
yes = kd.FromCh[k] == 255 && f.name() == rf.Name;
if (yes) break;
}
}
}
}
return yes;
TRecnotype TCursor::buildcursor(TRecnotype rp)
{
FILE* _f = open_index(TRUE);
@ -979,19 +1002,26 @@ TRecnotype TCursor::buildcursor(TRecnotype rp)
const bool filtered = has_filter();
TRecnotype* page = new TRecnotype [CMAXELPAGE];
<<<<<<< relation.cpp
// TRecnotype pos = DB_index_recno(handle);
// pos = DB_index_recno(fhnd);
_pos = -1;
while (!DB_index_eof(handle))
const bool simple_filter = has_simple_filter();
while (TRUE)
{
const TRecnotype recno = DB_index_recno(handle);
if (DB_index_eof(fhnd)) break;
const char* s0 = DB_index_getkey(fhnd);
if (l && (strncmp(to(), s0, l) < 0)) break;
const TRecnotype recno = DB_index_recno(fhnd);
if (recno == oldrecno) break; // means that no more keys are available
oldrecno=recno;
const char* s0 = DB_index_getkey(handle);
if (l && (strncmp(to(), s0, l) < 0)) break;
if (pagecnt == CMAXELPAGE)
{
if (filtered)
if (filtered && !simple_filter)
pagecnt = filtercursor(pagecnt,page);
size_t written = fwrite(page, sizeof(TRecnotype), pagecnt, _f);
@ -1009,15 +1039,24 @@ TRecnotype TCursor::buildcursor(TRecnotype rp)
ap += pagecnt;
pagecnt = 0;
}
page[pagecnt++] = recno;
long rec = DB_index_next(handle);
if (rec < 0)
fatal_box("Can't read index n. %d - file n. %d",file().getkey(),file().num());
if (filtered && simple_filter)
{
if (simple_filtercursor(s0))
page[pagecnt++] = recno;
}
else
page[pagecnt++] = recno;
DB_index_next(fhnd);
int rt=get_error(-1);
if (rt != NOERR)
fatal_box("Can't read index n. %d - file n. %d",DB_tagget(file().filehnd()->fhnd),file().filehnd()->ln);
} // while
if (pagecnt)
{
if (filtered)
if (filtered && !simple_filter)
pagecnt = filtercursor(pagecnt, page);
size_t written = fwrite(page, sizeof(TRecnotype), pagecnt, _f);
CHECKS(written == pagecnt, "Error writing index ", (const char*)_indexname);
if (_pos < 0)
@ -1038,7 +1077,6 @@ TRecnotype TCursor::buildcursor(TRecnotype rp)
return ap;
}
int TCursor::filtercursor(int pagecnt, TRecnotype* page)
{
TLocalisamfile& fil = file();
@ -1066,6 +1104,64 @@ int TCursor::filtercursor(int pagecnt, TRecnotype* page)
return np;
}
bool TCursor::simple_filtercursor(const char* key) const
{
const RecDes& recd = *curr().rec_des(); // Descrizione del record della testata
const KeyDes& kd = recd.Ky[_nkey-1]; // Elenco dei campi della chiave del cursore
TFieldref f;
for (int i = _fexpr->numvar()-1; i >= 0; i--)
{
f = _fexpr->varname(i);
int offset = 0;
for (int k = 0; k < kd.NkFields; k++)
{
const int nf = kd.FieldSeq[k] % MaxFields;
const RecFieldDes& rf = recd.Fd[nf];
int len = rf.Len;
if (f.name() == rf.Name)
{
offset += f.from();
if (f.to() > f.from())
len = f.to() - f.from();
else
len -= f.from();
char* val = (char*)(key+offset);
char oldchar = '\0';
for (int l = len; l >= 0; l--) // rtrim
{
if (l == 0 || val[l-1] != ' ')
{
oldchar = val[l];
val[l] = '\0';
break;
}
}
switch (rf.TypeF)
{
case _boolfld:
_fexpr->setvar(i, strchr("1STXY", *val)!=NULL ? "X" : " ");
break;
case _intfld:
case _longfld:
{
for (const char* v = val; *v == ' ' || *v == '0'; v++);
_fexpr->setvar(i, v);
}
break;
default:
_fexpr->setvar(i, val);
break;
}
if (oldchar)
val[l] = oldchar;
break;
}
offset += len;
}
}
return _fexpr->as_bool();
}
bool TCursor::ok() const
{
@ -1208,9 +1304,10 @@ void TCursor::filter(
if (vn[0] != '#')
{
TFieldref f(vn, 0);
_frefs.add(new TRecfield(_if->curr(f.file()), f.name(), f.from(), f.to()));
_frefs.add(new TRecfield(_if->curr(f.file()), f.name(), f.from(), f.to()), i);
}
else
NFCHECK("Variabile strana %s", (const char*)vn);
}
}
}
@ -1797,16 +1894,20 @@ TFieldref::TFieldref(const TString& s, short defid)
{
operator=(s);
if (_fileid == 0) _fileid = defid;
}
void TFieldref::copy(const TFieldref& f)
{
_fileid = f._fileid;
_id = f._id;
_name = f._name;
_from = f._from;
_to = f._to;
}
TObject* TFieldref::dup() const
{
TFieldref* f = new TFieldref();
f->_fileid = _fileid;
f->_id = _id;
f->_name = _name;
f->_from = _from;
f->_to = _to;
TFieldref* f = new TFieldref(*this);
return f;
}

View File

@ -273,6 +273,8 @@ protected:
virtual TRecnotype buildcursor(TRecnotype rp);
// @cmember Permette di creare una pagina di cursori
virtual int filtercursor(int pagecnt, TRecnotype* page);
// Controlla se una chiave rispetta il filtro
bool simple_filtercursor(const char* key) const;
// @cmember Posiziona il cursore in modo che il record corrente corrisponda alla
// posizione dell'indice temporaneo
TRecnotype readrec();
@ -401,12 +403,13 @@ public:
// @cmember Controlla se esiste un filtro sul cursor
bool has_filter() const
{ return _filter.not_empty() || _filterfunction; }
bool has_simple_filter() const;
// @cmember Salva la posizione attuale di tutti i file del cursore
void save_status()
{ _if->save_status(); }
// @cmember Ripristina la posizione attuale di tutti i file del cursore
void restore_status ()
void restore_status()
{ _if->restore_status(); }
// @cmember Costruttore
@ -497,6 +500,8 @@ protected:
virtual void print_on(ostream& out) const;
// @cmember Duplica l'oggetto TFieldref
virtual TObject* dup() const;
void copy(const TFieldref& fr);
// @access Public Member
public:
@ -504,9 +509,13 @@ public:
TFieldref();
// @cmember Costruttore
TFieldref(const TString&, short defid);
// @cmember Costruttore
TFieldref(const TFieldref& f) { copy(f); }
// @cmember Operatore di assegnamento
TFieldref& operator =(const TString& s);
// @cmember Operatore di assegnamento
TFieldref& operator =(const TFieldref& f) { copy(f); return *this; }
// @cmember Controlla la validita' dell'oggetto (TRUE se il numero del file e' valido)
virtual bool ok() const

View File

@ -965,7 +965,7 @@ TSheet::TSheet(short x, short y, short dx, short dy,
if (!(buttons & 0x10)) add_button(DLG_SELECT, "~Selezione", K_ENTER);
if (check_enabled())
{
add_button(DLG_USER, "Tutti", 0);
add_button(DLG_USER, "~Tutti", 0);
set_handler(DLG_USER, tutti_handler);
}
@ -1109,6 +1109,7 @@ bool TSheet::on_key(KEY key)
stop_run(key);
break;
case K_CTRL+'E':
case K_DEL:
if (items() && id2pos(DLG_DELREC) >= 0)
stop_run(K_DEL);
break;
@ -1120,6 +1121,10 @@ bool TSheet::on_key(KEY key)
if (id2pos(DLG_LINK) >= 0)
stop_run(key);
break;
case K_CTRL+'S':
if (id2pos(DLG_SELECT) >= 0)
stop_run(K_ENTER);
break;
default:
break;
}
@ -1131,6 +1136,9 @@ bool TSheet::on_key(KEY key)
// case K_SPACE:
// check(selected(), !checked(selected()));
// break;
case K_CTRL+'T':
tutti_handler(field(DLG_USER), K_SPACE);
break;
case K_F7:
uncheck(-1);
break;

View File

@ -343,60 +343,61 @@ const char *esc(
const char *s1 = s;
char *s2 = __tmp_string;
int base;
while (*s1)
{
if (*s1 == '\\')
{
s1++;
switch (tolower(*s1))
{
case 'b' : *s2++ = '\b'; break;
case 'e' : *s2++ = '\033'; break;
case 'f' : *s2++ = '\f'; break;
case 'n' : *s2++ = '\n'; break;
case 'r' : *s2++ = '\r'; break;
case 't' : *s2++ = '\t'; break;
default :
{
if (isdigit(*s1))
{
if (*s1 == '0')
{
s1++;
if (tolower(*s1) == 'x')
{
s1++;
base = 16;
}
else base = 8;
}
else base = 10;
*s2 = 0;
char c = tolower(*s1);
while (isdigit(c) || (base == 16 && c >= 'a' && c <= 'f'))
{
*s2 *= base;
if (isdigit(*s1)) *s2 += (*s1 - 48);
else *s2 += (*s1 - 'a' + 10) & 0x0F;
s1++;
c = tolower(*s1);
}
s2++; s1--;
}
else *s2++ = *s1;
}
}
}
else
if (*s1 == '^')
{
s1++;
*s2++ = (tolower(*s1) - 'a' + 1);
}
else *s2++ = *s1 ;
s1++;
}
if (s1)
while (*s1)
{
if (*s1 == '\\')
{
s1++;
switch (tolower(*s1))
{
case 'b' : *s2++ = '\b'; break;
case 'e' : *s2++ = '\033'; break;
case 'f' : *s2++ = '\f'; break;
case 'n' : *s2++ = '\n'; break;
case 'r' : *s2++ = '\r'; break;
case 't' : *s2++ = '\t'; break;
default :
{
if (isdigit(*s1))
{
if (*s1 == '0')
{
s1++;
if (tolower(*s1) == 'x')
{
s1++;
base = 16;
}
else base = 8;
}
else base = 10;
*s2 = 0;
char c = tolower(*s1);
while (isdigit(c) || (base == 16 && c >= 'a' && c <= 'f'))
{
*s2 *= base;
if (isdigit(*s1)) *s2 += (*s1 - 48);
else *s2 += (*s1 - 'a' + 10) & 0x0F;
s1++;
c = tolower(*s1);
}
s2++; s1--;
}
else *s2++ = *s1;
}
}
}
else
if (*s1 == '^')
{
s1++;
*s2++ = (tolower(*s1) - 'a' + 1);
}
else *s2++ = *s1 ;
s1++;
}
*s2 = '\0';
return(__tmp_string);
}

View File

@ -3,6 +3,7 @@
#define ANAMAG_CODART "CODART"
#define ANAMAG_DESCR "DESCR"
#define ANAMAG_DESCRAGG "DESCRAGG"
#define ANAMAG_GRMERC "GRMERC"
#define ANAMAG_RAGGFIS "RAGGFIS"
#define ANAMAG_CLASSEFIS "CLASSEFIS"
@ -46,6 +47,16 @@
#define ANAMAG_VALSTATUN "VALSTATUN"
#define ANAMAG_PROV "PROV"
#define ANAMAG_PAESE "PAESE"
#define ANAMAG_USER1 "USER1"
#define ANAMAG_USER2 "USER2"
#define ANAMAG_USER3 "USER3"
#define ANAMAG_USER4 "USER4"
#define ANAMAG_USER5 "USER5"
#define ANAMAG_USER6 "USER6"
#define ANAMAG_USER7 "USER7"
#define ANAMAG_USER8 "USER8"
#define ANAMAG_USER9 "USER9"
#define ANAMAG_USER10 "USER10"
#define ANAMAG_NUMREG1 "NUMREG1"
#define ANAMAG_NUMREG2 "NUMREG2"

View File

@ -33,8 +33,11 @@
#define F_DIBAEXPLOSION 140
#define F_DEFAULTMAG 141
#define F_DEFAULTDEP 142
#define F_LIV_ESPL 143
#define F_LIV_ESPL 143
#define F_COSTO_ESPL 144
#define F_DESCDEFMAG 145
#define F_DESCDEFDEP 146
#define H_DEFAULTMAG 147
#define G_SGNVAL 20
#define G_SGNQTA 21

View File

@ -89,7 +89,7 @@ END
LISTBOX F_TIPOPR 16
BEGIN
PROMPT 2 9 "Tipo prezzo "
PROMPT 2 8 "Tipo prezzo "
FIELD S6
ITEM "P|Prezzo"
ITEM "C|Costo"
@ -99,14 +99,14 @@ END
BOOL F_MOVQTA
BEGIN
FIELD B0
PROMPT 2 11 "Movimenta solo quantita'"
PROMPT 2 10 "Movimenta solo quantita'"
MESSAGE TRUE RESET,F_MOVVAL
END
BOOL F_MOVVAL
BEGIN
FIELD B1
PROMPT 42 11 "Movimenta solo valori"
PROMPT 42 10 "Movimenta solo valori"
MESSAGE TRUE RESET,F_MOVQTA
END
@ -118,7 +118,7 @@ END
STRING F_CAUCOLL 5
BEGIN
PROMPT 2 15 "Causale collegata "
PROMPT 2 13 "Causale collegata "
FIELD S9
USE %CAU SELECT S9==""
FLAGS "U"
@ -134,7 +134,7 @@ END
STRING F_DCAUCOLL 50 40
BEGIN
PROMPT 32 15 ""
PROMPT 32 13 ""
USE %CAU KEY 2 SELECT S9==""
FLAGS "U"
INPUT S0 F_DCAUCOLL
@ -150,20 +150,20 @@ END
BOOL F_DIBAEXPLOSION
BEGIN
FIELD B3
PROMPT 2 17 "Esplodi mediante Distinta Base"
PROMPT 2 15 "Esplodi mediante Distinta Base"
MESSAGE TRUE ENABLE,F_COSTO_ESPL|ENABLE,F_LIV_ESPL
MESSAGE CLEAR,F_COSTO_ESPL|CLEAR,F_LIV_ESPL
END
NUMBER F_LIV_ESPL 1
BEGIN
PROMPT 40 17 "Livello "
PROMPT 40 15 "Livello "
FIELD I0
END
LISTBOX F_COSTO_ESPL 14
BEGIN
PROMPT 52 17 "Costo da utilizzare "
PROMPT 28 16 "Costo da utilizzare "
FIELD S11
ITEM " |Nessuno"
ITEM "U|Ultimo costo"
@ -172,6 +172,7 @@ END
STRING F_DEFAULTMAG 3
BEGIN
FLAGS "U"
PROMPT 2 18 "Magazzino di default "
FIELD S10[1,3]
USE MAG SELECT CODTAB[4,5]==""
@ -179,23 +180,48 @@ BEGIN
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_DEFAULTMAG CODTAB
MESSAGE EMPTY DISABLE,F_DEFAULTDEP
MESSAGE ENABLE,F_DEFAULTDEP
OUTPUT F_DESCDEFMAG S0
OUTPUT H_DEFAULTMAG B0
MESSAGE EMPTY HIDE,F_DEFAULTDEP |HIDE,F_DESCDEFDEP
MESSAGE SHOW,F_DEFAULTDEP|SHOW,F_DESCDEFDEP
CHECKTYPE NORMAL
END
STRING F_DESCDEFMAG 70 45
BEGIN
FLAGS "D"
PROMPT 32 18 ""
END
BOOL H_DEFAULTMAG
BEGIN
FLAGS "HG"
PROMPT 2 18 "divisione in dep"
MESSAGE FALSE DISABLE,F_DEFAULTDEP
MESSAGE TRUE ENABLE,F_DEFAULTDEP
END
STRING F_DEFAULTDEP 2
BEGIN
FLAGS "U"
PROMPT 2 19 "Deposito di default "
FIELD S10[4,5]
USE MAG SELECT CODTAB[4,5]!=""
INPUT CODTAB[1,3] F_DEFAULTMAG
INPUT CODTAB[1,3] F_DEFAULTMAG SELECT
INPUT CODTAB[4,5] F_DEFAULTDEP
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_DEFAULTMAG CODTAB[1,3]
OUTPUT F_DEFAULTDEP CODTAB[4,5]
OUTPUT F_DESCDEFDEP S0
CHECKTYPE NORMAL
END
STRING F_DESCDEFDEP 70 45
BEGIN
FLAGS "D"
PROMPT 32 19 ""
END
ENDPAGE
PAGE "Movimentazione campi" 11 60 14

View File

@ -1,3 +1,3 @@
111
0
$rmovmag|136|150|95|0|Righe movimenti di magazzino|||
$rmovmag|40290|42456|105|0|Righe movimenti di magazzino|||

View File

@ -1,5 +1,5 @@
111
11
13
NUMREG|3|7|0|Numero di registrazione
NRIG|2|4|0|Numero di riga
CODMAG|1|5|0|Codice magazzino e deposito
@ -9,6 +9,8 @@ UM|1|2|0|Unita' di misura
QUANT|4|15|5|Quantita'
PREZZO|4|18|3|Prezzo
CAUS|1|6|0|Causale di magazzino della riga
IMPIANTO|1|5|0|Codice Impianto (MRP)
LINEA|1|5|0|Codice linea (MRP)
AUTOMATICA|1|1|0|Flag di riga automatica
ESPLOSA|8|1|0|Flag di riga esplosa (da DiBa)
2

View File

@ -17,9 +17,9 @@
//
class TMask_movmag : public TMask
{
TRecord_cache _cache_causali;
TArticolo_giacenza _curr_art;
static TRecord_cache cache_causali;
static TArticolo_giacenza curr_art ;
TEsercizi_contabili esercizi;
TMov_mag * _mov_mag;
TCodgiac_livelli * livelli_giac; // oggetto gestione livelli di giacenza
TString _price_codart;
@ -526,11 +526,10 @@ bool TMask_movmag::handle_codcaus(TMask_field &fld, KEY k)
bool TMask_movmag::handle_datacomp(TMask_field &fld, KEY k)
{
if (k == K_TAB) // && fld.focusdirty())
{
TEsercizi_contabili esc;
int codes= esc.date2esc(TDate(fld.get()));
if (codes > 0)
{
{
TMask_movmag& m = (TMask_movmag&) fld.mask();
const int codes=m.esercizi.date2esc(TDate(fld.get()));
if (codes>0) {
fld.mask().field(F_ANNOES).set(codes);
fld.mask().field(H_ANNOES).set(codes);
}

View File

@ -424,7 +424,7 @@ protected:
void setprint_permagazzini();
void setprint_perarticoli();
void setprint_perarticoli_all();
bool calcola_giacenze();
bool calcola_giacenze(const bool b = TRUE);
public:
TStampa_inventario() {}
@ -460,11 +460,11 @@ bool TStampa_inventario::destroy()
return TRUE;
}
bool TStampa_inventario::calcola_giacenze()
bool TStampa_inventario::calcola_giacenze(const bool b)
{
//Scorre l'anagrafica di magazzino e calcola per ognuno la giacenza alla data indicata
//Memorizzando i records in un file temporaneo che avrà lo stesso tracciato di LF_MAG
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", TRUE, TRUE);
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", TRUE, b);
TRelation ana_rel(LF_ANAMAG);
TCursor ana_cur(&ana_rel);
@ -491,13 +491,16 @@ bool TStampa_inventario::calcola_giacenze()
// Se il file è ok lo sostituisce all'interno della relazione del form
const bool rt = temp_mag->good();
if (rt)
_form->relation()->replace(temp_mag);
else
if (!rt)
{
error_box("Errore %d in creazione file temporaneo per saldi di magazzino alla data indicata.", temp_mag->status());
delete temp_mag;
}
else
if (b) // Non sostituire in caso di stampa tutti gli articoli
_form->relation()->replace(temp_mag);
else
delete temp_mag; // in caso di stampa tutti gli articoli, non cancella fisicamente il file; per riaprirlo poi
return rt;
}
@ -854,8 +857,16 @@ void TStampa_inventario::setprint_perarticoli_all()
joinexp << "ANNOES==" << _mask->get(F_ANNOES) << "|CODART==CODART";
TSortedfile *mag;
TRelation *rel = NULL;
if (_mask->get_bool(F_ALLADATA))
{
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", FALSE, TRUE); // Non crearlo, auto cancella il file
rel = new TRelation(temp_mag);
}
// !?!?!! ATTENZIONE : Modifica temporanea
mag= new TSortedfile(LF_MAG,NULL,sortexp,"",1);
mag= new TSortedfile(LF_MAG,rel,sortexp,"",1);
// il filtro viene qui settato DOPO la creazione del Sortedfile a causa di una bug
// sulla libreria nei TSorted_file / TCursor
mag->cursor().setfilter(filter);
@ -884,19 +895,30 @@ void TStampa_inventario::main_loop()
if (*_mask->get(F_FILTRO)=='T') // tutti gli articoli
{
_form = new TForm_inventario("mg4200aa", "");
if (b && !calcola_giacenze(FALSE))
{
delete _form;
continue;
}
setprint_perarticoli_all();
}
else
{
_form = new TForm_inventario("mg4200a", "");
if (b && !calcola_giacenze())
{
delete _form;
continue;
}
setprint_perarticoli();
}
} else {
_form = new TForm_inventario("mg4200b", "");
if (b && !calcola_giacenze())
{
delete _form;
continue;
}
setprint_permagazzini();
}
_form->set_parametri(_mask->get(F_CATVENLISTINO),

View File

@ -425,7 +425,6 @@ typedef enum
class TCausale_magazzino : public TRectype
{
static TDecoder _ragg_fisc;
public:
const TString & codice() const {return get("CODTAB");}
@ -446,6 +445,7 @@ public:
bool has_default_dep() const {return *default_dep() > ' '; }
bool is_fiscale();
TCausale_magazzino(const char * codice);
TCausale_magazzino(const TRectype &r);
virtual ~TCausale_magazzino() {}
};
@ -455,6 +455,7 @@ class TLine_movmag;
// ( un movimento (testata+righe) == un oggetto TMov_mag )
class TMov_mag : public TMultiple_rectype
{
static TCausale_magazzino *_causmag;
//
TString16 _annoes; // codice esercizio del movimento
TDate _datacomp; // data di competenza
@ -463,8 +464,6 @@ class TMov_mag : public TMultiple_rectype
TAssoc_array lines_to_add;
TAssoc_array lines_to_subtract;
static TRecord_cache _cache_causali;
protected:
virtual void load_rows_file(int logicnum);
virtual void set_body_key(TRectype & rowrec);

View File

@ -231,8 +231,8 @@ bool TArticolo::lock_and_prompt(const char * cod)
case _iskeynotfound:
mess.cut(0);
mess << "Il record di anagrafica\ndell'articolo ''"<< cod << "'' non esiste.";
error_box(mess);
return FALSE;
//error_box(mess);
//return FALSE;
break;
default:
mess.cut(0);
@ -581,6 +581,20 @@ bool TArticolo_giacenza::riporta_saldi(const char * oldes, const char* newes, co
rec.zero(MAG_SCARTI);
}
// Per non perdere le modifiche in memoria, al fine di avere i saldi riportati correttamente
// visto che non vengono salvati e poi riletti da disco, li si salvano nel TRecord_array
// dell'esercizio newes
if (!save_to_disk)
{
TRecord_array copia(rec_arr);
TRecord_array& nuovo = TArticolo_giacenza::mag(codes);
if (copia.rows() > 0)
nuovo = copia;
else
azzera_saldi(codes, FALSE);
}
// Scrive il pastrocchio (eventualmente sovrascrive)
return save_to_disk ? (rec_arr.write(TRUE) == NOERR) : TRUE;
}
@ -1178,16 +1192,10 @@ void TArticolo_giacenza_data::al(const TDate& data, const char* codmag, const ch
remove_body(LF_MAG); // Azzero la cache dei magazzini
TRecord_array& rmag = mag(annoes);
for (int i = find_mag(annoes, codmag, livello); i > 0;
i = find_mag(annoes, codmag, livello, i))
{
const TRectype& rec = rmag.row(i);
if (reset_giac)
azzera_saldi(annoes, FALSE);
else
riporta_saldi(predes, annoes, tipo, catven, codlis, FALSE);
}
if (reset_giac)
azzera_saldi(annoes, FALSE);
else
riporta_saldi(predes, annoes, tipo, catven, codlis, FALSE);
TRelation rel(LF_RMOVMAG); rel.add(LF_MOVMAG, "NUMREG==NUMREG");
TRectype filter(LF_RMOVMAG);
@ -1212,6 +1220,7 @@ void TArticolo_giacenza_data::al(const TDate& data, const char* codmag, const ch
rel.lfile(LF_MOVMAG).set_curr(p_movmag);
TMov_mag& movmag = *p_movmag;
const TRectype& rmovmag = rel.curr();
TRecord_array& rmag = mag(annoes);
for (cur = 0; cur.pos() < items; ++cur)
{
@ -1221,7 +1230,7 @@ void TArticolo_giacenza_data::al(const TDate& data, const char* codmag, const ch
{
const TString16 codmag = rmovmag.get(RMOVMAG_CODMAG);
const TString16 livello = rmovmag.get(RMOVMAG_LIVGIAC);
i = find_mag(annoes, codmag, livello);
const int i = find_mag(annoes, codmag, livello);
if (i >= 0)
{
TRectype& rec = (TRectype&)rmag.row(i);
@ -1314,8 +1323,6 @@ int TCausale_magazzino::sgn(TTipo_saldomag tiposaldo) const
return segno;
}
TDecoder TCausale_magazzino::_ragg_fisc("%RFC", "S6");
bool TCausale_magazzino::is_fiscale()
{
bool rt = FALSE;
@ -1325,7 +1332,7 @@ bool TCausale_magazzino::is_fiscale()
rt = tm == 'S' || tm == 'C'; // La causale deve essere Carico o Scarico...
if (rt)
{
const TRectype& rfc = ragg_fisc_cache.get(raggfisc());
const TRectype& rfc = cache().get("RFC",raggfisc());
const char ragg = rfc.get_char("S6");
rt &= (ragg == 'S' || ragg == 'C'); // Ed il raggruppamento deve essere Carico o Scarico
}
@ -1337,16 +1344,15 @@ bool TCausale_magazzino::is_fiscale()
TCausale_magazzino::TCausale_magazzino(const char * codice):
TRectype(LF_TABCOM)
{
/*
TTable f("%CAU");
settab("CAU");
put("CODTAB", codice);
if (TRectype::read(f) != NOERR)
zero();
*/
this->TRectype::operator =(cache().get("%CAU", codice));
}
TCausale_magazzino::TCausale_magazzino(const TRectype &r):
TRectype(r)
{
CHECK(r.num() == LF_TABCOM, "Tipo record errato sulla causale di magazzino");
}
const real CENTO=real(100.0);
bool TCondizione_vendita::ricerca(const char * codice, const real & qta)

View File

@ -68,7 +68,7 @@ int TLine_movmag::operator==(TLine_movmag &l)
// ********************************
// TMov_mag
TRecord_cache TMov_mag::_cache_causali("%CAU");
TCausale_magazzino *TMov_mag::_causmag = NULL;
TMov_mag::TMov_mag() :
TMultiple_rectype(LF_MOVMAG),
@ -85,7 +85,11 @@ const TCausale_magazzino& TMov_mag::causale(const char* cod) const
{
if (cod == NULL || *cod == '\0')
cod = get(MOVMAG_CODCAUS);
return (TCausale_magazzino&)_cache_causali.get(cod);
if (!_causmag)
_causmag = new TCausale_magazzino(cod);
else
*_causmag = cache().get("%CAU",cod);
return *_causmag;
}
void TMov_mag::zero(char c)
@ -201,50 +205,53 @@ bool TMov_mag::add_explrows() const
const TCausale_magazzino& cau = causale(codcaus);
if (cau.esplodente() && !b[r].get_bool(RMOVMAG_ESPLOSA))
{
// devono esserci n righe automatiche esplose
//if (!b.exist(r + 1) || !b[r + 1].get_bool(RMOVMAG_ESPLOSA))
const TString codart = row.get(RMOVMAG_CODART);
const char tipo_costo = cau.get("S11")[0];
const int livello = cau.get_int("I0");
const TString4 umroot(row.get(RMOVMAG_UM));
// mancano le righe, le inserisco
boom.destroy();
bool ok=distinta.set_root(row);
if (ok)
{
// mancano le righe, le inserisco
const char tipo_costo = cau.get("S11")[0];
const int livello = cau.get_int("I0");
const TString4 umroot(row.get(RMOVMAG_UM));
// mancano le righe, le inserisco
boom.destroy();
if (distinta.set_root(row.get(RMOVMAG_CODART),umroot,row.get_real(RMOVMAG_QUANT)))
distinta.explode(boom, TRUE, RAGGR_EXP_NONE, livello, "A");
TString codmag(codmag_rauto(r));
real prezzo(prezzo_rauto(r));
TRectype * linea_auto;
for (int newrow=0; newrow < boom.items() ; newrow++)
{
distinta.explode(boom, TRUE, RAGGR_EXP_NONE, livello, "A");
TString codmag(codmag_rauto(r));
real prezzo(prezzo_rauto(r));
TRectype * linea_auto;
for (int newrow=0; newrow < boom.items() ; newrow++)
{
TRiga_esplosione & riga_esp=(TRiga_esplosione & )(boom[newrow]);
linea_auto = new TRectype(row);
linea_auto->put(RMOVMAG_CODART, riga_esp.articolo());
linea_auto->put(RMOVMAG_UM, riga_esp.um());
linea_auto->put(RMOVMAG_QUANT, riga_esp.val());
if (codmag.not_empty())
linea_auto->put(RMOVMAG_CODMAG, codmag);
//if (!prezzo.is_zero())
articolo.read(riga_esp.articolo());
if (tipo_costo == 'U')
prezzo = articolo.get_real(ANAMAG_ULTCOS1);
else
if (tipo_costo == 'S')
prezzo = articolo.get_real(ANAMAG_COSTSTD);
linea_auto->put(RMOVMAG_PREZZO, prezzo);
linea_auto->put(RMOVMAG_NRIG, r+1+newrow);
linea_auto->put(RMOVMAG_ESPLOSA, TRUE);
//linea_auto->put(RMOVMAG_TIPORIGA, (char) riga_automatica);
//linea_auto->put(RMOVMAG_CODCAUS, codcaus);
b.insert_row(linea_auto);
added=TRUE;
}
TRiga_esplosione & riga_esp=(TRiga_esplosione & )(boom[newrow]);
linea_auto = new TRectype(row);
linea_auto->put(RMOVMAG_CODART, riga_esp.articolo());
linea_auto->put(RMOVMAG_UM, riga_esp.um());
linea_auto->put(RMOVMAG_QUANT, riga_esp.val());
if (codmag.not_empty())
linea_auto->put(RMOVMAG_CODMAG, codmag);
//if (!prezzo.is_zero())
articolo.read(riga_esp.articolo());
if (tipo_costo == 'U')
prezzo = articolo.get_real(ANAMAG_ULTCOS1);
else
if (tipo_costo == 'S')
prezzo = articolo.get_real(ANAMAG_COSTSTD);
linea_auto->put(RMOVMAG_PREZZO, prezzo);
linea_auto->put(RMOVMAG_NRIG, r+1+newrow);
linea_auto->put(RMOVMAG_ESPLOSA, TRUE);
//linea_auto->put(RMOVMAG_TIPORIGA, (char) riga_automatica);
//linea_auto->put(RMOVMAG_CODCAUS, codcaus);
b.insert_row(linea_auto);
added=TRUE;
}
}
}
// ora ci sono, mi basta eliminare la riga "padre"
if (boom.items() > 0)
if (boom.items() > 0 )
{
if (boom.items() == 1 && codart == ((TRiga_esplosione &)boom[0]).articolo())
error_box("Movimento di magazzino %ld:\ndistinta %s ciclica", get_long(MOVMAG_NUMREG),(const char *)codart);
b.destroy_row(r,TRUE);
}
else
error_box("Movimento di magazzino %ld:\nimpossibile esplodere l'articolo %s", get_long(MOVMAG_NUMREG),(const char *)codart);
}
} // ciclo righe
return added;

View File

@ -11,6 +11,8 @@
#define RMOVMAG_PREZZO "PREZZO"
#define RMOVMAG_CODCAUS "CAUS"
#define RMOVMAG_TIPORIGA "AUTOMATICA"
#define RMOVMAG_ESPLOSA "ESPLOSA"
#define RMOVMAG_ESPLOSA "ESPLOSA"
#define RMOVMAG_IMPIANTO "IMPIANTO"
#define RMOVMAG_LINEA "LINEA"
#endif

View File

@ -9,8 +9,10 @@ int main(int argc, char** argv)
{
case 0: // MRP
mr2100(argc,argv); break;
case 1: // planning
case 1: // generic planning
mr2200(argc,argv); break;
case 2: // generic planning
mr2300(argc,argv); break;
}
exit(0);
return 0;

View File

@ -3,6 +3,7 @@
int mr2100(int argc, char* argv[]);
int mr2200(int argc, char* argv[]);
int mr2300(int argc, char* argv[]);
#endif // __MR2_H

View File

@ -15,20 +15,23 @@ MENU MENU_BAR(1)
SUBMENU MENU_FILE "~File"
image USER_BMP_CHECK "check.bmp"
image USER_BMP_ARROWUP "darrowu.bmp"
image USER_BMP_ARROWDOWN "darrowd.bmp"
image USER_BMP_ARROWLEFT "darrowl.bmp"
image USER_BMP_ARROWRIGHT "darrowr.bmp"
image USER_BMP_ARROWUP_RED "darrowu2.bmp"
image USER_BMP_ARROWDOWN_RED "darrowd2.bmp"
image USER_BMP_ARROWLEFT_RED "darrowl2.bmp"
image USER_BMP_ARROWRIGHT_RED "darrowr2.bmp"
image USER_BMP_ARROWUP "..\include\darrowu.bmp"
image USER_BMP_ARROWDOWN "..\include\darrowd.bmp"
image USER_BMP_ARROWLEFT "..\include\darrowl.bmp"
image USER_BMP_ARROWRIGHT "..\include\darrowr.bmp"
image USER_BMP_ARROWUP_RED "..\include\darrowu2.bmp"
image USER_BMP_ARROWDOWN_RED "..\include\darrowd2.bmp"
image USER_BMP_ARROWLEFT_RED "..\include\darrowl2.bmp"
image USER_BMP_ARROWRIGHT_RED "..\include\darrowr2.bmp"
image USER_BMP_ARROWUPLEFT "darrowul.bmp"
image USER_BMP_ARROWDOWNLEFT "darrowdl.bmp"
image USER_BMP_ARROWUPRIGHT "darrowur.bmp"
image USER_BMP_ARROWDOWNRIGHT "darrowdr.bmp"
image USER_BMP_ARROWUPLEFT "..\include\darrowul.bmp"
image USER_BMP_ARROWDOWNLEFT "..\include\darrowdl.bmp"
image USER_BMP_ARROWUPRIGHT "..\include\darrowur.bmp"
image USER_BMP_ARROWDOWNRIGHT "..\include\darrowdr.bmp"
image USER_BMP_SELECT_ORDP "selordp.bmp"
image USER_BMP_SELECT_ORDF "selordf.bmp"
image USER_BMP_ORDINI_INPUT "ord_in.bmp"
image USER_BMP_ORDINI_OUTPUT "ord_out.bmp"

View File

@ -29,6 +29,18 @@ const real& TMRP_record::add_sched_rec(const real & val)
return _sched_receipts;
}
const real& TMRP_record::add_planned_ord(const real & val)
{
_planned_orders += val;
return _planned_orders;
}
const real& TMRP_record::add_proposed_ord(const real & val)
{
_proposed_orders += val;
return _proposed_orders;
}
const real& TMRP_record::add_net_req(const real & val)
{
_net_requirement += val;
@ -47,9 +59,9 @@ TMRP_record & TMRP_record::operator=(const TMRP_record & a)
_gross_requirement=a._gross_requirement;
_on_hand=a._on_hand;
_sched_receipts=a._sched_receipts;
_released_receipts=a._released_receipts;
_net_requirement=a._net_requirement;
_planned_orders=a._planned_orders;
_proposed_orders=a._proposed_orders;
return *this;
}
@ -141,7 +153,7 @@ TMRP_line & TMRP_line::operator=(const TMRP_line & a)
TMRP_record& TMRP_line::record(int i) const
{
TMRP_record* rec = (TMRP_record*)_req_per_bucket.objptr(i);
CHECKD(rec != NULL, "Invalid MRP record ", i);
CHECKD(rec, "Invalid MRP record ", i);
return *rec;
}
@ -176,9 +188,6 @@ real TMRP_line::sizeup_net_requirement(int i, const real &val)
real lm,li;
lotti_riordino(lm,li);
int cazzo;
if (!lm.is_zero() && !li.is_zero() )
cazzo=1;
if (req > lm) // Se la richiesta supera il lotto minimo
{
if (li > ZERO)
@ -203,6 +212,13 @@ const real& TMRP_line::add_gross_req(const TMRP_time& t, const real& val)
const real& TMRP_line::add_sched_rec(const TMRP_time& t, const real &val)
{ return record(t).add_sched_rec(val);}
const real& TMRP_line::add_planned_ord(const TMRP_time& t, const real &val)
{ return record(t).add_planned_ord(val);}
const real& TMRP_line::add_proposed_ord(int i, const real &val)
{
return record(i).add_proposed_ord(val);
}
const real & TMRP_line::set_net_req(int i, const real &val)
{
if (val>ZERO)
@ -214,32 +230,38 @@ const real & TMRP_line::set_net_req(int i, const real &val)
const real & TMRP_line::add_net_req(const TMRP_time &t, const real &val)
{ return record(t).add_net_req(val); }
const real & TMRP_line::add_net_req(int i, const real &val)
{ return record(i).add_net_req(val); }
const real & TMRP_line::set_on_hand(int i, const real &val)
{ return record(i).set_on_hand(val);}
const real & TMRP_line::set_on_hand(const TMRP_time &t, const real &val)
{ return record(t).set_on_hand(val);}
const TMRP_time& TMRP_line::lead_time(int i, TMRP_time& t) const
const TMRP_time& TMRP_line::lead_time(int i, TMRP_time& t, bool anticipate) const
{
t = record(i).time();
TLocalisamfile dist(LF_DIST);
dist.put("CODDIST", codice());
if (dist.read() == NOERR)
if (anticipate)
{
int days = dist.get_int("LEADTIME");
long hours = dist.get_long("LEADHOURS");
t.sub_time(days, hours);
}
else
{
TLocalisamfile anamag(LF_ANAMAG);
anamag.put(ANAMAG_CODART, codice());
if (anamag.read() == NOERR)
TLocalisamfile dist(LF_DIST);
dist.put("CODDIST", codice());
if (dist.read() == NOERR)
{
int days = anamag.get_int("LEADTIME");
t.sub_time(days);
int days = dist.get_int("LEADTIME");
long hours = dist.get_long("LEADHOURS");
t.sub_time(days, hours);
}
else
{
TLocalisamfile anamag(LF_ANAMAG);
anamag.put(ANAMAG_CODART, codice());
if (anamag.read() == NOERR)
{
int days = anamag.get_int("LEADTIME");
t.sub_time(days);
}
}
}
return t;
@ -273,10 +295,12 @@ real &TMRP_line::scorta_minima(real &g, const TDate &d) const
TMRP_line::TMRP_line(const char* art, const char* giac,
const char* mag, const char* imp,
const char* lin, long codcli)
const char* mag, const char* magc,
const char* imp, const char* lin,
long codcli)
: _codart(art), _livgiac(giac),
_codmag(mag), _codimp(imp), _codlin(lin), _codcli(codcli)
_codmag(mag), _codmag_coll(magc),
_codimp(imp), _codlin(lin), _codcli(codcli)
{
if (_articolo_giac==NULL)
_articolo_giac= new TArticolo_giacenza();
@ -293,17 +317,6 @@ TMRP_line::TMRP_line(const TMRP_line&a)
// TMRP_lines
///////////////////////////////////////////////////////////
TSortable* TMRP_lines::new_obj(const TToken_string& key) const
{
TCodice_articolo art; key.get(0, art); art.trim();
TString80 gia; key.get(1, gia); gia.trim();
TString16 mag; key.get(2, mag); mag.trim();
TString16 imp; key.get(3, imp); imp.trim();
TString16 lin; key.get(4, lin); lin.trim();
TString16 clifor ; key.get(5, clifor);
return new TMRP_line(art, gia, mag, imp, lin, atol(clifor));
}
TMRP_lines::TMRP_lines(const TMRP_lines & a)
{
TMRP_lines::operator=(a);
@ -323,8 +336,20 @@ TMRP_lines & TMRP_lines::operator= (const TMRP_lines &a)
return *this;
}
TMRP_line* TMRP_lines::find(const TCodice_articolo& codart,
const TString& gia, const TString& mag,
TSortable* TMRP_lines::new_obj(const TToken_string& key) const
{
TCodice_articolo art; key.get(0, art); art.trim();
TString16 gia; key.get(1, gia); gia.trim();
TString8 mag; key.get(2, mag); mag.trim();
TString8 magc; key.get(3, magc); magc.trim();
TString8 imp; key.get(4, imp); imp.trim();
TString8 lin; key.get(5, lin); lin.trim();
TString16 clifor ; key.get(6, clifor);
return new TMRP_line(art, gia, mag, magc, imp, lin, atol(clifor));
}
TMRP_line* TMRP_lines::find(const TCodice_articolo& codart, const TString& gia,
const TString& mag, const TString& magc,
const TString& imp, const TString& lin,
long codcli,
bool create)
@ -332,19 +357,25 @@ TMRP_line* TMRP_lines::find(const TCodice_articolo& codart,
_key = codart;
_key.add(gia);
if (_ignore_mag)
{
_key.add(" ",2);
else
_key.add(mag,2);
if (_ignore_imp)
_key.add(" ",3);
}
else
_key.add(imp,3);
if (_ignore_lin)
{
_key.add(mag,2);
_key.add(magc,3);
}
if (_ignore_imp)
_key.add(" ",4);
else
_key.add(lin,4);
_key.add(imp,4);
if (_ignore_lin)
_key.add(" ",5);
else
_key.add(lin,5);
_key.add(codcli,5);
_key.add(codcli,6);
TSortable* s = create ? add_obj(_key) : find_obj(_key);
return (TMRP_line*)s;
@ -371,7 +402,7 @@ TMRP_lines::~TMRP_lines()
class TRiga_ordine : public TToken_string
{
public:
int compare(const TToken_string& r, int level = SORT_COMPLETE) const;
int compare(const TToken_string& r, int level = SORT_COMPLETE, bool ascending=TRUE) const;
int compare_field(TString &str0, TString &str1,short field_no) const;
TRiga_ordine& operator=(TToken_string& r);
@ -384,7 +415,7 @@ public:
virtual ~TRiga_ordine() { }
};
int TRiga_ordine::compare(const TToken_string& riga, int level) const
int TRiga_ordine::compare(const TToken_string& riga, int level, bool ascending) const
{
TString16 str0, str1;
int cmp = 0;
@ -430,7 +461,7 @@ int TRiga_ordine::compare(const TToken_string& riga, int level) const
cmp=compare_field(str0,str1,f);
}
}
return cmp;
return ascending ? cmp : -cmp;
}
int TRiga_ordine::compare_field(TString &str0, TString &str1,short field_no) const
@ -506,10 +537,11 @@ TRiga_ordine::TRiga_ordine(const TDate& datadoc, long forn, const TMRP_line& lin
add(line.codimp(),F_CODIMP-FIRST_FIELD);
add(line.codlin(),F_CODLIN-FIRST_FIELD);
add(line.net_requirement(bucket).string(),F_QUANTITA-FIRST_FIELD);
real q = line.net_requirement(bucket);
//q -= line.planned_orders(bucket);
const TCodice_um um;
const TQuantita qta(line.codice(), um, ZERO);
const TQuantita qta(line.codice(), um, q);
add(qta.val().string(),F_QUANTITA-FIRST_FIELD);
add(qta.um(),F_UM-FIRST_FIELD);
add(price.string(),F_PREZZO-FIRST_FIELD);
@ -609,13 +641,14 @@ class TMatResPlanning : public TSkeleton_application
TLav_finder _artinfo;
private:
bool gross2net_logic(TMRP_line &curr_article, int bucket,bool lotsizing_f, bool lotsizing_p);
bool build_gross_requirements(const TMatResMask& m);
bool build_sched_receipts(const TMatResMask& m);
bool gross2net_logic(TMRP_line &curr_article, int bucket,bool lotsizing_f, bool lotsizing_p, bool use_leadtime);
bool load_gross_requirements(const TMatResMask& m);
bool load_planned_orders(const TMatResMask& m);
bool explode_articles(const TMatResMask& m);
bool test_codnum(const TCodice_numerazione& num, TString_array& a) const;
bool test_status(const TRectype& doc, TString_array& a) const;
int test_status(const TRectype& doc, TString_array& a) const;
bool has_confirmed_status(const TRectype& doc, TToken_string & riga ) const;
protected:
bool preprocess_cycle(const TMatResMask& m); // req iniziale dai docs
@ -663,23 +696,26 @@ public:
int TMatResMask::round_date(TDate& date, bool up) const
{
// Dimensione del bucke in giorni
int bucket_size = get_int(F_BUCKET) * 7;
if (bucket_size < 7) bucket_size = 7;
const int bucket_size = get_int(F_BUCKETS);
// Riporta la data al primo lunedi prima dell'inizio
TDate inizio = get(F_DADATA);
const int wday = inizio.wday();
if (wday > 1) inizio -= wday-1;
TDate inizio = get_date(F_DADATA);
if (bucket_size>1) // non vado a giorni
{
const int wday = inizio.wday();
if (wday > 1) inizio -= wday-1;
}
// Calcola il bucket di appartenenza
const int days = int(date - inizio);
const int bucket = days / bucket_size;
int bucket;
if (days<0)
bucket = days / bucket_size;
else
bucket = days / bucket_size;
if (up) // Arrotonda alla fine del bucket
date = inizio + long((bucket+1) * bucket_size - 1);
date = inizio + long((bucket+1 )* bucket_size - 1 /*- get_int(F_LASTWRKDAY)*/);
else // Arrotonda all'inizio del bucket
date = inizio + long(bucket * bucket_size);
return bucket;
}
@ -783,8 +819,8 @@ bool TMatResMask::on_field_event(TOperable_field& o, TField_event e, long jolly)
}
}
break;
case F_SORT_ORDINI:
if (e == fe_modify)
case F_RESORT_ORDINI:
if (e == fe_button)
sort_orders();
break;
case F_SELECT_ORDF:
@ -867,49 +903,32 @@ int TMatResMask::add_order_line(const TDate& datadoc, long forn, const TMRP_line
return pos;
}
static int order_compare(TSheet_field &s,int i1,int i2, int sorttype)
{
TMask &m=s.mask();
const bool ascending=!m.get_bool(F_SORT_ORDER);
const TRiga_ordine& r1 = (TRiga_ordine&)s.row(i1);
const TRiga_ordine& r2 = (TRiga_ordine&)s.row(i2);
return r1.compare(r2,sorttype,ascending);
}
static int order_compareDFA(TSheet_field &s,int i1,int i2)
{
const TRiga_ordine& r1 = (TRiga_ordine&)s.row(i1);
const TRiga_ordine& r2 = (TRiga_ordine&)s.row(i2);
return r1.compare(r2,SORT_BY_DFA);
}
{ return order_compare(s,i1,i2,SORT_BY_DFA);}
static int order_compareDAF(TSheet_field &s,int i1,int i2)
{
const TRiga_ordine& r1 = (TRiga_ordine&)s.row(i1);
const TRiga_ordine& r2 = (TRiga_ordine&)s.row(i2);
return r1.compare(r2,SORT_BY_DAF);
}
{ return order_compare(s,i1,i2,SORT_BY_DAF);}
static int order_compareAFD(TSheet_field &s,int i1,int i2)
{
const TRiga_ordine& r1 = (TRiga_ordine&)s.row(i1);
const TRiga_ordine& r2 = (TRiga_ordine&)s.row(i2);
return r1.compare(r2,SORT_BY_AFD);
}
{ return order_compare(s,i1,i2,SORT_BY_AFD);}
static int order_compareADF(TSheet_field &s,int i1,int i2)
{
const TRiga_ordine& r1 = (TRiga_ordine&)s.row(i1);
const TRiga_ordine& r2 = (TRiga_ordine&)s.row(i2);
return r1.compare(r2,SORT_BY_ADF);
}
{ return order_compare(s,i1,i2,SORT_BY_ADF);}
static int order_compareFAD(TSheet_field &s,int i1,int i2)
{
const TRiga_ordine& r1 = (TRiga_ordine&)s.row(i1);
const TRiga_ordine& r2 = (TRiga_ordine&)s.row(i2);
return r1.compare(r2,SORT_BY_FAD);
}
{ return order_compare(s,i1,i2,SORT_BY_FAD);}
static int order_compareFDA(TSheet_field &s,int i1,int i2)
{
const TRiga_ordine& r1 = (TRiga_ordine&)s.row(i1);
const TRiga_ordine& r2 = (TRiga_ordine&)s.row(i2);
int cmp=r1.compare(r2,SORT_BY_FDA);
return cmp;
}
{ return order_compare(s,i1,i2,SORT_BY_FDA);}
void TMatResMask::sort_orders()
{
TSheet_field& s = sfield(F_ORDINI);
TSheet_field& a = s;
switch (-get_int(F_SORT_ORDINI))
switch (-get_int(F_SORT))
{
case SORT_BY_DAF:
a.sort(order_compareDAF); break;
@ -955,7 +974,7 @@ void TMatResMask::select_orders(char type)
s.force_update(r);
}
}
TString msg=format("Ordini %s %s",type=='F' ? "fornitore" : "di produzione" ,on ? "selezionati" :" de-selezionati");
TString msg=format("Ordini %s %s",type=='F' ? "fornitore" : "di produzione" ,on ? "selezionati" :"de-selezionati");
xvt_statbar_set(msg);
}
@ -992,28 +1011,42 @@ TMatResMask::TMatResMask() : TCalendar_mask("mr2100a")
bool TMatResPlanning::test_codnum(const TCodice_numerazione& num,
TString_array& a) const
{
TString troia;
for (int diocane=0 ; diocane< a.items(); diocane++ )
{
troia = a.row(diocane).get(0);
if (troia == num.codice()) return TRUE;
}
return FALSE;
bool yes = a.find(num.codice()) >= 0;
return yes;
}
bool TMatResPlanning::test_status(const TRectype& doc,
bool TMatResPlanning::has_confirmed_status(const TRectype& doc,
TToken_string & riga ) const
{
const char statodoc = doc.get_char(DOC_STATO);
const char state_def = riga.get_char(F_STATODEF - FIRST_FIELD);
return (statodoc >= state_def);
}
int TMatResPlanning::test_status(const TRectype& doc,
TString_array& a) const
{
const TString16 tipodoc = doc.get(DOC_TIPODOC);
const int statodoc = doc.get_int(DOC_STATO);
bool yes = FALSE;
for (int i = a.items()-1; i >= 0 && !yes; i--)
const char statodoc = doc.get_char(DOC_STATO);
for (int i = a.items()-1; i >= 0; i--)
{
TToken_string& riga = a.row(i);
const char* t = riga.get(0);
if (tipodoc == t)
{
const int state_fr = riga.get_int(F_DASTATO - FIRST_FIELD);
const int state_to = riga.get_int(F_ASTATO - FIRST_FIELD);
yes = statodoc >= state_fr && statodoc <= state_to;
const char state_fr = riga.get_char(F_DASTATO - FIRST_FIELD);
const char state_to = riga.get_char(F_ASTATO - FIRST_FIELD);
if (statodoc >= state_fr && statodoc <= state_to)
return i;
}
}
return yes;
return -1;
}
static long table_items(const char* tab)
@ -1026,7 +1059,7 @@ static long table_items(const char* tab)
/////////// finished: 100%
/////////// tested : 100%
bool TMatResPlanning::build_gross_requirements(const TMatResMask& m)
bool TMatResPlanning::load_gross_requirements(const TMatResMask& m)
{
TDate date_fr = m.get(F_DADATA);
const int bucket_fr = m.round_date(date_fr, FALSE);
@ -1055,7 +1088,7 @@ bool TMatResPlanning::build_gross_requirements(const TMatResMask& m)
TString_array& n = m.sfield(F_NUM_ORC).rows_array();
TString_array& a = m.sfield(F_TIPI_ORC).rows_array();
TProgind pi(table_items("%NUM"), "Fase 1: caricamento fabbisogni lordi...", TRUE, TRUE);
TProgind pi(table_items("%NUM"), "Caricamento fabbisogni lordi...", TRUE, TRUE);
// Scandisce tutte le numerazioni considerando solo quelle
// contenenti i tipi documento specificati nella maschera
@ -1094,7 +1127,7 @@ bool TMatResPlanning::build_gross_requirements(const TMatResMask& m)
if (!doc_cons.ok())
doc_cons = curr_doc.get(DOC_DATADOC);
if (test_status(curr_doc, a))
if (test_status(curr_doc, a)>=0)
{
// Scandisce le righe articolo e memorizza
// le quantita' richieste
@ -1117,17 +1150,17 @@ bool TMatResPlanning::build_gross_requirements(const TMatResMask& m)
{
const TCodice_articolo art = riga.get(RDOC_CODARTMAG);
const TString16 liv = riga.get(RDOC_LIVELLO);
const TString16 mag = nomag ? EMPTY_STRING : riga.get(RDOC_CODMAG);
const TString16 imp = noimp ? EMPTY_STRING : riga.get(RDOC_IMPIANTO);
const TString16 lin = nolin ? EMPTY_STRING : riga.get(RDOC_LINEA);
const TString8 mag = nomag ? EMPTY_STRING : riga.get(RDOC_CODMAG);
const TString8 imp = noimp ? EMPTY_STRING : riga.get(RDOC_IMPIANTO);
const TString8 lin = nolin ? EMPTY_STRING : riga.get(RDOC_LINEA);
const TCodice_um um = riga.get(RDOC_UMQTA);
TQuantita q(art, um, qta);
q.convert2umbase();
TMRP_line* line = _articles.find(art, liv, mag, imp, lin, 0L);
TMRP_line* line = _articles.find(art, liv, mag, "", imp, lin, 0L);
if (line == NULL)
{
// nuova linea
line = _articles.find(art, liv, mag, imp, lin, 0L, TRUE);
line = _articles.find(art, liv, mag, "", imp, lin, 0L, TRUE);
line->set_description(riga.get(RDOC_DESCR));
}
const TMRP_time t(datacons, 0, imp, lin);
@ -1170,7 +1203,7 @@ bool TMatResPlanning::explode_articles(const TMatResMask& m)
if (pi == NULL)
{
TString80 msg;
msg.format("Fase 2: esplosione articoli (livello %d)", level++);
msg.format("Esplosione articoli (livello %d)", level++);
pi = new TProgind(_articles.items()-a, msg, TRUE, TRUE);
}
pi->addstatus(1);
@ -1206,10 +1239,10 @@ bool TMatResPlanning::explode_articles(const TMatResMask& m)
TString16 imp = line.codimp();
TString16 lin = line.codlin();
_artinfo.art2magimpline(art, mag, imp, lin);
TMRP_line* son = _articles.find(art, riga.giacenza(),mag, imp, lin, 0L);
TMRP_line* son = _articles.find(art, riga.giacenza(),mag, "", imp, lin, 0L);
if (son == NULL)
{
son = _articles.find(art, riga.giacenza(), mag, imp, lin, 0L, TRUE);
son = _articles.find(art, riga.giacenza(), mag, "", imp, lin, 0L, TRUE);
son->set_description(distinta.describe(art));
}
line.add_son(riga.val(), son);
@ -1225,7 +1258,7 @@ bool TMatResPlanning::explode_articles(const TMatResMask& m)
/////////// finished: 100%
/////////// tested:
bool TMatResPlanning ::build_sched_receipts(const TMatResMask& m)
bool TMatResPlanning ::load_planned_orders(const TMatResMask& m)
{
TDate date_fr = m.get(F_DADATA);
const int bucket_fr = m.round_date(date_fr, FALSE);
@ -1247,7 +1280,7 @@ bool TMatResPlanning ::build_sched_receipts(const TMatResMask& m)
TString_array& n = m.sfield(F_NUM_ORF).rows_array();
TString_array& a = m.sfield(F_TIPI_ORF).rows_array();
TProgind pi(table_items("%NUM"), "Fase 3: caricamento arrivi futuri...", TRUE, TRUE);
TProgind pi(table_items("%NUM"), "Caricamento arrivi futuri...", TRUE, TRUE);
// Scandisce tutte le numerazioni considerando solo quelle
// contenenti i tipi documento specificati nella maschera
@ -1282,7 +1315,8 @@ bool TMatResPlanning ::build_sched_receipts(const TMatResMask& m)
if (evaso)
continue;
if (!test_status(curr, a))
const int sheetrow = test_status(curr, a);
if (sheetrow<0)
continue;
// Data di consegna standard
@ -1316,7 +1350,7 @@ bool TMatResPlanning ::build_sched_receipts(const TMatResMask& m)
const TString16 mag = riga.get(RDOC_CODMAG);
const TString16 imp = riga.get(RDOC_IMPIANTO);
const TString16 lin = riga.get(RDOC_LINEA);
TMRP_line* line = _articles.find(art, liv, mag, imp, lin, 0L, FALSE);
TMRP_line* line = _articles.find(art, liv, mag, "", imp, lin, 0L, TRUE);
if (line != NULL)
{
const TCodice_um um = riga.get(RDOC_UMQTA);
@ -1324,7 +1358,10 @@ bool TMatResPlanning ::build_sched_receipts(const TMatResMask& m)
q.convert2umbase();
const TMRP_time t(consegna, 0, imp, lin);
line->add_sched_rec(t, q.val());
if (has_confirmed_status(doc, a.row(sheetrow)))
line->add_sched_rec(t, q.val());
else
line->add_planned_ord(t, q.val());
}
}
}
@ -1342,12 +1379,21 @@ bool TMatResPlanning ::build_sched_receipts(const TMatResMask& m)
bool TMatResPlanning::preprocess_cycle(const TMatResMask& m)
{
// costruisce il gross requirement dai DOC di planning
if (build_gross_requirements(m))
bool ok=load_gross_requirements(m);
// costruisce gli sched rec degli elementi dai DOCS ordini fornitore emessi
ok |= load_planned_orders(m);
if (ok)
// esplode l'array mediante la DIBA
return explode_articles(m);
/*
// costruisce il gross requirement dai DOC di planning
if (load_gross_requirements(m))
// esplode l'array mediante la DIBA
if (explode_articles(m))
// costruisce gli sched rec degli elementi dai DOCS ordini fornitore emessi
return build_sched_receipts(m);
return load_planned_orders(m);
*/
return FALSE;
}
@ -1355,7 +1401,7 @@ bool TMatResPlanning::preprocess_cycle(const TMatResMask& m)
/////////// tested:
// implementa la logica che porta dal fabbisogno lordo a quello netto
// per quel bucket e riporta il balance on hand sul bucket successivo
bool TMatResPlanning::gross2net_logic(TMRP_line &curr_article, int bucket, bool lotsizing_f, bool lotsizing_p)
bool TMatResPlanning::gross2net_logic(TMRP_line &curr_article, int bucket, bool lotsizing_f, bool lotsizing_p, bool use_leadtime)
{
// Verifico se esiste gia' un fabbisogno netto
real sm,tmpreal = -curr_article.net_requirement(bucket);
@ -1390,7 +1436,7 @@ bool TMatResPlanning::gross2net_logic(TMRP_line &curr_article, int bucket, bool
if (net_req > ZERO)
{
TMRP_time lead_time;
curr_article.lead_time(bucket, lead_time);
curr_article.lead_time(bucket, lead_time, use_leadtime);
for (int o = 0; o < n_figli; o++)
{
@ -1400,6 +1446,7 @@ bool TMatResPlanning::gross2net_logic(TMRP_line &curr_article, int bucket, bool
article_son.add_gross_req(lead_time, tmpreal);
}
}
curr_article.add_proposed_ord(bucket, curr_article.net_requirement(bucket));
return TRUE;
}
@ -1408,13 +1455,13 @@ bool TMatResPlanning::gross2net_logic(TMRP_line &curr_article, int bucket, bool
bool TMatResPlanning::net_requirement_cycle(const TMatResMask& m)
{
bool ok = TRUE;
bool lotsizing_p=m.get_bool(F_LOTSIZING_P);
bool lotsizing_f=m.get_bool(F_LOTSIZING_F);
const bool lotsizing_p=m.get_bool(F_LOTSIZING_P);
const bool lotsizing_f=m.get_bool(F_LOTSIZING_F);
const bool use_leadtime=!m.get_bool(F_IGN_LDTIME);
// ordina gli articoli
const long total = _articles.sort();
TProgind pi(total, "Fase 4: calcolo dei fabbisogni netti", FALSE, TRUE);
TProgind pi(total, "Calcolo dei fabbisogni netti", FALSE, TRUE);
// cicla iterativamente sugli elementi di _articles
for (long a = 0; a < total; a++)
@ -1431,7 +1478,7 @@ bool TMatResPlanning::net_requirement_cycle(const TMatResMask& m)
for (int bucket = 0; ok && bucket <= last; bucket = curr_article.next_bucket(bucket))
{
ok = gross2net_logic(curr_article, bucket, lotsizing_f, lotsizing_p);
ok = gross2net_logic(curr_article, bucket, lotsizing_f, lotsizing_p, use_leadtime);
if (!ok)
break;
}
@ -1452,9 +1499,9 @@ bool TMatResPlanning::build_orders(TMatResMask& m)
const long tot = _articles.items();
if (tot > 0L)
{
const int leadtime = m.get_int(F_LEADTIME);
const int extratime = m.get_int(F_XTRA_LDTIME);
TProgind pi(tot, "Fase 5: generazione righe ordini...", FALSE, TRUE);
TProgind pi(tot, "Generazione righe ordini...", FALSE, TRUE);
for (long a = 0; a < tot; a++)
{
pi.addstatus(1);
@ -1467,11 +1514,13 @@ bool TMatResPlanning::build_orders(TMatResMask& m)
for (int b = line.last_bucket(); b >= 0; b--)
{
real qta = line.net_requirement(b);
if (!qta.is_zero() && !qta.round(5).is_zero())// > real("0.00001"))
//qta -= line.planned_orders(b);
qta.round(5);
if (!qta.is_zero())
{
TMRP_time time = line.time(b);
if (line.sons() == 0) // Sottrai alle foglie il bonus
time.sub_time(leadtime);
time.sub_time(extratime);
TDate date = time.date();
m.round_date(date);
@ -1546,10 +1595,10 @@ bool TMatResPlanning::emit_orders(TMatResMask& m)
if (qta.is_zero())
continue;
if (datadoc < today)
if (!noyes_box("Riga %d: data di documento inferiore a quella odierna. Confermi ?",r+1))
if (!noyes_box("Riga %d: data di emissione del documento (%s) inferiore a quella odierna. Confermi ?",r+1,(const char *)datadoc.string()))
continue;
if (datacon < datadoc)
if (!noyes_box("Riga %d: data di consegna inferiore a quella del documento. Confermi ?",r+1))
if (!noyes_box("Riga %d: data di consegna (%s) inferiore a quella di emissione del documento (%s). Confermi ?",r+1,(const char *)datacon.string(), (const char *)datadoc.string()))
continue;
if (prod || forn!=0L)
{

View File

@ -6,10 +6,10 @@ class TMRP_record : public TObject
TMRP_time _time; // time
real _gross_requirement; // gross req
real _on_hand; // projected on hand
real _sched_receipts; // scheduled receipts
real _released_receipts; // released scheduled receipts (not used)
real _sched_receipts; // scheduled receipts (released )
real _net_requirement; // lot-sized net requirement
real _planned_orders; // anticipated planned orders
real _proposed_orders; // anticipated planned orders
public:
const real& gross_requirement() const { return _gross_requirement; }
@ -17,12 +17,15 @@ public:
const real& sched_receipts() const { return _sched_receipts; }
const real& net_requirement() const { return _net_requirement; }
const real& planned_orders() const { return _planned_orders; }
const real& proposed_orders() const { return _proposed_orders; }
const real& set_on_hand(const real & val) { return _on_hand=val;}
const real& set_net_req(const real & val) { return _net_requirement=val;}
const real& add_net_req(const real & val);
const real& add_gross_req(const real& val);
const real& add_sched_rec(const real& val);
const real& add_planned_ord(const real& val);
const real& add_proposed_ord(const real& val);
TMRP_record & operator=(const TMRP_record & a);
@ -38,9 +41,10 @@ class TMRP_line : public TSortable
{
TCodice_articolo _codart;
TString16 _livgiac;
TString16 _codmag;
TString16 _codimp;
TString16 _codlin;
TString8 _codmag;
TString8 _codmag_coll;
TString8 _codimp;
TString8 _codlin;
long _codcli;
static TArticolo_giacenza *_articolo_giac;
@ -62,6 +66,7 @@ public:
const TCodice_articolo& codice() const { return _codart; }
const TString& livgiac() const { return _livgiac; }
const TString& codmag() const { return _codmag; }
const TString& codmag_coll() const { return _codmag_coll; }
const TString& codimp() const { return _codimp; }
const TString& codlin() const { return _codlin; }
long codcli() const { return _codcli; }
@ -93,6 +98,9 @@ public:
const real & planned_orders(int i) const
{return record(i).planned_orders();}
const real & proposed_orders(int i) const
{return record(i).proposed_orders();}
const TString& set_description(const TString &s) { return _description=s; }
const real& set_on_hand(int i, const real& val);
@ -100,9 +108,13 @@ public:
const real& add_gross_req(const TMRP_time& t, const real& val);
const real& add_sched_rec(const TMRP_time& t, const real& val);
const real& add_planned_ord(const TMRP_time& t, const real& val);
const real& add_net_req(const TMRP_time& t, const real& val);
const real& add_net_req(int i, const real& val);
const real& set_net_req(int i, const real& val);
const real& add_proposed_ord(int i, const real& val);
real sizeup_net_requirement(int i, const real& val);
real& giacenza_attuale(real&) const;
@ -110,7 +122,7 @@ public:
real &scorta_minima(real&) const;
real &scorta_minima(real&, const TDate & data) const;
const TMRP_time& lead_time(int i, TMRP_time& t) const;
const TMRP_time& lead_time(int i, TMRP_time& t, bool antic = TRUE) const;
const TMRP_time& time(int i) const { return record(i).time(); }
@ -118,7 +130,8 @@ public:
TMRP_line & operator=(const TMRP_line & a);
TMRP_line(const char* art, const char* giac,
const char* magdep, const char* imp, const char* lin,
const char* magdep, const char* magdepc,
const char* imp, const char* lin,
long codcli);
TMRP_line(const TMRP_line&a);
virtual ~TMRP_line() { }
@ -135,7 +148,7 @@ protected:
public:
TMRP_line* find(const TCodice_articolo& codart,
const TString& giac, const TString& mag,
const TString& giac, const TString& mag, const TString& magc,
const TString& imp, const TString& lin,
long codcli,
bool create=FALSE);

View File

@ -6,6 +6,7 @@
#define F_TIPI_ORC 202
#define F_NUM_ORF 203
#define F_TIPI_ORF 204
#define F_IGN_LDTIME 205
#define F_DADATA 206
#define F_ADATA 207
#define F_BUCKETS 208
@ -20,7 +21,7 @@
#define F_NOIMP 217
#define F_NOLIN 218
#define F_KEEP_IMP 219
#define F_LEADTIME 220
#define F_XTRA_LDTIME 220
#define F_ORC_MASTER 221
#define F_SORT 222
#define F_LOTSIZING_P 223
@ -30,21 +31,30 @@
#define F_CATVEN_CV 227
#define F_TIPOCF_CONDV 228
#define F_CF_CONDV 229
#define F_SORT_ORDER 230
// campi senza default sul profilo
#define F_YEAR 301
#define F_IMPIANTO 302
#define F_LINEA 303
#define F_CALENDAR 304
#define F_ORDINI 401
#define F_SORT_ORDINI 402
#define F_SELECT_ORDF 403
#define F_SELECT_ORDP 404
#define F_ORDINI 305
#define F_SELECT_ORDF 306
#define F_SELECT_ORDP 307
#define F_RESORT_ORDINI 308
// sheet tipi doc
#define F_TIPO 101
#define F_DASTATO 102
#define F_ASTATO 103
#define F_DESCTIPO 104
#define F_DESCTIPO 102
#define F_DASTATO 103
#define F_ASTATO 104
#define F_STATODEF 105
// sheet tipi doc
#define F_CODNUM 101
#define F_DESCNUM 110
// sheet ordini
#define F_SELECTED 101
#define F_ORD_TYPE 102
#define F_DATADOC 103

View File

@ -46,21 +46,21 @@ ENDPAGE
PAGE "Query" -1 -1 80 19
GROUPBOX DLG_NULL 78 7
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 2 "@bParametri dell'elaborazione"
PROMPT 1 1 "@bParametri dell'elaborazione"
END
DATE F_DADATA
BEGIN
PROMPT 2 4 "Dalla data "
PROMPT 2 2 "Dalla data "
CHECKTYPE REQUIRED
GROUP 1
END
DATE F_ADATA
BEGIN
PROMPT 45 4 "Alla data "
PROMPT 45 2 "Alla data "
CHECKTYPE REQUIRED
VALIDATE DATE_CMP_FUNC > F_DADATA
WARNING "La data finale deve essere maggiore di quella iniziale"
@ -70,7 +70,7 @@ END
LIST F_BUCKETS 1 15
BEGIN
GROUP 1
PROMPT 2 6 "Bucket temporale "
PROMPT 2 3 "Bucket temporale "
ITEM "1|1 Settimana"
MESSAGE DISABLE,F_BUCKET|COPY,F_BUCKET
ITEM "2|2 Settimane"
@ -94,7 +94,7 @@ END
NUMBER F_BUCKET 2
BEGIN
GROUP 1
PROMPT 45 6 "Settimane "
PROMPT 45 3 "Settimane "
FLAGS "U"
CHECKTYPE REQUIRED
END
@ -114,39 +114,16 @@ BEGIN
PROMPT 2 12 "Non suddividere per linee"
END
BOOLEAN F_KEEP_IMP
BEGIN
GROUP 1
PROMPT 2 13 "Mantieni la produzione all'interno dello stesso impianto"
END
BOOLEAN F_LOTSIZING_F
BEGIN
GROUP 1
PROMPT 2 15 "Lotti minimi sugli ordini di acquisto"
END
BOOLEAN F_LOTSIZING_P
BEGIN
GROUP 1
PROMPT 2 16 "Lotti minimi sugli ordini di produzione"
END
NUMBER F_LEADTIME 2
BEGIN
GROUP 1
PROMPT 2 17 "Lead time aggiuntivo sui materiali "
FLAGS "U"
END
ENDPAGE
PAGE "Parametri" -1 -1 80 19
PAGE "Elabora" -1 -1 80 19
LIST F_ORC_MASTER 1 20
BEGIN
GROUP 1
PROMPT 1 0 ""
PROMPT 1 5 ""
ITEM "O|Ordini da clienti"
ITEM "M|Master Schedule Plan"
END
@ -154,51 +131,56 @@ END
SPREADSHEET F_NUM_ORC 8 6
BEGIN
GROUP 1
PROMPT 1 1 ""
PROMPT 1 6 ""
ITEM "Codice"
END
SPREADSHEET F_TIPI_ORC 62 6
BEGIN
GROUP 1
PROMPT 16 1 ""
PROMPT 16 6 ""
ITEM "Tipo@4"
ITEM "Descrizione@50"
ITEM "Da stato"
ITEM "A stato"
ITEM "Descrizione@50"
END
TEXT DLG_NULL
BEGIN
PROMPT 1 8 "@bOrdini produzione/fornitori"
PROMPT 1 13 "@bOrdini produzione/fornitori"
END
SPREADSHEET F_NUM_ORF 8 6
BEGIN
GROUP 1
PROMPT 1 9 ""
PROMPT 1 14 ""
ITEM "Codice"
END
SPREADSHEET F_TIPI_ORF 62 6
BEGIN
GROUP 1
PROMPT 16 9 ""
PROMPT 16 14 ""
ITEM "Tipo@4"
ITEM "Descrizione@50"
ITEM "Da stato"
ITEM "A stato"
ITEM "Descrizione@50"
ITEM "Stato def."
END
ENDPAGE
PAGE "Genera" -1 -1 78 20
TEXT DLG_NULL
BEGIN
PROMPT 2 16 "@bOrdini di produzione"
PROMPT 2 6 "@bOrdini di produzione"
END
STRING F_NUM_PROD 4
BEGIN
GROUP 1
PROMPT 27 16 "Numerazione "
PROMPT 27 6 "Numerazione "
FLAGS "U"
USE %NUM
INPUT CODTAB F_NUM_PROD
@ -212,7 +194,7 @@ END
STRING F_TIPO_PROD 4
BEGIN
GROUP 1
PROMPT 50 16 "Tipo "
PROMPT 50 6 "Tipo "
FLAGS "U"
USE %TIP
INPUT CODTAB F_TIPO_PROD
@ -226,7 +208,7 @@ END
STRING F_RIGA_PROD 4
BEGIN
GROUP 1
PROMPT 66 16 "Riga "
PROMPT 66 6 "Riga "
FLAGS "U"
USE %TRI SELECT S7=="M"
INPUT CODTAB F_RIGA_PROD
@ -239,13 +221,13 @@ END
TEXT DLG_NULL
BEGIN
PROMPT 2 17 "@bOrdini a fornitori"
PROMPT 2 7 "@bOrdini a fornitori"
END
STRING F_NUM_FORN 4
BEGIN
GROUP 1
PROMPT 27 17 "Numerazione "
PROMPT 27 7 "Numerazione "
FLAGS "U"
COPY USE F_NUM_PROD
INPUT CODTAB F_NUM_FORN
@ -258,7 +240,7 @@ END
STRING F_TIPO_FORN 4
BEGIN
GROUP 1
PROMPT 50 17 "Tipo "
PROMPT 50 7 "Tipo "
FLAGS "U"
COPY USE F_TIPO_PROD
INPUT CODTAB F_TIPO_FORN
@ -271,7 +253,7 @@ END
STRING F_RIGA_FORN 4
BEGIN
GROUP 1
PROMPT 66 17 "Riga "
PROMPT 66 7 "Riga "
FLAGS "U"
COPY USE F_RIGA_PROD
INPUT CODTAB F_RIGA_FORN
@ -284,7 +266,7 @@ END
LIST F_TIPOCV 10
BEGIN
GROUP 1
PROMPT 2 18 "Preleva i prezzi da "
PROMPT 2 8 "Preleva i prezzi da "
ITEM "|Anagrafica"
MESSAGE HIDE,F_CODCONDV|HIDE,F_TIPOCF_CONDV|HIDE,F_CATVEN_CV|CHECK,F_CODCONDV
ITEM "L|Listino"
@ -297,7 +279,7 @@ END
STRING F_CODCONDV 3
BEGIN
PROMPT 36 18 ""
PROMPT 36 8 ""
USE LF_CONDV
INPUT TIPO F_TIPOCV
INPUT CATVEN F_CATVEN_CV
@ -319,7 +301,7 @@ END
STRING F_CATVEN_CV 2
BEGIN
PROMPT 43 18 "Categoria di vendita "
PROMPT 43 8 "Categoria di vendita "
USE CVE
INPUT CODTAB F_CATVEN_CV
DISPLAY "Codice" CODTAB
@ -331,36 +313,86 @@ END
LIST F_TIPOCF_CONDV 9
BEGIN
PROMPT 43 18 ""
PROMPT 43 8 ""
ITEM "C|Cliente"
ITEM "F|Fornitore"
END
BOOLEAN F_KEEP_IMP
BEGIN
GROUP 1
PROMPT 2 13 "Mantieni la produzione all'interno dello stesso impianto"
END
BOOLEAN F_LOTSIZING_F
BEGIN
GROUP 1
PROMPT 2 15 "Lotti minimi sugli ordini di acquisto"
END
BOOLEAN F_LOTSIZING_P
BEGIN
GROUP 1
PROMPT 2 16 "Lotti minimi sugli ordini di produzione"
END
BOOL F_IGN_LDTIME
BEGIN
GROUP 1
PROMPT 2 17 "Ignora lead time di anagrafica "
FLAGS "U"
END
NUMBER F_XTRA_LDTIME 2
BEGIN
GROUP 1
PROMPT 42 17 "anticipa di "
FLAGS "U"
END
TEXT DLG_NULL
BEGIN
GROUP 1
PROMPT 58 17 "giorni sui materiali"
FLAGS "U"
END
ENDPAGE
PAGE "Fabbisogni" -1 -1 78 20
BUTTON F_SELECT_ORDP 20 2
BEGIN
PROMPT 1 1 "Ordini di produzione"
PROMPT 12 1 "Ordini di produzione"
PICTURE USER_BMP_SELECT_ORDP
END
BUTTON F_SELECT_ORDF 20 2
BEGIN
PROMPT 24 1 "Ordini a fornitore"
PROMPT 46 1 "Ordini a fornitore"
PICTURE USER_BMP_SELECT_ORDF
END
LIST F_SORT_ORDINI 40
LIST F_SORT 25
BEGIN
PROMPT 1 3 "Ordina per "
ITEM "1|Data / fornitore / articolo"
ITEM "2|Data / articolo / fornitore"
ITEM "3|Fornitore / articolo / data"
ITEM "4|Fornitore / data / articolo"
ITEM "5|Articolo / fornitore / data"
ITEM "6|Articolo / data / fornitore"
PROMPT 1 3 "Ordinamento "
ITEM "1|Data/fornitore/articolo"
ITEM "2|Data/articolo/fornitore"
ITEM "3|Fornitore/articolo/data"
ITEM "4|Fornitore/data/articolo"
ITEM "5|Articolo/fornitore/data"
ITEM "6|Articolo/data/fornitore"
END
BOOLEAN F_SORT_ORDER
BEGIN
PROMPT 42 3 "Inverso"
END
BUTTON F_RESORT_ORDINI 10 1
BEGIN
PROMPT 62 3 "Riordina"
END
SPREADSHEET F_ORDINI
@ -388,11 +420,6 @@ BEGIN
END
//TEXT DLG_NULL
//BEGIN
// PROMPT 1 -1 "Premere il bottone (+) in alto a destra della tabella per riordinarla"
//END
ENDPAGE
PAGE "Calendario" -1 -1 78 20
@ -441,28 +468,30 @@ ENDMASK
PAGE "Numerazioni clienti" -1 -1 60 6
STRING F_TIPO 4
STRING F_CODNUM 4
BEGIN
PROMPT 1 1 "Codice "
PROMPT 1 1 "Numerazione "
FLAGS "U"
USE %NUM
INPUT CODTAB F_TIPO
INPUT CODTAB F_CODNUM
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_TIPO CODTAB
OUTPUT F_DESCTIPO S0
OUTPUT F_CODNUM CODTAB
OUTPUT F_DESCNUM S0
CHECKTYPE REQUIRED
ADD NONE
END
STRING F_DESCTIPO 50
STRING F_DESCNUM 50 40
BEGIN
PROMPT 16 1 ""
PROMPT 1 2 "Descrizione "
FLAGS "U"
USE %NUM KEY 2
INPUT S0 F_DESCTIPO
DISPLAY "Descrizione@70" S0
INPUT S0 F_DESCNUM
DISPLAY "Descrizione@50" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT F_TIPO
OUTPUT F_DESCNUM S0
OUTPUT F_CODNUM CODTAB
CHECKTYPE REQUIRED
ADD NONE
END
@ -490,7 +519,7 @@ PAGE "Ordini clienti" -1 -1 60 10
STRING F_TIPO 4
BEGIN
PROMPT 1 1 "Tipo "
PROMPT 1 1 "Tipo "
FLAGS "U"
USE %TIP
INPUT CODTAB F_TIPO
@ -502,9 +531,21 @@ BEGIN
ADD NONE
END
NUMBER F_DASTATO 1
STRING F_DESCTIPO 50 40
BEGIN
PROMPT 1 2 "Da stato "
PROMPT 1 2 "Descrizione "
USE %TIP KEY 2
INPUT S0 F_DESCTIPO
DISPLAY "Descrizione@70" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT F_TIPO
CHECKTYPE REQUIRED
ADD NONE
END
STRING F_DASTATO 1
BEGIN
PROMPT 1 3 "Da stato "
USE %STD
INPUT CODTAB F_DASTATO
DISPLAY "Stato" CODTAB
@ -514,9 +555,9 @@ BEGIN
ADD NONE
END
NUMBER F_ASTATO 1
STRING F_ASTATO 1
BEGIN
PROMPT 16 2 "A stato "
PROMPT 1 4 "A stato "
COPY USE F_DASTATO
INPUT CODTAB F_ASTATO
COPY DISPLAY F_DASTATO
@ -525,18 +566,6 @@ BEGIN
ADD NONE
END
STRING F_DESCTIPO 50
BEGIN
PROMPT 16 1 ""
USE %TIP KEY 2
INPUT S0 F_DESCTIPO
DISPLAY "Descrizione@70" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT F_TIPO
CHECKTYPE REQUIRED
ADD NONE
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
@ -559,28 +588,30 @@ ENDMASK
PAGE "Numerazioni fornitori" -1 -1 60 6
STRING F_TIPO 4
STRING F_CODNUM 4
BEGIN
PROMPT 1 1 "Codice "
PROMPT 1 1 "Numerazione "
FLAGS "U"
USE %NUM
INPUT CODTAB F_TIPO
INPUT CODTAB F_CODNUM
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_TIPO CODTAB
OUTPUT F_DESCTIPO S0
OUTPUT F_CODNUM CODTAB
OUTPUT F_DESCNUM S0
CHECKTYPE REQUIRED
ADD NONE
END
STRING F_DESCTIPO 50
STRING F_DESCNUM 50 40
BEGIN
PROMPT 16 1 ""
PROMPT 1 2 "Descrizione "
FLAGS "U"
USE %NUM KEY 2
INPUT S0 F_DESCTIPO
DISPLAY "Descrizione@70" S0
INPUT S0 F_DESCNUM
DISPLAY "Descrizione@50" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT F_TIPO
OUTPUT F_DESCNUM S0
OUTPUT F_CODNUM CODTAB
CHECKTYPE REQUIRED
ADD NONE
END
@ -609,7 +640,7 @@ PAGE "Ordini fornitori" -1 -1 60 10
STRING F_TIPO 4
BEGIN
PROMPT 1 1 "Tipo "
PROMPT 1 1 "Tipo "
FLAGS "U"
USE %TIP
INPUT CODTAB F_TIPO
@ -621,9 +652,21 @@ BEGIN
ADD NONE
END
NUMBER F_DASTATO 1
STRING F_DESCTIPO 50 40
BEGIN
PROMPT 1 2 "Da stato "
PROMPT 1 2 "Descrizione "
USE %TIP KEY 2
INPUT S0 F_DESCTIPO
DISPLAY "Descrizione@70" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT F_TIPO
CHECKTYPE REQUIRED
ADD NONE
END
STRING F_DASTATO 1
BEGIN
PROMPT 1 3 "Da stato "
USE %STD
INPUT CODTAB F_DASTATO
DISPLAY "Stato" CODTAB
@ -633,9 +676,9 @@ BEGIN
ADD NONE
END
NUMBER F_ASTATO 1
STRING F_ASTATO 1
BEGIN
PROMPT 16 2 "A stato "
PROMPT 1 4 "A stato "
COPY USE F_DASTATO
INPUT CODTAB F_ASTATO
COPY DISPLAY F_DASTATO
@ -644,14 +687,13 @@ BEGIN
ADD NONE
END
STRING F_DESCTIPO 50
STRING F_STATODEF 1
BEGIN
PROMPT 16 1 ""
USE %TIP KEY 2
INPUT S0 F_DESCTIPO
DISPLAY "Descrizione@70" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT F_TIPO
PROMPT 1 5 "Stato definitivo "
COPY USE F_DASTATO
INPUT CODTAB F_STATODEF
COPY DISPLAY F_DASTATO
OUTPUT F_STATODEF CODTAB
CHECKTYPE REQUIRED
ADD NONE
END

File diff suppressed because it is too large Load Diff

View File

@ -1,392 +1,129 @@
// funzioni di ricerca distinta master
bool distinta_master(const char *code);
// funzione per l'uso degli alberi delle distinte
TDistinta_tree &dist_tree();
#include <applicat.h>
#include "mrplib.h"
#include "../mg/mglib.h"
#include "../ve/velib.h"
#include "../ve/veconf.h"
#define MASTERCODE_CHAR 'M'
#include "mr2100.h"
#include "mr2201.h"
//***********************
// oggetto TRiga articolo
class TMSP_constraint;
class TMSP_constraints;
const real MAXCAPACITY("999999999.99");
const int NO_PROPOSE=1000 ;
class TRiga_articolo : public TToken_string
enum TMSP_mode {_actual_plan, _released_schedule, _stock_break};
enum TMSP_logic {_first_fit_logic, _JIT_logic};
class TPlanning_mask : public TCalendar_mask
{
public:
static int order_compare(TSheet_field & s, int i1, int i2, int level);
static int order_compare( const TToken_string& r1 , const TToken_string& r2 , int level, bool ascending=TRUE);
static int compare_field(TString &str0, TString &str1,short field_no) ;
static int order_comparePCAL(TSheet_field & s, int i1, int i2);
static int order_comparePCLA(TSheet_field & s, int i1, int i2);
static int order_comparePALC(TSheet_field & s, int i1, int i2);
static int order_comparePACL(TSheet_field & s, int i1, int i2);
static int order_comparePLAC(TSheet_field & s, int i1, int i2);
static int order_comparePLCA(TSheet_field & s, int i1, int i2);
static int order_compareCAL(TSheet_field & s, int i1, int i2);
static int order_compareCLA(TSheet_field & s, int i1, int i2);
static int order_compareALC(TSheet_field & s, int i1, int i2);
static int order_compareACL(TSheet_field & s, int i1, int i2);
static int order_compareLAC(TSheet_field & s, int i1, int i2);
static int order_compareLCA(TSheet_field & s, int i1, int i2);
static int order_comparePCA(TSheet_field & s, int i1, int i2);
static int order_comparePAC(TSheet_field & s, int i1, int i2);
static int order_compareAC(TSheet_field & s, int i1, int i2);
static int order_compareCA(TSheet_field & s, int i1, int i2);
static bool find_block(const TSheet_field& sf, const int riga, int &first_row, int &last_row );
// quantità provenienti dai documenti "ordine":
TMSP_constraints _constraints;
int compare(const TToken_string& r, int level) const;
TRiga_articolo& operator=(TToken_string& r);
TRiga_articolo& operator+=(TRiga_articolo& r);
// quantità provenienti dai documenti "planning" (commesse):
TMSP_lines _articles;
TRiga_articolo() : TToken_string(128) { }
TRiga_articolo(const TMSP_constraint & line);
virtual ~TRiga_articolo() { }
};
#define SORT_BY_PCAL -1 // cliente / articolo / impianto-linea
#define SORT_BY_PCLA -2 //
#define SORT_BY_PALC -3 //
#define SORT_BY_PACL -4 //
#define SORT_BY_PLAC -5 //
#define SORT_BY_PLCA -6 //
#define SORT_BY_PCA - 8 // cliente / articolo
#define SORT_BY_PAC - 9 //
#define SORT_BY_PRIORITY 16
#define SORT_WITHOUT_LINE 8
#define SORT_BY_CAL -17 // cliente / articolo / impianto-linea
#define SORT_BY_CLA -18 //
#define SORT_BY_ALC -19 //
#define SORT_BY_ACL -20 //
#define SORT_BY_LAC -21 //
#define SORT_BY_LCA -22 //
#define SORT_BY_CA -24 // cliente / articolo
#define SORT_BY_AC -25 //
// quantità per il processo di nettificazione/sizing in caso di generazione dell'MSP
TMRP_lines _mrp_articles;
// proposte del sistema
TMRP_lines _proposed_articles, _proposed_1stlevel;
//***********************
// form di stampa degli sheet
class TMSP_form : public TForm
{
protected:
bool validate(TForm_item &cf, TToken_string &s);
public:
TMSP_form (TIsamtempfile * rep);
};
class TCRP_form : public TForm
{
protected:
bool validate(TForm_item &cf, TToken_string &s);
public:
TCRP_form (TIsamtempfile * rep);
};
class TMSP_constraints : public TMRP_array
{
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TMSP_constraint* find(long cliente,const TString& codart,const TString& giac,
const TString& imp, const TString& lin, const TString& mag,
bool create=FALSE) ;
TMSP_constraint& operator[](long n) const
{ return (TMSP_constraint&)find_obj(n); }
};
class TMSP_record : public TObject
{
public:
long _numdoc;
int _numrig;
real _qta;
real _price;
virtual TObject* dup() const;
TMSP_record() : _numdoc(0L), _numrig(0) { }
};
class TMaster_code : public TObject
{
TString _code;
TString _liv;
TString _um;
TString _codimp;
TString _codlin;
TString _codmag;
real _expr;
real _leadtime;
public:
const char *articolo() const {return _code;}
const char *livello() const {return _liv;}
const char *um() const {return _um;}
const real &expr() const {return _expr;}
const real &leadtime() const {return _leadtime;}
const char *codimp() const {return _codimp;}
const char *codlin() const {return _codlin;}
const char *codmag() const {return _codmag;}
TMaster_code(const char *code, const char *liv, const char *ummaster, const real &expr, const real &leadtime, const char *codimp, const char *codlin, const char *codmag);
TMaster_code(const char *code, const char *liv,const char *ummaster, const real &expr, int leadtime, const char *codimp, const char *codlin, const char *codmag);
virtual ~TMaster_code() {}
};
class TMSP_line2 : public TObject
{
bool _used;
TMSP_constraint *_constraint;
TArray _mastercodes;
public:
bool used() {return _used;}
void set_use(bool on) {_used=on;}
void add_mastercode (TMaster_code *);
TMaster_code *get_mastercode (int i=0);
TMSP_constraint &constraint() {return *_constraint;}
TMSP_line2(const TMSP_constraint &c);
virtual ~TMSP_line2() {}
};
class TMSP_record_array : public TObject
{
TArray _buckets;
public:
int items() const { return _buckets.items(); }
int last() const { return _buckets.last(); }
int pred(int i) const { return _buckets.pred(i); }
virtual TMSP_record_array& operator=(const TMSP_record_array& a);
TMSP_record& operator[](int b);
};
class TMSP_constraint : public TSortable
{
long _cliente;
TCodice_articolo _codart;
TString16 _giac;
TString8 _imp, _lin;
TString8 _mag;
TString _desc;
// capacità linea per linea
TCRP_lines _capacities;
bool _on_sheet;
bool _check_master;
TArray _lines2; // codici di livello 2 per articoli NON master
TMSP_constraints _upperlines; // vincoli dei codici di livello 1 per articoli master
TMSP_record_array _bucket_qta;
protected:
virtual int compare(const TSortable& s) const;
enum Categoria_doc {_Doc_vincoli=1, _Doc_planning=2};
public:
long cliente() const { return _cliente; }
const TCodice_articolo& codice() const { return _codart; }
const TString& livgiac() const { return _giac; }
const TString& codimp() const { return _imp; }
const TString& codlin() const { return _lin; }
const TString& codmag() const { return _mag; }
const TString& desc() const { return _desc; }
void set_desc(const char* str) { _desc = str; }
bool is_page_crp() const {return curr_page()==4;}
bool riga(int b, long& ndoc, int& nriga);
void set_riga(int b, char provv, TString& codnum, int annodoc, long ndoc, int nriga);
// master sched. a due livelli:
int find_distinta_master(const TMSP_constraint & constr, TString & master, TString & livmaster,TString & um,real & expr, TString & imp,TString & lin,TString & magdep, int fromindex=0);
void set_mastercode_check(bool on);
bool mastercodes2check() const ;
bool on_field_event(TOperable_field& o, TField_event e, long jolly);
TMSP_line2 * use_mspline2(TMSP_constraint&line);
TMSP_line2 * use_mspline2(TToken_string &row, TSheet_field & sf);
void discard_line2(TMSP_line2 * );
void reset_unused_line2();
TMSP_line2 * get_unused_line2();
bool load_MRP_lines(TMSP_mode mode, int level=0);
bool gross2net(TMSP_mode mode, bool lotsizing=FALSE);
void add_MRP_bucket(TMRP_line& new_article, int nbucket, const real &curr_arts);
// proposta automatica del sistema
bool general_review(bool check_machine, bool check_human, bool useextralines, bool useextrahours,bool lotsizing, bool no_outcapacity, int anticipomin,int anticipomax, TMSP_mode mode, TMSP_logic logic, const char *msg );
int insert_propose(bool verbose=FALSE) ;
bool remove_propose(bool verbose=FALSE) ;
void add_or_sub_propose(char sign);
TMSP_constraint* add_upperline(const TMSP_constraint& constr);
TMSP_constraint* get_upperline(TMSP_constraint& constr);
bool has_upperlines() const ;
void propose_1stJIT(TMSP_logic logic, bool check_m, bool check_h);
// controlli
void print_articles();
void print_capacities();
bool sortMSPsheet();
bool sortCRPsheet();
void check_articles();
void check_capacities();
void pack_article_sheet();
// capacity review
bool capacity_review(bool useextralines, bool useextrahours);
TCRP_line *compute_capacity(TLinea_prod &lineaprod, bool useextralines, bool useextrahours);
int last() const { return _bucket_qta.last(); }
int pred(int i) const { return _bucket_qta.pred(i); }
TMSP_constraint* find_constraint(const TMSP_line& l,bool force_insert=FALSE);
int find_constr_row(TMSP_constraint& c);
virtual real& qta(int b) { return _bucket_qta[b]._qta; }
virtual real& price(int b) { return _bucket_qta[b]._price; }
bool test_art_row(int r, bool signal=TRUE);
bool test_load_row(int r, bool signal=TRUE);
int init_bucket0(TArticolo_giacenza &art, int r);
virtual void fill_sheet_row(TToken_string& row, const TMask & m, bool codes_only=FALSE) ;
bool do_test_art_row(int r, int c, bool signal);
void do_test_art_2ndlevel(TMSP_line2 *mspline, bool erase=FALSE);
bool is_on_sheet() const { return _on_sheet; }
void set_on_sheet(bool on = TRUE) { _on_sheet = on; }
void copy_sheet_row(TToken_string & newrow, const TToken_string & row);
TMSP_constraint & operator=(const TMSP_constraint & line);
TMSP_constraint(long cliente,
const TCodice_articolo& codart,
const TString& giac,
const TString& imp, const TString& lin,
const TString& mag);
TMSP_constraint(const TMSP_constraint & cons);
virtual ~TMSP_constraint() { }
};
// linee contenenti pianificazioni
class TMSP_line : public TMSP_constraint
{
public:
virtual void fill_sheet_row(TToken_string& row, const TMask & m, bool codes_only=FALSE) ;
TMSP_line(long cliente, const TCodice_articolo& codart,
const TString& giac, const TString& mag,
const TString& imp, const TString& lin);
TMSP_line(TMSP_line & line);
TMSP_line(TMSP_constraint & cons);
virtual ~TMSP_line() { }
};
class TMSP_lines : public TMRP_array
{
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TMSP_line* find(long cliente, const TString& art, const TString& gia,
const TString& imp, const TString& lin, const TString& mag,
bool create=FALSE);
TMSP_line* find(const TToken_string& row, bool create=FALSE);
TMSP_line& operator[](long i) const
{ return (TMSP_line&)find_obj(i); }
};
class TCapacita_prod : public TSortable
{
real _capacity; // Capacita' macchina
real _human_capacity; // Capacita' macchina
real _load; // Carico macchina
real _human_load; // Carico uomo
// static TDecoder* _umart1; // Decoder per trovare unita' base articolo
// static TDecoder* _umart2; // Decoder per trovare conversione
// static TDecoder* _umdist; // Decoder per trovare unita' base distinta
protected:
virtual int compare(const TSortable& s) const;
virtual TObject* dup() const { return new TCapacita_prod(*this); }
void copy(const TCapacita_prod& q);
real get_factor(const TCodice_um& um) const;
void convert(real& val, const TCodice_um& from_um, const TCodice_um& to_um) const;
public:
const TCapacita_prod& operator =(const TCapacita_prod& q)
{ copy(q); return q; }
void set(const real& cap, const real& load);
void set_capacity(const real& cap){_capacity=cap;}
void set_human_capacity(const real& cap){_human_capacity=cap;}
void set_load(const real& load) {_load=load;}
void set_human_load(const real& load) {_human_load=load;}
void add_capacity(const real& cap){_capacity+=cap;}
void add_human_capacity(const real& cap){_human_capacity+=cap;}
void add_load(const real& load) {_load+=load;}
void add_human_load(const real& load) {_human_load+=load;}
real & capacity() {return _capacity;}
real & load() {return _load;}
real & human_capacity() {return _human_capacity;}
real & human_load() {return _human_load;}
void clear_sheets();
void set_sheet_header();
void fill_sheet();
void enable_codes(int r, bool on = TRUE);
void disable_codes(int r) {enable_codes(r,FALSE);}
TCapacita_prod ();
TCapacita_prod (const real& cap, const real& load);
TCapacita_prod (const TCapacita_prod & q) { copy(q); }
virtual ~TCapacita_prod () {}
};
class TCRP_line : public TSortable
{
TString8 _lineap, _imp;
TString _desc;
bool _on_sheet;
TArray _bucket;
protected:
virtual int compare(const TSortable& s) const;
TCapacita_prod& bucket(int n) ;
TCapacita_prod& operator[](int n)
{return bucket(n);}
// costruttore per la derivazione
TPlanning_mask(const char * name);
public:
const TString& codimp() const { return _imp; }
const TString& codlin() const { return _lineap; }
const TString& desc() const { return _desc; }
void set_desc(const char* str) { _desc = str; }
void msprow2codes(TToken_string &row, long &clifor, TCodice_articolo &art ,
TString & liv, TString & mag, TString & magcoll, TString & imp, TString & lin, TString & um);
void crprow2codes(TToken_string &row, TString & imp, TString & lin, long &clifor, TCodice_articolo &art ,
TString & liv, TString & um);
TMRP_line* find_propose(long codcli, const char * codart,const char * liv,
const char * codimp,const char * codlin,const char * mag, const char * magcoll,
bool Force=FALSE);
TMSP_line* find_article(long cli, const char *art, const char *liv,
const char *imp, const char *lin, const char *mag, const char *magc,
bool Force=FALSE)
{return _articles.find(cli, art, liv, imp, lin, mag, magc, Force);}
int last() const { return _bucket.last(); }
int pred(int i) const { return _bucket.pred(i); }
real& capacity(int b) { return bucket(b).capacity(); }
real& load(int b) { return bucket(b).load(); }
real& human_capacity(int b) { return bucket(b).human_capacity(); }
real& human_load(int b) { return bucket(b).human_load(); }
int days_per_bucket() const;
void set_capacity(int b,const real & v ) { bucket(b).set_capacity(v); }
void set_human_capacity(int b,const real & v ) { bucket(b).set_human_capacity(v); }
// void set_load(int b, const real & v) { bucket(b).set_load(v); }
// void set_human_capacity(int b,const real & v ) { bucket(b).set_human_capacity(v); }
// void set_human_load(int b, const real & v) { bucket(b).set_human_load(v); }
int round_date(TDate& date, bool up = FALSE) const;
void round_field(TMask_field& fld, bool up) const;
// void add_capacity(int b,const real & v ) { bucket(b).add_capacity(v); }
void add_load(int b, const real & v) { bucket(b).add_load(v); }
// void add_human_capacity(int b,const real & v ) { bucket(b).add_human_capacity(v); }
void add_human_load(int b, const real & v) { bucket(b).add_human_load(v); }
int test_codnum(const TCodice_numerazione& num) const;
bool test_tipodoc_num( const TSheet_field &sheet_num , const TSheet_field &sheet_type) ;
void fill_capacity_row(TToken_string& row, bool percent=FALSE);
void fill_load_row(TToken_string& row, bool percent=FALSE);
void fill_hcapacity_row(TToken_string& row, bool percent=FALSE);
void fill_hload_row(TToken_string& row, bool percent=FALSE);
int test_status(const TRectype& doc, int tipo) const;
bool has_confirmed_status(const TRectype& doc, TToken_string &riga) const;
bool has_confirmed_status(const TRectype &doc) const;
bool is_on_sheet() const { return _on_sheet; }
void set_on_sheet(bool on = TRUE) { _on_sheet = on; }
bool elabora();
bool carica_documenti();
int salva_documenti();
//TCRP_line(const TString& codlin);
TCRP_line(const TString& codimp,const TString& codlin);
virtual ~TCRP_line() { }
void init();
TPlanning_mask();
virtual ~TPlanning_mask() { }
};
class TCRP_lines : public TMRP_array
class TPlanning_app : public TSkeleton_application
{
TPlanning_mask *_m;
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TCRP_line* find(const TLinea_prod& linea_prod,
const char * codart="", long codcli=0L, bool create=FALSE);
TCRP_line* find(const char * codimp="", const char * codlin="",
const char * codart="", long codcli=0L, bool create=FALSE);
TCRP_line& operator[](long n) const
{ return (TCRP_line&)find_obj(n); }
void openfiles() ;
virtual TPlanning_mask& mask() {return *_m;}
virtual bool create();
virtual void main_loop();
virtual bool firm_change_enabled() const { return FALSE; }
};
class TPlan_docs : public TMRP_array
{
TString16 _num, _doc, _rig;
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TDocumento& find(int anno, long num);
TRiga_documento& add_to_row(int anno, long num, int riga, const real& qta);
long flush(const TDate& data);
TPlan_docs(const char* num, const char* tip, const char* rig);
virtual ~TPlan_docs() { }
};

View File

@ -4,9 +4,12 @@
#define G_POSTPROCESS 2
#define G_MASTERSCHEDULE 6
#define G_NOMASTERSCHEDULE 7
#define G_BUCKET_DEF 8
#define G_BUCKET_WEEK 9
#define G_FIRSTFIT 10
#define G_INFINITE 20
#define G_FINITE 30
#define G_FINITE_H 35
#define G_QTA 40
#define G_VALORI 41
@ -40,11 +43,11 @@
#define F_HUMANCHECK_CRP 222
#define F_2LEVEL_MSP 223
#define F_2LEVEL_PRIORITY 224
//#define F_??? 225
#define F_EXTRACAPACITY 225
#define F_SHOWPERC 226
#define F_SHOWPERC2 227
#define F_SHOWDETAILS 227
#define F_LOADTYPE 228
//#define F_??? 229
#define F_EXTRAHCAPACITY 229
#define F_USENONSTDLIN_MSP 230
#define F_USEEXTRAHRS_MSP 231
@ -59,8 +62,8 @@
#define F_ANTICIPOMIN 240
#define F_OUTOFCAPACITY 241
#define F_MAXGIORNIGIAC 242
//#define F_??? 243
//#define F_??? 244
#define F_ANTICIPOMAX2 243
#define F_ANTICIPOMIN2 244
//#define F_??? 245
#define F_RECALC_TYPE2 246
@ -94,7 +97,8 @@
#define F_BUCKET 350
#define F_BUCKETS 351
#define F_DAYXBUCK 352
#define F_LASTWRKDAY 353
#define H_BUCKET 354
// non profiled fields : nenumber freely
#define F_ARTICOLI 401
@ -120,6 +124,7 @@
#define F_DESCTIPO 102
#define F_DASTATO 103
#define F_ASTATO 104
#define F_STATODEF 105
// sheet articoli
#define LAST_BUCKET 13
@ -138,44 +143,49 @@
#define F_CODLIN 111
#define F_MAGAZZINO 112
#define F_DEPOSITO 113
#define F_UM 114
#define F_BUCKET0 115
#define F_BUCKET0_V 116
#define F_BUCKET1 117
#define F_BUCKET1_V 118
#define F_BUCKET2 119
#define F_BUCKET2_V 120
#define F_BUCKET3 121
#define F_BUCKET3_V 122
#define F_BUCKET4 123
#define F_BUCKET4_V 124
#define F_BUCKET5 125
#define F_BUCKET5_V 126
#define F_BUCKET6 127
#define F_BUCKET6_V 128
#define F_BUCKET7 129
#define F_BUCKET7_V 130
#define F_BUCKET8 131
#define F_BUCKET8_V 132
#define F_BUCKET9 133
#define F_BUCKET9_V 134
#define F_BUCKET10 135
#define F_BUCKET10_V 136
#define F_BUCKET11 137
#define F_BUCKET11_V 138
#define F_BUCKET12 139
#define F_BUCKET12_V 140
#define F_BUCKET13 141
#define F_BUCKET13_V 142
#define F_MASTERCODE 143
#define F_SORTCODIMP 144
#define F_SORTCODLIN 145
#define F_MAG_COLL 114
#define F_DEP_COLL 115
#define F_UM 116
#define F_BUCKET0 117
#define F_BUCKET0_V 118
#define F_BUCKET1 119
#define F_BUCKET1_V 120
#define F_BUCKET2 121
#define F_BUCKET2_V 122
#define F_BUCKET3 123
#define F_BUCKET3_V 124
#define F_BUCKET4 125
#define F_BUCKET4_V 126
#define F_BUCKET5 127
#define F_BUCKET5_V 128
#define F_BUCKET6 129
#define F_BUCKET6_V 130
#define F_BUCKET7 131
#define F_BUCKET7_V 132
#define F_BUCKET8 133
#define F_BUCKET8_V 134
#define F_BUCKET9 135
#define F_BUCKET9_V 136
#define F_BUCKET10 137
#define F_BUCKET10_V 138
#define F_BUCKET11 139
#define F_BUCKET11_V 140
#define F_BUCKET12 141
#define F_BUCKET12_V 142
#define F_BUCKET13 143
#define F_BUCKET13_V 144
#define F_MASTERCODE 145
#define F_SORTCODIMP 146
#define F_SORTCODLIN 147
#define H_CODIMP 150
#define F_DESCCLI 151
#define F_DESCIMP 158
#define F_DESCLIN 159
#define F_DESCMAG 160
#define H_CODIMP 161
#define F_DESCIMP 152
#define F_DESCLIN 153
#define F_DESCMAG 154
#define F_DESCMAGCOLL 155
#define F_DETTAGLIO_IN 160
#define F_DETTAGLIO_OUT 161
// sheet linee
#define F_CODIMPCRP 101

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,13 @@
#include <applicat.h>
#include <colors.h>
#include <defmask.h>
#include <progind.h>
#include <tabutil.h>
#include <xvtility.h>
#include <utility.h>
#include <printer.h>
#include <execp.h>
#include "mrplib.h"
#include "../mg/mglib.h"
#include "../ve/velib.h"
#include "../ve/veconf.h"
#include "mr2100.h"
#include "mr2200.h"
#include "mr2201.h"
#include "mr2200a.h"
#include "mr2200b.h"
// albero per le ricerche sulle dist
static TDistinta_tree *_dist_tree=NULL;
@ -219,59 +210,50 @@ int TRiga_articolo::order_compare( const TToken_string &r1 , const TToken_strin
} else {
// ordinamenti non standard
short f;
short fields_ACL[] = {F_ARTICOLO, F_CLIENTE, F_SORTCODIMP, F_SORTCODLIN};
short fields_ALC[] = {F_ARTICOLO, F_SORTCODIMP, F_SORTCODLIN, F_CLIENTE};
short fields_LAC[] = {F_SORTCODIMP, F_SORTCODLIN, F_ARTICOLO, F_CLIENTE};
short fields_LCA[] = {F_SORTCODIMP, F_SORTCODLIN, F_CLIENTE, F_ARTICOLO};
short fields_CLA[] = {F_CLIENTE, F_SORTCODIMP, F_SORTCODLIN, F_ARTICOLO};
short fields_CAL[] = {F_CLIENTE, F_ARTICOLO, F_SORTCODIMP, F_SORTCODLIN};
short fields_CA[] = {F_CLIENTE, F_CLIENTE, F_CLIENTE, F_ARTICOLO};
short fields_AC[] = {F_ARTICOLO, F_CLIENTE, F_CLIENTE, F_CLIENTE};
for (int i = -1; i <= 4 && cmp == 0; i++)
short fields_ACL[] = {F_PRIORITA,F_ARTICOLO, F_CLIENTE, F_SORTCODIMP, F_SORTCODLIN,F_PRIORITA};
short fields_ALC[] = {F_PRIORITA,F_ARTICOLO, F_SORTCODIMP, F_SORTCODLIN, F_CLIENTE,F_PRIORITA};
short fields_LAC[] = {F_PRIORITA,F_SORTCODIMP, F_SORTCODLIN, F_ARTICOLO, F_CLIENTE,F_PRIORITA};
short fields_LCA[] = {F_PRIORITA,F_SORTCODIMP, F_SORTCODLIN, F_CLIENTE, F_ARTICOLO,F_PRIORITA};
short fields_CLA[] = {F_PRIORITA,F_CLIENTE, F_SORTCODIMP, F_SORTCODLIN, F_ARTICOLO,F_PRIORITA};
short fields_CAL[] = {F_PRIORITA,F_CLIENTE, F_ARTICOLO, F_SORTCODIMP, F_SORTCODLIN,F_PRIORITA};
short fields_CA[] = {F_PRIORITA,F_CLIENTE, F_ARTICOLO, F_PRIORITA, F_PRIORITA, F_PRIORITA};
short fields_AC[] = {F_PRIORITA,F_ARTICOLO, F_CLIENTE, F_PRIORITA, F_PRIORITA, F_PRIORITA};
for (int ii = 0; ii < 4 && cmp == 0; ii++)
{
if (i<0 || i>3)
const int i = ii + (-level <= SORT_BY_PRIORITY ? 0 : 1);
switch (level)
{
if (-level <= SORT_BY_PRIORITY == i<0)
f = F_PRIORITA;
else
f = 0;
} else
switch (level)
{
case SORT_BY_PCAL:
case SORT_BY_CAL:
f=fields_CAL[i]; break;
case SORT_BY_PCLA:
case SORT_BY_CLA:
f=fields_CLA[i]; break;
case SORT_BY_PLCA:
case SORT_BY_LCA:
f=fields_LCA[i]; break;
case SORT_BY_PLAC:
case SORT_BY_LAC:
f=fields_LAC[i]; break;
case SORT_BY_PACL:
case SORT_BY_ACL:
f=fields_ACL[i]; break;
case SORT_BY_PALC:
case SORT_BY_ALC:
f=fields_ALC[i]; break;
case SORT_BY_PAC:
case SORT_BY_AC:
f=fields_AC[i]; break;
case SORT_BY_PCA:
case SORT_BY_CA:
f=fields_CA[i]; break;
default:
NFCHECK("Ordinamento sconosciuto");
break;
}
if (f)
{
r1.get(f-FIRST_FIELD, str0);
r2.get(f-FIRST_FIELD, str1);
cmp=TRiga_articolo::compare_field(str0,str1,f) * (ascending && f != F_PRIORITA ? 1 : -1);
case SORT_BY_PCAL:
case SORT_BY_CAL:
f=fields_CAL[i]; break;
case SORT_BY_PCLA:
case SORT_BY_CLA:
f=fields_CLA[i]; break;
case SORT_BY_PLCA:
case SORT_BY_LCA:
f=fields_LCA[i]; break;
case SORT_BY_PLAC:
case SORT_BY_LAC:
f=fields_LAC[i]; break;
case SORT_BY_PACL:
case SORT_BY_ACL:
f=fields_ACL[i]; break;
case SORT_BY_PALC:
case SORT_BY_ALC:
f=fields_ALC[i]; break;
case SORT_BY_PAC:
case SORT_BY_AC:
f=fields_AC[i]; break;
case SORT_BY_PCA:
case SORT_BY_CA:
f=fields_CA[i]; break;
default:
NFCHECK("Ordinamento sconosciuto");
break;
}
r1.get(f-FIRST_FIELD, str0);
r2.get(f-FIRST_FIELD, str1);
cmp=TRiga_articolo::compare_field(str0,str1,f) * (ascending && f != F_PRIORITA ? 1 : -1);
}
}
return cmp;
@ -423,7 +405,7 @@ TRiga_articolo::TRiga_articolo(const TMSP_constraint& line)
add(line.codlin(),F_CODLIN-FIRST_FIELD);
TString8 str = line.codmag().left(3);
add(str, F_MAGAZZINO-FIRST_FIELD);
add(str,F_MAGAZZINO-FIRST_FIELD);
str = line.codmag().mid(3);
add(str, F_DEPOSITO-FIRST_FIELD);
@ -440,15 +422,65 @@ TRiga_articolo::TRiga_articolo(const TMSP_constraint& line)
}
///////////////////////////////////////////////////////////
TRigadoc_ref::TRigadoc_ref(const char *codnum, int annodoc, long numdoc,int numrig, const real &qta, const real &prz)
{
_codnum =codnum;
_annodoc =annodoc;
_numdoc =numdoc;
_numrig =numrig;
_qta=qta;
_prz=prz;
}
TObject* TRigadoc_ref::dup() const
{
TRigadoc_ref* o=new TRigadoc_ref(_codnum,_annodoc,_numdoc,_numrig,_qta,_prz);
return o;
}
////////////////////
TMSP_record::TMSP_record() :
_curr_ref(-1), _qta_locked(FALSE), _qta_min(ZERO),_qta(ZERO),_price(ZERO)
{ }
TObject* TMSP_record::dup() const
{
TMSP_record* o=new TMSP_record();
o->_numdoc=_numdoc;
o->_numrig=_numrig;
o->_rigadoc_refs =_rigadoc_refs;
o->_qta_locked=_qta_locked;
o->_qta_min=_qta_min;
o->_qta=_qta;
o->_price=_price;
return o;
}
void TMSP_record::remove_rigaref()
{
CHECK(_curr_ref>0,"Nessun riferimento a riga documento da cancellare");
_rigadoc_refs.remove(_curr_ref-1);
if (_curr_ref>=_rigadoc_refs.items())
_curr_ref--;
}
void TMSP_record::add_rigaref(TRigadoc_ref *r)
{
_rigadoc_refs.add(r);
_curr_ref = _rigadoc_refs.items();
}
TRigadoc_ref *TMSP_record::first_rigaref()
{
_curr_ref=0;
return next_rigaref();
}
TRigadoc_ref *TMSP_record::next_rigaref()
{
if (_rigadoc_refs.items()<=_curr_ref)
return NULL;
return (TRigadoc_ref *)_rigadoc_refs.objptr(_curr_ref++);
}
TRigadoc_ref* TMSP_record::rigaref(int n)
{
if (_rigadoc_refs.items()<=n)
return NULL;
return (TRigadoc_ref* )_rigadoc_refs.objptr(_curr_ref=n);
}
///////////////////////////////////////////////////////////
TMSP_record& TMSP_record_array::operator[](int b)
@ -472,58 +504,69 @@ TMSP_record_array& TMSP_record_array::operator=(const TMSP_record_array& a)
///////////////////////////////////////////////////////////
TCapacita_prod::TCapacita_prod () :
_capacity(), _load()
{ }
TCapacita_prod::TCapacita_prod (const real& cap, const real& load) :
_capacity(cap), _load(load)
{ }
void TCapacita_prod::set(const real& cap, const real& load)
{ _capacity=(cap);_load=(load);}
void TCapacita_prod::copy (const TCapacita_prod & q)
TCapacity_couple::TCapacity_couple() :
_machine(ZERO), _human(ZERO)
{}
TCapacity_couple::TCapacity_couple(const real & machine, const real & human) :
_machine(machine), _human(human)
{}
TCapacity_couple& TCapacity_couple::operator= (const TCapacity_couple&c)
{
_machine = c._machine;
_human = c._human;
return *this;
}
TCapacity_couple::TCapacity_couple(const TCapacity_couple&c) :
_machine(c._machine), _human(c._human)
{
_capacity=q._capacity; // Valore attuale
_load=q._load; // Valore attuale
}
int TCapacita_prod::compare(const TSortable& s) const
///////////////////////////////////////////////////////////
TCapacity_record::TCapacity_record () :
_capacity(), _load()
{ }
void TCapacity_record::copy(const TCapacity_record & q)
{
TCapacita_prod& c=(TCapacita_prod&)s;
real r=_capacity-c._capacity;
_capacity=q._capacity;
_load=q._load;
}
int TCapacity_record::compare(const TSortable& s) const
{
TCapacity_record& c=(TCapacity_record&)s;
real r=_capacity.machine()-c._capacity.machine();
return r.sign();
}
TCRP_line::TCRP_line(const TString& codimp,const TString& codlin)
: _lineap(codlin),_on_sheet(FALSE)
///////////////////////////////////////
TCRP_line::TCRP_line(const TString& codimp,const TString& codlin,const TString& codart, long codcli)
: _lineap(codlin),_codart(codart), _codcli(codcli), _on_sheet(FALSE)
{
if (!codlin.blank())
{
TTable tablnp("LNP");
tablnp.put("CODTAB",_lineap);
tablnp.read();
_desc = tablnp.get("S0");
_imp = tablnp.get("S6");
const TRectype & rec = cache().get("LNP",_lineap);
_desc = rec.get("S0");
_imp = rec.get("S6");
}
else
{
_imp = codimp ;
if (!codimp.blank())
{
TTable tabimp("IMP");
tabimp.put("CODTAB",_imp);
tabimp.read();
_desc = tabimp.get("S0");
const TRectype & rec = cache().get("IMP",_imp);
_desc = rec.get("S0");
}
else
{
_desc = "Totale ditta";
}
}
if (!codart.blank())
{
const TRectype & rec = cache().get(LF_ANAMAG,_codart);
_desc = rec.get("DESCR");
}
}
int TCRP_line::compare(const TSortable& s) const
@ -531,14 +574,14 @@ int TCRP_line::compare(const TSortable& s) const
const TCRP_line& c = (const TCRP_line&)s;
int cmp = _imp.compare(c._imp);
if (cmp == 0)
{
cmp = _lineap.compare(c._lineap);
}
if (cmp == 0)
cmp = _codart.compare(c._codart);
return cmp;
}
// carica una riga di sheet con i dati dell'oggetto vincolo
void TCRP_line::fill_capacity_row(TToken_string& row, bool percent)
void TCRP_line::fill_capacity_row(TToken_string& row, bool human, bool percent)
{
row.add(codimp(),F_CODIMPCRP -FIRST_FIELD);
row.add(codlin(),F_CODLINCRP -FIRST_FIELD);
@ -548,24 +591,7 @@ void TCRP_line::fill_capacity_row(TToken_string& row, bool percent)
real r;
for (int bu = last(); bu > 0; bu = pred(bu))
{
r=capacity(bu);
if (!r.is_zero())
row.add(percent ? "100" : r.string(), bu + F_LBUCKET0 -FIRST_FIELD); // buckets
else
row.add("", bu + F_LBUCKET0 -FIRST_FIELD);
}
}
void TCRP_line::fill_hcapacity_row(TToken_string& row, bool percent)
{
row.add(codimp(),F_CODIMPCRP -FIRST_FIELD);
row.add(codlin(),F_CODLINCRP -FIRST_FIELD);
row.add(percent ? "%": "ore",F_LUM -FIRST_FIELD);
real r;
for (int bu = last(); bu > 0; bu = pred(bu))
{
r=human_capacity(bu);
r= human ? capacity(bu).human() : capacity(bu).machine();
if (!r.is_zero())
row.add(percent ? "100" : r.string(), bu + F_LBUCKET0 -FIRST_FIELD); // buckets
else
@ -574,43 +600,32 @@ void TCRP_line::fill_hcapacity_row(TToken_string& row, bool percent)
}
// carica una riga di sheet con i dati dell'oggetto vincolo
void TCRP_line::fill_load_row(TToken_string& row, bool percent)
void TCRP_line::fill_load_row(TToken_string& row, bool human, bool percent)
{
row.add(codimp(),F_CODIMPCRP -FIRST_FIELD);
row.add(codlin(),F_CODLINCRP -FIRST_FIELD);
row.add(codart(),F_CODARTCRP -FIRST_FIELD);
row.add(percent ? "%": "ore",F_LUM -FIRST_FIELD);
real r;
real c,l;
for (int bu = last(); bu > 0; bu = pred(bu))
{
r=percent ? (capacity(bu).is_zero() ? ZERO : (100L * load(bu) / capacity(bu))) : load(bu) ;
row.add(r.string(), bu + F_LBUCKET0 -FIRST_FIELD); // buckets
}
}
void TCRP_line::fill_hload_row(TToken_string& row, bool percent)
{
row.add(codimp(),F_CODIMPCRP -FIRST_FIELD);
row.add(codlin(),F_CODLINCRP -FIRST_FIELD);
row.add(percent ? "%": "ore",F_LUM -FIRST_FIELD);
real r;
for (int bu = last(); bu > 0; bu = pred(bu))
{
r=percent ? (human_capacity(bu).is_zero() ? ZERO :(100L * human_load(bu) / human_capacity(bu))) : human_load(bu) ;
row.add(r.string(), bu + F_LBUCKET0 -FIRST_FIELD); // buckets
c = human ? capacity(bu).human() : capacity(bu).machine() ;
l = human ? load(bu).human() : load(bu).machine() ;
if (percent)
l = c.is_zero() ? ZERO : (100L * l / c);
row.add(l.string(), bu + F_LBUCKET0 -FIRST_FIELD); // buckets
}
}
TCapacita_prod& TCRP_line::bucket(int n)
TCapacity_record& TCRP_line::bucket(int n)
{
TCapacita_prod *o;
o=(TCapacita_prod *)_bucket.objptr(n);
TCapacity_record *o;
o=(TCapacity_record *)_bucket.objptr(n);
if (o==NULL)
{
o=new TCapacita_prod();
o=new TCapacity_record();
_bucket.add(o,n);
}
return *o;
@ -624,17 +639,18 @@ TCapacita_prod& TCRP_line::bucket(int n)
TSortable* TCRP_lines::new_obj(const TToken_string& key) const
{
TString8 codimp, codlin;
key.get(0,codimp);
TString codart;
long codcli;
key.get(3,codart);
codcli = atoi(codart);
key.get(2,codart);
key.get(1,codlin);
return new TCRP_line(codimp, codlin);
key.get(0,codimp);
return new TCRP_line(codimp, codlin, codart, codcli);
}
TCRP_line* TCRP_lines::find(const TLinea_prod& linea_prod, const char * codart, long codcli, bool create)
{
/* _key=linea_prod.codimp();
_key.add(linea_prod.codice());
TSortable* s = create ? add_obj(_key) : find_obj(_key);
return (TCRP_line*)s;*/
TString8 codimp(linea_prod.codimp());
TString8 codlin(linea_prod.codice());
return find(codimp, codlin ,codart, codcli, create);
@ -644,10 +660,23 @@ TCRP_line* TCRP_lines::find(const char * codimp, const char * codlin, const char
{
_key.add(codimp,0);
_key.add(codlin,1);
TCRP_line * l = NULL;
if (create && codart && *codart)
{
l = (TCRP_line*)find_obj(_key);
CHECK(l,"Impossibile trovare la linea di Capacity review per un articolo");
}
_key.add(codart,2); // articolo
_key.add(format("%ld",codcli),3); // cliente
TSortable* s = create ? add_obj(_key) : find_obj(_key);
return (TCRP_line*)s;
TCRP_line *s = (TCRP_line*)(create ? add_obj(_key) : find_obj(_key));
if (create && l)
for (int b = l->last(); b >=0; b--)
{
s->capacity(b).set_machine(l->capacity(b).machine());
s->capacity(b).set_human(l->capacity(b).human());
}
return s;
}
///////////////////////////////////////////////////////////
@ -743,6 +772,10 @@ void TMSP_constraint::fill_sheet_row(TToken_string& row, const TMask & m, bool c
row.add(str, F_MAGAZZINO-FIRST_FIELD);
str = _mag.mid(3);
row.add(str,F_DEPOSITO-FIRST_FIELD);
str = _mag_coll.left(3);
row.add(str, F_MAG_COLL-FIRST_FIELD);
str = _mag_coll.mid(3);
row.add(str,F_DEP_COLL-FIRST_FIELD);
const TCodice_um um;
const TQuantita qta_art(codice(), um, ZERO);
@ -762,40 +795,64 @@ void TMSP_constraint::fill_sheet_row(TToken_string& row, const TMask & m, bool c
row.add(mastercodes2check() ? MASTERCODE_CHAR : ' ',F_MASTERCODE-FIRST_FIELD);
}
bool TMSP_constraint::riga(int buck, long& ndoc, int& nrig)
TRigadoc_ref* TMSP_constraint::first_rigaref(int buck)
{
TMSP_record& b = _bucket_qta[buck];
ndoc = b._numdoc;
nrig = b._numrig;
return ndoc > 0L && nrig > 0;
TRigadoc_ref* rdr=b.first_rigaref();
return rdr;
}
TRigadoc_ref* TMSP_constraint::next_rigaref(int buck)
{
TMSP_record& b = _bucket_qta[buck];
TRigadoc_ref* rdr=b.next_rigaref();
return rdr;
}
int TMSP_constraint::rigarefs(int buck)
{
return _bucket_qta[buck].rigarefs();
}
TRigadoc_ref * TMSP_constraint::rigaref(int buck, int n)
{
return _bucket_qta[buck].rigaref(n);
}
void TMSP_constraint::add_rigaref(int buck, TString& codnum, int annodoc, long ndoc, int nrig, const real & qta, const real &prz)
{
TMSP_record& b = _bucket_qta[buck];
TRigadoc_ref *rdr= new TRigadoc_ref(codnum, annodoc, ndoc, nrig, qta,prz);
b.add_rigaref(rdr);
}
void TMSP_constraint::set_riga(int buck, char provv, TString& codnum, int annodoc, long ndoc, int nrig)
void TMSP_constraint::add_rigaref(int buck, TRigadoc_ref *rdr)
{
TMSP_record& b = _bucket_qta[buck];
b._numdoc = ndoc;
b._numrig = nrig;
b.add_rigaref(rdr);
}
void TMSP_constraint::remove_rigaref(int buck)
{
TMSP_record& b = _bucket_qta[buck];
b.remove_rigaref();
}
int TMSP_constraint::find_distinta_master(const TMSP_constraint & constr, TString & master,TString & livmaster,TString & um, real & expr, TString & imp,TString & lin,TString & magdep, int fromindex)
{
TArray sons;
dist_tree().set_global("_LIVELLO",constr.livgiac());
dist_tree().set_global("_IMPIANTO",constr.codimp());
dist_tree().set_global("_LINEA",constr.codlin());
dist_tree().set_global("_MAGAZZINO",constr.codmag());
if (dist_tree().set_root(constr.codice()))
{
dist_tree().set_global("_LIVELLO",constr.livgiac());
dist_tree().set_global("_IMPIANTO",constr.codimp());
dist_tree().set_global("_LINEA",constr.codlin());
dist_tree().set_global("_MAGAZZINO",constr.codmag());
dist_tree().explode(sons, FALSE, RAGGR_EXP_NONE, 1);
dist_tree().explode(sons, FALSE, RAGGR_EXP_NONE, 1, "AV");
TRiga_esplosione* riga;
while (riga=(TRiga_esplosione* )sons.objptr(fromindex))
{
if (distinta_master(riga->articolo()))
if (distinta_master(riga->articolo(), TRUE))
{
master=riga->articolo();
livmaster=riga->livello();
um =riga->um();
expr =riga->val();
master = riga->articolo();
livmaster = riga->livello();
um = riga->um();
expr = riga->val();
return fromindex;
}
fromindex=sons.succ(fromindex);
@ -819,7 +876,7 @@ void TMSP_constraint::set_mastercode_check(bool on)
TMSP_line2 *TMSP_constraint::use_mspline2(TToken_string & row, TSheet_field & sf)
{
TString16 liv;
TString8 mag,imp,lin;
TString8 mag,magc,imp,lin;
long codcli=row.get_long(F_CLIENTE-FIRST_FIELD);
livelli_giac().pack_grpcode(liv, row.get(sf.cid2index(F_LIV1)),1);
livelli_giac().pack_grpcode(liv, row.get(sf.cid2index(F_LIV2)),2);
@ -829,8 +886,10 @@ TMSP_line2 *TMSP_constraint::use_mspline2(TToken_string & row, TSheet_field & sf
lin=row.get(sf.cid2index(F_CODLIN));
add_magcode(mag, row.get(sf.cid2index(F_MAGAZZINO)));
add_depcode(mag, row.get(sf.cid2index(F_DEPOSITO)));
add_magcode(magc, row.get(sf.cid2index(F_MAG_COLL)));
add_depcode(magc, row.get(sf.cid2index(F_DEP_COLL)));
codcli=row.get_long(F_CLIENTE-FIRST_FIELD);
TMSP_line mspline(codcli, codice(), liv, imp, lin, mag);
TMSP_line mspline(codcli, codice(), liv, imp, lin, mag, magc);
for (int b= 1 ; b< LAST_BUCKET ; b++)
{
real q(row.get(sf.cid2index(F_BUCKET0+b*2)));
@ -945,6 +1004,7 @@ TMSP_constraint & TMSP_constraint::operator=(const TMSP_constraint & line)
_imp=line.codimp();
_lin=line.codlin();
_mag=line.codmag();
_mag_coll=line.codmag_coll();
_on_sheet=_on_sheet;
_desc=line.desc();
_bucket_qta=line._bucket_qta;
@ -957,14 +1017,15 @@ TMSP_constraint::TMSP_constraint(long cliente,
const TString& giac,
const TString& imp,
const TString& lin,
const TString& mag)
const TString& mag,
const TString& magc)
: _cliente(cliente), _codart(codart), _giac(giac),
_imp(imp), _lin(lin), _mag(mag),_on_sheet(FALSE),_check_master(FALSE)
_imp(imp), _lin(lin), _mag(mag), _mag_coll(magc),_on_sheet(FALSE),_check_master(FALSE)
{ }
TMSP_constraint::TMSP_constraint(const TMSP_constraint & line)
: _cliente(line.cliente()), _codart(line.codice()), _giac(line.livgiac()),
_imp(line.codimp()), _lin(line.codlin()), _mag(line.codmag()), _on_sheet(FALSE),
_imp(line.codimp()), _lin(line.codlin()), _mag(line.codmag()), _mag_coll(line.codmag_coll()),_on_sheet(FALSE),
_check_master(FALSE), _desc(line.desc())
{
}
@ -981,7 +1042,7 @@ TSortable* TMSP_constraints::new_obj(const TToken_string& key) const
TString8 imp; key.get(3, imp); imp.trim();
TString8 lin; key.get(4, lin); lin.trim();
TString8 mag; key.get(5, mag); mag.trim();
return new TMSP_constraint(cli, art, gia, imp, lin, mag);
return new TMSP_constraint(cli, art, gia, imp, lin, mag, "");
}
TMSP_constraint* TMSP_constraints::find(long cliente,
@ -990,6 +1051,7 @@ TMSP_constraint* TMSP_constraints::find(long cliente,
const TString& imp,
const TString& lin,
const TString& mag,
// const TString& magc,
bool create)
{
_key.format("%ld", cliente);
@ -998,6 +1060,7 @@ TMSP_constraint* TMSP_constraints::find(long cliente,
_key.add(imp);_key.trim();
_key.add(lin);_key.trim();
_key.add(mag);_key.trim();
// _key.add(magc);_key.trim();
TSortable* s = create ? add_obj(_key) : find_obj(_key);
TMSP_constraint *c=(TMSP_constraint*)s;
if (create)
@ -1008,6 +1071,55 @@ TMSP_constraint* TMSP_constraints::find(long cliente,
return c;
}
TMSP_constraint* TMSP_constraints::find(const TToken_string& row, bool create)
{
TString80 str,giaclev;
_key.cut(0);
for (int i = 0; i <= 11; i++)
{
row.get(i, str);
str.trim();
switch (i+FIRST_FIELD)
{
case F_LIV1:
case F_LIV2:
case F_LIV3:
livelli_giac().pack_grpcode(giaclev, str, i+FIRST_FIELD-F_LIV1+1); break;
case F_LIV4:
livelli_giac().pack_grpcode(giaclev, str, 4);
_key.add(giaclev);
break; // Concatena i livelli
case F_MAGAZZINO:
// case F_MAG_COLL:
_key.add(str);
row.get(i+1, str);
_key << str;
break; // Concatena magazzini e depositi
case F_CLIENTE:
if (str.blank()) str = "0";
case F_ARTICOLO:
case F_CODIMP:
case F_CODLIN:
_key.add(str); break; // Aggiungi normalmente
}
_key.trim();
}
TSortable* s = create ? add_obj(_key) : find_obj(_key);
TMSP_constraint *c=(TMSP_constraint*)s;
if (create)
{
if (c->desc().blank())
{
row.get(F_ARTICOLO, str);
c->set_desc(cache().get(LF_ANAMAG,str).get("DESCR"));
}
}
return c;
}
//////////////////////////////////////////////////////////
// TMSP_line
///////////////////////////////////////////////////////////
@ -1021,8 +1133,8 @@ void TMSP_line::fill_sheet_row(TToken_string& row, const TMask & m, bool codes_o
TMSP_line::TMSP_line(long cliente, const TCodice_articolo& codart,
const TString& giac, const TString& imp,
const TString& lin, const TString& mag)
: TMSP_constraint(cliente, codart, giac, imp, lin,mag)
const TString& lin, const TString& mag, const TString& magc)
: TMSP_constraint(cliente, codart, giac, imp, lin, mag, magc)
{ }
TMSP_line::TMSP_line(TMSP_constraint & cons)
@ -1045,13 +1157,14 @@ TSortable* TMSP_lines::new_obj(const TToken_string& key) const
TString imp; key.get(3, imp); imp.trim();
TString lin; key.get(4, lin); lin.trim();
TString mag; key.get(5, mag); mag.trim();
return new TMSP_line(cliente, art, gia, imp, lin, mag);
TString magc; key.get(6, magc); magc.trim();
return new TMSP_line(cliente, art, gia, imp, lin, mag, magc);
}
TMSP_line* TMSP_lines::find(long cliente,
const TString& art,
const TString& gia, const TString& imp,
const TString& lin, const TString& mag,
const TString& gia, const TString& imp, const TString& lin,
const TString& mag, const TString& magc,
bool create)
{
_key.format("%ld", cliente);
@ -1060,6 +1173,7 @@ TMSP_line* TMSP_lines::find(long cliente,
_key.add(imp);
_key.add(lin);
_key.add(mag);
_key.add(magc);
TSortable* s = create ? add_obj(_key) : find_obj(_key);
return (TMSP_line*)s;
}
@ -1069,7 +1183,7 @@ TMSP_line* TMSP_lines::find(const TToken_string& row, bool create)
TString80 str,giaclev;
_key.cut(0);
for (int i = 0; i <= 11; i++)
for (int i = 0; i <= 13; i++)
{
row.get(i, str);
str.trim();
@ -1085,11 +1199,15 @@ TMSP_line* TMSP_lines::find(const TToken_string& row, bool create)
_key.add(giaclev);
break; // Concatena i livelli
case F_MAGAZZINO:
case F_MAG_COLL:
_key.add(str);
row.get(i+1, str);
str.trim();
_key << str;
break; // Concatena magazzini e depositi
case F_DEPOSITO:
case F_DEP_COLL:
break; // Ignora (vedi sopra)
case F_CLIENTE:
if (str.blank()) str = "0";
case F_ARTICOLO:
@ -1108,35 +1226,42 @@ TMSP_line* TMSP_lines::find(const TToken_string& row, bool create)
TSortable* TPlan_docs::new_obj(const TToken_string& key) const
{
int anno; key.get(0, anno);
long num; key.get(1, num);
TString8 codnum; key.get(0, codnum);
int anno; key.get(1, anno);
long num; key.get(2, num);
TDocumento* doc = new TDocumento('D', anno, _num, num);
TDocumento* doc = new TDocumento('D', anno, codnum, num);
doc->head().put(DOC_TIPODOC, _doc);
return doc;
}
TDocumento& TPlan_docs::find(int anno, long num)
TDocumento& TPlan_docs::find(TRigadoc_ref * rdr)
{
_key.format("%d|%ld", anno, num);
if (rdr)
_key.format("%s|%d|%ld",(const char *)rdr->codnum(), rdr->annodoc(), rdr->numdoc());
else
_key = " |0|0";
return *(TDocumento*)add_obj(_key);
}
TRiga_documento& TPlan_docs::add_to_row(int anno, long num, int riga, const real& qta)
TRiga_documento& TPlan_docs::add_to_row(TRigadoc_ref * rdr, const real& qta)
{
TDocumento& doc = find(anno, num);
CHECK(rdr,"TPlan_docs::add_to_row :passare un rigaref fvalido");
TDocumento& doc = find(rdr);
int riga = rdr->numrig();
if (riga <= 0 || riga > doc.physical_rows())
{
TRiga_documento& r = doc.new_row(_rig);
riga = r.get_int(RDOC_NRIGA);
rdr->set_numrig(riga);
}
TRiga_documento& rdoc = doc[riga];
real val = rdoc.get(RDOC_QTA);
val += qta;
if (val <= ZERO)
rdoc.put(RDOC_QTA, ZERO);
else
rdoc.put(RDOC_QTA, val);
val = ZERO;
rdoc.put(RDOC_QTA, val);
rdr->set_qta_residua(val);
return rdoc;
}
@ -1172,7 +1297,7 @@ long TPlan_docs::flush(const TDate& data)
}
if (err != NOERR)
{
error_box("Impossibile riscrivere il documento del %d %s %ld",doc.anno(), (const char *)doc.numerazione(),doc.numero());
error_box("Impossibile riscrivere il documento del %d %s %ld",(int)doc.anno(), (const char *)doc.numerazione(),(long)doc.numero());
retv=-1;
}
}
@ -1186,11 +1311,128 @@ TPlan_docs::TPlan_docs(const char* num, const char* tip, const char* rig)
{
}
bool distinta_master(const char *code)
bool distinta_master(const char *code, bool is_son)
{
const TRectype &rec=cache().get(LF_DIST,code);
if (rec.empty())
return FALSE;
return !is_son;
return rec.get_bool("MASTER");
}
///////////////////////////////////////////////////////////
// Sheet ordini / commessse
///////////////////////////////////////////////////////////
void TLista_ordini::get_row(long r, TToken_string& row)
{
row = "";
if (r < _line->rigarefs(_curr_bucket))
{
TRigadoc_ref * rdr=_line->rigaref(_curr_bucket,(int)r);
if (rdr)
{
TLocalisamfile & rdoc = _r->lfile(LF_RIGHEDOC);
TLocalisamfile & doc = _r->lfile(LF_DOC);
rdoc.put(RDOC_PROVV,"D");
rdoc.put(RDOC_ANNO,rdr->annodoc());
rdoc.put(RDOC_CODNUM,rdr->codnum());
rdoc.put(RDOC_NDOC,rdr->numdoc());
rdoc.put(RDOC_NRIGA,rdr->numrig());
_r->read();
row.add(" ");
row.add(rdr->annodoc());
row.add(rdr->codnum());
row.add(rdr->numdoc());
row.add(rdr->numrig());
TDate dc(rdoc.get_date(RDOC_DATACONS));
row.add(dc.ok() ? dc : doc.get_date(RDOC_DATACONS));
row.add(rdoc.get(RDOC_UMQTA));
real q(rdoc.get_real(RDOC_QTA));
row.add(q.string("#######@,@@@"));
q -= rdoc.get_real(RDOC_QTAEVASA);
row.add(q.string("#######@,@@@"));
//const char statodef=cache().get("%TIP",doc.get(DOC_TIPODOC)).get("S2")[1];
row.add(doc.get(DOC_STATO));
}
}
else
{
row = "|||||||";
row.add(_line->qta(_curr_bucket).string("#######@,@@@"));
}
}
bool TLista_ordini::edit_checked()
{
for (long r=0; r < items()-1; r++) if (checked(r))
{
TFilename ininame;
ininame.temp();
ininame.ext("ini");
{
TConfig action(ininame);
action.set("Action","MODIFY","Transaction");
action.set_paragraph(format("%d",LF_DOC));
TToken_string & rw = row(r);
action.set("PROVV","D");
action.set("ANNODOC",rw.get(1));
action.set("CODNUM",rw.get(2));
action.set("NDOC",rw.get(3));
}
TExternal_app editdoc(format("VE0 -1 -i%s",(const char *)ininame));
editdoc.run();
TConfig action(ininame);
TRigadoc_ref * rdr=_line->rigaref(_curr_bucket,(int)r);
}
return TRUE;
}
long TLista_ordini::get_items() const
{
const long i=_line->rigarefs(_curr_bucket);
return i == 0 ? i : i+1;
}
void TLista_ordini::set_bucket(int b)
{
_curr_bucket=b;
reset_parked();
}
bool TLista_ordini::bucket_handler(TMask_field & f, KEY key)
{
if (key == K_SPACE)
{
TLista_ordini &m = (TLista_ordini &)f.mask();
const int buck=atoi(f.get());
if (m.get_bucket() != buck)
{
m.set_bucket(buck);
m.select(0);
m.force_update();
}
}
return TRUE;
}
TLista_ordini::TLista_ordini(TMSP_constraint * l, const char * title) :
TSheet(-1, 5, 80, 15, title,
"@1|Anno|CodNum|Numero|Riga|Consegna@10|UM|Q.ta totale@12|Q.ta residua@12|Stato",0,2)
{
_line = l;
TMask_field &f= add_list(FIRST_FIELD,0,"Bucket ",1,0,2,"","0|1|2|3|4|5|6|7|8|9|10|11|12|13","0|1|2|3|4|5|6|7|8|9|10|11|12|13");
f.set_handler(bucket_handler);
_curr_bucket = 0;
while (_curr_bucket <= LAST_BUCKET && _line->rigarefs(_curr_bucket)==0)
_curr_bucket++;
f.set(_curr_bucket <= LAST_BUCKET ? _curr_bucket : 0);
f.set_focus();
enable_check();
_r= new TRelation(LF_RIGHEDOC);
_r->add(LF_DOC,"PROVV==PROVV|CODNUM==CODNUM|ANNO==ANNO|NDOC==NDOC");
}
TLista_ordini::~TLista_ordini()
{
delete _r;
}

440
mr/mr2201.h Executable file
View File

@ -0,0 +1,440 @@
#include <colors.h>
#include <defmask.h>
#include <progind.h>
#include <tabutil.h>
#include <xvtility.h>
#include <utility.h>
#include <printer.h>
#include <sheet.h>
// funzioni di ricerca distinta master
bool distinta_master(const char *code, bool is_son=FALSE);
// funzione per l'uso degli alberi delle distinte
TDistinta_tree &dist_tree();
#define MASTERCODE_CHAR 'M'
//***********************
// oggetto TRiga articolo
class TMSP_constraint;
class TMSP_constraints;
class TRiga_articolo : public TToken_string
{
public:
static int order_compare(TSheet_field & s, int i1, int i2, int level);
static int order_compare( const TToken_string& r1 , const TToken_string& r2 , int level, bool ascending=TRUE);
static int compare_field(TString &str0, TString &str1,short field_no) ;
static int order_comparePCAL(TSheet_field & s, int i1, int i2);
static int order_comparePCLA(TSheet_field & s, int i1, int i2);
static int order_comparePALC(TSheet_field & s, int i1, int i2);
static int order_comparePACL(TSheet_field & s, int i1, int i2);
static int order_comparePLAC(TSheet_field & s, int i1, int i2);
static int order_comparePLCA(TSheet_field & s, int i1, int i2);
static int order_compareCAL(TSheet_field & s, int i1, int i2);
static int order_compareCLA(TSheet_field & s, int i1, int i2);
static int order_compareALC(TSheet_field & s, int i1, int i2);
static int order_compareACL(TSheet_field & s, int i1, int i2);
static int order_compareLAC(TSheet_field & s, int i1, int i2);
static int order_compareLCA(TSheet_field & s, int i1, int i2);
static int order_comparePCA(TSheet_field & s, int i1, int i2);
static int order_comparePAC(TSheet_field & s, int i1, int i2);
static int order_compareAC(TSheet_field & s, int i1, int i2);
static int order_compareCA(TSheet_field & s, int i1, int i2);
static bool find_block(const TSheet_field& sf, const int riga, int &first_row, int &last_row );
int compare(const TToken_string& r, int level) const;
TRiga_articolo& operator=(TToken_string& r);
TRiga_articolo& operator+=(TRiga_articolo& r);
TRiga_articolo() : TToken_string(128) { }
TRiga_articolo(const TMSP_constraint & line);
virtual ~TRiga_articolo() { }
};
#define SORT_BY_PCAL -1 // cliente / articolo / impianto-linea
#define SORT_BY_PCLA -2 //
#define SORT_BY_PALC -3 //
#define SORT_BY_PACL -4 //
#define SORT_BY_PLAC -5 //
#define SORT_BY_PLCA -6 //
#define SORT_BY_PCA - 8 // cliente / articolo
#define SORT_BY_PAC - 9 //
#define SORT_BY_PRIORITY 16
#define SORT_WITHOUT_LINE 8
#define SORT_BY_CAL -17 // cliente / articolo / impianto-linea
#define SORT_BY_CLA -18 //
#define SORT_BY_ALC -19 //
#define SORT_BY_ACL -20 //
#define SORT_BY_LAC -21 //
#define SORT_BY_LCA -22 //
#define SORT_BY_CA -24 // cliente / articolo
#define SORT_BY_AC -25 //
//***********************
// form di stampa degli sheet
class TMSP_form : public TForm
{
protected:
bool validate(TForm_item &cf, TToken_string &s);
public:
TMSP_form (TIsamtempfile * rep);
};
class TCRP_form : public TForm
{
protected:
bool validate(TForm_item &cf, TToken_string &s);
public:
TCRP_form (TIsamtempfile * rep);
};
class TMSP_constraints : public TMRP_array
{
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TMSP_constraint* find(long cliente,const TString& codart,const TString& giac,
const TString& imp, const TString& lin, const TString& mag,
bool create=FALSE) ;
TMSP_constraint* find(const TToken_string& row, bool create=FALSE);
TMSP_constraint& operator[](long n) const
{ return (TMSP_constraint&)find_obj(n); }
};
class TRigadoc_ref : public TObject
{
TString8 _codnum;
int _annodoc;
long _numdoc;
int _numrig ;
real _qta;
real _prz;
public:
const TString& codnum() {return _codnum;}
int annodoc() {return _annodoc;}
long numdoc() {return _numdoc;}
int numrig() {return _numrig ;}
void set_numrig(int nr) {_numrig = nr;}
void set_qta_residua(real & q) {_qta = q;}
real & qta_residua() {return _qta;}
// real & qta_totale() {return _qta;}
virtual TObject* dup() const;
TRigadoc_ref(const char *codnum, int annodoc, long numdoc,int numrig, const real &qta, const real &prz);
};
class TMSP_record : public TObject
{
int _curr_ref;
TArray _rigadoc_refs;
public:
bool _qta_locked;
real _qta_min;
real _qta;
real _price;
void add_rigaref(TRigadoc_ref *r);
void remove_rigaref();
TRigadoc_ref *first_rigaref();
TRigadoc_ref *next_rigaref();
int rigarefs() {return _rigadoc_refs.items();}
TRigadoc_ref* rigaref(int n);
virtual TObject* dup() const;
TMSP_record();
};
class TMaster_code : public TObject
{
TString _code;
TString _liv;
TString _um;
TString _codimp;
TString _codlin;
TString _codmag;
real _expr;
real _leadtime;
public:
const char *articolo() const {return _code;}
const char *livello() const {return _liv;}
const char *um() const {return _um;}
const real &expr() const {return _expr;}
const real &leadtime() const {return _leadtime;}
const char *codimp() const {return _codimp;}
const char *codlin() const {return _codlin;}
const char *codmag() const {return _codmag;}
TMaster_code(const char *code, const char *liv, const char *ummaster, const real &expr, const real &leadtime, const char *codimp, const char *codlin, const char *codmag);
TMaster_code(const char *code, const char *liv,const char *ummaster, const real &expr, int leadtime, const char *codimp, const char *codlin, const char *codmag);
virtual ~TMaster_code() {}
};
class TMSP_line2 : public TObject
{
bool _used;
TMSP_constraint *_constraint;
TArray _mastercodes;
public:
bool used() {return _used;}
void set_use(bool on) {_used=on;}
void add_mastercode (TMaster_code *);
TMaster_code *get_mastercode (int i=0);
TMSP_constraint &constraint() {return *_constraint;}
TMSP_line2(const TMSP_constraint &c);
virtual ~TMSP_line2() {}
};
class TMSP_record_array : public TObject
{
TArray _buckets;
public:
int items() const { return _buckets.items(); }
int last() const { return _buckets.last(); }
int pred(int i) const { return _buckets.pred(i); }
virtual TMSP_record_array& operator=(const TMSP_record_array& a);
TMSP_record& operator[](int b);
};
class TMSP_constraint : public TSortable
{
long _cliente;
TCodice_articolo _codart;
TString16 _giac; // livelli di giacenza
TString8 _imp, _lin; // codice impianto e linea
TString8 _mag; // magazzino /deposito
TString8 _mag_coll; // magazzino /deposito collegato
TString _desc;
bool _on_sheet;
bool _check_master;
TArray _lines2; // codici di livello 2 per articoli NON master
TMSP_constraints _upperlines; // vincoli dei codici di livello 1 per articoli master
TMSP_record_array _bucket_qta;
protected:
virtual int compare(const TSortable& s) const;
public:
long cliente() const { return _cliente; }
const TCodice_articolo& codice() const { return _codart; }
const TString& livgiac() const { return _giac; }
const TString& codimp() const { return _imp; }
const TString& codlin() const { return _lin; }
const TString& codmag() const { return _mag; }
const TString& codmag_coll() const { return _mag_coll; }
const TString& desc() const { return _desc; }
void set_desc(const char* str) { _desc = str; }
TRigadoc_ref * first_rigaref(int buck);
TRigadoc_ref * next_rigaref(int buck);
int rigarefs(int buck);
TRigadoc_ref* rigaref(int buck, int n);
void add_rigaref(int buck, TString& codnum, int annodoc, long ndoc, int nrig, const real & qta, const real &prz);
void add_rigaref(int buck, TRigadoc_ref *rdr);
void remove_rigaref(int buck);
// master sched. a due livelli:
int find_distinta_master(const TMSP_constraint & constr, TString & master, TString & livmaster,TString & um,real & expr, TString & imp,TString & lin,TString & magdep, int fromindex=0);
void set_mastercode_check(bool on);
bool mastercodes2check() const ;
TMSP_line2 * use_mspline2(TMSP_constraint&line);
TMSP_line2 * use_mspline2(TToken_string &row, TSheet_field & sf);
void discard_line2(TMSP_line2 * );
void reset_unused_line2();
TMSP_line2 * get_unused_line2();
TMSP_constraint* add_upperline(const TMSP_constraint& constr);
TMSP_constraint* get_upperline(TMSP_constraint& constr);
bool has_upperlines() const ;
int last() const { return _bucket_qta.last(); }
int pred(int i) const { return _bucket_qta.pred(i); }
bool & qta_locked(int b) { return _bucket_qta[b]._qta_locked; }
virtual real& qta_min(int b) { return _bucket_qta[b]._qta_min; }
virtual real& qta(int b) { return _bucket_qta[b]._qta; }
virtual real& price(int b) { return _bucket_qta[b]._price; }
virtual void fill_sheet_row(TToken_string& row, const TMask & m, bool codes_only=FALSE) ;
bool is_on_sheet() const { return _on_sheet; }
void set_on_sheet(bool on = TRUE) { _on_sheet = on; }
TMSP_constraint & operator=(const TMSP_constraint & line);
TMSP_constraint(long cliente,
const TCodice_articolo& codart,
const TString& giac,
const TString& imp, const TString& lin,
const TString& mag, const TString& magc);
TMSP_constraint(const TMSP_constraint & cons);
virtual ~TMSP_constraint() { }
};
// linee contenenti pianificazioni
class TMSP_line : public TMSP_constraint
{
public:
virtual void fill_sheet_row(TToken_string& row, const TMask & m, bool codes_only=FALSE) ;
TMSP_line(long cliente, const TCodice_articolo& codart,
const TString& giac, const TString& mag, const TString& magc,
const TString& imp, const TString& lin);
TMSP_line(TMSP_line & line);
TMSP_line(TMSP_constraint & cons);
virtual ~TMSP_line() { }
};
class TMSP_lines : public TMRP_array
{
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TMSP_line* find(long cliente, const TString& art, const TString& gia,
const TString& imp, const TString& lin, const TString& mag, const TString& magc,
bool create=FALSE);
TMSP_line* find(const TToken_string& row, bool create=FALSE);
TMSP_line& operator[](long i) const
{ return (TMSP_line&)find_obj(i); }
};
class TCapacity_couple : public TObject
{
real _machine;
real _human;
public:
void set_machine(const real &v) {_machine = v;}
void set_human (const real &v) {_human = v;}
void add_machine(const real &v) {_machine += v;}
void add_human (const real &v) {_human += v;}
public:
const real &machine() const {return _machine;}
const real &human () const {return _human;}
TCapacity_couple& operator= (const TCapacity_couple &c);
TCapacity_couple(const TCapacity_couple&c);
TCapacity_couple();
TCapacity_couple(const real & machine, const real & human);
};
class TCapacity_record : public TSortable
{
TCapacity_couple _capacity; // Capacita'
TCapacity_couple _load; // Carico
protected:
virtual int compare(const TSortable& s) const;
virtual TObject* dup() const { return new TCapacity_record(*this); }
void copy(const TCapacity_record& q);
real get_factor(const TCodice_um& um) const;
void convert(real& val, const TCodice_um& from_um, const TCodice_um& to_um) const;
public:
const TCapacity_record& operator =(const TCapacity_record& q)
{ copy(q); return *this; }
TCapacity_couple &capacity() {return _capacity;}
TCapacity_couple &load() {return _load;}
TCapacity_record ();
TCapacity_record (const TCapacity_record & q) { copy(q); }
virtual ~TCapacity_record () {}
};
class TCRP_line : public TSortable
{
TString8 _imp,_lineap;
TString _codart;
long _codcli;
TString _desc;
bool _on_sheet;
TArray _bucket;
protected:
virtual int compare(const TSortable& s) const;
TCapacity_record& bucket(int n) ;
TCapacity_record& operator[](int n)
{return bucket(n);}
public:
const TString& codimp() const { return _imp; }
const TString& codlin() const { return _lineap; }
const TString& codart() const { return _codart; }
const TString& desc() const { return _desc; }
//void set_desc(const char* str) { _desc = str; }
int last() const { return _bucket.last(); }
int pred(int i) const { return _bucket.pred(i); }
TCapacity_couple& capacity(int b) { return bucket(b).capacity(); }
TCapacity_couple& load(int b) { return bucket(b).load(); }
void fill_capacity_row(TToken_string& row, bool human, bool percent=FALSE);
void fill_load_row(TToken_string& row, bool human, bool percent=FALSE);
bool is_on_sheet() const { return _on_sheet; }
void set_on_sheet(bool on = TRUE) { _on_sheet = on; }
TCRP_line(const TString& codimp,const TString& codlin,const TString &codart, long codcli);
virtual ~TCRP_line() { }
};
class TCRP_lines : public TMRP_array
{
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TCRP_line* find(const TLinea_prod& linea_prod,
const char * codart="", long codcli=0L, bool create=FALSE);
TCRP_line* find(const char * codimp="", const char * codlin="",
const char * codart="", long codcli=0L, bool create=FALSE);
TCRP_line& operator[](long n) const
{ return (TCRP_line&)find_obj(n); }
};
class TPlan_docs : public TMRP_array
{
TString16 _num, _doc, _rig;
protected:
virtual TSortable* new_obj(const TToken_string& key) const;
public:
TDocumento& find(TRigadoc_ref * riga);
TRiga_documento& add_to_row(TRigadoc_ref * rdr, const real& qta);
long flush(const TDate& data);
TPlan_docs(const char* num, const char* tip, const char* rig);
virtual ~TPlan_docs() { }
};
class TLista_ordini : public TSheet
{
TMSP_constraint * _line;
TRelation *_r;
int _curr_bucket;
static bool bucket_handler(TMask_field & f, KEY key);
protected:
virtual void get_row(long r, TToken_string& row);
virtual long get_items() const;
public:
bool edit_checked();
int get_bucket() {return _curr_bucket;}
void set_bucket(int b);
TLista_ordini(TMSP_constraint *l, const char * title);
~TLista_ordini();
};

42
mr/mr2300.cpp Executable file
View File

@ -0,0 +1,42 @@
#include "mr2200.h"
#include "mr2200a.h"
class TMSP_mask : public TPlanning_mask
{
public:
TMSP_mask();
virtual ~TMSP_mask() { }
};
TMSP_mask::TMSP_mask()
: TPlanning_mask("mr2300a")
{
init();
}
class TMSP_app : public TPlanning_app
{
TPlanning_mask *_m;
protected:
virtual TPlanning_mask& mask() {return *_m;}
virtual bool create();
};
bool TMSP_app::create()
{
if (TSkeleton_application::create())
{
openfiles();
_m = new TMSP_mask();
_m->field(F_MSCHEDULEPLAN).set("X");
return TRUE;
}
return FALSE;
}
int mr2300(int argc, char* argv[])
{
TMSP_app a;
a.run(argc, argv, "Master Schedule Planning");
return 0;
}

1
mr/mr2300a.uml Executable file
View File

@ -0,0 +1 @@
#include "mr2200a.uml"

View File

@ -15,4 +15,6 @@
#define USER_BMP_SELECT_ORDP 1700
#define USER_BMP_SELECT_ORDF 1701
#define USER_BMP_ORDINI_INPUT 1801
#define USER_BMP_ORDINI_OUTPUT 1802

View File

@ -1144,10 +1144,12 @@ int TUnita_produttiva::raw_numpers_turno(int t)
int TUnita_produttiva::numpers_turno(int t)
{
int val;
if (!TUnita_produttiva::personale_dedicato())
if (TUnita_produttiva::personale_dedicato())
{
val=raw_numpers_turno(t);
if (val==0)
val=get_int("I1");
}
else
val= mrp_config().numpers_turno(t);
return val;
@ -1217,9 +1219,8 @@ TImpianto::TImpianto(const char* cod)
settab("IMP");
if (cod && *cod)
{
TTable t("IMP");
t.put("CODTAB",cod);
t.read();
const TRectype & rec = cache().get("IMP", cod);
*this = rec;
}
}
@ -1248,9 +1249,8 @@ TLinea_prod::TLinea_prod(const char* cod )
settab("LNP");
if (cod && *cod)
{
TTable t("LNP");
put("CODTAB",cod);
read(t);
const TRectype & rec = cache().get("LNP", cod);
*this = rec;
}
}
@ -1267,6 +1267,19 @@ const char * TLinea_prod::codmagdep() const
}
const char * TLinea_prod::codmagdep_coll() const
{
const char * cod=TUnita_produttiva::codmagdep_coll() ;
if (*cod==0)
{
TImpianto* imp=((TLinea_prod *)this)->get_impianto();
if (imp)
return imp->codmagdep_coll();
}
return cod;
}
int TLinea_prod::inizio_turno(int t)
{
int val;

Some files were not shown because too many files have changed in this diff Show More