Patch level : 12.322

Files correlati     : lv2.exe lv3.exe f168.trr lv0400a.msk

Diana 2000
----------

Spese automatiche da contratto sui buoni di consegna.

git-svn-id: svn://10.65.10.50/branches/R_10_00@23479 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2016-12-28 00:02:05 +00:00
parent 6888cdcf6a
commit 60794cd270
5 changed files with 2914 additions and 2843 deletions

View File

@ -24,7 +24,7 @@ TIPOCAN|2|1|0|Tipo canone
CANFIX|2|1|0|Opzioni per importo canone fisso
NOLCICTE|1|1|0|Opzioni per importo % sul valore convenzionale
TIPOIMB|2|1|0|Tipo imballo
SSCONS|8|1|0|Spese di spedizione alla consegna
SSCONS|8|1|0|Spese da addebitare alla consegna
TIPOSTPRZ|8|1|0|Stampa prezzo in bolla
DTLASTFAT|5|8|0|Data ultima fattura
ATTFATNODT|8|1|0|Attiva fatturazione indipendentemente dalla data

View File

@ -586,7 +586,7 @@ END
BOOLEAN F_SSCONS
BEGIN
PROMPT 2 18 "Spese di spedizione alla consegna"
PROMPT 2 18 "Spese da addebitare alla consegna"
FIELD SSCONS
END

View File

@ -140,6 +140,10 @@ bool TGenera_documenti_app::crea_documento_ritiro(const TISAM_recordset& ritiro,
//recupero i dati di interesse dalla maschera
const TDate datagen(TODAY);
//per ogni planning recupero i dati di interesse dal planning
const long ndoc = ritiro.get(DOC_NDOC).as_int();
if (ndoc > 5132)
int i = 1;
const long codcli = ritiro.get(DOC_CODCF).as_int();
const long codcont = ritiro.get(DOC_CODCONT).as_int();
const TDate dtcons = ritiro.get("G1:DATAPRCO").as_date(); //che è anche la data documento
@ -335,6 +339,20 @@ bool TGenera_documenti_app::crea_documento_ritiro(const TISAM_recordset& ritiro,
TToken_string orderkey;
orderkey.add(RDOC_CODART);
doc.sort_rows(orderkey);
if (tcont.get_bool(LVCONDV_SSCONS))
{
char name[8] = "CODSP0";
TString_array spese;
const TRectype& ven_rec = doc.clifor().vendite();
for (int i = 1; i <= 4; i++)
{
name[5] = '0' + i;
const TString& s = ven_rec.get(name);
if (s.full())
spese.add(s);
}
doc.update_spese_aut(spese, false, NULL, true);
}
while (err = doc.write() == _isreinsert)
{
const long old_ndoc = doc.get_long(DOC_NDOC);
@ -572,6 +590,20 @@ bool TGenera_documenti_app::crea_documento_plan(const TISAM_recordset& plan, TLo
TToken_string orderkey;
orderkey.add(RDOC_CODART);
doc.sort_rows(orderkey);
if (tcont.get_bool(LVCONDV_SSCONS))
{
char name[8] = "CODSP0";
TString_array spese;
const TRectype& ven_rec = doc.clifor().vendite();
for (int i = 1; i <= 4; i++)
{
name[5] = '0' + i;
const TString& s = ven_rec.get(name);
if (s.full())
spese.add(s);
}
doc.update_spese_aut(spese, false, NULL, true);
}
err = doc.rewrite();
++numdocgen;
}

View File

@ -45,7 +45,7 @@ END
STRING F_PATH 255 50
BEGIN
PROMPT 10 8 "Cartella "
FLAGS "D"
// FLAGS "D"
END
SPREADSHEET F_SHEET_NAME 78 -1

View File

@ -445,10 +445,6 @@ bool TGestione_buoni_msk::set_righe_buono_handler(TMask_field& f, KEY k)
}
else
{
doc.put(DOC_CODCF, codcf);
doc.put(DOC_DATADOC, datadoc);
doc.put(DOC_CODINDSP, indsped);
doc.put(DOC_CODCONT, codcont);
const TDate dataprco = dmsk.proponi_dataprco();
if (dataprco.ok() && dmsk.get(F_LVDATAPRCO).empty())
@ -1383,6 +1379,28 @@ int TGestione_buoni_app::write( const TMask& m )
date_dotmp(m);
TDocumento& d = doc();
const long codcf = d.get_long(DOC_CODCF);
const int codcont = d.get_int(DOC_CODCONT);
const TLaundry_contract tcont(codcf, codcont);
if (tcont.get_bool(LVCONDV_SSCONS))
{
char name[8] = "CODSP0";
TString_array spese;
const TRectype& ven_rec = d.clifor().vendite();
for (int i = 1; i <= 4; i++)
{
name[5] = '0' + i;
const TString& s = ven_rec.get(name);
if (s.full())
spese.add(s);
}
d.update_spese_aut(spese, false, NULL, true);
}
return TMotore_application::write(m);
}
@ -1395,6 +1413,27 @@ int TGestione_buoni_app::rewrite( const TMask& m )
date_dotmp(m);
TDocumento& d = doc();
const long codcf = d.get_long(DOC_CODCF);
const int codcont = d.get_int(DOC_CODCONT);
const TLaundry_contract tcont(codcf, codcont);
if (tcont.get_bool(LVCONDV_SSCONS))
{
char name[8] = "CODSP0";
TString_array spese;
const TRectype& ven_rec = d.clifor().vendite();
for (int i = 1; i <= 4; i++)
{
name[5] = '0' + i;
const TString& s = ven_rec.get(name);
if (s.full())
spese.add(s);
}
d.update_spese_aut(spese, false, NULL, true);
}
return TMotore_application::rewrite(m);
}