Patch level : 12.0 1059

Files correlati     : bs0500a.uml bs0500.cpp

Modifiche richieste per CodDogana e IDArticolo
This commit is contained in:
Francesco_Fucarino 2021-06-08 09:50:05 +02:00
parent 7aac7a1516
commit 14055ce178
2 changed files with 24 additions and 12 deletions

View File

@ -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)); str.format("SQL error %d", abs(err));
_log->log(2, str); _log->log(2, str);
} }
if (!pi.add_status()) if (!pi.add_status())
break; break;
} }
odbc.exec("COMMIT;"); odbc.exec("COMMIT;");
} }
@ -1328,6 +1326,13 @@ void TImporta_sync::sync_doc(const TDate& dal, const TDate& al , int tipotestata
if (tipocf != "C") // verificare if (tipocf != "C") // verificare
tipocf = "F"; 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; TToken_string key = tipocf;
key.add(codcf); key.add(codcf);
const TRectype & clifor = cache().get(LF_CLIFO, key); 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(); TString8 tipodoc = docs.get("TipoDocCE").as_string();
TString origine_dc = docs.get("Origine").as_string(); TString origine_dc = docs.get("Origine").as_string();
if (((tipodoc.not_empty()) && (tipodoc != " ")) ) if (((tipodoc.not_empty()) && (tipodoc != " ")) )
//&& ((docs.get("CodIva").as_string().not_empty() && (docs.get("CodIva").as_string() != " ")))) //&& ((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(); const int tipoart = docs.get("TipoArticolo").as_int();
TRectype& rdoc = doc->new_row("01"); 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); 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) if (importadoc && tipoart == 0)
{ {
rdoc.put(RDOC_CODARTMAG, codart); rdoc.put(RDOC_CODARTMAG, codart);
@ -1431,8 +1439,13 @@ void TImporta_sync::sync_doc(const TDate& dal, const TDate& al , int tipotestata
{ {
TArticolo articolo; TArticolo articolo;
articolo.put(ANAMAG_CODART, codart); 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); TRectype& umart = articolo.new_row(LF_UMART);
TString unitamisura = docs.get("CodUntMis").as_string(); TString unitamisura = docs.get("CodUntMis").as_string();
if (unitamisura.blank()) 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.put(RDOC_CODARTMAG, codart);
//rdoc.check_row(); //rdoc.check_row();
const TString descr = docs.get("DSRiga").as_string(); rdoc.put(RDOC_DESCR, descrizione.sleft(50));
rdoc.put(RDOC_DESCR, descr.sleft(50)); if (descrizione.len() > 50)
if (descr.len() > 50)
{ {
rdoc.put(RDOC_DESCLUNGA, "X"); 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_CODMAG, docs.get("CodMagazzino").as_string().left(5));
rdoc.put(RDOC_CODMAGC, docs.get("CodMagazDest").as_string().left(5)); rdoc.put(RDOC_CODMAGC, docs.get("CodMagazDest").as_string().left(5));

View File

@ -166,7 +166,7 @@ END
BOOLEAN F_UNITADEFAULT BOOLEAN F_UNITADEFAULT
BEGIN BEGIN
PROMPT 2 3 "Unità di Default" PROMPT 2 3 "Unità di Misura (Default)"
FIELD SyncUNITADEFAULT FIELD SyncUNITADEFAULT
END END