diff --git a/cg/buildcg.mak b/cg/buildcg.mak index c2024cd61..2530ba9c9 100755 --- a/cg/buildcg.mak +++ b/cg/buildcg.mak @@ -111,6 +111,6 @@ if [ "$1" = "" -o "$1" = "etc" ]; then gmake $FLAGS $1 else - gmake $FLAGS $P2HOME/campo/$1 + gmake $FLAGS $EP$1 fi rm /tmp/build_cg_$1 diff --git a/cg/cg0100.cpp b/cg/cg0100.cpp index 548685d3c..62a64eecd 100755 --- a/cg/cg0100.cpp +++ b/cg/cg0100.cpp @@ -66,22 +66,6 @@ bool CG0100_application::protected_record(TRectype &rec) pconti.next(); return pconti.good() && (pconti.curr() == rec1); - // - // if (pconti.bad()) return FALSE; - - // const int ngruppo = pconti.get_int(PCN_GRUPPO); - // const int nconto = pconti.get_int(PCN_CONTO); - - // Cercavo di cancellare un gruppo e ho trovato un conto dello stesso gruppo - // if (conto == 0 && gruppo == ngruppo) - // return TRUE; - - // Cercavo di cancellare un conto e ho trovato un sottoconto - // dello stesso gruppo e conto - - // if (gruppo == ngruppo && conto == nconto) - // return TRUE; - // return FALSE; } void CG0100_application::init_query_mode(TMask& m) @@ -155,7 +139,8 @@ void CG0100_application::init_insert_mode(TMask& m) m.send_key(K_SHIFT + K_CTRL + 'h', -3); TLocalisamfile& pconti = *_rel->lfile(); - TString s(15), s1(1), s2(1), s3(8), s4(2); + TString s(15), s2(1), s3(8), s4(2); + int s1 = 0; pconti.setkey(1) ; @@ -170,12 +155,11 @@ void CG0100_application::init_insert_mode(TMask& m) if (pconti.good()) { s = pconti.get(PCN_CODCBL); - s1 = pconti.get(PCN_SEZIVD); + s1 = atoi(pconti.get(PCN_SEZIVD)); s2 = pconti.get(PCN_LETTIVD); s3 = pconti.get(PCN_NUMRIVD); s4 = pconti.get(PCN_NUMIVD); indbil = pconti.get_int(PCN_INDBIL); - m.show(FLD_CM1_RICSER, indbil == PASSIVITA || indbil == RICAVI); } if (indbil == ORDINE) { @@ -183,16 +167,17 @@ void CG0100_application::init_insert_mode(TMask& m) m.show(FLD_CM1_SEZIVDH); m.disable(FLD_CM1_SEZIVDH); m.set(FLD_CM1_SEZIVDH, s1); - ivd_enable = s1.empty(); + ivd_enable = (s1 == 0); } else { m.show(FLD_CM1_SEZIVD); m.hide(FLD_CM1_SEZIVDH); - ivd_enable = s1.empty() && s2.empty() && s3.empty() && s4.empty(); + ivd_enable = (s1 == 0) && s2.empty() && s3.empty() && s4.empty(); } } else ivd_enable = TRUE; + m.show(FLD_CM1_RICSER, indbil == PASSIVITA || indbil == RICAVI); if (conto != 0) { if (indbil != ORDINE) diff --git a/cg/cg0100a.uml b/cg/cg0100a.uml index a1aa825ce..f49526b32 100755 --- a/cg/cg0100a.uml +++ b/cg/cg0100a.uml @@ -58,6 +58,7 @@ BEGIN DISPLAY "Gruppo" GRUPPO DISPLAY "Conto" CONTO DISPLAY "Sottoconto" SOTTOCONTO + DISPLAY "Sospeso" SOSPESO DISPLAY "Descrizione@50" DESCR OUTPUT FLD_CM1_SOTTOCONTO SOTTOCONTO OUTPUT FLD_CM1_GRUPPO GRUPPO @@ -74,6 +75,7 @@ BEGIN USE LF_PCON KEY 2 INPUT DESCR FLD_CM1_DESC DISPLAY "Descrizione@50" DESCR + DISPLAY "Sospeso" SOSPESO DISPLAY "Gruppo" GRUPPO DISPLAY "Conto" CONTO DISPLAY "Sottoconto " SOTTOCONTO @@ -98,7 +100,7 @@ END LIST FLD_CM1_INDBIL 1 17 BEGIN - PROMPT 4 6 "Indicatore di bilancio " + PROMPT 4 6 "Sezione di bilancio " FIELD LF_PCON->INDBIL GROUP 1 3 HELP "Inserire l' indicatore di bilancio" @@ -114,7 +116,7 @@ BEGIN PROMPT 4 7 "Sez. e classe IV dir.: " FIELD LF_PCON->SEZIVD GROUP 1 4 - ITEM "0|Nessuna" + ITEM "0|Nessuna" MESSAGE RESET,5@ ITEM "1|Attivita'" ITEM "2|Passivita'" ITEM "9|Conto economico" @@ -125,7 +127,7 @@ LIST FLD_CM1_SEZIVDH 1 19 BEGIN PROMPT 4 7 "Sez. e classe IV dir.: " FIELD LF_PCON->SEZIVD - ITEM "0|Nessuna" + ITEM "0|Nessuna" MESSAGE RESET,5@ ITEM "1|C.ordine attivo" ITEM "2|C.ordine passivo" ITEM "5|C.ordine" @@ -136,7 +138,7 @@ STRING FLD_CM1_LETTIVD 1 1 BEGIN PROMPT 51 7 "" FIELD LF_PCON->LETTIVD - GROUP 1 4 + GROUP 1 4 5 FLAGS "U" END @@ -144,14 +146,14 @@ STRING FLD_CM1_LETTIVDH 1 BEGIN PROMPT 51 7 "" FLAGS "HDU" - GROUP 4 + GROUP 4 5 END NUMBER FLD_CM1_NUMRIVD 8 4 BEGIN PROMPT 55 7 "" FIELD LF_PCON->NUMRIVD - GROUP 1 4 + GROUP 1 4 5 FLAGS "MZ" END @@ -159,7 +161,7 @@ NUMBER FLD_CM1_NUMRIVDH 8 4 BEGIN PROMPT 55 7 "" FLAGS "HDMZ" - GROUP 4 + GROUP 4 5 END NUMBER FLD_CM1_NUMIVD 2 @@ -167,7 +169,7 @@ BEGIN PROMPT 66 7 "" FIELD LF_PCON->NUMIVD FLAGS "RZ" - GROUP 1 4 + GROUP 1 4 5 USE %IVD INPUT CODTAB[1,1] FLD_CM1_SEZIVD INPUT CODTAB[2,2] FLD_CM1_LETTIVD @@ -190,7 +192,7 @@ NUMBER FLD_CM1_NUMIVDH 2 BEGIN PROMPT 66 7 "" FLAGS "HDRZ" - GROUP 1 4 + GROUP 1 4 5 END LIST FLD_CM1_SEZIVDOPP 1 17 @@ -198,7 +200,7 @@ BEGIN PROMPT 4 8 "Classe segno opp.: " FIELD LF_PCON->SEZIVDOPP GROUP 1 2 4 - ITEM "0|Nessuna" + ITEM "0|Nessuna" MESSAGE RESET,6@ ITEM "1|Attivita'" ITEM "2|Passivita'" ITEM "9|Conto economico" @@ -210,7 +212,7 @@ BEGIN PROMPT 51 8 "" FIELD LF_PCON->LETTIVDOPP FLAGS "U" - GROUP 1 2 4 + GROUP 1 2 4 6 END NUMBER FLD_CM1_NUMRIVDOPP 8 4 @@ -218,7 +220,7 @@ BEGIN PROMPT 55 8 "" FIELD LF_PCON->NUMRIVDOPP FLAGS "MZ" - GROUP 1 2 4 + GROUP 1 2 4 6 END NUMBER FLD_CM1_NUMIVDOPP 2 @@ -226,7 +228,7 @@ BEGIN PROMPT 66 8 "" FIELD LF_PCON->NUMIVDOPP FLAGS "RZ" - GROUP 1 2 4 + GROUP 1 2 4 6 COPY USE FLD_CM1_NUMIVD INPUT CODTAB[1,1] FLD_CM1_SEZIVDOPP INPUT CODTAB[2,2] FLD_CM1_LETTIVDOPP @@ -245,7 +247,7 @@ LIST FLD_CM1_TIPOSPRIC 1 45 BEGIN PROMPT 4 9 "Tipo Spesa/Ricavo " FIELD LF_PCON->TIPOSPRIC - GROUP 1 + GROUP 1 2 HELP "Specificare il tipo Spesa/Ricavo" ITEM "0|Acquisti o vendite in genere" ITEM "1|Acquisti beni per rivendita" @@ -262,7 +264,7 @@ BEGIN PROMPT 4 10 "Ricavi per servizi " FIELD RICSER FLAGS "H" - ITEM "0|Altre passivita'" + ITEM "0|Altre attivita'" ITEM "1|Servizi" END @@ -322,6 +324,7 @@ BOOLEAN FLD_CM2_SOSPESO BEGIN PROMPT 50 15 "Conto sospeso" FIELD LF_PCON->SOSPESO + GROUP 1 2 END ENDPAGE diff --git a/cg/cg1700a.uml b/cg/cg1700a.uml index 1d2e8dc17..02a946fa0 100755 --- a/cg/cg1700a.uml +++ b/cg/cg1700a.uml @@ -32,7 +32,7 @@ BEGIN PROMPT 30 8 "" END -BUTTON DLG_CANCEL 9 2 +BUTTON DLG_QUIT 9 2 BEGIN PROMPT 46 8 "" END diff --git a/cg/cg5000.cpp b/cg/cg5000.cpp index f72cab619..aa536fbde 100755 --- a/cg/cg5000.cpp +++ b/cg/cg5000.cpp @@ -1,15 +1,15 @@ -#include - -class CG5_App : public TConfig_application -{ -public: - CG5_App() : TConfig_application(CONFIG_STUDIO) {} - virtual ~CG5_App() {} -}; - -int cg5000 (int argc, char* argv[]) -{ - CG5_App appc; - appc.run(argc, argv, "Configurazione Studio"); - return 0; -} +#include + +class CG5_App : public TConfig_application +{ +public: + CG5_App() : TConfig_application(CONFIG_STUDIO) {} + virtual ~CG5_App() {} +}; + +int cg5000 (int argc, char* argv[]) +{ + CG5_App appc; + appc.run(argc, argv, "Parametri Studio"); + return 0; +} diff --git a/cg/cg5100.cpp b/cg/cg5100.cpp index 6c0f4d584..b07a5b8cd 100755 --- a/cg/cg5100.cpp +++ b/cg/cg5100.cpp @@ -1,78 +1,78 @@ -#include -#include -#include -#include "cg5100a.h" - -class CG51_App : public TConfig_application -{ -public: - virtual bool preprocess_config (TMask& mask, TConfig& config); - virtual bool postprocess_config (TMask& mask, TConfig& config); - virtual bool postprocess_config_changed(const char* par, const char* var, - const char* oldv, const char* newv); - - CG51_App() : TConfig_application(CONFIG_DITTA) {} - virtual ~CG51_App() {} -}; - -bool CG51_App::preprocess_config (TMask& mask, TConfig& config) -{ - // these are disabled in normal applications - mask.enable(CHK_ANCFCM); - mask.enable(CHK_PCTCCM); - disable_menu_item(M_FILE_NEW); - disable_menu_item(M_FILE_REVERT); - return TRUE; -} - -bool CG51_App::postprocess_config(TMask& mask, TConfig& config) -{ - enable_menu_item(M_FILE_NEW); - enable_menu_item(M_FILE_REVERT); - return TRUE; -} - -bool CG51_App::postprocess_config_changed(const char* par, const char* var, - const char* oldv, const char* newv) -{ - TString v(var); - TDir dir; - TString file(16); - - if (v == "AnCfCm") - { - dir.get(LF_CLIFO, _lock, _nordir, _sysdirop); - file = dir.name(); - file[0] = *newv == 'X' ? '%' : '$'; - dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); - dir.put(LF_CLIFO, _nordir, _sysdirop); - } - else if (v == "PcTcCm") - { - dir.get(LF_PCON, _lock, _nordir, _sysdirop); - file = dir.name(); - file[0] = *newv == 'X' ? '%' : '$'; - dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); - dir.put(LF_PCON, _nordir, _sysdirop); - - dir.get(LF_CAUSALI, _lock, _nordir, _sysdirop); - file = dir.name(); - file[0] = *newv == 'X' ? '%' : '$'; - dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); - dir.put(LF_CAUSALI, _nordir, _sysdirop); - - dir.get(LF_RCAUSALI, _lock, _nordir, _sysdirop); - file = dir.name(); - file[0] = *newv == 'X' ? '%' : '$'; - dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); - dir.put(LF_RCAUSALI, _nordir, _sysdirop); - } - return TRUE; -} - -int cg5100 (int argc, char* argv[]) -{ - CG51_App appc; - appc.run(argc, argv, "Configurazione Ditta"); - return 0; -} +#include +#include +#include +#include "cg5100a.h" + +class CG51_App : public TConfig_application +{ +public: + virtual bool preprocess_config (TMask& mask, TConfig& config); + virtual bool postprocess_config (TMask& mask, TConfig& config); + virtual bool postprocess_config_changed(const char* par, const char* var, + const char* oldv, const char* newv); + + CG51_App() : TConfig_application(CONFIG_DITTA) {} + virtual ~CG51_App() {} +}; + +bool CG51_App::preprocess_config (TMask& mask, TConfig& config) +{ + // these are disabled in normal applications + mask.enable(CHK_ANCFCM); + mask.enable(CHK_PCTCCM); + disable_menu_item(M_FILE_NEW); + disable_menu_item(M_FILE_REVERT); + return TRUE; +} + +bool CG51_App::postprocess_config(TMask& mask, TConfig& config) +{ + enable_menu_item(M_FILE_NEW); + enable_menu_item(M_FILE_REVERT); + return TRUE; +} + +bool CG51_App::postprocess_config_changed(const char* par, const char* var, + const char* oldv, const char* newv) +{ + TString v(var); + TDir dir; + TString file(16); + + if (v == "AnCfCm") + { + dir.get(LF_CLIFO, _lock, _nordir, _sysdirop); + file = dir.name(); + file[0] = *newv == 'X' ? '%' : '$'; + dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); + dir.put(LF_CLIFO, _nordir, _sysdirop); + } + else if (v == "PcTcCm") + { + dir.get(LF_PCON, _lock, _nordir, _sysdirop); + file = dir.name(); + file[0] = *newv == 'X' ? '%' : '$'; + dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); + dir.put(LF_PCON, _nordir, _sysdirop); + + dir.get(LF_CAUSALI, _lock, _nordir, _sysdirop); + file = dir.name(); + file[0] = *newv == 'X' ? '%' : '$'; + dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); + dir.put(LF_CAUSALI, _nordir, _sysdirop); + + dir.get(LF_RCAUSALI, _lock, _nordir, _sysdirop); + file = dir.name(); + file[0] = *newv == 'X' ? '%' : '$'; + dir.set(file, dir.eod(), dir.flags(), dir.des(), dir.expr()); + dir.put(LF_RCAUSALI, _nordir, _sysdirop); + } + return TRUE; +} + +int cg5100 (int argc, char* argv[]) +{ + CG51_App appc; + appc.run(argc, argv, "Parametri Ditta"); + return 0; +}