Patch level : 12.0 1032
Files correlati : ve0.exe Commento : Corretta l'autoevasione ordini Interno Da ggiornare anche il programma di esportazione bolle major
This commit is contained in:
		
							parent
							
								
									5d1ae08d56
								
							
						
					
					
						commit
						aeaaa0c0e6
					
				@ -385,9 +385,7 @@ void TRiga_documento::update_orders(real qta, TToken_string & tipi, TToken_strin
 | 
				
			|||||||
      const TDate adata(31, 12, year);
 | 
					      const TDate adata(31, 12, year);
 | 
				
			||||||
      TLista_documenti docs;
 | 
					      TLista_documenti docs;
 | 
				
			||||||
      TString_array saved;
 | 
					      TString_array saved;
 | 
				
			||||||
      TString_array evaded;
 | 
					 | 
				
			||||||
      TArray saved_qta;
 | 
					      TArray saved_qta;
 | 
				
			||||||
      TArray evaded_qta;
 | 
					 | 
				
			||||||
      TString_array to_delete;
 | 
					      TString_array to_delete;
 | 
				
			||||||
      TToken_string tok(get(RDOC_ORIGINAL_ROWS), ',');
 | 
					      TToken_string tok(get(RDOC_ORIGINAL_ROWS), ',');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -431,6 +429,8 @@ void TRiga_documento::update_orders(real qta, TToken_string & tipi, TToken_strin
 | 
				
			|||||||
      for (int i = storno ? ndocs - 1 : 0; (qta_da_evadere > ZERO) && (storno ? i >= 0 : i < ndocs); storno ? i-- : i++)
 | 
					      for (int i = storno ? ndocs - 1 : 0; (qta_da_evadere > ZERO) && (storno ? i >= 0 : i < ndocs); storno ? i-- : i++)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        TDocumento & d = docs[i];
 | 
					        TDocumento & d = docs[i];
 | 
				
			||||||
 | 
					        TString_array evaded;
 | 
				
			||||||
 | 
					        TArray evaded_qta;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        for (int nrow = d.find_nrow(tiporiga, codart, storno); (qta_da_evadere > ZERO) && nrow > 0; nrow = d.find_nrow(tiporiga, codart, storno, nrow))
 | 
					        for (int nrow = d.find_nrow(tiporiga, codart, storno); (qta_da_evadere > ZERO) && nrow > 0; nrow = d.find_nrow(tiporiga, codart, storno, nrow))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@ -502,14 +502,30 @@ void TRiga_documento::update_orders(real qta, TToken_string & tipi, TToken_strin
 | 
				
			|||||||
            qta_da_evadere -= qta_evasa;
 | 
					            qta_da_evadere -= qta_evasa;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        TString_array orig_saved(saved);
 | 
				
			||||||
 | 
					        TArray orig_saved_qta(saved_qta);
 | 
				
			||||||
 | 
					        const int items = orig_saved.items();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        saved.merge_token(evaded);
 | 
					        saved.merge_token(evaded);
 | 
				
			||||||
 | 
					        if (items > 0)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          saved_qta.destroy();
 | 
				
			||||||
 | 
					          for (int i = 0; i < items; i++)
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            const int pos = saved.find(orig_saved.row(i));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (pos >= 0)
 | 
				
			||||||
 | 
					              saved_qta.add(orig_saved_qta[i], pos);
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        FOR_EACH_ARRAY_ITEM(evaded_qta, i, eobj)
 | 
					        FOR_EACH_ARRAY_ITEM(evaded_qta, i, eobj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          const int pos = saved.find(evaded.row(i));
 | 
					          const int pos = saved.find(evaded.row(i));
 | 
				
			||||||
          real *q = (real *)saved_qta.objptr(pos);
 | 
					          real *q = (real *)saved_qta.objptr(pos);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          if (q == nullptr)
 | 
					          if (q == nullptr)
 | 
				
			||||||
            saved_qta.add(q = new real);
 | 
					            saved_qta.add(q = new real, pos);
 | 
				
			||||||
          *q += *((real *)eobj);
 | 
					          *q += *((real *)eobj);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        FOR_EACH_ARRAY_ITEM(to_delete, i, riga)
 | 
					        FOR_EACH_ARRAY_ITEM(to_delete, i, riga)
 | 
				
			||||||
 | 
				
			|||||||
@ -3710,7 +3710,7 @@ void TDocumento::auto_evasione(const int nrow)
 | 
				
			|||||||
                {
 | 
					                {
 | 
				
			||||||
                  TRiga_documento & rdoc = d[nrow];
 | 
					                  TRiga_documento & rdoc = d[nrow];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                  if (!rdoc.is_evasa())
 | 
					                  if (!rdoc.is_evasa() || storno)
 | 
				
			||||||
                  {
 | 
					                  {
 | 
				
			||||||
                    TToken_string rdoc_key = rdoc.get_rdoc_key();
 | 
					                    TToken_string rdoc_key = rdoc.get_rdoc_key();
 | 
				
			||||||
                    real qta_evasa = qta_da_evadere;
 | 
					                    real qta_evasa = qta_da_evadere;
 | 
				
			||||||
 | 
				
			|||||||
@ -58,8 +58,6 @@ int TLista_documenti::read(char provv, char tipocf, long clifo, int anno,
 | 
				
			|||||||
  CHECK(tipocf == 'C' || tipocf == 'F' || tipocf == ' ', "Il tipo deve essere Cliente o Fornitore o Entrambi");
 | 
					  CHECK(tipocf == 'C' || tipocf == 'F' || tipocf == ' ', "Il tipo deve essere Cliente o Fornitore o Entrambi");
 | 
				
			||||||
  CHECKD(tipocf == ' ' || clifo > 0L, "Codice cliente non valido", clifo);
 | 
					  CHECKD(tipocf == ' ' || clifo > 0L, "Codice cliente non valido", clifo);
 | 
				
			||||||
  CHECKD(anno > 2000, "Anno non valido: ", anno);
 | 
					  CHECKD(anno > 2000, "Anno non valido: ", anno);
 | 
				
			||||||
  CHECK(!tipidoc.empty_items(), "Lista dei tipi documento vuota");
 | 
					 | 
				
			||||||
  CHECK(!statidoc.empty_items(), "Lista degli stati documento vuota");
 | 
					 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  const int key = (tipocf == ' ' && clifo == 0L) ? 1:2;
 | 
					  const int key = (tipocf == ' ' && clifo == 0L) ? 1:2;
 | 
				
			||||||
  TRelation doc(LF_DOC);
 | 
					  TRelation doc(LF_DOC);
 | 
				
			||||||
@ -143,7 +141,7 @@ int TLista_documenti::read(char provv, char tipocf, long clifo, int anno,
 | 
				
			|||||||
  {                
 | 
					  {                
 | 
				
			||||||
    const TString4 tipodoc  = head.get(DOC_TIPODOC);
 | 
					    const TString4 tipodoc  = head.get(DOC_TIPODOC);
 | 
				
			||||||
    const TString4 statodoc = head.get(DOC_STATO);
 | 
					    const TString4 statodoc = head.get(DOC_STATO);
 | 
				
			||||||
    bool match = false;
 | 
					    bool match = (tipidoc.items() == 0);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    for (int i = tipidoc.items()-1; i>=0; i--)
 | 
					    for (int i = tipidoc.items()-1; i>=0; i--)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user