Patch level : 10.0
Files correlati : pl0002 Ricompilazione Demo : [ ] Commento : Modifiche richieste da Tassan git-svn-id: svn://10.65.10.50/branches/R_10_00@21850 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b96988446a
commit
261cb27351
242
ps/pl0002100.cpp
242
ps/pl0002100.cpp
@ -57,6 +57,12 @@ public:
|
||||
virtual bool trasferisci();
|
||||
};
|
||||
|
||||
class TLif_listini : public TLif_transfer
|
||||
{
|
||||
public:
|
||||
virtual bool trasferisci();
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TLif_clienti
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -96,7 +102,6 @@ bool TLif_clifo_co_clifor::trasferisci()
|
||||
TString80 iban = get_str("sig_iban1"); iban << get_str("sig_bban1");
|
||||
|
||||
const TString4 codspmezzo = get_str("cod_mezzo_trasp");
|
||||
const TString4 codlist = get_str("cod_listino");
|
||||
const TString4 percprovv = get_str("cod_catprovvi");
|
||||
const TString8 codag = get_str("cod_agente");
|
||||
const bool addbolli = get_str("flg_addebito_bollo")[0] == '0' ? false : true;
|
||||
@ -107,25 +112,24 @@ bool TLif_clifo_co_clifor::trasferisci()
|
||||
codcli.format("%04d", codcf); codcli << "00";
|
||||
|
||||
rec.zero();
|
||||
rec.put(CLI_TIPOCF, tipocf);
|
||||
rec.put(CLI_CODCF, codcli);
|
||||
rec.put(CLI_CODPAG, condpag);
|
||||
rec.put(CLI_FIDO, fido);
|
||||
rec.put(CLI_TIPOCF, tipocf);
|
||||
rec.put(CLI_CODCF, codcli);
|
||||
rec.put(CLI_CODPAG, condpag);
|
||||
rec.put(CLI_FIDO, fido);
|
||||
rec.put(CLI_SOSPESO, sospeso == '0' ? false : true);
|
||||
rec.put(CLI_CODABI, codabi);
|
||||
rec.put(CLI_CODCAB, codcab);
|
||||
rec.put(CLI_IBAN, iban);
|
||||
rec.put(CLI_CODABI, codabi);
|
||||
rec.put(CLI_CODCAB, codcab);
|
||||
rec.put(CLI_IBAN, iban);
|
||||
|
||||
cfv_rec.zero();
|
||||
cfv_rec.put(CFV_TIPOCF, tipocf);
|
||||
cfv_rec.put(CFV_CODCF, codcli);
|
||||
cfv_rec.put(CFV_TIPOCF, tipocf);
|
||||
cfv_rec.put(CFV_CODCF, codcli);
|
||||
cfv_rec.put(CFV_CODSPMEZZO, codspmezzo);
|
||||
cfv_rec.put(CFV_CODLIST, codlist);
|
||||
cfv_rec.put(CFV_PERCPROVV, percprovv);
|
||||
cfv_rec.put(CFV_CODAG, codag);
|
||||
cfv_rec.put(CFV_ADDBOLLI, addbolli);
|
||||
cfv_rec.put(CFV_PERCSPINC, percspinc);
|
||||
cfv_rec.put(CFV_CODPORTO, codporto);
|
||||
cfv_rec.put(CFV_PERCPROVV, percprovv);
|
||||
cfv_rec.put(CFV_CODAG, codag);
|
||||
cfv_rec.put(CFV_ADDBOLLI, addbolli);
|
||||
cfv_rec.put(CFV_PERCSPINC, percspinc);
|
||||
cfv_rec.put(CFV_CODPORTO, codporto);
|
||||
|
||||
aggiorna_record(rec, lista_campi);
|
||||
if (test_write(clienti))
|
||||
@ -185,31 +189,31 @@ bool TLif_clifo_ca_anagrafiche::trasferisci()
|
||||
|
||||
if(err == NOERR)
|
||||
{
|
||||
const TString4 stato = get_str("cod_naz");
|
||||
const TString80 ragsoc = get_str("des_ragsoc");
|
||||
const TString16 cofi = get_str("cod_cfisc");
|
||||
const TString16 paiv = get_str("cod_piva");
|
||||
const long tpper = get_long("flg_per_fis");
|
||||
const TString80 mail = get_str("des_email1");
|
||||
const TString80 tel = get_str("sig_tel_fis");
|
||||
const TString80 fax = get_str("sig_fax_fis");
|
||||
const TString4 stato = get_str("cod_naz");
|
||||
const TString80 ragsoc = get_str("des_ragsoc");
|
||||
const TString16 cofi = get_str("cod_cfisc");
|
||||
const TString16 paiv = get_str("cod_piva");
|
||||
const long tpper = get_long("flg_per_fis");
|
||||
const TString80 mail = get_str("des_email1");
|
||||
const TString80 tel = get_str("sig_tel_fis");
|
||||
const TString80 fax = get_str("sig_fax_fis");
|
||||
const TString80 indirizzo = get_str("des_indir_res");
|
||||
const TString localita = get_str("des_localita_fis");
|
||||
const long cap = get_long("cod_cap_fis");
|
||||
const TString localita = get_str("des_localita_fis");
|
||||
const long cap = get_long("cod_cap_fis");
|
||||
|
||||
rec.put(CLI_TIPOCF, tipocf);
|
||||
rec.put(CLI_CODCF, codcli);
|
||||
rec.put(CLI_STATOCF, stato);
|
||||
rec.put(CLI_RAGSOC, ragsoc);
|
||||
rec.put(CLI_TIPOCF, tipocf);
|
||||
rec.put(CLI_CODCF, codcli);
|
||||
rec.put(CLI_STATOCF, stato);
|
||||
rec.put(CLI_RAGSOC, ragsoc);
|
||||
rec.put(CLI_TIPOPERS, tpper == 0L ? 'G' : 'F');
|
||||
rec.put(CLI_COFI, cofi);
|
||||
rec.put(CLI_PAIV, paiv);
|
||||
rec.put(CLI_MAIL, mail);
|
||||
rec.put(CLI_TEL, tel);
|
||||
rec.put(CLI_FAX, fax);
|
||||
rec.put(CLI_INDCF, indirizzo);
|
||||
rec.put(CLI_LOCCF, localita);
|
||||
rec.put(CLI_CAPCF, cap);
|
||||
rec.put(CLI_COFI, cofi);
|
||||
rec.put(CLI_PAIV, paiv);
|
||||
rec.put(CLI_MAIL, mail);
|
||||
rec.put(CLI_TEL, tel);
|
||||
rec.put(CLI_FAX, fax);
|
||||
rec.put(CLI_INDCF, indirizzo);
|
||||
rec.put(CLI_LOCCF, localita);
|
||||
rec.put(CLI_CAPCF, cap);
|
||||
|
||||
aggiorna_record(rec, lista_campi);
|
||||
if (test_write(clienti))
|
||||
@ -275,14 +279,14 @@ bool TLif_clifo_ca_sedi::trasferisci()
|
||||
const TString paiv = "";
|
||||
const TString8 fatt_a = codcont;
|
||||
|
||||
rec.put(CLI_CODCF, codcli);
|
||||
rec.put(CLI_RAGSOC, ragsoc);
|
||||
rec.put(CLI_INDCF, indirizzo);
|
||||
rec.put(CLI_LOCCF, localita);
|
||||
rec.put(CLI_CAPCF, cap);
|
||||
rec.put(CLI_TEL, tel);
|
||||
rec.put(CLI_COFI, cofi);
|
||||
rec.put(CLI_PAIV, paiv);
|
||||
rec.put(CLI_CODCF, codcli);
|
||||
rec.put(CLI_RAGSOC, ragsoc);
|
||||
rec.put(CLI_INDCF, indirizzo);
|
||||
rec.put(CLI_LOCCF, localita);
|
||||
rec.put(CLI_CAPCF, cap);
|
||||
rec.put(CLI_TEL, tel);
|
||||
rec.put(CLI_COFI, cofi);
|
||||
rec.put(CLI_PAIV, paiv);
|
||||
rec.put(CLI_CODCFFATT, fatt_a);
|
||||
|
||||
cfv_rec.put(CFV_CODCF, codcli);
|
||||
@ -343,31 +347,32 @@ bool TLif_contratti::trasferisci()
|
||||
bool inbolla = get_str("flg_nonriportaddt")[0] == 'N' ? false : true;
|
||||
|
||||
trec.zero();
|
||||
trec.put(LVCONDV_CODCF, codcli);
|
||||
trec.put(LVCONDV_CODCONT, 1);
|
||||
trec.put(LVCONDV_DATAIN, dadata);
|
||||
trec.put(LVCONDV_CODCF, codcli);
|
||||
trec.put(LVCONDV_CODCONT, 1);
|
||||
trec.put(LVCONDV_DATAIN, dadata);
|
||||
trec.put(LVCONDV_STPRZBOL, inbolla);
|
||||
trec.put(LVCONDV_PERFAT, 3); //da accordi con Tassan in data 23/03/2011 la fatturazione è sempre mensile
|
||||
test_write(condv);
|
||||
contratti.add(codcli, codcli);
|
||||
}
|
||||
|
||||
rrec.zero();
|
||||
grec.zero();
|
||||
rrec.put(LVRCONDV_CODCF, codcli);
|
||||
rrec.put(LVRCONDV_CODCF, codcli);
|
||||
rrec.put(LVRCONDV_CODCONT, 1);
|
||||
|
||||
const real dotin(get_str("qta_iniziale"));
|
||||
const real dotod(get_str("qta_attuale"));
|
||||
const TString80 codart = get_str("cod_art");
|
||||
|
||||
grec.put(CLIFOGIAC_ANNOES, anno);
|
||||
grec.put(CLIFOGIAC_TIPOCF, 'C');
|
||||
grec.put(CLIFOGIAC_CODCF, codcli);
|
||||
grec.put(CLIFOGIAC_ANNOES, anno);
|
||||
grec.put(CLIFOGIAC_TIPOCF, 'C');
|
||||
grec.put(CLIFOGIAC_CODCF, codcli);
|
||||
grec.put(CLIFOGIAC_INDSPED, 0);
|
||||
grec.put(CLIFOGIAC_CODART, codart);
|
||||
grec.put(CLIFOGIAC_NRIGA, 1);
|
||||
grec.put(CLIFOGIAC_DOTIN, dotin);
|
||||
grec.put(CLIFOGIAC_DOTOD, dotod);
|
||||
grec.put(CLIFOGIAC_CODART, codart);
|
||||
grec.put(CLIFOGIAC_NRIGA, 1);
|
||||
grec.put(CLIFOGIAC_DOTIN, dotin);
|
||||
grec.put(CLIFOGIAC_DOTOD, dotod);
|
||||
|
||||
test_write(clifogiac);
|
||||
|
||||
@ -379,12 +384,12 @@ bool TLif_contratti::trasferisci()
|
||||
|
||||
int bloccato = get_str("flg_disabilitato")[0] == '0' ? 0 : 1; //articolo in sostituzione ->accordi Tassan il 16/03/2011
|
||||
|
||||
rrec.put(LVRCONDV_CODART, codart);
|
||||
rrec.put(LVRCONDV_PREZZO, prezzo);
|
||||
rrec.put(LVRCONDV_MINCIC, mincic);
|
||||
rrec.put(LVRCONDV_VALCONV, valcon);
|
||||
rrec.put(LVRCONDV_CODART, codart);
|
||||
rrec.put(LVRCONDV_PREZZO, prezzo);
|
||||
rrec.put(LVRCONDV_MINCIC, mincic);
|
||||
rrec.put(LVRCONDV_VALCONV, valcon);
|
||||
rrec.put(LVRCONDV_FORFPERCL, percfo);
|
||||
rrec.put(LVRCONDV_ARTBLOC, bloccato);
|
||||
rrec.put(LVRCONDV_ARTBLOC, bloccato);
|
||||
rrec.put(LVRCONDV_IMPFISART, przfis);
|
||||
|
||||
test_write(rcondv);
|
||||
@ -423,17 +428,17 @@ bool TLif_articoli::trasferisci()
|
||||
const TString80 codart = get_str("cod_art");
|
||||
const TString80 descr = get_str("des_articolo");
|
||||
const TString descragg = get_str("des_articolo_ex");
|
||||
const real plordo(get_str("qta_pes_lordo_kg"));
|
||||
const real pnetto(get_str("qta_pes_netto_kg"));
|
||||
const long ppconf = get_long("num_colli");
|
||||
const TString4 ump = pnetto > ZERO ? "GR" : "";
|
||||
|
||||
rec.put(ANAMAG_CODART, codart);
|
||||
rec.put(ANAMAG_DESCR, descr);
|
||||
rec.put(ANAMAG_CODART, codart);
|
||||
rec.put(ANAMAG_DESCR, descr);
|
||||
rec.put(ANAMAG_DESCRAGG, descragg);
|
||||
rec.put(ANAMAG_PESO, plordo);
|
||||
rec.put(ANAMAG_TARA, plordo - pnetto);
|
||||
rec.put(ANAMAG_PPCONF, ppconf);
|
||||
rec.put(ANAMAG_CODIVA, "20");
|
||||
rec.put(ANAMAG_PESO, pnetto);
|
||||
rec.put(ANAMAG_UMP, ump);
|
||||
rec.put(ANAMAG_PPCONF, ppconf);
|
||||
rec.put(ANAMAG_CODIVA, "20");
|
||||
|
||||
aggiorna_record(rec, lista_campi);
|
||||
if (test_write(anamag))
|
||||
@ -441,8 +446,8 @@ bool TLif_articoli::trasferisci()
|
||||
if(!articoli.is_key(codart))
|
||||
{
|
||||
umrec.put(UMART_CODART, codart);
|
||||
umrec.put(UMART_NRIGA, 1);
|
||||
umrec.put(UMART_UM, "NR");
|
||||
umrec.put(UMART_NRIGA, 1);
|
||||
umrec.put(UMART_UM, "NR");
|
||||
test_write(umart);
|
||||
|
||||
articoli.add(codart, codart);
|
||||
@ -450,13 +455,101 @@ bool TLif_articoli::trasferisci()
|
||||
TString msg;
|
||||
msg << TR("Inserito articolo ") << " '" << codart << "\' -> " << descr;
|
||||
log(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
anamag.close();
|
||||
return write_enabled();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TLif_listini::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.PZ_PREZZIBASE";
|
||||
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "PZ_PREZZIBASE", true);
|
||||
|
||||
TSystemisamfile umart(LF_UMART);
|
||||
umart.open(_lock);
|
||||
TRectype& umrec = umart.curr();
|
||||
|
||||
TSystemisamfile condv(LF_LVCONDV);
|
||||
condv.open(_lock);
|
||||
TRectype& conrec = condv.curr();
|
||||
|
||||
TSystemisamfile rcondv(LF_LVRCONDV);
|
||||
rcondv.open(_lock);
|
||||
|
||||
TLif_iterator hi(this);
|
||||
|
||||
TAssoc_array contratti;
|
||||
|
||||
while (++hi)
|
||||
{
|
||||
const TString80 codart = get_str("cod_art");
|
||||
const TString4 codlis = get_str("cod_listino");
|
||||
const long prglis = get_long("prg_listino");
|
||||
const real prezzo(get_str("prz_listino"));
|
||||
|
||||
TString8 listino = codlis; listino << prglis;
|
||||
|
||||
umrec.zero();
|
||||
umrec.put(UMART_CODART, codart);
|
||||
umrec.put(UMART_NRIGA, 1);
|
||||
umrec.read(umart);
|
||||
umrec.put(UMART_CODART, codart);
|
||||
umrec.put(UMART_NRIGA, 1);
|
||||
umrec.put(UMART_PREZZO, prezzo);
|
||||
|
||||
aggiorna_record(umrec, lista_campi);
|
||||
if (test_write(umart))
|
||||
{
|
||||
TString query;
|
||||
query << "USE LVRCONDV\n"
|
||||
<< "SELECT CODART=\"" << codart << "\"";
|
||||
|
||||
TISAM_recordset rcont(query);
|
||||
|
||||
for(bool ok = rcont.move_first(); ok; ok = rcont.move_next())
|
||||
{
|
||||
TRectype& riga = rcont.cursor()->curr();
|
||||
riga.put(LVRCONDV_PREZDAN, prezzo);
|
||||
riga.rewrite(rcondv);
|
||||
|
||||
const long codcf = riga.get_long(LVRCONDV_CODCF);
|
||||
const long codco = riga.get_long(LVRCONDV_CODCONT);
|
||||
|
||||
TToken_string ckey;
|
||||
ckey.add(codcf);
|
||||
ckey.add(codco);
|
||||
|
||||
if(!contratti.is_key(ckey))
|
||||
{
|
||||
conrec.put(LVCONDV_CODCF, codcf);
|
||||
conrec.put(LVCONDV_CODCONT, codco);
|
||||
conrec.read(condv);
|
||||
conrec.put(LVCONDV_CODCF, codcf);
|
||||
conrec.put(LVCONDV_CODCONT, codco);
|
||||
conrec.put(LVCONDV_ADDCAPROT, true);
|
||||
conrec.rewrite(condv);
|
||||
}
|
||||
contratti.add(ckey, ckey);
|
||||
}
|
||||
}
|
||||
}
|
||||
umart.close();
|
||||
condv.close();
|
||||
rcondv.close();
|
||||
|
||||
return write_enabled();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TImportazione_lif_msk
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -541,6 +634,11 @@ void TImportazione_lif_msk::trasferisci()
|
||||
TLif_articoli pc;
|
||||
pc.init(TR("Articoli"), query_header1, log);
|
||||
go_on = pc.trasferisci();
|
||||
|
||||
TLif_listini pc1;
|
||||
pc1.init(TR("Listini"), query_header1, log);
|
||||
go_on = pc1.trasferisci();
|
||||
|
||||
book.add(log);
|
||||
rep_to_print = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user