diff --git a/ps/pd0610100.cpp b/ps/pd0610100.cpp index b20777927..8a588762d 100755 --- a/ps/pd0610100.cpp +++ b/ps/pd0610100.cpp @@ -78,36 +78,26 @@ void TTabmod_caf_msk::registra() { TModule_table caf("&CAF"); TSheet_field& sheet = sfield(F_SHEET); - const int last_item = sheet.cid2index(S_FORN1)+1; FOR_EACH_SHEET_ROW(sheet, r, riga) { + caf.zero(); TToken_string& row = *(TToken_string*)riga; TString80 codtab; - const long codcli = atol(row.get(sheet.cid2index(S_CLIENTE))); - codtab.format("%06ld", codcli); + codtab << row.get(sheet.cid2index(S_CLIENTE)); codtab << row.get(sheet.cid2index(S_ARTICOLO)); - const int items = row.items(); - if (items < last_item) + + const long forn1 = row.get_long(sheet.cid2index(S_FORN1)); + const long forn2 = row.get_long(sheet.cid2index(S_FORN2)); + caf.put("CODTAB", codtab); + if (forn1 > 0 || forn2 > 0) { - caf.put("CODTAB", codtab); - caf.remove(); - } - else - { - const long forn1 = row.get_long(sheet.cid2index(S_FORN1)); - const long forn2 = row.get_long(sheet.cid2index(S_FORN2)); - - caf.put("CODTAB", codtab); - if (forn1 > 0 || forn2 > 0) - { - caf.put("I0", forn1); - caf.put("I1", forn2); - caf.rewrite_write(); - } - else - caf.remove(); - } + caf.put("I0", forn1); + caf.put("I1", forn2); + caf.rewrite_write(); + } + else + caf.remove(); } riempi_sheet(); } diff --git a/ps/pd0610100a.uml b/ps/pd0610100a.uml index 52235494d..7eb78b0a9 100755 --- a/ps/pd0610100a.uml +++ b/ps/pd0610100a.uml @@ -29,6 +29,7 @@ BEGIN DISPLAY "Descrizione@50" RAGSOC OUTPUT F_CLIENTE CODCF OUTPUT F_RAGSOC RAGSOC + FLAGS "Z" CHECKTYPE REQUIRED END @@ -65,7 +66,7 @@ PAGE "Articoli/Fornitori" -1 -1 80 18 NUMBER S_CLIENTE 6 BEGIN PROMPT 2 2 "" - FLAGS "D" + FLAGS "ZD" END STRING S_ARTICOLO 20