diff --git a/pe/pe0400.cpp b/pe/pe0400.cpp index 09a77a705..de9ca65dc 100755 --- a/pe/pe0400.cpp +++ b/pe/pe0400.cpp @@ -994,8 +994,9 @@ int TGestione_preventivo_app::write( const TMask& m ) { TRiga_documento & row = (TRiga_documento &)doc[i]; const int level = row.get_int(RDOC_LEVEL); + const TString & row_k = row.get(RDOC_K); - if (i == rows || level >= doc[i + 1].get_int(RDOC_LEVEL)) + if ((row_k.blank()) && (i == rows || level >= doc[i + 1].get_int(RDOC_LEVEL))) row.put(RDOC_K, k); } mask.update_costi_ricavi(); @@ -1014,8 +1015,9 @@ int TGestione_preventivo_app::rewrite( const TMask& m ) { TRiga_documento & row = (TRiga_documento &)doc[i]; const int level = row.get_int(RDOC_LEVEL); + const TString & row_k = row.get(RDOC_K); - if (i == rows || level >= doc[i + 1].get_int(RDOC_LEVEL)) + if ((row_k.blank()) && (i == rows || level >= doc[i + 1].get_int(RDOC_LEVEL))) row.put(RDOC_K, k); } mask.update_costi_ricavi();