Patch level : 12.0 no-patch

Files correlati     :
Commento            :

Spostati TAnagrafica e TClifor in cglib
 ecli2doc in TDocumento
This commit is contained in:
Alessandro Bonazzi 2020-08-27 13:08:07 +02:00
parent f110178497
commit 3d1fdb90d5
3 changed files with 90 additions and 11 deletions

View File

@ -1,10 +1,6 @@
#ifndef __SCONTI_H
#define __SCONTI_H
#ifndef __TCLIFOR_H
#include "clifor.h"
#endif
#ifndef __VELIB_H
#include "velib.h"
#endif

View File

@ -21,10 +21,6 @@
class TViswin;
#endif
#ifndef __CLIFOR_H
#include "../ve/clifor.h"
#endif
#ifndef __VERIG_H
#include "../ve/verig.h"
#endif
@ -972,7 +968,8 @@ public:
TString & registrazione, TString & data_registrazione) const;
bool is_split_payment() const;
void cli2doc() { clifor().cli2doc(*this); }
void cli2doc();
TDocumento ();
TDocumento (const TDocumento& d);
TDocumento(char provv, int anno, const char* codnum, long numdoc);

View File

@ -5,7 +5,7 @@
#include <tabutil.h>
#include <utility.h>
#include "../cg/cglib.h"
#include "../cg/cfban.h"
#include "../db/dblib.h"
#include "../pr/prlib.h"
#include "../li/letint.h"
@ -3416,4 +3416,90 @@ bool TDocumento::is_split_payment() const
}
}
return yes;
}
}
void TDocumento::cli2doc()
{
const TRectype& v = clifor().vendite();
put(DOC_CODVAL, get(CLI_CODVAL));
put(DOC_CODLIN, get(CLI_CODLIN));
put(DOC_CODPAG, get(CLI_CODPAG));
TToken_string key;
key.add(get(CLI_TIPOCF));
key.add(get(CLI_CODCF));
key.add("V");
key.add("1");
const TRectype& cfban = cache().get(LF_CFBAN, key);
if (cfban.empty())
{
put(DOC_CODABIA, get(CLI_CODABI));
put(DOC_CODCABA, get(CLI_CODCAB));
put(DOC_IBAN, get(CLI_IBAN));
}
else
{
put(DOC_CODABIA, cfban.get(CFBAN_ABI));
put(DOC_CODCABA, cfban.get(CFBAN_CAB));
put(DOC_IBAN, cfban.get(CFBAN_IBAN));
}
// Trasforma chiave da Vostra a Nostra banca
key.add("N", 2);
const TRectype& cfbanpr = cache().get(LF_CFBAN, key);
// Setta i campi che appartengono al file LF_CFVEN
if (cfbanpr.empty())
{
put(DOC_CODABIP, v.get(CFV_CODABIPR));
put(DOC_CODCABP, v.get(CFV_CODCABPR));
}
else
{
put(DOC_CODABIP, cfbanpr.get(CFBAN_ABI));
put(DOC_CODCABP, cfbanpr.get(CFBAN_CAB));
put(DOC_PROGBNP, cfbanpr.get(CFBAN_PROGPR));
}
put(DOC_RAGGR, v.get(CFV_RAGGDOC));
put(DOC_RAGGREFF, v.get(CFV_RAGGEFF));
put(DOC_CODINDSP, v.get(CFV_CODINDSP));
put(DOC_CODAG, v.get(CFV_CODAG));
put(DOC_CODAGVIS, v.get(CFV_CODAG1));
put(DOC_CODSPMEZZO, v.get(CFV_CODSPMEZZO));
put(DOC_CODPORTO, v.get(CFV_CODPORTO));
put(DOC_CODNOTESP1, v.get(CFV_CODNOTESP1));
put(DOC_CODNOTESP2, v.get(CFV_CODNOTESP2));
put(DOC_CODNOTE, v.get(CFV_CODNOTE));
put(DOC_CODVETT1, v.get(CFV_CODVETT1));
put(DOC_CODVETT2, v.get(CFV_CODVETT2));
put(DOC_CODVETT3, v.get(CFV_CODVETT3));
put(DOC_PERCSPINC, v.get(CFV_PERCSPINC));
put(DOC_ADDBOLLI, v.get(CFV_ADDBOLLI));
put(DOC_CATVEN, v.get(CFV_CATVEN));
const int alleg = get_int(CLI_ALLEG);
const bool split_payment = get_date(DOC_DATADOC).year() >= 2015 && get_bool(CLI_SPLITPAY);
put(DOC_LIQDIFF, !split_payment && alleg == 7 && ini_get_bool(CONFIG_DITTA, "cg", "GesLiqDiff") ? "X" : "");
//listino: deve essere attiva la gestione listini nella ditta
const bool gest_listini = ini_get_bool(CONFIG_DITTA, "ve", "GES", false, 1);
if (gest_listini)
{
const TDate datadoc = get_date(DOC_DATADOC);
const TString& listino = clifor().find_listino_al(datadoc);
put(DOC_CODLIST, listino);
}
put(DOC_ZONA, v.get(CFV_CODZONA));
put(DOC_RAGGR, v.get(CFV_RAGGDOC));
//aggiungere gestione spese e bolli???
put(DOC_CODPORTO, v.get(CFV_CODPORTO));
}