Patch level : 12.0 1034
Files correlati : ve0.exe ve6.exe fatacq.ini fatacq.msk vetbeld.msk verig00.msk Commento : Corretta la funzionalità fatturare a, si deve controllare la tabella elaborazioni Aggiunto l'aggiornamento dei prezzi e delle descrizioni nella fatturazione bolle, quindi si deve controllare la tabella delle elaborazioni terminato il supporto per il reverse charge parziale
This commit is contained in:
		
							parent
							
								
									fdac7575f9
								
							
						
					
					
						commit
						05c60ff78d
					
				| @ -164,10 +164,12 @@ Col(14) = FR_IMPFISSO | |||||||
| Col(15) = FR_PERCPROV1 | Col(15) = FR_PERCPROV1 | ||||||
| Col(16) = FR_CODIVA | Col(16) = FR_CODIVA | ||||||
| Col(17) = FR_ADDIVA | Col(17) = FR_ADDIVA | ||||||
| Col(18) = FR_CAUS | Col(18) = FR_REVCHARGE | ||||||
| Col(19) = FR_CODMAGC | Col(19) = FR_TIPODET | ||||||
| Col(20) = FR_CODDEPC | Col(20) = FR_CAUS | ||||||
| Col(21) = FR_TIPORIGA | Col(21) = FR_CODMAGC | ||||||
|  | Col(22) = FR_CODDEPC | ||||||
|  | Col(23) = FR_TIPORIGA | ||||||
| 
 | 
 | ||||||
| [RIGHE] | [RIGHE] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1021,6 +1021,9 @@ public: | |||||||
|   int find_nrow(const char * tiporiga, const char * codice, bool reverse = false, int from = -1) const; |   int find_nrow(const char * tiporiga, const char * codice, bool reverse = false, int from = -1) const; | ||||||
|   TRiga_documento & find_row(const char * tiporiga, const char * codice, bool reverse = false); |   TRiga_documento & find_row(const char * tiporiga, const char * codice, bool reverse = false); | ||||||
|    |    | ||||||
|  |   void update_prices(); | ||||||
|  |   void update_descriptions(); | ||||||
|  | 
 | ||||||
| 	TDocumento (); | 	TDocumento (); | ||||||
| 	TDocumento (const TDocumento& d); | 	TDocumento (const TDocumento& d); | ||||||
| 	TDocumento(char provv, int anno, const char* codnum, long numdoc); | 	TDocumento(char provv, int anno, const char* codnum, long numdoc); | ||||||
|  | |||||||
| @ -1476,6 +1476,8 @@ void TRiga_documento::autosave(TSheet_field& f) | |||||||
|     put( RDOC_IMPFISUN, row.get( f.cid2index(FR_IMPFISUN )) ); |     put( RDOC_IMPFISUN, row.get( f.cid2index(FR_IMPFISUN )) ); | ||||||
|     put( RDOC_IMPFISSO, row.get( f.cid2index(FR_IMPFISSO )) ); |     put( RDOC_IMPFISSO, row.get( f.cid2index(FR_IMPFISSO )) ); | ||||||
|     put( RDOC_CODIVA, codiva); |     put( RDOC_CODIVA, codiva); | ||||||
|  |     put(RDOC_REVCHARGE, row.get_bool(cid2index(FR_REVCHARGE))); | ||||||
|  |     put(RDOC_TIPODET, row.get_bool(cid2index(FR_TIPODET))); | ||||||
|     put( RDOC_ADDIVA, row.get( f.cid2index(FR_ADDIVA )) ); |     put( RDOC_ADDIVA, row.get( f.cid2index(FR_ADDIVA )) ); | ||||||
|     put( RDOC_ASPBENI, row.get( f.cid2index(FR_ASPBENI )) );   |     put( RDOC_ASPBENI, row.get( f.cid2index(FR_ASPBENI )) );   | ||||||
|     put( RDOC_CAUSMAG, row.get( f.cid2index(FR_CAUS )) );   |     put( RDOC_CAUSMAG, row.get( f.cid2index(FR_CAUS )) );   | ||||||
| @ -1613,6 +1615,8 @@ void TRiga_documento::autoload(TSheet_field & f) | |||||||
|   row.add( get( RDOC_IMPFISUN ), f.cid2index(FR_IMPFISUN  )); |   row.add( get( RDOC_IMPFISUN ), f.cid2index(FR_IMPFISUN  )); | ||||||
|   row.add( get( RDOC_IMPFISSO ), f.cid2index(FR_IMPFISSO )); |   row.add( get( RDOC_IMPFISSO ), f.cid2index(FR_IMPFISSO )); | ||||||
| 	row.add( codiva, f.cid2index(FR_CODIVA )); | 	row.add( codiva, f.cid2index(FR_CODIVA )); | ||||||
|  |   row.add(get(RDOC_REVCHARGE), cid2index(FR_REVCHARGE)); | ||||||
|  |   row.add(get(RDOC_TIPODET), cid2index(FR_TIPODET)); | ||||||
|   row.add( get( RDOC_ADDIVA ), f.cid2index(FR_ADDIVA )); |   row.add( get( RDOC_ADDIVA ), f.cid2index(FR_ADDIVA )); | ||||||
|   row.add( get( RDOC_ASPBENI ), f.cid2index(FR_ASPBENI )); |   row.add( get( RDOC_ASPBENI ), f.cid2index(FR_ASPBENI )); | ||||||
|   row.add( get( RDOC_CAUSMAG ), f.cid2index(FR_CAUS )); |   row.add( get( RDOC_CAUSMAG ), f.cid2index(FR_CAUS )); | ||||||
|  | |||||||
| @ -2569,24 +2569,9 @@ real TDocumento::imposta(bool spese, int ndec) const | |||||||
| 
 | 
 | ||||||
| real TDocumento::totale_doc() const | real TDocumento::totale_doc() const | ||||||
| { | { | ||||||
| /*  A pag.1 c'e' scritto di non fare cosi'
 |  | ||||||
|   const TString16 field(tipo().totale_doc()); |  | ||||||
| 
 |  | ||||||
|   if (field.not_empty()) |  | ||||||
|     return get_real(field); |  | ||||||
|   else |  | ||||||
|   { |  | ||||||
|     real r = imponibile() + imposta(); |  | ||||||
|     const int ndec = decimals(); |  | ||||||
|      |  | ||||||
|     r += spese_incasso(r - ritenute()), ndec); |  | ||||||
|     r += bolli(real(r - ritenute()), ndec); |  | ||||||
|     return r; |  | ||||||
|   } |  | ||||||
| */ |  | ||||||
|   // Cosi' e' piu' ordinato, strutturato e veloce  
 |  | ||||||
|   real r; |   real r; | ||||||
|   const TString& field = tipo().totale_doc(); |   const TString& field = tipo().totale_doc(); | ||||||
|  | 
 | ||||||
|   if (field.blank()) |   if (field.blank()) | ||||||
|   { |   { | ||||||
|     const int ndec = decimals(); |     const int ndec = decimals(); | ||||||
| @ -2607,6 +2592,7 @@ real TDocumento::totale_doc() const | |||||||
| real TDocumento::totale_netto() const | real TDocumento::totale_netto() const | ||||||
| { | { | ||||||
|   const TString& field = tipo().totale_netto(); |   const TString& field = tipo().totale_netto(); | ||||||
|  | 
 | ||||||
|   if (field.full()) |   if (field.full()) | ||||||
|     return get_real(field); |     return get_real(field); | ||||||
|   else |   else | ||||||
| @ -2616,6 +2602,7 @@ real TDocumento::totale_netto() const | |||||||
| real TDocumento::basesconto() const | real TDocumento::basesconto() const | ||||||
| { | { | ||||||
|   const TString& field = tipo().basesconto(); |   const TString& field = tipo().basesconto(); | ||||||
|  | 
 | ||||||
|   return field.full() ? get_real(field) : ZERO; |   return field.full() ? get_real(field) : ZERO; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -2684,13 +2671,16 @@ TPagamento& TDocumento::pagamento() | |||||||
| {  | {  | ||||||
|   const char tipocf = get_char(DOC_TIPOCF); |   const char tipocf = get_char(DOC_TIPOCF); | ||||||
|   const long codcf = get_long(DOC_CODCF); |   const long codcf = get_long(DOC_CODCF); | ||||||
|  | 
 | ||||||
|   _pag.set_clifo(codcf, tipocf); |   _pag.set_clifo(codcf, tipocf); | ||||||
| 
 | 
 | ||||||
|   TDate data_in = get_date(DOC_DATAINSC); |   TDate data_in = get_date(DOC_DATAINSC); | ||||||
|  | 
 | ||||||
|   if (data_in.empty())      |   if (data_in.empty())      | ||||||
|     data_in = get_date(DOC_DATADOC); |     data_in = get_date(DOC_DATADOC); | ||||||
| 
 | 
 | ||||||
|   const TString8 codpag(get(DOC_CODPAG)); |   const TString8 codpag(get(DOC_CODPAG)); | ||||||
|  | 
 | ||||||
|   if (codpag != _pag.code()) |   if (codpag != _pag.code()) | ||||||
|   {                         |   {                         | ||||||
|     _pag.set_code(codpag); |     _pag.set_code(codpag); | ||||||
| @ -2709,10 +2699,12 @@ TPagamento& TDocumento::pagamento() | |||||||
| real TDocumento::provvigione(bool first, int ndec) const | real TDocumento::provvigione(bool first, int ndec) const | ||||||
| {  | {  | ||||||
|   TString16 field = agente(first).campoprovv(); |   TString16 field = agente(first).campoprovv(); | ||||||
|  | 
 | ||||||
|   if (field.empty()) |   if (field.empty()) | ||||||
| 		field = first ? tipo().totprovv() : tipo().totprovv1(); | 		field = first ? tipo().totprovv() : tipo().totprovv1(); | ||||||
| 
 | 
 | ||||||
|   real val;    |   real val;    | ||||||
|  | 
 | ||||||
|   if (field.not_empty()) |   if (field.not_empty()) | ||||||
|     val = get_real(field); |     val = get_real(field); | ||||||
|   else |   else | ||||||
| @ -2742,6 +2734,7 @@ real TDocumento::valore(bool totale, bool lordo, int ndec) const | |||||||
| void TDocumento::put_str(const char* fieldname, const char* val) | void TDocumento::put_str(const char* fieldname, const char* val) | ||||||
| {           | {           | ||||||
|   const TFixed_string fn(fieldname); |   const TFixed_string fn(fieldname); | ||||||
|  | 
 | ||||||
|   if (fn == DOC_TIPODOC) |   if (fn == DOC_TIPODOC) | ||||||
|   {                        |   {                        | ||||||
|     const TString4 v(val); |     const TString4 v(val); | ||||||
| @ -2786,7 +2779,9 @@ void TDocumento::zero(const char * fieldname) | |||||||
| { | { | ||||||
|   if (strcmp(fieldname, DOC_TIPODOC) == 0) |   if (strcmp(fieldname, DOC_TIPODOC) == 0) | ||||||
|     reset_fields(*this); |     reset_fields(*this); | ||||||
|  | 
 | ||||||
|   TAuto_variable_rectype::zero(fieldname); |   TAuto_variable_rectype::zero(fieldname); | ||||||
|  | 
 | ||||||
|   dirty_fields(); |   dirty_fields(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -2798,8 +2793,6 @@ TCli_for& TDocumento::clifor(bool force_reload) const | |||||||
| 
 | 
 | ||||||
|   if (force_reload) |   if (force_reload) | ||||||
|     cf.read(tipo, codice); |     cf.read(tipo, codice); | ||||||
| //	if (force_reload || cf.empty() || cf.tipo() != tipo || cf.codice() != codice)
 |  | ||||||
| 	//    cf.read(tipo, codice);
 |  | ||||||
| 	return cf; | 	return cf; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -2857,6 +2850,7 @@ TOccasionale& TDocumento::occas() const | |||||||
|   const TString16 occ_code = cod_occas(); // Codice occasionale in testata
 |   const TString16 occ_code = cod_occas(); // Codice occasionale in testata
 | ||||||
| 
 | 
 | ||||||
|   TOccasionale& rec = (TOccasionale&)_occas; |   TOccasionale& rec = (TOccasionale&)_occas; | ||||||
|  | 
 | ||||||
|   if (occ_code != rec.codice()) |   if (occ_code != rec.codice()) | ||||||
|   {  |   {  | ||||||
|     TLocalisamfile o(LF_OCCAS); |     TLocalisamfile o(LF_OCCAS); | ||||||
| @ -2945,6 +2939,7 @@ TRecord_array& TDocumento::body(int logicnum) const | |||||||
|         TRecfield ccms(rec, RDOC_CODCMS); |         TRecfield ccms(rec, RDOC_CODCMS); | ||||||
|         TRecfield fcms(rec, RDOC_FASCMS); |         TRecfield fcms(rec, RDOC_FASCMS); | ||||||
|         TRecfield ccos(rec, RDOC_CODCOSTO); |         TRecfield ccos(rec, RDOC_CODCOSTO); | ||||||
|  | 
 | ||||||
|         if (codcms == ccms) ccms = ""; |         if (codcms == ccms) ccms = ""; | ||||||
|         if (fascms == fcms) fcms = ""; |         if (fascms == fcms) fcms = ""; | ||||||
|         if (codcos == ccos) ccos = ""; |         if (codcos == ccos) ccos = ""; | ||||||
| @ -3007,6 +3002,7 @@ void TDocumento::update_raee() | |||||||
|           r1.set_descr(d); |           r1.set_descr(d); | ||||||
| 
 | 
 | ||||||
|           const TString& um = sp.um(); |           const TString& um = sp.um(); | ||||||
|  | 
 | ||||||
|           if (um.full()) |           if (um.full()) | ||||||
| 						r1.put(RDOC_UMQTA, um); | 						r1.put(RDOC_UMQTA, um); | ||||||
|           if (cod_iva_cli.blank()) |           if (cod_iva_cli.blank()) | ||||||
| @ -3035,6 +3031,7 @@ void TDocumento::update_raee() | |||||||
| void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, TSheet_field* sh, bool force) | void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, TSheet_field* sh, bool force) | ||||||
| { | { | ||||||
|   const bool updated = get_bool(DOC_SPESEUPD); |   const bool updated = get_bool(DOC_SPESEUPD); | ||||||
|  | 
 | ||||||
|   if (!force && updated) |   if (!force && updated) | ||||||
|     return; |     return; | ||||||
| 
 | 
 | ||||||
| @ -3143,7 +3140,6 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, | |||||||
| void TDocumento::update_conai_qta() | void TDocumento::update_conai_qta() | ||||||
| { | { | ||||||
| 	_conaiqta.destroy(); | 	_conaiqta.destroy(); | ||||||
| 
 |  | ||||||
| 	FOR_EACH_SELF_PHYSICAL_RDOC(i, r) | 	FOR_EACH_SELF_PHYSICAL_RDOC(i, r) | ||||||
|     if (r->is_merce() || r->is_omaggio()) |     if (r->is_merce() || r->is_omaggio()) | ||||||
| 	  { | 	  { | ||||||
| @ -3406,6 +3402,7 @@ int TDocumento::set_row_ids() | |||||||
|   const int phrw = physical_rows(); |   const int phrw = physical_rows(); | ||||||
|   long maxid = 0L; |   long maxid = 0L; | ||||||
|   int first_needed = 0; |   int first_needed = 0; | ||||||
|  | 
 | ||||||
|   for (int r = 1; r <= phrw; r++) |   for (int r = 1; r <= phrw; r++) | ||||||
|   { |   { | ||||||
|     const TRiga_documento& row = physical_row(r); |     const TRiga_documento& row = physical_row(r); | ||||||
| @ -3485,6 +3482,7 @@ void TDocumento::get_protocolli_esenzione(TString& esenzione, TString& data_esen | |||||||
| 																					TString& registrazione, TString& data_registrazione) const | 																					TString& registrazione, TString& data_registrazione) const | ||||||
| { | { | ||||||
|   TCli_for& c = clifor(); |   TCli_for& c = clifor(); | ||||||
|  | 
 | ||||||
| 	if (c.use_lettere()) | 	if (c.use_lettere()) | ||||||
| 	{ | 	{ | ||||||
| 		if (c.read_lettera(get_date(DOC_DATADOC), true)) | 		if (c.read_lettera(get_date(DOC_DATADOC), true)) | ||||||
| @ -3509,6 +3507,7 @@ bool TDocumento::is_split_payment() const | |||||||
| { | { | ||||||
|   bool yes =  get_int(DOC_ANNO) >= 2015 && clifor().get_bool(CLI_SPLITPAY) &&  |   bool yes =  get_int(DOC_ANNO) >= 2015 && clifor().get_bool(CLI_SPLITPAY) &&  | ||||||
|               (is_fattura() || is_nota_credito()) && !imposta().is_zero(); |               (is_fattura() || is_nota_credito()) && !imposta().is_zero(); | ||||||
|  |    | ||||||
|   if (yes) |   if (yes) | ||||||
|   { |   { | ||||||
|     const TRectype& causale = cache().get(LF_CAUSALI, tipo().causale()); |     const TRectype& causale = cache().get(LF_CAUSALI, tipo().causale()); | ||||||
| @ -3828,3 +3827,32 @@ TRiga_documento & TDocumento::find_row(const char * tiporiga, const char * codic | |||||||
|     return empty_row(this); |     return empty_row(this); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void TDocumento::update_prices() | ||||||
|  | { | ||||||
|  |   TDocumento_mask m(tipo().codice()); | ||||||
|  | 
 | ||||||
|  |   FOR_EACH_SELF_PHYSICAL_RDOC(r, rdoc) | ||||||
|  |     rdoc->zero(RDOC_CHECKED); | ||||||
|  |   m.doc() = *this; | ||||||
|  |   m.doc2mask(false, false, false); | ||||||
|  |   m.mask2doc(); | ||||||
|  |   *this = m.doc(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void TDocumento::update_descriptions() | ||||||
|  | { | ||||||
|  |   FOR_EACH_SELF_PHYSICAL_RDOC(r, rdoc) | ||||||
|  |   { | ||||||
|  |     const TString& codart = rdoc->get(RDOC_CODARTMAG); | ||||||
|  |     if (codart.full()) | ||||||
|  |     { | ||||||
|  |       const TRectype& anamag = cache().get(LF_ANAMAG, codart); | ||||||
|  |       TString descr = anamag.get(ANAMAG_DESCR); | ||||||
|  |       const TString& agg = anamag.get(ANAMAG_DESCRAGG); | ||||||
|  | 
 | ||||||
|  |       if (agg.full()) | ||||||
|  |         descr << '\n' << agg; | ||||||
|  |       rdoc->set_descr(descr); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -195,7 +195,7 @@ public: | |||||||
|   bool pack_rif() const { return get_bool("B15"); } |   bool pack_rif() const { return get_bool("B15"); } | ||||||
| 	bool calcola_scarti() const { return get_bool("B11"); } | 	bool calcola_scarti() const { return get_bool("B11"); } | ||||||
|  	bool reload_prices() const { return get_bool("B13"); } |  	bool reload_prices() const { return get_bool("B13"); } | ||||||
|   bool reload_descriptions() const { return reload_prices() && get_bool("B14"); } |   bool reload_descriptions() const { return /*reload_prices() && non serve perchè ci pensa la maschera */ get_bool("B14"); } | ||||||
| 	const TString& num_riferimenti_in() const { return get("S11"); } | 	const TString& num_riferimenti_in() const { return get("S11"); } | ||||||
| 
 | 
 | ||||||
|   int intestazioni_sheet() const { return get_int("I1"); } |   int intestazioni_sheet() const { return get_int("I1"); } | ||||||
| @ -281,7 +281,7 @@ public: | |||||||
|   virtual bool elabora(TLista_documenti& doc_in, TLista_documenti& doc_out, |   virtual bool elabora(TLista_documenti& doc_in, TLista_documenti& doc_out, | ||||||
|                        const TDate& data_elab, bool interattivo = false); |                        const TDate& data_elab, bool interattivo = false); | ||||||
|                         |                         | ||||||
| 	bool change_clifo() { return get_bool("B14"); } | 	bool change_clifo() { return get_bool("S12"); } // la maschera lo scrive come booleano
 | ||||||
|   virtual bool get_num_tip_out(const TDocumento& doc_out, TString& codnum, TString& tipodoc) const; |   virtual bool get_num_tip_out(const TDocumento& doc_out, TString& codnum, TString& tipodoc) const; | ||||||
|    |    | ||||||
|   TFatturazione_bolle(const char* cod); |   TFatturazione_bolle(const char* cod); | ||||||
|  | |||||||
| @ -406,7 +406,7 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do | |||||||
| 		if (change_clifo()) | 		if (change_clifo()) | ||||||
| 		{ | 		{ | ||||||
| 			const char t = campione.get_char(DOC_TIPOCFFATT); | 			const char t = campione.get_char(DOC_TIPOCFFATT); | ||||||
| 			const long codcf = campione.get_long(DOC_CODCFFATT); | 			long codcf = campione.get_long(DOC_CODCFFATT); | ||||||
| 
 | 
 | ||||||
| 			if (t > ' ') | 			if (t > ' ') | ||||||
| 			{ | 			{ | ||||||
| @ -414,6 +414,11 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do | |||||||
| 				if (interattivo) | 				if (interattivo) | ||||||
| 					doc_out[0].put(DOC_TIPOCF, t); | 					doc_out[0].put(DOC_TIPOCF, t); | ||||||
| 			} | 			} | ||||||
|  |       if (codcf == 0L) | ||||||
|  |       { | ||||||
|  |         campione.put(DOC_CODCFFATT, campione.clifor().get_long(CLI_CODCFFATT)); | ||||||
|  |         codcf = campione.get_long(DOC_CODCFFATT); | ||||||
|  |       } | ||||||
| 			if (codcf > 0L) | 			if (codcf > 0L) | ||||||
| 			{ | 			{ | ||||||
| 				campione.put(DOC_CODCF, codcf); | 				campione.put(DOC_CODCF, codcf); | ||||||
| @ -594,22 +599,10 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do | |||||||
|     const TString& sconto = d.get(DOC_SCONTOPERC); |     const TString& sconto = d.get(DOC_SCONTOPERC); | ||||||
|     d.put(DOC_SCONTOPERC, sconto); |     d.put(DOC_SCONTOPERC, sconto); | ||||||
| 		 | 		 | ||||||
|     if (change_clifo()) |     if (reload_prices()) | ||||||
| 		{ |       d.update_prices(); | ||||||
| 			const TString4 tipodoc= d.tipo().codice(); |     if (reload_descriptions()) | ||||||
| 			TDocumento_mask m(tipodoc); |       d.update_descriptions(); | ||||||
| 
 |  | ||||||
| 			if (reload_prices()) |  | ||||||
| 			{ |  | ||||||
|         FOR_EACH_PHYSICAL_RDOC_BACK(d, r, rdoc) |  | ||||||
|           rdoc->zero(RDOC_CHECKED); |  | ||||||
| 			} |  | ||||||
| 			m.doc() = d; |  | ||||||
| 			m.doc2mask(true, true); |  | ||||||
| 			m.mask2doc(); |  | ||||||
| 			d = m.doc(); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
|     if (_rowsort.full()) |     if (_rowsort.full()) | ||||||
|       d.sort_rows(_rowsort); |       d.sort_rows(_rowsort); | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -167,7 +167,8 @@ TDocumento_mask::TDocumento_mask(const char* td) | |||||||
| 
 | 
 | ||||||
| 	for (i = 4; i > 0; i--) | 	for (i = 4; i > 0; i--) | ||||||
| 	{ | 	{ | ||||||
| 		const short pos = _sheet->cid2index(FR_LIV1 + i -1); | 		const short pos = cid2index(FR_LIV1 + i -1); | ||||||
|  | 
 | ||||||
| 		if (_livelli_giac->enabled(i)) | 		if (_livelli_giac->enabled(i)) | ||||||
| 		{ | 		{ | ||||||
| 			const TString& header = _livelli_giac->name(i); | 			const TString& header = _livelli_giac->name(i); | ||||||
| @ -183,6 +184,17 @@ TDocumento_mask::TDocumento_mask(const char* td) | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |   bool is_acquisto = false; | ||||||
|  | 
 | ||||||
|  |   if (_doc.tipo().causale().full()) | ||||||
|  |   { | ||||||
|  |     const TCausale & caus = cached_causale(_doc.tipo().causale()); | ||||||
|  | 
 | ||||||
|  |     is_acquisto = caus.reg().tipo_registro() == acquisto; | ||||||
|  |   } | ||||||
|  |   if (!is_acquisto) | ||||||
|  |     _sheet->delete_column(cid2index(FR_REVCHARGE)); | ||||||
|  | 
 | ||||||
| // configurazione campi
 | // configurazione campi
 | ||||||
| 
 | 
 | ||||||
| 	TConfig cfg(CONFIG_DITTA, "ve"); | 	TConfig cfg(CONFIG_DITTA, "ve"); | ||||||
|  | |||||||
| @ -1933,14 +1933,11 @@ bool codart_handler(TMask_field& f, KEY key ) | |||||||
| 			if (pos >= 0 && row_mask.fld(pos).get().blank()) | 			if (pos >= 0 && row_mask.fld(pos).get().blank()) | ||||||
| 				row_mask.set(id, cart.get_peso(i)); | 				row_mask.set(id, cart.get_peso(i)); | ||||||
| 		} | 		} | ||||||
| 
 |     row_mask.check_field(FR_CODIVA); | ||||||
| 		const int pos = row_mask.id2pos(FR_CODIVA); |  | ||||||
| 		if (pos >= 0) |  | ||||||
| 			iva_handler(row_mask.fld(pos), 0); |  | ||||||
| 
 |  | ||||||
| 		if (found) | 		if (found) | ||||||
| 		{ | 		{ | ||||||
| 			TString8 caus(row_mask.get(FR_CAUS)); | 			TString8 caus(row_mask.get(FR_CAUS)); | ||||||
|  | 
 | ||||||
| 			if (caus.blank()) | 			if (caus.blank()) | ||||||
| 				caus = mask.get(F_CAUSMAG); | 				caus = mask.get(F_CAUSMAG); | ||||||
| 
 | 
 | ||||||
| @ -2161,10 +2158,7 @@ bool umart_handler( TMask_field& f, KEY key ) | |||||||
| 
 | 
 | ||||||
|     const char* const prezzo = mask.doc().tipo().calcolo_lordo() ? RDOC_PREZZOL : RDOC_PREZZO; |     const char* const prezzo = mask.doc().tipo().calcolo_lordo() ? RDOC_PREZZOL : RDOC_PREZZO; | ||||||
|     mask.doc()[current_doc_row].put(prezzo, row_mask.get(FR_PREZZO));   |     mask.doc()[current_doc_row].put(prezzo, row_mask.get(FR_PREZZO));   | ||||||
| 
 |     row_mask.check_field(FR_CODIVA); | ||||||
|     const int pos = row_mask.id2pos(FR_CODIVA); |  | ||||||
|     if (pos >= 0) |  | ||||||
|       iva_handler(row_mask.fld(pos), 0); |  | ||||||
|   } |   } | ||||||
|   return true; |   return true; | ||||||
| } | } | ||||||
| @ -2515,11 +2509,7 @@ bool sppr_handler( TMask_field& f, KEY key ) | |||||||
| 				row_mask.set(FR_PREZZO, prezzo);					 | 				row_mask.set(FR_PREZZO, prezzo);					 | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 |     row_mask.check_field(FR_CODIVA); | ||||||
|     const int posiva = row_mask.id2pos(FR_CODIVA); |  | ||||||
| 		if (posiva >= 0) |  | ||||||
| 			iva_handler(row_mask.fld(posiva), 0); |  | ||||||
| 
 |  | ||||||
| 		if (row_mask.id2pos(FR_CDC1) >= 0 && sp.get("S1").full()) | 		if (row_mask.id2pos(FR_CDC1) >= 0 && sp.get("S1").full()) | ||||||
| 		{ | 		{ | ||||||
| 			const TString80 cdc(sp.cdc()); | 			const TString80 cdc(sp.cdc()); | ||||||
|  | |||||||
| @ -1352,14 +1352,14 @@ ENDIF | |||||||
| 
 | 
 | ||||||
| IFDEF(X_CODIVA) | IFDEF(X_CODIVA) | ||||||
|   DEFINE Y_REVCHARGE Y_CODIVA+1 |   DEFINE Y_REVCHARGE Y_CODIVA+1 | ||||||
|   DEFINE X_TIPODET X_CODIVA+20 |   DEFINE X_TIPODET X_CODIVA+30 | ||||||
| ENDIF | ENDIF | ||||||
| 
 | 
 | ||||||
| BOOLEAN FR_REVCHARGE  | BOOLEAN FR_REVCHARGE  | ||||||
| BEGIN | BEGIN | ||||||
| IFDEF(X_CODIVA) | IFDEF(X_CODIVA) | ||||||
|   PROMPT X_CODIVA Y_REVCHARGE "Reverse charge" |   PROMPT X_CODIVA Y_REVCHARGE "Reverse charge" | ||||||
|   ELSE | ELSEIF | ||||||
|   PROMPT 2 16 "Reverse charge" |   PROMPT 2 16 "Reverse charge" | ||||||
| ENDIF | ENDIF | ||||||
|   FIELD REVCHARGE |   FIELD REVCHARGE | ||||||
| @ -1369,8 +1369,8 @@ STRING FR_TIPODET 1 | |||||||
| BEGIN | BEGIN | ||||||
| IFDEF(X_CODIVA) | IFDEF(X_CODIVA) | ||||||
|   PROMPT X_TIPODET Y_REVCHARGE "Indetraib.  " |   PROMPT X_TIPODET Y_REVCHARGE "Indetraib.  " | ||||||
| ELSE | ELSEIF | ||||||
|   PROMPT 20 16 "Indetraib.  " |   PROMPT 30 16 "Indetraib.  " | ||||||
| ENDIF | ENDIF | ||||||
|   USE %DET |   USE %DET | ||||||
|   INPUT CODTAB FR_TIPODET |   INPUT CODTAB FR_TIPODET | ||||||
|  | |||||||
| @ -534,7 +534,7 @@ BOOLEAN F_RELOAD_PRICES | |||||||
| BEGIN | BEGIN | ||||||
|    PROMPT 45 17 "Ricarica i prezzi" |    PROMPT 45 17 "Ricarica i prezzi" | ||||||
|    FIELD B13 |    FIELD B13 | ||||||
|    GROUP 1 |    GROUP 1 2 | ||||||
|    MESSAGE FALSE DISABLE,F_RELOAD_DESCR |    MESSAGE FALSE DISABLE,F_RELOAD_DESCR | ||||||
|    MESSAGE TRUE ENABLE,F_RELOAD_DESCR |    MESSAGE TRUE ENABLE,F_RELOAD_DESCR | ||||||
|  END |  END | ||||||
| @ -543,7 +543,7 @@ BOOLEAN F_RELOAD_DESCR | |||||||
| BEGIN | BEGIN | ||||||
|    PROMPT 45 18 "Ricarica le descrizioni" |    PROMPT 45 18 "Ricarica le descrizioni" | ||||||
|    FIELD B14 |    FIELD B14 | ||||||
|    GROUP 1 |    GROUP 1 2 | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| RADIOBUTTON F_PROTOCOLLO 1 38  | RADIOBUTTON F_PROTOCOLLO 1 38  | ||||||
| @ -558,7 +558,7 @@ END | |||||||
| BOOLEAN F_CHGCF | BOOLEAN F_CHGCF | ||||||
| BEGIN | BEGIN | ||||||
|    PROMPT 2 19 "Aggiorna il codice cliente/fornitore" |    PROMPT 2 19 "Aggiorna il codice cliente/fornitore" | ||||||
| 	 FIELD B13 | 	 FIELD S12[1,1] | ||||||
|    GROUP 2 |    GROUP 2 | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user