diff --git a/ha/ha0300.cpp b/ha/ha0300.cpp index 2b547fe64..f80fb37af 100755 --- a/ha/ha0300.cpp +++ b/ha/ha0300.cpp @@ -359,7 +359,7 @@ void TDocumenti_premio::write_rows(const TMask& m) for (int i = sm.fields()-1; i >= 0; i--) //giro su tutti i campi della maschera di riga... { TMask_field& mf = sm.fld(i); //aggiunge solo quelli che hanno un field - if ((mf.field() != NULL) && (mf.dlg() > 100)) //> 100 per evitare errori sui campi dlg_null + if ((mf.dlg() > 100) && (mf.field() != NULL)) //> 100 per evitare errori sui campi dlg_null { const int idx = sheet.cid2index(mf.dlg()); mf.field()->write(row->get(idx), rec); @@ -386,11 +386,10 @@ void TDocumenti_premio::write_rows(const TMask& m) //panegirico sul codice iva (che ci va sennò col cavolo che si riesce a contabilizzare il contratto) TString80 codspp; - TConfig config(CONFIG_DITTA, "ha"); switch (tipo_contr) { - case 'A': codspp = config.get("CoAntSpe"); break; - case 'R': codspp = config.get("CoRifaSpe"); break; + case 'A': codspp = ini_get_string(CONFIG_DITTA, "ha", "CoAntSpe"); break; + case 'R': codspp = ini_get_string(CONFIG_DITTA, "ha", "CoRifaSpe"); break; default: break; } last_rec.put(RDOC_CODART, codspp); @@ -399,7 +398,7 @@ void TDocumenti_premio::write_rows(const TMask& m) TCli_for clifo(m.get(F_TIPOCF)[0], m.get_long(F_CODCF)); TString4 codiva(clifo.vendite().get(CFV_ASSFIS)); //per i restanti 1E+6 - 1 clienti... - if (!codiva.full()) + if (codiva.blank()) codiva = cache().get("SPP", codspp, "S3"); last_rec.put(RDOC_CODIVA, codiva); } diff --git a/ha/ha0300a.h b/ha/ha0300a.h index 977aa81fa..1f6b32e95 100755 --- a/ha/ha0300a.h +++ b/ha/ha0300a.h @@ -8,6 +8,8 @@ #define F_TIPOCF 205 #define F_CODCF 206 #define F_DESCF 207 +#define F_CODCFATT 208 +#define F_DESCFATT 209 #define F_CODCONTR 210 #define F_DESCONTR 211 diff --git a/ha/ha0300a.uml b/ha/ha0300a.uml index 977982198..bbed35a4f 100755 --- a/ha/ha0300a.uml +++ b/ha/ha0300a.uml @@ -13,9 +13,14 @@ BEGIN PROMPT 1 0 "" END -RADIOBUTTON F_TIPOCONTR 1 76 +TEXT DLG_NULL BEGIN - PROMPT 2 0 "@bTipo contratto" + PROMPT 1 1 "@bTipo contratto" +END + +RADIOBUTTON F_TIPOCONTR 1 70 +BEGIN + PROMPT 16 0 "" ITEM "A|Anticipo" MESSAGE CLEAR,F_DATAFCOMP|ENABLE,1@|CLEAR,F_CODLIS|REQUIRED,F_CODCONTR ITEM "P|Posticipo" @@ -61,10 +66,9 @@ END NUMBER F_CODCF 6 BEGIN - PROMPT 2 3 "Cliente " + PROMPT 2 2 "Cliente " WARNING "Cliente assente" HELP "Codice del cliente del documento" - FLAGS "R" FIELD CODCF USE LF_CLIFO KEY 1 INPUT TIPOCF "C" @@ -83,7 +87,7 @@ STRING F_DESCF 50 BEGIN WARNING "Cliente assente" HELP "Ragione sociale del cliente del documento" - PROMPT 24 3 "" + PROMPT 24 2 "" USE LF_CLIFO KEY 2 INPUT TIPOCF "C" INPUT RAGSOC F_DESCF @@ -96,6 +100,37 @@ BEGIN ADD RUN cg0 -1 C END +NUMBER F_CODCFATT 6 +BEGIN + PROMPT 2 3 "Cli. fatt." + WARNING "Inserire un codice >= 200000" + HELP "Codice del cliente cui fatturare >= 200000" + FIELD DOC2 + COPY USE F_CODCF + INPUT TIPOCF "C" + INPUT CODCF F_CODCFATT + COPY DISPLAY F_CODCF + OUTPUT F_CODCFATT CODCF + OUTPUT F_DESCFATT RAGSOC + CHECKTYPE NORMAL + ADD RUN cg0 -1 C +END + +STRING F_DESCFATT 50 +BEGIN + WARNING "Cliente assente" + HELP "Ragione sociale del cliente cui fatturare" + PROMPT 24 3 "" + COPY USE F_DESCF + INPUT TIPOCF "C" + INPUT RAGSOC F_DESCFATT + COPY DISPLAY F_DESCF + COPY OUTPUT F_CODCFATT + CHECKTYPE NORMAL + ADD RUN cg0 -1 C +END + + LIST F_PROVV 1 BEGIN PROMPT 140 101 "" @@ -129,7 +164,7 @@ BEGIN INPUT ANNO F_ANNO SELECT INPUT NDOC F_NDOC DISPLAY "Numero" NDOC - DISPLAY "Data doc." DATADOC + DISPLAY "Data doc.@10" DATADOC DISPLAY "Inizio@10" DATACOMP DISPLAY "Fine@10" DATAFCOMP DISPLAY "Tipo" TIPODOC diff --git a/ha/ha0500.cpp b/ha/ha0500.cpp index 30c7ada75..b4b6f23f6 100755 --- a/ha/ha0500.cpp +++ b/ha/ha0500.cpp @@ -23,19 +23,9 @@ protected: virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); public: - THardy_elab_docs_mask(); - ~THardy_elab_docs_mask(); + THardy_elab_docs_mask() : TAutomask ("ha0500a") {} }; - -THardy_elab_docs_mask::THardy_elab_docs_mask() : TAutomask ("ha0500a") -{ -} - -THardy_elab_docs_mask::~THardy_elab_docs_mask() -{ -} - bool THardy_elab_docs_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) { switch (o.dlg()) @@ -498,7 +488,7 @@ bool THardy_elab_docs::genera_nac(const TMask& mask, TArray& contratti_cliente, { TContratto_premi& contratto = *(TContratto_premi*)riga; const long ndoc = contratto.numero(); //il numdoc del contratto serve nelle segnalazioni - const long codcf = contratto.codcf(); //il codice cliente ci serve nella generazione della NAC.. + const long codcf = contratto.codcf_fatt(); //il codice cliente ci serve nella generazione della NAC.. const char tipo_contratto = contratto.tipo_contratto(); //..e pure il tipo di contratto in esame! //segnaliamo l'elaborazione del contratto sul log @@ -672,7 +662,7 @@ bool THardy_elab_docs::genera_nac(const TMask& mask, TArray& contratti_cliente, real reso_storico = rdoc->get_real(RCA_2_RESO_STORICO); reso_storico += rdoc->get_real(RCA_2_RESO_CORRENTE); rdoc->put(RCA_2_RESO_STORICO, reso_storico); - //se il contratto è andato a pareggio avverte dilegentemente l'operatore + //se il contratto è andato a pareggio avverte diligentemente l'operatore if (reso_storico >= anticipato) log_msg << " -- Contratto pareggiato!"; diff --git a/ha/halib.cpp b/ha/halib.cpp index 0082435a4..20de4155b 100755 --- a/ha/halib.cpp +++ b/ha/halib.cpp @@ -32,6 +32,13 @@ char TContratto_premi::tipo_contratto() const return 'P'; } +long TContratto_premi::codcf_fatt() const +{ + long cod = get_long(DOC_DOC2); + if (cod <= 0) + cod = codcf(); + return cod; +} TContratto_premi::TContratto_premi(char provv, int anno, const char* codnum, long ndoc) : TDocumento(provv, anno, codnum, ndoc) diff --git a/ha/halib.h b/ha/halib.h index 32a0b4f99..b78b5eeb6 100755 --- a/ha/halib.h +++ b/ha/halib.h @@ -37,6 +37,7 @@ static TString4 _tipo_ant, _tipo_post, _tipo_rifa; public: char tipo_contratto() const; + long codcf_fatt() const; TContratto_premi(char provv, int anno, const char* codnum, long ndoc); TContratto_premi(const TRectype& rec_doc);