From c30f6d57a9ff0e183ff0af59e77169298414fd39 Mon Sep 17 00:00:00 2001 From: AlexBonazzi Date: Fri, 26 Jul 2019 11:23:37 +0200 Subject: [PATCH] Patch level : 12.0 860 Files correlati : lv0.exe lv0300a.msk Commento : MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aggiunto dettaglio consegne alla fatturazione Nella configurazione prima pagina c'รจ il flag dettaglio consegne --- src/lv/lv0300a.h | 2 ++ src/lv/lv0300a.uml | 10 +++++++++- src/lv/lv2500.cpp | 41 ++++++++++++++++++++++++++++++----------- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/src/lv/lv0300a.h b/src/lv/lv0300a.h index d388d0141..6a6bbf9fb 100755 --- a/src/lv/lv0300a.h +++ b/src/lv/lv0300a.h @@ -101,6 +101,8 @@ #define F_DOTSTO 278 +#define F_DETTCONS 279 + #define F_BACKUP 300 #define S_CODNUM_RIT 101 diff --git a/src/lv/lv0300a.uml b/src/lv/lv0300a.uml index 596a16b3c..d8643cca1 100755 --- a/src/lv/lv0300a.uml +++ b/src/lv/lv0300a.uml @@ -166,7 +166,7 @@ BEGIN FLAGS "UP" END -STRING F_DESTIPODOC_FAT 50 +STRING F_DESTIPODOC_FAT 50 30 BEGIN PROMPT 24 5 "" HELP "Descrizione tipo documento" @@ -177,6 +177,14 @@ BEGIN COPY OUTPUT F_TIPODOC_FAT END +BOOLEAN F_DETTCONS +BEGIN + PROMPT 60 5 "Dettaglio consegne" + FIELD DettCons + MESSAGE TRUE CLEAR,F_RIFTEST + MESSAGE FALSE ENABLE,F_RIFTEST +END + BOOLEAN F_RIFTEST BEGIN PROMPT 2 6 "Scrivi riferimenti in testata documento" diff --git a/src/lv/lv2500.cpp b/src/lv/lv2500.cpp index 1ab1edeab..65f16f723 100755 --- a/src/lv/lv2500.cpp +++ b/src/lv/lv2500.cpp @@ -124,8 +124,8 @@ protected: virtual bool doc_raggruppabili(const TDocumento& doc_in, const TDocumento& doc_out, TToken_string& campi) const ; virtual bool doc_raggruppabile(const TDocumento & doc) const { return true; } virtual void campi_raggruppamento_righe(TToken_string& campi_riga) const; - virtual bool gestione_riferimenti() const { return true; } - virtual bool riferimenti_in_testa() const { return true; } +// virtual bool gestione_riferimenti() const { return true; } +// virtual bool riferimenti_in_testa() const { return true; } virtual TRiga_documento& find_or_create_row(TDocumento& doc_out, const TRiga_documento & rin,const char lavtype); virtual bool get_num_tip_out(const TDocumento& doc_out, TString& codnum, TString& tipodoc) const; @@ -511,24 +511,26 @@ int TFatturazione_lavanderie::write_fatt_ragg(const bool solotot) void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_documenti& doc_in) { const bool use_indsp = ini_get_bool(CONFIG_DITTA, "mg", "MOV_INDSPED"); - const bool riftest = ini_get_bool(CONFIG_DITTA, "lv", "RifTest"); const bool zero_note = ini_get_bool(CONFIG_DITTA, "lv", "ZeroNote"); - + const bool dett_cons = ini_get_bool(CONFIG_DITTA, "lv", "DettCons"); + const bool riftest = !dett_cons && ini_get_bool(CONFIG_DITTA, "lv", "RifTest"); + //scorro tutti i documenti di output generati precedentemente for (int id = 0; id < doc_out.items(); id++) { //instanzio il documento e recupero le variabili di interesse per recuperare //il contratto del cliente in questione TDocumento& doc = doc_out[id]; - const long clifo = doc.get_long(DOC_CODCF); + TRecord_array original_rows = doc.body(); + const long clifo = doc.get_long(DOC_CODCF); const int indsped = doc.get_int(DOC_CODINDSP); TLaundry_contract contr(clifo,indsped,_data_elab); //flag per il calcolo sul valore convenzionale e sul fisso per dotazione iniziale bool valconvcli = false; - bool fixdotin = false; - bool elcons = contr.get_bool(LVCONDV_ELCONS); - bool rifbol = contr.get_bool(LVCONDV_RIFBOL); +// bool fixdotin = false; + bool elcons = contr.get_bool(LVCONDV_ELCONS); + bool rifbol = !dett_cons && contr.get_bool(LVCONDV_RIFBOL); const bool splitpay = doc.anno() > 2015 && doc.clifor().get_bool(CLI_SPLITPAY); real consvconv; @@ -556,6 +558,8 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do if (doc.physical_rows() > 0 && doc[1].is_descrizione()) { + const TString desc = doc[1].get(RDOC_DESCR); + if (elcons) { TRiga_documento& rout = doc[1]; @@ -564,7 +568,7 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do rout.put(RDOC_DESCEST, ""); } else - if (!rifbol) + if (!rifbol || dett_cons) doc.destroy_row(1, true); } @@ -739,7 +743,9 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do else // se il tipo canone ่ impostato a nessuno o % sul valore convenzionale per cliente vado in ambedue i casi ad eseguire il ciclo che analizza i tipi forfait { //per ogni documento, scorro tutte le sue righe - for (int i = 1; i <= doc.physical_rows() ; i++) + const int rigamerce = doc.physical_rows() > 0 && doc[1].is_descrizione() ? 2 : 1; + + for (int i = rigamerce; i <= doc.physical_rows() ; i++) { TRiga_documento& rout = doc[i]; @@ -1340,12 +1346,25 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do } } } - for(int h = doc.physical_rows(); h > 0; h--) + const int rigamerce = doc.physical_rows() > 0 && doc[1].is_descrizione() ? 2 : 1; + + for(int h = doc.physical_rows(); h >= rigamerce; h--) { TRiga_documento& rdoc = doc[h]; if (rdoc.get(RDOC_DESCR).empty() || ((rdoc.imponibile().is_zero() && rdoc.get_real(RDOC_QTA).is_zero()))) doc.destroy_row(h, true); } + if (dett_cons) + { + for (int i = 1; i <= original_rows.rows(); i++) + { + TRiga_documento & r =doc.new_row(original_rows[i].get(RDOC_TIPORIGA)); + + doc.copy_data(r, original_rows[i]); + r.zero(RDOC_PREZZO); + r.zero(RDOC_CODIVA); + } + } } for (int id = doc_out.items() - 1; id >= 0 ; id--) {