Patch level : 12.0 428
Files correlati : tf Commento : - Aggiunto controllo per bolla doganale, dal 01/01/2018 fallirà sempre - Aggiunto punto di test in tf0400 abilitato solo in debug - In tf0400f nel caso esista solo un nome/cognome dell'azienda viene automaticamente alzato il flag rsoc, prima dava errore - Aggiunta ivaXCassa insieme all'IVA differita in esigibilità IVA - Sistemata eliminazione record custom derivante da prima nota: oltre a eliminarlo adesso chiede se si vuole ricaricare il movimento originale - Aggiunta richiesta di modifica per l'imposta ogni volta che viene modificato l'imponibile o l'aliquota git-svn-id: svn://10.65.10.50/branches/R_10_00@24003 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									1d9ca81943
								
							
						
					
					
						commit
						c52c0945f4
					
				@ -311,6 +311,12 @@ inline const char * noSpecial(char a)
 | 
				
			|||||||
	return "";
 | 
						return "";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool bd2017()
 | 
				
			||||||
 | 
					{ 
 | 
				
			||||||
 | 
						static TDate today = TDate(TODAY), lastDay = TDate(31,12,2017); 
 | 
				
			||||||
 | 
						return today <= lastDay; 
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/////////////////////////////////////////////////////////////////////////////////////
 | 
					/////////////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
// TTrFa_record
 | 
					// TTrFa_record
 | 
				
			||||||
/////////////////////////////////////////////////////////////////////////////////////
 | 
					/////////////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
@ -1105,6 +1111,11 @@ bool TTrFa_app::tff0400(TSheet_field& sheet)
 | 
				
			|||||||
		
 | 
							
 | 
				
			||||||
		TVariant vtipocf = strarr->get(_tipocf), vcodcf = strarr->get(_codcf), voccas = strarr->get(_occas);
 | 
							TVariant vtipocf = strarr->get(_tipocf), vcodcf = strarr->get(_codcf), voccas = strarr->get(_occas);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef DBG
 | 
				
			||||||
 | 
							if(vtipocf.as_string() == "F" && vcodcf.as_string() == "358")
 | 
				
			||||||
 | 
								bool tolla = true;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		TRectype r_cedeprest = getCli(vtipocf.as_string(), vcodcf.as_string(), voccas.as_string());
 | 
							TRectype r_cedeprest = getCli(vtipocf.as_string(), vcodcf.as_string(), voccas.as_string());
 | 
				
			||||||
		TAnagrafica cedeprest;
 | 
							TAnagrafica cedeprest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1149,7 +1160,8 @@ bool TTrFa_app::tff0400(TSheet_field& sheet)
 | 
				
			|||||||
			{
 | 
								{
 | 
				
			||||||
				// Ovviamente tutte le bolle doganali fatte prima del rilascio
 | 
									// Ovviamente tutte le bolle doganali fatte prima del rilascio
 | 
				
			||||||
				// non avranno questo campo compilato e quindi dovrò passare la partita IVA "OO99999999999"
 | 
									// non avranno questo campo compilato e quindi dovrò passare la partita IVA "OO99999999999"
 | 
				
			||||||
				if(strcmp(strarr->get(_codnum),"BD") == 0)
 | 
									// Controllo anche di essere in una data entro il 31/12/2017, dopo tale data sto ragionamento non è valido
 | 
				
			||||||
 | 
									if(strcmp(strarr->get(_codnum),"BD") == 0 && bd2017())
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					tff0400f.set("P4_FISCIVAPAESE", "OO");
 | 
										tff0400f.set("P4_FISCIVAPAESE", "OO");
 | 
				
			||||||
					tff0400f.set("P4_FISCIVACOD",   "99999999999");
 | 
										tff0400f.set("P4_FISCIVACOD",   "99999999999");
 | 
				
			||||||
@ -1192,8 +1204,13 @@ bool TTrFa_app::tff0400(TSheet_field& sheet)
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					// Devo indovinare quale è il nome e il cognome
 | 
										// Devo indovinare quale è il nome e il cognome
 | 
				
			||||||
					TToken_string nomeCog(cedeprest.cognome(), ' ');	// Notare il separatore spazio
 | 
										TToken_string nomeCog(cedeprest.cognome(), ' ');	// Notare il separatore spazio
 | 
				
			||||||
 | 
										// Se ho solo un nominativo è una ditta per Diana
 | 
				
			||||||
 | 
										if(nomeCog.items() == 1)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											rsoc = true;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
					// Controllo se ho solo un nome e un cognome
 | 
										// Controllo se ho solo un nome e un cognome
 | 
				
			||||||
					if(nomeCog.items() <= 2)
 | 
										else if(nomeCog.items() == 2)
 | 
				
			||||||
					{
 | 
										{
 | 
				
			||||||
						tff0400f.set("P4_ANANOME",    nomeCog.get(1));
 | 
											tff0400f.set("P4_ANANOME",    nomeCog.get(1));
 | 
				
			||||||
						tff0400f.set("P4_ANACOGNOME", nomeCog.get(0));
 | 
											tff0400f.set("P4_ANACOGNOME", nomeCog.get(0));
 | 
				
			||||||
@ -1339,7 +1356,7 @@ bool TTrFa_app::tff2200(TToken_string* strarr, int nriga)
 | 
				
			|||||||
	real aliquota = cache().get("%IVA", strarr->get(_aliquota), "R0");
 | 
						real aliquota = cache().get("%IVA", strarr->get(_aliquota), "R0");
 | 
				
			||||||
	tff2200f.set("PL_ALIQUOTAIVA",		aliquota);
 | 
						tff2200f.set("PL_ALIQUOTAIVA",		aliquota);
 | 
				
			||||||
	TRectype thisMov = cache().get(LF_MOV, strarr->get(_numero));
 | 
						TRectype thisMov = cache().get(LF_MOV, strarr->get(_numero));
 | 
				
			||||||
	tff2200f.set("PL_ESIGIVA",				is_split_payment(thisMov) ? "S" : is_IVA_diff(thisMov) ? "D" : "I");
 | 
						tff2200f.set("PL_ESIGIVA",				is_split_payment(thisMov) ? "S" : is_IVA_diff(thisMov) || is_IVAxCassa(thisMov) ? "D" : "I");
 | 
				
			||||||
	tff2200f.set("PL_NATURA",					strarr->get(_natura));
 | 
						tff2200f.set("PL_NATURA",					strarr->get(_natura));
 | 
				
			||||||
	real det(strarr->get(_detraibile)); 
 | 
						real det(strarr->get(_detraibile)); 
 | 
				
			||||||
	// Nella conversione la vigola viene persa e 100,00 diventa 10.000 quindi divido 
 | 
						// Nella conversione la vigola viene persa e 100,00 diventa 10.000 quindi divido 
 | 
				
			||||||
 | 
				
			|||||||
@ -373,14 +373,14 @@ BEGIN
 | 
				
			|||||||
  FLAGS "D"
 | 
					  FLAGS "D"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CURRENCY A_IMPONIBILE 12
 | 
					NUMBER A_IMPONIBILE 12 2
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 42 8 "Imponibile"
 | 
					  PROMPT 42 8 "Imponibile"
 | 
				
			||||||
  FIELD IMPORTO
 | 
					  FIELD IMPORTO
 | 
				
			||||||
  CHEKTYPE REQUIRED
 | 
					  CHEKTYPE REQUIRED
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CURRENCY A_IMPOSTA 12
 | 
					NUMBER A_IMPOSTA 12 2
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
 PROMPT 42 9 "Imposta   "
 | 
					 PROMPT 42 9 "Imposta   "
 | 
				
			||||||
  FIELD IMPOSTA
 | 
					  FIELD IMPOSTA
 | 
				
			||||||
 | 
				
			|||||||
@ -115,6 +115,8 @@ inline TDate toDate(const char * date) { return TDate(date).string(); }
 | 
				
			|||||||
#define IF_IS_ENABLED(strarr) if(strcmp(strarr->get(_invio), FLAG_INVIO) != 0 && strcmp(strarr->get(_invio), FLAG_FORZATO) != 0) continue;
 | 
					#define IF_IS_ENABLED(strarr) if(strcmp(strarr->get(_invio), FLAG_INVIO) != 0 && strcmp(strarr->get(_invio), FLAG_FORZATO) != 0) continue;
 | 
				
			||||||
// Ritorno il carattere senza accento maiuscolo
 | 
					// Ritorno il carattere senza accento maiuscolo
 | 
				
			||||||
inline const char * noSpecial(char a);
 | 
					inline const char * noSpecial(char a);
 | 
				
			||||||
 | 
					// Ritorno se è ancora valida la bolla doganale senza informazioni fornitore
 | 
				
			||||||
 | 
					bool bd2017();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/////////////////////////////////////////////////////////////////////////////////////
 | 
					/////////////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
// TTrFa_record
 | 
					// TTrFa_record
 | 
				
			||||||
 | 
				
			|||||||
@ -123,6 +123,7 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
 | 
				
			|||||||
			if(imponibile > 0)
 | 
								if(imponibile > 0)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				imposta = imponibile * real(cache().get("%IVA", o.get(), "R0")) / 100;
 | 
									imposta = imponibile * real(cache().get("%IVA", o.get(), "R0")) / 100;
 | 
				
			||||||
 | 
									if(imposta != o.mask().get_real(A_IMPOSTA) && yesno_box("Aggiornare l'imposta?"))
 | 
				
			||||||
					o.mask().set(A_IMPOSTA, imposta.round(2).string());
 | 
										o.mask().set(A_IMPOSTA, imposta.round(2).string());
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@ -136,6 +137,7 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
 | 
				
			|||||||
			if(codiva != "")
 | 
								if(codiva != "")
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				imposta = imponibile * real(cache().get("%IVA", codiva, "R0")) / 100;
 | 
									imposta = imponibile * real(cache().get("%IVA", codiva, "R0")) / 100;
 | 
				
			||||||
 | 
									if(imposta != o.mask().get_real(A_IMPOSTA) && yesno_box("Aggiornare l'imposta?"))
 | 
				
			||||||
					o.mask().set(A_IMPOSTA, imposta.round(2).string());
 | 
										o.mask().set(A_IMPOSTA, imposta.round(2).string());
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@ -251,8 +253,6 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
 | 
				
			|||||||
      const long progr = o.mask().get_long(A_NUMERO);
 | 
					      const long progr = o.mask().get_long(A_NUMERO);
 | 
				
			||||||
			TString codalq	 = o.mask().get(A_ALIQUOTA);
 | 
								TString codalq	 = o.mask().get(A_ALIQUOTA);
 | 
				
			||||||
			TString key; key << progr << "|" << codalq;
 | 
								TString key; key << progr << "|" << codalq;
 | 
				
			||||||
      if (progr >= MOV_CUSTOM)
 | 
					 | 
				
			||||||
      {
 | 
					 | 
				
			||||||
			if(cache().get(LF_TRASFATT, key).full())
 | 
								if(cache().get(LF_TRASFATT, key).full())
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				TLocalisamfile trasfat(LF_TRASFATT);
 | 
									TLocalisamfile trasfat(LF_TRASFATT);
 | 
				
			||||||
@ -262,7 +262,10 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
 | 
				
			|||||||
				if (err != NOERR)
 | 
									if (err != NOERR)
 | 
				
			||||||
					return error_box(FR("Errore di cancellazione: %d"), err);
 | 
										return error_box(FR("Errore di cancellazione: %d"), err);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
				// In qualsiasi caso elimino sta riga
 | 
								else
 | 
				
			||||||
 | 
					        return error_box(TR("Riga non cancellabile"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Elimino la riga
 | 
				
			||||||
			TSheet_field& sheet = sfield(F_RIGHE);
 | 
								TSheet_field& sheet = sfield(F_RIGHE);
 | 
				
			||||||
			// Vado a cercare la riga
 | 
								// Vado a cercare la riga
 | 
				
			||||||
			FOR_EACH_SHEET_ROW(sheet, r, strarr)
 | 
								FOR_EACH_SHEET_ROW(sheet, r, strarr)
 | 
				
			||||||
@ -274,9 +277,14 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
 | 
				
			|||||||
				if(thisProg == progr && thisAlq == codalq) break;
 | 
									if(thisProg == progr && thisAlq == codalq) break;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			sheet.destroy(r);	// Aggiorna in automatico
 | 
								sheet.destroy(r);	// Aggiorna in automatico
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								// Se ha cancellato un movimento custom che deriva dalla prima nota propongo di andarlo a ripescare
 | 
				
			||||||
 | 
								if(progr < MOV_CUSTOM && yesno_box("Hai cancellato una riga custom di un movimento in prima nota, vuoi ricaricare la tabella?\n(Tutti i record verranno salvati per non perdere le modifiche!)"))
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									saveAll();
 | 
				
			||||||
 | 
									load_sheet();
 | 
				
			||||||
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
      else
 | 
					 | 
				
			||||||
        return error_box(TR("Riga non cancellabile"));
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case DLG_EMAIL:
 | 
						case DLG_EMAIL:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user