From afd64cd4ba3cb91ea87cb03541efa61ee6b41228 Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Tue, 5 Nov 2019 19:01:32 +0100 Subject: [PATCH] Patch level : 12.0 896 Files correlati : ve0.exe ve1.exe ve1.exe ve5,exe ve6.exe tutti i profili Commento to : Gestione conai --- src/ve/f180.trr | 2 +- src/ve/ve0100.cpp | 34 +++++---- src/ve/ve0100.h | 5 +- src/ve/ve0300.cpp | 1 + src/ve/ve0300b.dat | 32 +++++--- src/ve/ve1300.cpp | 11 ++- src/ve/ve2400.cpp | 83 +++++++++++---------- src/ve/velib.h | 44 +++++------ src/ve/velib02.cpp | 98 +++++-------------------- src/ve/velib03.cpp | 140 +++++++++++++++++------------------ src/ve/velib03a.cpp | 34 +++++++-- src/ve/velib04b.cpp | 16 +++- src/ve/velib06.cpp | 57 ++++++++------- src/ve/velib06a.cpp | 52 ++++++------- src/ve/vepriv.h | 5 +- src/ve/verig.h | 36 +++++---- src/ve/verig.uml | 173 ++++++++++++++++++++++++++++++-------------- 17 files changed, 437 insertions(+), 386 deletions(-) diff --git a/src/ve/f180.trr b/src/ve/f180.trr index b48a9959d..0a545e703 100644 --- a/src/ve/f180.trr +++ b/src/ve/f180.trr @@ -6,4 +6,4 @@ CATEGORIA|1|2|0|Codice categoia CONAI SOTTOCAT|1|2|0|Codice sottocategoria CONAI PESO|4|15|5|Peso CONAI (Kg) 1 -CODART+NRIGA+CATEGORIA+SOTTOCAT| +CODART+NRIGA| diff --git a/src/ve/ve0100.cpp b/src/ve/ve0100.cpp index e1a85fdbb..bb9c70287 100755 --- a/src/ve/ve0100.cpp +++ b/src/ve/ve0100.cpp @@ -361,24 +361,26 @@ bool TMotore_application::last_doc(char provv, int anno, const char* codnum, return found; } -const char* TMotore_application::get_next_key( ) +bool TMotore_application::get_next_key(TToken_string& key) { - const TMask& m = curr_mask( ); - const TCodice_numerazione& cod_num = cached_numerazione(m.get(F_CODNUM)); - - // Se per questa numerazione e' abilitata le numerazione automatica - if (cod_num.auto_num()) - { - TDate ddoc; // unused - long ndoc = 1; - if (last_doc(m.get(F_PROVV)[0], m.get_int(F_ANNO), cod_num.codice(), ndoc, ddoc)) - ndoc++; - else - ndoc = 1; - return format("%d|%ld", F_NDOC, ndoc); - } + const TMask& m = curr_mask(); + const TCodice_numerazione& cod_num = cached_numerazione(m.get(F_CODNUM)); - return ""; + // Se per questa numerazione e' abilitata le numerazione automatica + key.cut(0); + if (cod_num.auto_num()) + { + TDate ddoc; // unused + long ndoc = 1; + + if (last_doc(m.get(F_PROVV)[0], m.get_int(F_ANNO), cod_num.codice(), ndoc, ddoc)) + ndoc++; + else + ndoc = 1; + key.format("%d|%ld", F_NDOC, ndoc); + return true; + } + return false; } const char* TMotore_application::record_description(const TRelation& rel) const diff --git a/src/ve/ve0100.h b/src/ve/ve0100.h index 5c9c21f57..ef1610e05 100755 --- a/src/ve/ve0100.h +++ b/src/ve/ve0100.h @@ -105,8 +105,9 @@ public: // Operazione TMotore_application( ) : _ncopie(-1){ } virtual ~TMotore_application( ) { } - - virtual const char* get_next_key( ); + + bool TMotore_application::get_next_key(TToken_string& key); +// virtual const char* get_next_key( ); // Test Plafond int check_plafond_write(TDocumento& d); diff --git a/src/ve/ve0300.cpp b/src/ve/ve0300.cpp index 7380d163d..dd1451d61 100755 --- a/src/ve/ve0300.cpp +++ b/src/ve/ve0300.cpp @@ -1384,6 +1384,7 @@ void TMask_generator::genera_testata_1() _m->field( DOC_CODCF ); _m->group( 1 ); _m->use( LF_CLIFO, 1 ); + _m->join(LF_COMUNI, "STATO==STATOCF COM==COMCF"); temp_s.format( "TIPOCF \"%c\"~CODCF %d", tipo_cf, F_CODCF); _m->input( temp_s ); _m->display( "\"Codice\" CODCF~\"Ragione Sociale@50\" RAGSOC~\"Partita IVA@12\" PAIV~\"Sospeso\" SOSPESO~\"Indirizzo@35\" INDCF ~\"Numero@15\" CIVCF~\"Località@50\" LOCALITACF ~\"Comune@50\" 13->DENCOM" ); diff --git a/src/ve/ve0300b.dat b/src/ve/ve0300b.dat index 4eecd13b5..b3235e80a 100755 --- a/src/ve/ve0300b.dat +++ b/src/ve/ve0300b.dat @@ -64,16 +64,24 @@ JOLLY9|2|20|Jolly|20 JOLLY10|2|20|Jolly|20 RIDPREZZO|3|18|Riduzione prezzo|18 PERCPROV|3|502|2a Perc.\nProvv.|5 -SCAACC|2|4|Sottocategoria\nACCIAIO|4 -PUNACC|3|1305|Peso unitario\nACCIAIO|13 -SCAALL|2|4|Sottocategoria\nALLUMINIO|4 -PUNALL|3|1305|Peso unitario\nALLUMINIO|13 -SCACAR|2|4|Sottocategoria\nCARTA|4 -PUNCAR|3|1305|Peso unitario\nCARTA|13 -SCAPLA|2|4|Sottocategoria\nPLASTICA|4 -PUNPLA|3|1305|Peso unitario\nPLASTICA|13 -SCALEG|2|4|Sottocategoria\nLEGNO|4 -PUNLEG|3|1305|Peso unitario\nLEGNO|13 -SCAVET|2|4|Sottocategoria\nVETRO|4 -PUNVET|3|1305|Peso unitario\nVETRO|13 +CCON(1)|2|4|CONAI\nSottoc.1|4 +PCON(1)|3|1305|CONAI\nPeso un.1|13 +CCON(2)|2|4|CONAI\nSottoc.2|4 +PCON(2)|3|1305|CONAI\nPeso un.2|13 +CCON(3)|2|4|CONAI\nSottoc.3|4 +PCON(3)|3|1305|CONAI\nPeso un.3|13 +CCON(4)|2|4|CONAI\nSottoc.4|4 +PCON(4)|3|1305|CONAI\nPeso un.4|13 +CCON(5)|2|4|CONAI\nSottoc.5|4 +PCON(5)|3|1305|CONAI\nPeso un.5|13 +CCON(6)|2|4|CONAI\nSottoc.6|4 +PCON(6)|3|1305|CONAI\nPeso un.6|13 +CCON(6)|2|4|CONAI\nSottoc.7|4 +PCON(7)|3|1305|CONAI\nPeso un.7|13 +CCON(7)|2|4|CONAI\nSottoc.8|4 +PCON(8)|3|1305|CONAI\nPeso un.8|13 +CCON(8)|2|4|CONAI\nSottoc.9|4 +PCON(9)|3|1305|CONAI\nPeso un.9|13 +CCON(10)|2|4|CONAI\nSottoc.10|4 +PCON(10)|3|1305|CONAI\nPeso un.10|13 diff --git a/src/ve/ve1300.cpp b/src/ve/ve1300.cpp index 78c614e6d..9f3399c48 100755 --- a/src/ve/ve1300.cpp +++ b/src/ve/ve1300.cpp @@ -48,15 +48,14 @@ public: TRiga_documento& TDoc_recordset::riga_doc(int n) const { - if (n < 0 || n > _doc->rows()) // Non dovrebbe succedere mai + if (n == 0) + n = _mypos + 1; + if (n < 0 || n > _doc->rows()) // Non dovrebbe succedere mai { + message_box("chi mi chiama ?"); n = _doc->new_row("05").numero(); // Crea una riga descrizione fittizia ((TDoc_recordset*)this)->_lastpos++; } - if (n <= 0) - n = _mypos+1; - if (n <= 0) - n = 1; return _doc->row(n); } @@ -847,7 +846,7 @@ bool TReport_doc::msg_add_row(TVariant_stack& stack) } } - TRiga_documento& curr_rdoc = riga_doc(0); + TRiga_documento& curr_rdoc = riga_doc(); if (curr_rdoc.get(RDOC_TIPORIGA) == row_type) return false; // Riga generata diff --git a/src/ve/ve2400.cpp b/src/ve/ve2400.cpp index b74c2e6c3..e540670f8 100755 --- a/src/ve/ve2400.cpp +++ b/src/ve/ve2400.cpp @@ -72,7 +72,8 @@ class TMask_anamag: public TMask static bool handle_sheet_cod(TMask_field &, KEY); // handler dello sheet dei codici alternativi static bool notify_sheet_cod(TSheet_field & s, int r, KEY k); // notify dello sheet delle unità di misura static bool handle_codcorr(TMask_field &, KEY); // handler dello sheet dei codici alternativi - static bool notify_sheet_giac(TSheet_field & s, int r, KEY k); // notify delle giacenze + static bool notify_sheet_conai(TSheet_field & s, int r, KEY k); + static bool notify_sheet_giac(TSheet_field & s, int r, KEY k); // notify delle giacenze static bool handle_sheetgiac(TMask_field &, KEY); // handler dello sheet giacenze static bool notify_sheet_sto(TSheet_field & s, int r, KEY k); // notify dello storico static bool handle_sheetstomag(TMask_field &, KEY); // handler dello sheet storico giacenze @@ -375,9 +376,12 @@ void TMask_anamag::set_parametered_fields() // setta i campi della maschera per la pagina giacenze TSheet_field &fld_stomag = sfield(F_SHEETSTOMAG); - TSheet_field &fld_giac = sfield(F_SHEETGIAC); + TSheet_field &fld_giac = sfield(F_SHEETGIAC); fld_giac.set_notify(notify_sheet_giac); - TSheet_field &fld_cod = sfield(F_SHEETCOD); + TSheet_field &fld_conai = sfield(F_SHEETCON); + fld_conai.set_notify(notify_sheet_conai); + fld_conai.set_append(false); + TSheet_field &fld_cod = sfield(F_SHEETCOD); // disabilita le colonne quando non sono utilizzati i livelli di giacenza for (int i=0; i < 4; i++) @@ -1073,7 +1077,7 @@ bool TMask_anamag::handle_sheet_um(TMask_field &fld, KEY k) // aggiunge all'hash table l'elemento della riga corrente e controlla che non esista già if (v.add(um)) return error_box("Le unità di misura devono essere diverse tra loro"); - } + } } if (m.edit_mode()) @@ -1476,7 +1480,19 @@ bool TMask_anamag::check_totali_storico() return TRUE; } +bool TMask_anamag::notify_sheet_conai(TSheet_field &f, int i, KEY k) +{ + TMask_anamag& m = (TMask_anamag&)f.mask(); + switch (k) + { + case (K_INS) : + { + return f.rows_array().items() < 10; + } + } + return true; +} bool TMask_anamag::notify_sheet_giac(TSheet_field &f, int i, KEY k) { TMask_anamag& m = (TMask_anamag&)f.mask(); @@ -1999,12 +2015,12 @@ void TAnagrafica_magazzino::fill_conai(const TString& codart, TSheet_field& fld_ fld_con.hide(); TArticolo_conai ac(codart); - FOR_EACH_CONAI_SOTTOCAT(ac, cat, sottocat) + for (int i = 0; i < FR_CMAX; i++) { TToken_string& row = fld_con.row(-1); - row.add(cat.first); - row.add(sottocat.first); - row.add(sottocat.second); + row.add(ac.get_scat(i).left(2)); + row.add(ac.get_scat(i).right(2)); + row.add(ac.get_peso(i)); } // Lo rimostro @@ -2014,47 +2030,30 @@ void TAnagrafica_magazzino::fill_conai(const TString& codart, TSheet_field& fld_ int TAnagrafica_magazzino::write_conai(const TMask& m) const { int ok = NOERR; - // Prima di tutto svuoto i campi del conai sull'articolo - TLocalisamfile anamag(LF_ANAMAG); - anamag.put(ANAMAG_CODART, m.get(F_CODART)); - if(anamag.read() == NOERR) - { - anamag.put(ANAMAG_CONAISC, ""); - anamag.put(ANAMAG_CONACC, ""); - anamag.put(ANAMAG_CONALL, ""); - anamag.put(ANAMAG_CONCAR, ""); - anamag.put(ANAMAG_CONLEG, ""); - anamag.put(ANAMAG_CONPLA, ""); - anamag.put(ANAMAG_CONVET, ""); - ok |= anamag.rewrite(); - } - - // Adesso svuoto i record presenti in CONART - TLocalisamfile conart(LF_CONART); - TRelation rel_conart(LF_CONART); - TRectype filter_conart(LF_CONART); - filter_conart.put(ANAMAG_CODART, m.get(F_CODART)); - - TCursor cur_conart(&rel_conart, "", 1, &filter_conart, &filter_conart); - while(cur_conart.items() > 0) - { - ok |= conart.remove(cur_conart.curr()); - } + TRecord_array conart(m.get(F_CODART), LF_CONART); + TRectype conrec(LF_CONART); + conart.destroy_rows(); // Infine salvo i nuovi dati in conart TSheet_field& sheet_conai = m.sfield(F_SHEETCON); + int r = 1; FOR_EACH_SHEET_ROW(sheet_conai, num_riga, row) { - conart.zero(); - conart.put(CONART_CODART, m.get(F_CODART)); - conart.put(CONART_NRIGA, num_riga +1); - conart.put(CONART_CATEGORIA, row->get(cid2index(FS_CAT_CONAI))); - conart.put(CONART_SOTTOCAT, row->get(cid2index(FS_SCAT_CONAI))); - conart.put(CONART_PESO, row->get(cid2index(FS_PES_CONAI))); - ok |= conart.write(); - } + const TString cat = row->get(cid2index(FS_CAT_CONAI)); + if (cat.full()) + { + conrec.zero(); + conrec.put(CONART_CODART, m.get(F_CODART)); + conrec.put(CONART_NRIGA, r++); + conrec.put(CONART_CATEGORIA, cat); + conrec.put(CONART_SOTTOCAT, row->get(cid2index(FS_SCAT_CONAI))); + conrec.put(CONART_PESO, row->get(cid2index(FS_PES_CONAI))); + conart.add_row(conrec); + } + } + ok |= conart.write(true); return ok; } diff --git a/src/ve/velib.h b/src/ve/velib.h index fc273749d..1d4803afa 100755 --- a/src/ve/velib.h +++ b/src/ve/velib.h @@ -13,6 +13,10 @@ #include #endif +#ifndef __UTILITY_H +#include +#endif + #ifndef __VISWIN_H class TViswin; #endif @@ -247,6 +251,8 @@ class TTipo_documento : public TRectype // velib03 TString16 _field_qta_mag, _field_qtaevasa_mag; // Veri campi Quantità e Quantità Evasa per magazzino TString16 _raee_cod, _raee_fld; TString _str_desc_doc, _str_desc_rdoc; + TDate _first_ok_date; + int _max_days; int _liv, _row; TString4 _module; @@ -373,6 +379,7 @@ public: bool head_ca_required() const { return _hca_req; } bool check_double_art() const { return _check_double_art; } bool ignora_anticipi_fatturazione() const { return _ignora_anticipi_fatturazione; } + const TDate & first_ok_date(); TTipo_documento(const char* tipodoc = NULL); TTipo_documento(const TRectype& rec); @@ -542,32 +549,23 @@ TCONAI_class conai_str2class(const char* class_or_subclass); const char* conai_class2str(TCONAI_class cc); const char* conai_material(TCONAI_class cc); bool conai_configured_class(TCONAI_class cc); -const char* conai_peso_name(TCONAI_class cc, int logic_num = LF_RIGHEDOC); -const char* conai_sottocat_name(TCONAI_class cc, int logic_num = LF_RIGHEDOC); +// Campi virtuali per peso CONAI su RDOC in Kg +inline const char* conai_peso_name(int i) { return format("PCON(%d)", i); } +// Campi virtuali per sottocategoria CONAI su RDOC +inline const char* conai_sottocat_name(int i) { return format("CCON(%d)", i); } const char* conai_esenzione_name(TCONAI_class cc, int logicnum = LF_RIGHEDOC); #define CHECK_CONAI(cc) CHECKD(cc>=CONAI_FIRST&&cc> _conais; - std::map _tipo_spesa; -public: + TAssoc_array _conais; - const TSpesa_prest& get_spesa(const TString& cat, const TString& sottocat) { return _conais[cat][sottocat]; } - const TSpesa_prest& get_spesa(const TString& full_sottocat) { return get_spesa(full_sottocat.left(2), full_sottocat.right(2)); } - const std::map get_categoria(const TString& cat) { return _conais[cat]; } - const bool find(const TString& cod_spesa) { return _conais.find(cod_spesa.left(2)) != _conais.end() && _conais[cod_spesa.left(2)].find(cod_spesa.right(2)) != _conais[cod_spesa.left(2)].end(); } - const TString_array get_lista_cod_spesa(); +public: + const TSpesa_prest& get_spesa(const TString& sottocat) { return (const TSpesa_prest &) _conais[sottocat]; } + const bool find(const TString& cod_spesa) { return _conais.objptr(cod_spesa) != NULL; } + int get_lista_cod_spesa(TString_array & keys) { return _conais.get_keys(keys); } TConai(); }; @@ -692,7 +690,7 @@ public: virtual real quantita_mag() const; virtual real qtaevasa_mag() const; virtual real qtaresidua_mag() const; - real calc_conai_qta(TCONAI_class type, const int num_field) const; + real calc_conai_qta(const int num_field) const; real valore(bool totale, bool lordo = false, int ndec = AUTO_DECIMALS) const; const TString& codice_costo() const; @@ -789,8 +787,7 @@ class TDocumento : public TMultiple_rectype // velib03 static short _has_provv; static TCodgiac_livelli *_livelli; - TConai _conai; - std::map _conaiqta; // Per ogni sottocategoria CONAI mi calcola la qta + TAssoc_array _conaiqta; // Per ogni sottocategoria CONAI mi calcola la qta protected: virtual TRectype * new_body_record(int logicnum = 0) @@ -850,8 +847,8 @@ public: virtual void zero(char c = '\0') { TMultiple_rectype::zero(c); } void sort_rows(const char * key); - int physical_rows() const { return body().rows(); } - virtual int rows() const { return physical_rows() + (ha_riga_sconto() ? 1 : 0) + (ha_riga_esenzione() ? 1 : 0) + (ha_riga_valfisc() ? 1 : 0); } + inline int physical_rows() const { return body().rows(); } + inline virtual int rows() const { return physical_rows() + (ha_riga_sconto() ? 1 : 0) + (ha_riga_esenzione() ? 1 : 0) + (ha_riga_valfisc() ? 1 : 0); } const TRiga_documento& operator[](int index) const { return (const TRiga_documento&)((TDocumento *)this)->row(index); } TRiga_documento& operator[](int index) { return (TRiga_documento&)row(index); } @@ -947,7 +944,6 @@ public: void update_spese_aut(TString_array & spese, bool preserve_old = false, TSheet_field * sh = NULL, bool force = false); void update_conai_qta(); - //real calc_conai_qta(TCONAI_class type); void update_conai(); void old_update_conai(); diff --git a/src/ve/velib02.cpp b/src/ve/velib02.cpp index 74a6298f3..40116a3e4 100755 --- a/src/ve/velib02.cpp +++ b/src/ve/velib02.cpp @@ -953,51 +953,7 @@ TString conai_configured_spesa(TCONAI_class cc) return __con_conf->get(cc); } -// Campi virtuali per peso CONAI su RDOC e ANAMAG in Kg -const char* conai_peso_name(TCONAI_class type, int logicnum) -{ - if (conai_configured_class(type)) // Garantisce anche che type < CONAI_CLASSES - { - const char* const __conai_peso_rdoc[CONAI_CLASSES] = - { "CONPUACC", "CONPUALL", "CONPUCAR", "CONPUPLA", "CONPULEG", "CONPUVET" }; - - const char* const __conai_peso_anmg[CONAI_CLASSES] = - {ANAMAG_CONACC, ANAMAG_CONALL, ANAMAG_CONCAR, ANAMAG_CONPLA, ANAMAG_CONLEG, ANAMAG_CONVET}; - - switch (logicnum) - { - case LF_ANAMAG : - error_box("La gestione conai è stata modificata! Impossibile determinare il campo"); - return __conai_peso_anmg[type]; - case LF_RIGHEDOC: - return __conai_peso_rdoc[type]; - default : break; - } - } - return ""; -} -// Campi virtuali per sottocategoria CONAI su RDOC e ANAMAG -const char* conai_sottocat_name(TCONAI_class type, int logicnum) -{ - if (conai_configured_class(type)) // Garantisce anche che type < CONAI_CLASSES - { - const char* const __conai_scat_rdoc[CONAI_CLASSES] = - { "CONSCACC", "CONSCALL", "CONSCCAR", "CONSCPLA", "CONSCLEG", "CONSCVET" }; - const char* const __conai_scat_anmg[CONAI_CLASSES] = - { ANAMAG_CONAISC"[1,4]", ANAMAG_CONAISC"[5,8]", ANAMAG_CONAISC"[9,12]", - ANAMAG_CONAISC"[13,16]", ANAMAG_CONAISC"[17,20]", ANAMAG_CONAISC"[21,24]" }; - switch (logicnum) - { - case LF_ANAMAG : - error_box("La gestione conai è stata modificata! Impossibile determinare il campo"); - return __conai_scat_anmg[type]; - case LF_RIGHEDOC: return __conai_scat_rdoc[type]; - default : break; - } - } - return ""; -} const char* conai_esenzione_name(TCONAI_class cc, int logicnum) { @@ -1005,8 +961,8 @@ const char* conai_esenzione_name(TCONAI_class cc, int logicnum) { const char* const __conai_ese_cfven[CONAI_CLASSES] = { CFV_ESACC, CFV_ESALL, CFV_ESCAR, CFV_ESPLA, CFV_ESLEG, CFV_ESVET }; - - switch (logicnum) + + switch (logicnum) { case LF_RIGHEDOC: case LF_CFVEN : return __conai_ese_cfven[cc]; @@ -1020,21 +976,6 @@ const char* conai_esenzione_name(TCONAI_class cc, int logicnum) // TConai /////////////////////////////////////////////////////////// -const TString_array TConai::get_lista_cod_spesa() -{ - TString_array ret; - for (auto i = _conais.begin(); i != _conais.end(); ++i) - { - /*for (auto j = i->second.begin(); j != i->second().end(); ++j) - { - if (ret.find(j->second.codice()) == -1) - ret.add(j->second.codice()); - } - */ - } - return ret; -} - TConai::TConai() { TRelation rel(LF_TABMOD); @@ -1045,15 +986,16 @@ TConai::TConai() TCursor conais(&rel, "", 1, &rec, &rec); for (conais = 0; conais.pos() < conais.items(); ++conais) { - TRectype row = conais.curr(); - const TString& con_class = row.get("CODTAB").left(2); - const TString& con_sub = row.get("CODTAB").mid(2); - const TString& cod_spesa = row.get("S1").blank() ? conai_configured_spesa(conai_str2class(con_class)) : row.get("S1"); - if (conai_configured_class(conai_str2class(con_class))) - { - // Aggiungo - _conais[con_class][con_sub] = TSpesa_prest(cod_spesa); - } + TRectype & row = conais.curr(); + const TString& con_sub = row.get("CODTAB"); + TString cod_spesa = row.get("S1"); + + if (cod_spesa.blank()) + cod_spesa = conai_configured_spesa(conai_str2class(con_sub)); + + + if (cod_spesa.full()) + _conais.add(con_sub, new TSpesa_prest(cod_spesa), true); } } @@ -1063,17 +1005,14 @@ TConai::TConai() // Calcola il peso in Kg di una componente (carta, palstica, ecc.) dell'imballo della riga corrente -real TRiga_documento::calc_conai_qta(TCONAI_class type, const int num_field) const +real TRiga_documento::calc_conai_qta(const int num_field) const { real kg; if (is_merce() || is_omaggio()) { - TString weight_name = conai_peso_name(type, LF_RIGHEDOC); - if (weight_name.full()) // Se la categoria conai e' gestita - { - weight_name << "(%d)"; - const real peso = get_real(weight_name.format(weight_name, num_field)); // Peso unitario imballo - real qta = quantita(); // Quantita' merce + const real peso = get_real(conai_peso_name(num_field)); // Peso unitario imballo + real qta = quantita(); // Quantita' merce + if (peso > ZERO && !qta.is_zero()) // Verifica se ha un peso valido { // A volte CODARTMAG è vuoto per cui converte erroneamente la qta in 0 :-( @@ -1087,7 +1026,6 @@ real TRiga_documento::calc_conai_qta(TCONAI_class type, const int num_field) con kg.round(5); } } - } return kg; } @@ -1363,7 +1301,7 @@ void TRiga_documento::autosave(TSheet_field& f) break; } } - for (short id = FR_SCAACC; id <= FR_PUNVET; id++) + for (short id = FR_CCON01; id <= FR_PCON10; id++) { const int pos = m.id2pos(id); @@ -1487,7 +1425,7 @@ void TRiga_documento::autoload(TSheet_field & f) } } - for (short id = FR_SCAACC; id <= FR_PUNVET; id++) + for (short id = FR_CCON01; id <= FR_PCON10; id++) { const int pos = m.id2pos(id); if (pos > 0) diff --git a/src/ve/velib03.cpp b/src/ve/velib03.cpp index c5f60dbc1..189772e28 100755 --- a/src/ve/velib03.cpp +++ b/src/ve/velib03.cpp @@ -1967,7 +1967,9 @@ TRiga_documento & TDocumento::row(int index) r = _valfisc; } - } + } + if (r != NULL) + r->set_doc(this); return *r; } @@ -3001,29 +3003,25 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, void TDocumento::update_conai_qta() { - _conaiqta.clear(); + _conaiqta.destroy(); FOR_EACH_PHYSICAL_RDOC(*this, i, r) if (r->is_merce() || r->is_omaggio()) { - FOR_EACH_CONFIGURED_CONAI_CLASS(cc) - { - TString catconai = conai_sottocat_name(cc, LF_RIGHEDOC); catconai << "(%d)"; - int row_conai = 1; - bool ok = true; - while(ok) - { - static TString current_cat; current_cat.cut(0); - current_cat.format(catconai, row_conai); + TString current_cat; - if (r->get(current_cat).full()) - { - const real rowqty = r->calc_conai_qta(cc, row_conai); - if (rowqty.is_zero()) continue; - _conaiqta[r->get(current_cat)] += rowqty; - row_conai++; - } - else - ok = false; + for (int i = 1; i <= FR_CMAX; i++) + { + TString8 cat = r->get(conai_sottocat_name(i)); + + if (cat.full()) + { + const real rowqty = r->calc_conai_qta(i); + + real * q = (real *) _conaiqta.objptr(cat); + + if (q == NULL) + _conaiqta.add(cat, q = new real); + *q += rowqty; } } } @@ -3065,7 +3063,7 @@ void TDocumento::update_conai() { if (main_app().has_module(DCAUT, CHK_DONGLE) && tipo().add_conai() && tipo().stati_iniziali_modifica().find(stato()) >= 0) { - set conai_aggiornati; + TAssoc_array conai_aggiornati; const TRectype& cfven = clifor().vendite(); const bool cli_add_conai = cfven.get_bool("ADDCONAI"); @@ -3087,18 +3085,16 @@ void TDocumento::update_conai() // Controllo se il documento ha il metodo nuovo, in caso negativo skippo tutto // Cancella le righe generate e poi ti ricalcolo tutto if(!has_new_conai(*this)) - { return; - } const TString& cod = r.get(RDOC_CODART); const TString& sottocat = r.get(RDOC_TIPOCON); - if (_conai.find(sottocat)) + if (_conaiqta.objptr(sottocat) != NULL) { if (cli_add_conai) { real perc_esenz = cfven.get_real(get_cf_esenz(sottocat.left(2))); - real qta = _conaiqta[sottocat]; + real qta = (real &) _conaiqta[sottocat]; if (dataes.ok() && datadoc > dataes) perc_esenz = ZERO; const bool cli_esente = esponi_esenti && (perc_esenz >= CENTO); @@ -3115,7 +3111,7 @@ void TDocumento::update_conai() } else destroy_row(i, true); - conai_aggiornati.insert(sottocat); + conai_aggiornati.add(sottocat, sottocat); } } } @@ -3124,62 +3120,62 @@ void TDocumento::update_conai() if (cli_add_conai) { const TString4 cod_iva_cli = codesiva(); + TConai conai; - std::map righe_spesa; - for(auto cp = _conaiqta.begin(); cp != _conaiqta.end(); ++cp) - { - const TString cod_sottocat = cp->first; + FOR_EACH_ASSOC_OBJECT(_conaiqta, o, key, item) + { + const TString cod_sottocat = key; - // Se l'ho già fatto skippo - if (conai_aggiornati.find(cod_sottocat) != conai_aggiornati.end()) - continue; + // Se l'ho già fatto skippo + if (conai_aggiornati.objptr(cod_sottocat) != NULL) + continue; - TSpesa_prest sp = _conai.get_spesa(cod_sottocat); + TSpesa_prest sp = conai.get_spesa(cod_sottocat); - // Aggiungo la spesa - const real perc_esenz = cfven.get_real(get_cf_esenz(cod_sottocat.left(2))); - const bool cli_esente = (esponi_esenti) && (perc_esenz >= CENTO); - const real qta_lorda = _conaiqta[cod_sottocat]; - real qta = qta_lorda; - if (!cli_esente && !qta_lorda.is_zero() && !perc_esenz.is_zero()) - { - qta = qta_lorda * (CENTO - perc_esenz) / CENTO; - qta.round(5); - } + // Aggiungo la spesa + const real perc_esenz = cfven.get_real(get_cf_esenz(cod_sottocat.left(2))); + const bool cli_esente = (esponi_esenti) && (perc_esenz >= CENTO); + const real qta_lorda = *((real *) item); + real qta = qta_lorda; + if (!cli_esente && !qta_lorda.is_zero() && !perc_esenz.is_zero()) + { + qta = qta_lorda * (CENTO - perc_esenz) / CENTO; + qta.round(5); + } - if (qta > ZERO) - { - const TString4 tipo = sp.tipo_riga(); - TRiga_documento& riga = new_row(tipo); + if (qta > ZERO) + { + const TString4 tipo = sp.tipo_riga(); + TRiga_documento& riga = new_row(tipo); - riga.put(RDOC_CODART, sp.codice()); - riga.generata(); - riga.put(RDOC_GENTIPO, 'C'); - static TString descrizione; - descrizione.cut(0) << sp.descrizione() << " (" << cod_sottocat << ")"; - riga.put(RDOC_DESCR, descrizione); - riga.put(RDOC_QTA, qta); + riga.put(RDOC_CODART, sp.codice()); + riga.generata(); + riga.put(RDOC_GENTIPO, 'C'); + static TString descrizione; + descrizione.cut(0) << sp.descrizione() << " (" << cod_sottocat << ")"; + riga.put(RDOC_DESCR, descrizione); + riga.put(RDOC_QTA, qta); - // Mi salvo anche la sottocategoria in questione - riga.put(RDOC_TIPOCON, cod_sottocat); + // Mi salvo anche la sottocategoria in questione + riga.put(RDOC_TIPOCON, cod_sottocat); - const real cambio = get_real(DOC_CAMBIO); - const TString4 valuta = get(DOC_CODVAL); - real prezzo = cli_esente ? ZERO : sp.prezzo(); + const real cambio = get_real(DOC_CAMBIO); + const TString4 valuta = get(DOC_CODVAL); + real prezzo = cli_esente ? ZERO : sp.prezzo(); - sppr_calc(sp, valuta, cambio, prezzo); - if (this->tipo().calcolo_lordo()) - prezzo = riga.iva().lordo(prezzo, ALL_DECIMALS); - riga.put(RDOC_PREZZO, prezzo); - riga.put(RDOC_UMQTA, sp.um()); - if (cod_iva_cli.empty()) - riga.put(RDOC_CODIVA, sp.cod_iva()); - else - riga.put(RDOC_CODIVA, cod_iva_cli); - } - } - } + sppr_calc(sp, valuta, cambio, prezzo); + if (this->tipo().calcolo_lordo()) + prezzo = riga.iva().lordo(prezzo, ALL_DECIMALS); + riga.put(RDOC_PREZZO, prezzo); + riga.put(RDOC_UMQTA, sp.um()); + if (cod_iva_cli.empty()) + riga.put(RDOC_CODIVA, sp.cod_iva()); + else + riga.put(RDOC_CODIVA, cod_iva_cli); + } + } + } } } diff --git a/src/ve/velib03a.cpp b/src/ve/velib03a.cpp index ab27441a2..f96007ad9 100755 --- a/src/ve/velib03a.cpp +++ b/src/ve/velib03a.cpp @@ -267,8 +267,16 @@ const TString_array& TTipo_documento::sheet_columns() const if (_sheet_columns.empty()) { TFilename pn; profile_name(pn); - TConfig prof(pn, "SHEET"); - for (int i = 0; i < MAX_COLUMNS; i++) + TConfig prof(pn);//, "SHEET"); + TString_array para; + + prof.list_paragraphs(para); + if (para.find("SHEET", 0) >= 0) + prof.set_paragraph("SHEET"); + else + if (para.find("SH", 0) >= 0) + prof.set_paragraph("SH"); + for (int i = 0; i < MAX_COLUMNS; i++) { const TString& id = prof.get("Col", NULL, i); if (atoi(id) <= 0) @@ -444,6 +452,7 @@ void TTipo_documento::read_formule() _load_cont = prof.get_bool("LOAD_CONT", "MAIN"); _raee_cod = prof.get("RAEE_COD", "MAIN"); _raee_fld = prof.get("RAEE_FLD", "MAIN"); + _max_days = prof.get_int("MAXDAYSBEFORE", "MAIN", -1, -1); TToken_string str = prof.get("ART_TO_SHOW", "MAIN"); _liv = str.get_int(); @@ -527,7 +536,22 @@ bool TTipo_documento::scarica_residuo() const return get_bool("B4"); } - +const TDate & TTipo_documento::first_ok_date() +{ + if (!_first_ok_date.ok()) + { + _first_ok_date = TDate(TODAY); + if (_max_days < 0) + { + _first_ok_date.set_day(1); + _first_ok_date.set_month(1); + _first_ok_date.set_year(1900); + } + else + _first_ok_date -= _max_days; + } + return _first_ok_date; +} /////////////////////////////////////////////////////////// // Espressione rdocumento /////////////////////////////////////////////////////////// @@ -611,11 +635,11 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st const int cond_nvars = cond_expr.numvar(); TExpr_documento expr(field, _numexpr, _doc); const int nvars = expr.numvar(); - + for (int i = _doc->rows(); i > 0; i--) { const TRiga_documento& riga = (const TRiga_documento&)(*_doc)[i]; - + for (int j = cond_nvars - 1; j >= 0; j--) { const char* s = cond_expr.varname(j); diff --git a/src/ve/velib04b.cpp b/src/ve/velib04b.cpp index d0c1faa6b..d5036ef84 100755 --- a/src/ve/velib04b.cpp +++ b/src/ve/velib04b.cpp @@ -1231,10 +1231,6 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc) _error = ultprot_error; return _error; } - if (upd_prot) - reg.update(ult_prot, doc.data()); - else - registro.update(ult_prot, doc.data()); } else // oppure dal numero di documento ult_prot = doc.numero(); @@ -3212,6 +3208,18 @@ error_type TContabilizzazione::write_all(TDocumento& doc, TMovimentoPN_VE & movi error_box("*** Errore %d scrivendo il movimento contabile %ld.", err, numreg); return generic_error; } + if (_nump_iva) // Reperisce l'ultimo numero di protocollo dal registro IVA + { + const bool upd_prot = ini_get_bool(CONFIG_DITTA, "ve", "UpdateProtocol", true); + TRegistro& registro = _caus->reg(); + TRegistro reg(registro); + const int ult_prot = head.get_int(MOV_PROTIVA); + + if (upd_prot) + reg.update(ult_prot, doc.data()); + else + registro.update(ult_prot, doc.data()); + } // Aggiorno subito i saldi if (_caus->soloiva()) movimento.destroy_cg_row(-1); diff --git a/src/ve/velib06.cpp b/src/ve/velib06.cpp index e617df598..273688979 100755 --- a/src/ve/velib06.cpp +++ b/src/ve/velib06.cpp @@ -72,17 +72,11 @@ TColor_rule::TColor_rule(const char* desc, const char* expr, TTypeexp type, COLO // Gestione campi CONAI su maschera righe /////////////////////////////////////////////////////////// -short conai_peso_id(TCONAI_class type) -{ return type >= CONAI_FIRST && type <= CONAI_LAST ? FR_PUNACC + 2 * type : DLG_NULL; } +short conai_peso_id(int id) +{ return id >= 0 && id < FR_CMAX ? FR_PCON01 + 2 * id : DLG_NULL; } -short conai_sottocat_id(TCONAI_class type) -{ return type >= CONAI_FIRST && type <= CONAI_LAST ? FR_SCAACC + 2*type : DLG_NULL; } - -TCONAI_class conai_id2class(short id) -{ - const TCONAI_class t = TCONAI_class((id-FR_SCAACC) / 2); - return t >= CONAI_FIRST && t <= CONAI_LAST ? t : CONAI_NONE; -} +short conai_sottocat_id(int id) +{ return id >= 0 && id < FR_CMAX ? FR_CCON01 + 2 * id : DLG_NULL; } /////////////////////////////////////////////////////////// // TDocumento_mask @@ -662,9 +656,9 @@ void TDocumento_mask::configura_sheet(TSheet_field& sheet) TToken_string colonne; int i; - + colonne = "0"; - for (i = 0; i < ncols; i ++ ) + for (i = 0; i < ncols; i++) { TToken_string& sheet_col = (TToken_string&)sheet_columns.row(i); const int field_id = sheet_col.get_int(0); @@ -672,13 +666,13 @@ void TDocumento_mask::configura_sheet(TSheet_field& sheet) to_delete.reset(coltomove); const TString80 descr(sheet_col.get(1)); - if (descr.not_empty() ) - sheet.set_column_header( field_id, descr); + if (descr.not_empty()) + sheet.set_column_header(field_id, descr); const int size = sheet_col.get_int(2) * 8; // XI_FU_MULTIPLE if (size != 0) - sheet.set_column_width( field_id, size); - + sheet.set_column_width(field_id, size); + if (field_id != FR_LORDO) colonne.add(field_id); if (field_id == FR_CODIVA && tdoc.is_costo()) @@ -689,18 +683,23 @@ void TDocumento_mask::configura_sheet(TSheet_field& sheet) colonne.add(col); } } - + to_delete.set(0L); to_delete.reset(1); + bool has_conai = false; + FOR_EACH_CONAI_CLASS(ct) + has_conai |= conai_configured_class(ct); + + for (int ct = 0; ct < FR_CMAX; ct++) { const short posc = conai_sottocat_id(ct); const short posp = conai_peso_id(ct); const int colc = sheet.cid2index(posc); const int colp = sheet.cid2index(posp); - if (conai_configured_class(ct)) + if (has_conai) { to_delete.reset(colc); if (colonne.find(format("%d", posc)) < 0) @@ -753,6 +752,7 @@ void TDocumento_mask::configura_sheet(TSheet_field& sheet) } } + if (!to_delete[sheet.cid2index(FR_CODDEP)]) sheet.enable_column(FR_CODDEP, _ges_dep && _ges_mag); if (!to_delete[sheet.cid2index(FR_CODMAG)]) @@ -1760,23 +1760,30 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga) f.add_driver(-F_CODVAL); } - FOR_EACH_CONAI_CLASS(type) - { - const short posc = conai_sottocat_id(type); - const short posp = conai_peso_id(type); - if (conai_configured_class(type)) + bool has_conai = false; + + FOR_EACH_CONAI_CLASS(ct) + has_conai |= conai_configured_class(ct); + + for (int i = 0; i < FR_CMAX; i++) + { + const short posc = conai_sottocat_id(i); + const short posp = conai_peso_id(i); + + if (has_conai) { m->show(posc); m->set_handler(posc, sottocat_conai_handler); m->show(posp); m->set_handler(posp, peso_conai_handler); - } + } else { m->hide(posc); m->hide(posp); } - } + } + // Impostiamo gli eventuali drivers FOR_EACH_MASK_FIELD((*m), i, f) if (f->is_edit()) diff --git a/src/ve/velib06a.cpp b/src/ve/velib06a.cpp index 86211455d..a65f099d2 100755 --- a/src/ve/velib06a.cpp +++ b/src/ve/velib06a.cpp @@ -420,7 +420,7 @@ bool note_hndl( TMask_field& f, KEY key ) TString stringone; for (int i = 0; i < 6; i++) { - const char fieldname[3] = { 'S', i+'0', '\0' }; + TString4 fieldname; fieldname << 'S' << i; stringone << note.get(fieldname); } stringone.replace(char(0xB6), '\n'); @@ -482,15 +482,16 @@ bool data_hndl( TMask_field& field, KEY key ) const TDate datadoc(m.get(F_DATADOC)); if (!datadoc.ok()) return field.error_box("La data documento deve essere comunque indicata."); - + if (m.id2pos(F_DATACAMBIO1) >= 0 && !m.get(F_CODVAL).empty()) m.set(F_DATACAMBIO1, field.get(), TRUE); } - if (key == K_ENTER || field.to_check(key)) + const TDate datadoc(m.get(F_DATADOC)); + if (key == K_ENTER || field.to_check(key)) { - const TDate datadoc(m.get(F_DATADOC)); const int annodoc = m.get_int(F_ANNO); - if (datadoc.year() != annodoc) + + if (datadoc.year() != annodoc) { if (datadoc.ok()) return field.error_box(TR("La data documento deve appartenere all'anno %d"), annodoc); @@ -544,6 +545,12 @@ bool data_hndl( TMask_field& field, KEY key ) if (doc.good() && same_key && datadoc > doc.get_date(DOC_DATADOC)) return field.error_box("Data documento superiore alla data del documento successivo"); } + if (key == K_ENTER || field.to_check(key)) + { + if (m.insert_mode() && datadoc < ((TTipo_documento &)m.doc().tipo()).first_ok_date()) + return field.error_box("La data documento non può essere antecente al %s.", ((TTipo_documento &)m.doc().tipo()).first_ok_date().stringa()); + } + return true; } @@ -1896,29 +1903,22 @@ bool codart_handler(TMask_field& f, KEY key ) condv.ricerca(); const char* rdoc_prezzo = mask.doc().tipo().calcolo_lordo() ? RDOC_PREZZOL : RDOC_PREZZO; - mask.doc()[current_doc_row].put(rdoc_prezzo, row_mask.get(FR_PREZZO)); + mask.doc()[current_doc_row].put(rdoc_prezzo, row_mask.get(FR_PREZZO)); + TArticolo_conai cart(codart); - FOR_EACH_CONFIGURED_CONAI_CLASS(type) + for (int i = 0; i < FR_CMAX; i++) { - short id = conai_sottocat_id(type); + short id = conai_sottocat_id(i); int pos = row_mask.id2pos(id); if (pos >= 0 && row_mask.fld(pos).get().blank()) - { - const int lognum = anamag.num(); - const TFieldref fr(conai_sottocat_name(type, lognum), lognum); - row_mask.fld(pos).set(fr.read(anamag)); - } + row_mask.fld(pos).set(cart.get_scat(i)); - id = conai_peso_id(type); + id = conai_peso_id(i); pos = row_mask.id2pos(id); if (pos >= 0 && row_mask.fld(pos).get().blank()) - { - const int lognum = anamag.num(); - const TFieldref fr(conai_peso_name(type, lognum), lognum); - row_mask.fld(pos).set(fr.read(anamag)); - } + row_mask.set(id, cart.get_peso(i)); } const int pos = row_mask.id2pos(FR_CODIVA); @@ -3315,10 +3315,10 @@ bool sottocat_conai_handler(TMask_field& f, KEY key ) if (key == K_F8) { const TString& codart = f.mask().get(FR_CODARTMAG); - const TArticolo& articolo = cached_article(codart); - const TCONAI_class type = conai_id2class(f.dlg()); - const TFieldref fld(conai_sottocat_name(type, LF_ANAMAG), LF_ANAMAG); - f.set(fld.read(articolo)); + TArticolo_conai articolo(codart); + const int i = (f.dlg() - FR_CCON01)/2; + f.set(articolo.get_scat(i)); + peso_conai_handler(f.mask().field(f.dlg() + 1), key); } return true; } @@ -3328,9 +3328,9 @@ bool peso_conai_handler(TMask_field& f, KEY key) if (key == K_F8) { const TString& codart = f.mask().get(FR_CODARTMAG); - const TArticolo& articolo = cached_article(codart); - const TCONAI_class type = conai_id2class(f.dlg()); - f.set(articolo.get(conai_peso_name(type, LF_ANAMAG))); + TArticolo_conai articolo(codart); + const int i = (f.dlg() - FR_PCON01) / 2; + f.set(articolo.get_peso(i).string()); } return true; } diff --git a/src/ve/vepriv.h b/src/ve/vepriv.h index 28e24ac41..bc40227ce 100755 --- a/src/ve/vepriv.h +++ b/src/ve/vepriv.h @@ -50,9 +50,8 @@ bool reportba8_hndl(TMask_field& f, KEY key); bool is_tipodoc_ok(const TString & tipodoc); -TCONAI_class conai_id2class(short id); -short conai_peso_id(TCONAI_class cc); -short conai_sottocat_id(TCONAI_class cc); +short conai_peso_id(int cc); +short conai_sottocat_id(int cc); #endif diff --git a/src/ve/verig.h b/src/ve/verig.h index 9120704ef..c13ab00e3 100755 --- a/src/ve/verig.h +++ b/src/ve/verig.h @@ -109,22 +109,30 @@ //campi CONAI -#define FR_SCAACC 167 -#define FR_PUNACC 168 -#define FR_SCAALL 169 -#define FR_PUNALL 170 -#define FR_SCACAR 171 -#define FR_PUNCAR 172 -#define FR_SCAPLA 173 -#define FR_PUNPLA 174 -#define FR_SCALEG 175 -#define FR_PUNLEG 176 -#define FR_SCAVET 177 -#define FR_PUNVET 178 +#define FR_CCON01 167 +#define FR_PCON01 168 +#define FR_CCON02 169 +#define FR_PCON02 170 +#define FR_CCON03 171 +#define FR_PCON03 172 +#define FR_CCON04 173 +#define FR_PCON04 174 +#define FR_CCON05 175 +#define FR_PCON05 176 +#define FR_CCON06 177 +#define FR_PCON06 178 +#define FR_CCON07 179 +#define FR_PCON07 180 +#define FR_CCON08 181 +#define FR_PCON08 182 +#define FR_CCON09 183 +#define FR_PCON09 184 +#define FR_CCON10 185 +#define FR_PCON10 186 +#define FR_CMAX (FR_PCON10-FR_CCON01+1)/2 // Ultimo campo fittizio -#define FR_END 179 - +#define FR_END 187 #define MAX_COLUMNS FR_END-FR_LORDO #define FR_DESMAG 270 diff --git a/src/ve/verig.uml b/src/ve/verig.uml index e9950b246..4764045f3 100755 --- a/src/ve/verig.uml +++ b/src/ve/verig.uml @@ -2083,109 +2083,174 @@ ENDPAGE PAGE "Pag.4" -1 -1 MASK_WIDTH MASK_HEIGHT -GROUPBOX DLG_NULL 78 8 +GROUPBOX DLG_NULL 78 12 BEGIN PROMPT 1 0 "CONAI" END -STRING FR_SCAACC 4 +STRING FR_CCON01 4 BEGIN - PROMPT 2 1 "Sottocategoria ACCIAIO " - USE &SCC SELECT CODTAB[1,2]=="AC" - INPUT CODTAB FR_SCAACC - DISPLAY "Sottocategoria" CODTAB[3,4] + PROMPT 2 1 "Sottocategoria 1 " + USE &SCC + INPUT CODTAB FR_CCON01 + DISPLAY "Sottocategoria" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT FR_SCAACC CODTAB - FIELD CONSCACC + OUTPUT FR_CCON01 CODTAB + FIELD CCON(1) END -NUMBER FR_PUNACC 13 5 +NUMBER FR_PCON01 13 5 BEGIN PROMPT 40 1 "Peso unitario " - FIELD CONPUACC + FIELD PCON(1) END -STRING FR_SCAALL 4 +STRING FR_CCON02 4 BEGIN - PROMPT 2 2 "Sottocategoria ALLUMINIO " - USE &SCC SELECT CODTAB[1,2]=="AL" - INPUT CODTAB FR_SCAALL - COPY DISPLAY FR_SCAACC - OUTPUT FR_SCAALL CODTAB - FIELD CONSCALL + PROMPT 2 2 "Sottocategoria 2 " + USE &SCC + INPUT CODTAB FR_CCON02 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON02 CODTAB + FIELD CCON(2) END -NUMBER FR_PUNALL 13 5 +NUMBER FR_PCON02 13 5 BEGIN PROMPT 40 2 "Peso unitario " - FIELD CONPUALL + FIELD PCON(2) END -STRING FR_SCACAR 4 +STRING FR_CCON03 4 BEGIN - PROMPT 2 3 "Sottocategoria CARTA " - USE &SCC SELECT CODTAB[1,2]=="CA" - INPUT CODTAB FR_SCACAR - COPY DISPLAY FR_SCAACC - OUTPUT FR_SCACAR CODTAB - FIELD CONSCCAR + PROMPT 2 3 "Sottocategoria 3 " + USE &SCC + INPUT CODTAB FR_CCON03 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON03 CODTAB + FIELD CCON(3) END -NUMBER FR_PUNCAR 13 5 +NUMBER FR_PCON03 13 5 BEGIN PROMPT 40 3 "Peso unitario " - FIELD CONPUCAR + FIELD PCON(3) END -STRING FR_SCAPLA 4 +STRING FR_CCON04 4 BEGIN - PROMPT 2 4 "Sottocategoria PLASTICA " + PROMPT 2 4 "Sottocategoria 4 " USE &SCC SELECT CODTAB[1,2]=="PL" - INPUT CODTAB FR_SCAPLA - COPY DISPLAY FR_SCAACC - OUTPUT FR_SCAPLA CODTAB - FIELD CONSCPLA + INPUT CODTAB FR_CCON04 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON04 CODTAB + FIELD CCON(4) END -NUMBER FR_PUNPLA 13 5 +NUMBER FR_PCON04 13 5 BEGIN PROMPT 40 4 "Peso unitario " - FIELD CONPUPLA + FIELD PCON(4) END -STRING FR_SCALEG 4 +STRING FR_CCON05 4 BEGIN - PROMPT 2 5 "Sottocategoria LEGNO " - USE &SCC SELECT CODTAB[1,2]=="LE" - INPUT CODTAB FR_SCALEG - COPY DISPLAY FR_SCAACC - OUTPUT FR_SCALEG CODTAB - FIELD CONSCLEG + PROMPT 2 5 "Sottocategoria 5 " + USE &SCC + INPUT CODTAB FR_CCON05 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON05 CODTAB + FIELD CCON(5) END -NUMBER FR_PUNLEG 13 5 +NUMBER FR_PCON05 13 5 BEGIN PROMPT 40 5 "Peso unitario " - FIELD CONPULEG + FIELD PCON(5) END -STRING FR_SCAVET 4 +STRING FR_CCON06 4 BEGIN - PROMPT 2 6 "Sottocategoria VETRO " - USE &SCC SELECT CODTAB[1,2]=="VE" - INPUT CODTAB FR_SCAVET - COPY DISPLAY FR_SCAACC - OUTPUT FR_SCAVET CODTAB - FIELD CONSCVET + PROMPT 2 6 "Sottocategoria 6 " + USE &SCC + INPUT CODTAB FR_CCON06 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON06 CODTAB + FIELD CCON(6) END -NUMBER FR_PUNVET 13 5 +NUMBER FR_PCON06 13 5 BEGIN PROMPT 40 6 "Peso unitario " - FIELD CONPUVET + FIELD PCON(6) +END + +STRING FR_CCON07 4 +BEGIN + PROMPT 2 7 "Sottocategoria 7 " + USE &SCC + INPUT CODTAB FR_CCON07 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON07 CODTAB + FIELD CCON(7) +END + +NUMBER FR_PCON07 13 5 +BEGIN + PROMPT 40 7 "Peso unitario " + FIELD PCON(7) +END + +STRING FR_CCON08 4 +BEGIN + PROMPT 2 8 "Sottocategoria 8 " + USE &SCC + INPUT CODTAB FR_CCON08 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON08 CODTAB + FIELD CCON(8) +END + +NUMBER FR_PCON08 13 5 +BEGIN + PROMPT 40 8 "Peso unitario " + FIELD PCON(8) +END + +STRING FR_CCON09 4 +BEGIN + PROMPT 2 9 "Sottocategoria 9 " + USE &SCC + INPUT CODTAB FR_CCON09 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON09 CODTAB + FIELD CCON(9) +END + +NUMBER FR_PCON09 13 5 +BEGIN + PROMPT 40 9 "Peso unitario " + FIELD PCON(9) +END + +STRING FR_CCON10 4 +BEGIN + PROMPT 2 10 "Sottocategoria 10 " + USE &SCC + INPUT CODTAB FR_CCON10 + COPY DISPLAY FR_CCON01 + OUTPUT FR_CCON10 CODTAB + FIELD CCON(10) +END + +NUMBER FR_PCON10 13 5 +BEGIN + PROMPT 40 10 "Peso unitario " + FIELD PCON(10) END #endif + #ifndef FULL_SCREEN ENDPAGE