From 14055ce178c3728c4241898c8e91b654098ad102 Mon Sep 17 00:00:00 2001 From: Francesco_Fucarino Date: Tue, 8 Jun 2021 09:50:05 +0200 Subject: [PATCH] Patch level : 12.0 1059 Files correlati : bs0500a.uml bs0500.cpp Modifiche richieste per CodDogana e IDArticolo --- src/bs/bs0500.cpp | 34 +++++++++++++++++++++++----------- src/bs/bs0500a.uml | 2 +- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/bs/bs0500.cpp b/src/bs/bs0500.cpp index 6242a971f..fb241939a 100644 --- a/src/bs/bs0500.cpp +++ b/src/bs/bs0500.cpp @@ -444,11 +444,9 @@ void TImporta_sync::save_origine_2(TISAM_recordset& in_set, const char* out_tabl str.format("SQL error %d", abs(err)); _log->log(2, str); } - if (!pi.add_status()) break; } - odbc.exec("COMMIT;"); } @@ -1328,6 +1326,13 @@ void TImporta_sync::sync_doc(const TDate& dal, const TDate& al , int tipotestata if (tipocf != "C") // verificare tipocf = "F"; + if ((tipocf != "C" && tipocf != "F") || codcf == 0) + { + TString msg; msg.format("Attenzione! Per il doc n.%d e' presente il tipo C/F = '%s' con cod = %d \nIl documento verra' saltato.", nd, (const char*)tipocf, codcf); + _log->log(1, msg); + continue; + } + TToken_string key = tipocf; key.add(codcf); const TRectype & clifor = cache().get(LF_CLIFO, key); @@ -1357,8 +1362,6 @@ void TImporta_sync::sync_doc(const TDate& dal, const TDate& al , int tipotestata TString8 tipodoc = docs.get("TipoDocCE").as_string(); TString origine_dc = docs.get("Origine").as_string(); - - if (((tipodoc.not_empty()) && (tipodoc != " ")) ) //&& ((docs.get("CodIva").as_string().not_empty() && (docs.get("CodIva").as_string() != " ")))) { @@ -1420,9 +1423,14 @@ void TImporta_sync::sync_doc(const TDate& dal, const TDate& al , int tipotestata { const int tipoart = docs.get("TipoArticolo").as_int(); TRectype& rdoc = doc->new_row("01"); - const TString80 codart = docs.get("CodArticolo").as_string(); + TString80 codart = docs.get("IDArticolo").as_string(); + if (codart.blank()) + codart = docs.get("CodArticolo").as_string(); rdoc.put(RDOC_CODART, codart); + TString descrizione = docs.get("Modello").as_string(); + if (descrizione.blank()) + descrizione = docs.get("DSRiga").as_string(); if (importadoc && tipoart == 0) { rdoc.put(RDOC_CODARTMAG, codart); @@ -1431,8 +1439,13 @@ void TImporta_sync::sync_doc(const TDate& dal, const TDate& al , int tipotestata { TArticolo articolo; articolo.put(ANAMAG_CODART, codart); - articolo.put(ANAMAG_DESCR, docs.get("DSRiga").as_string()); - articolo.put(ANAMAG_CLASSDOG, docs.get("CodDogana").as_string()); + + articolo.put(ANAMAG_DESCR, descrizione); + TString nomenclatura = docs.get("CodDogana").as_string(); + if (nomenclatura.blank()) + nomenclatura = docs.get("CodCategoria").as_string(); + + articolo.put(ANAMAG_CLASSDOG, nomenclatura); TRectype& umart = articolo.new_row(LF_UMART); TString unitamisura = docs.get("CodUntMis").as_string(); if (unitamisura.blank()) @@ -1458,12 +1471,11 @@ void TImporta_sync::sync_doc(const TDate& dal, const TDate& al , int tipotestata rdoc.put(RDOC_CODARTMAG, codart); //rdoc.check_row(); - const TString descr = docs.get("DSRiga").as_string(); - rdoc.put(RDOC_DESCR, descr.sleft(50)); - if (descr.len() > 50) + rdoc.put(RDOC_DESCR, descrizione.sleft(50)); + if (descrizione.len() > 50) { rdoc.put(RDOC_DESCLUNGA, "X"); - rdoc.put(RDOC_DESCEST, descr.smid(50)); + rdoc.put(RDOC_DESCEST, descrizione.smid(50)); } rdoc.put(RDOC_CODMAG, docs.get("CodMagazzino").as_string().left(5)); rdoc.put(RDOC_CODMAGC, docs.get("CodMagazDest").as_string().left(5)); diff --git a/src/bs/bs0500a.uml b/src/bs/bs0500a.uml index a5b45d8e4..8af81d5ad 100644 --- a/src/bs/bs0500a.uml +++ b/src/bs/bs0500a.uml @@ -166,7 +166,7 @@ END BOOLEAN F_UNITADEFAULT BEGIN - PROMPT 2 3 "Unità di Default" + PROMPT 2 3 "Unità di Misura (Default)" FIELD SyncUNITADEFAULT END