Patch level :10.0
Files correlati :lv0.exe,lv2.exe.lv0,lv0400.msk Ricompilazione Demo : [ ] Commento : Gestito il valore convenzionale sulla fatturazione e conseguenti correzzioni sulla maschera dei contratti git-svn-id: svn://10.65.10.50/trunk@18726 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5a901414d9
commit
1dd2896c14
@ -176,17 +176,17 @@ LISTBOX F_TIPOFORF 1 23
|
||||
BEGIN
|
||||
PROMPT 1 14 "Forfait "
|
||||
ITEM "0|Nessuno"
|
||||
MESSAGE HIDE,1@|DISABLE, F_IMPFISART|DISABLE,3@|DISABLE,F_MINCIC
|
||||
MESSAGE HIDE,1@|DISABLE, F_IMPFISART|DISABLE,3@|HIDE,F_MINCIC
|
||||
ITEM "1|A valore fisso"
|
||||
MESSAGE HIDE,1@|ENABLE,F_IMPFISART|DISABLE,3@|DISABLE,F_MINCIC
|
||||
MESSAGE HIDE,1@|ENABLE,F_IMPFISART|DISABLE,3@|HIDE,F_MINCIC
|
||||
ITEM "2|Nolo"
|
||||
MESSAGE SHOW,F_NOLCIC|HIDE,F_VCARTCLI|DISABLE,F_IMPFISART|DISABLE,3@|DISABLE,F_MINCIC
|
||||
MESSAGE SHOW,F_NOLCIC|HIDE,F_VCARTCLI|DISABLE,F_IMPFISART|DISABLE,3@|HIDE,F_MINCIC
|
||||
ITEM "3|Ciclaggio"
|
||||
MESSAGE SHOW,F_NOLCIC|HIDE,F_VCARTCLI|DISABLE,F_IMPFISART|DISABLE,3@|ENABLE,F_MINCIC
|
||||
MESSAGE SHOW,F_NOLCIC|HIDE,F_VCARTCLI|DISABLE,F_IMPFISART|DISABLE,3@|SHOW,F_MINCIC
|
||||
ITEM "4|% sul val. convenz."
|
||||
MESSAGE HIDE,F_NOLCIC|SHOW,F_VCARTCLI|DISABLE,F_IMPFISART|ENABLE,3@|DISABLE,F_MINCIC
|
||||
MESSAGE HIDE,F_NOLCIC|SHOW,F_VCARTCLI|DISABLE,F_IMPFISART|ENABLE,3@|HIDE,F_MINCIC
|
||||
ITEM "5|Fisso su dot. iniziale"
|
||||
MESSAGE HIDE,1@|ENABLE,F_IMPFISART|DISABLE,3@|DISABLE,F_MINCIC
|
||||
MESSAGE HIDE,1@|ENABLE,F_IMPFISART|DISABLE,3@|HIDE,F_MINCIC
|
||||
END
|
||||
|
||||
LISTBOX F_NOLCIC 1 20
|
||||
@ -197,12 +197,11 @@ BEGIN
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
LISTBOX F_VCARTCLI 1 20
|
||||
LISTBOX F_VCARTCLI 1 13
|
||||
BEGIN
|
||||
PROMPT 39 14 "Per "
|
||||
ITEM "N|Nessuno"
|
||||
ITEM "C|Cliente"
|
||||
PROMPT 60 15 "Per "
|
||||
ITEM "A|Articolo"
|
||||
ITEM "C|Cliente"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
@ -698,7 +697,7 @@ BEGIN
|
||||
ITEM "3|Ciclaggio"
|
||||
MESSAGE ENABLE,S_NOLCIC|DISABLE,S_VCARTCLI|DISABLE,S_IMPFISART|DISABLE,3@|ENABLE,S_MINCIC|ENABLE,2@
|
||||
ITEM "4|% sul val. convenz."
|
||||
MESSAGE DISABLE,S_NOLCIC|ENABLE,S_VCARTCLI|DISABLE,S_IMPFISART|ENABLE,3@|DISABLE,S_MINCIC|DISABLE,2@
|
||||
MESSAGE ENABLE,S_NOLCIC|ENABLE,S_VCARTCLI|DISABLE,S_IMPFISART|ENABLE,3@|DISABLE,S_MINCIC|DISABLE,2@
|
||||
ITEM "5|Fisso su dot. iniziale"
|
||||
MESSAGE DISABLE,1@|ENABLE,S_IMPFISART|DISABLE,3@|DISABLE,S_MINCIC|DISABLE,2@
|
||||
FIELD TIPOFORF
|
||||
|
@ -116,6 +116,7 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
|
||||
const long clifo = doc.get_long(DOC_CODCF);
|
||||
const int indsped = doc.get_int(DOC_CODINDSP);
|
||||
TLaundry_contract contr(clifo,indsped,_data_elab);
|
||||
bool valconvcli=false;
|
||||
|
||||
for (int i = 1; i <= doc.physical_rows(); i++)
|
||||
{
|
||||
@ -183,7 +184,7 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
const real qta=rout.get(RDOC_QTA);
|
||||
const real qta=rout.get_real(RDOC_QTA);
|
||||
const real consumo=qta * rout.get_real(RDOC_PREZZO);
|
||||
const real ciclaggio=dot * rcont.get_real(LVRCONDV_PREZZO) * rcont.get_real(LVRCONDV_MINCIC);
|
||||
if (consumo<ciclaggio)
|
||||
@ -208,23 +209,66 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
const real qta=rout.get(RDOC_QTA);
|
||||
const real consumo=qta * rout.get_real(RDOC_PREZZO);
|
||||
const real impconv=dot * rcont.get_real(LVRCONDV_VALCONV) * rcont.get_real(LVRCONDV_FORFPERCL);
|
||||
if (consumo<impconv)
|
||||
const char tipovalconv = rcont.get_char(LVRCONDV_VCARTCLI);
|
||||
if (tipovalconv=='A')
|
||||
{
|
||||
const bool cicl2rig=contr.get_bool(LVCONDV_CICLAGGIO);
|
||||
if (cicl2rig)
|
||||
const real qta=rout.get_real(RDOC_QTA);
|
||||
const real consumo=qta * rout.get_real(RDOC_PREZZO);
|
||||
const real impconv=dot * rcont.get_real(LVRCONDV_VALCONV) * rcont.get_real(LVRCONDV_FORFPERCL);
|
||||
if (consumo<impconv)
|
||||
{
|
||||
TRiga_documento& congrow=doc.insert_row(++i, "01");
|
||||
doc.copy_data(congrow,rout);
|
||||
congrow.put(RDOC_DESCR,"Conguaglio valore convenzionale");
|
||||
congrow.put(RDOC_PREZZO, rcont.get_real(LVRCONDV_PREZZO));
|
||||
const bool cicl2rig=contr.get_bool(LVCONDV_CICLAGGIO);
|
||||
if (cicl2rig)
|
||||
{
|
||||
TRiga_documento& congrow=doc.insert_row(++i, "01");
|
||||
doc.copy_data(congrow,rout);
|
||||
congrow.put(RDOC_DESCR,"Conguaglio valore convenzionale");
|
||||
congrow.put(RDOC_QTA, UNO);
|
||||
congrow.put(RDOC_PREZZO, impconv - consumo);
|
||||
}
|
||||
else
|
||||
{
|
||||
rout.put(RDOC_QTA, UNO);
|
||||
rout.put(RDOC_PREZZO, impconv);
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!valconvcli)
|
||||
{
|
||||
rout.put(RDOC_QTA, UNO);
|
||||
rout.put(RDOC_PREZZO, impconv);
|
||||
valconvcli=true;
|
||||
real impconvtot;
|
||||
real consumotot;
|
||||
for (int j = i; j < doc.physical_rows(); j++)
|
||||
{
|
||||
TRiga_documento& riga = doc[j];
|
||||
const TString80 codart=riga.get(RDOC_CODART);
|
||||
const TRectype & rcont=contr.row(codart);
|
||||
const char tipvalconvcli = rcont.get_char(LVRCONDV_VCARTCLI);
|
||||
if (tipvalconvcli=='C')
|
||||
{
|
||||
impconvtot += dot * rcont.get_real(LVRCONDV_VALCONV) * rcont.get_real(LVRCONDV_FORFPERCL);
|
||||
consumotot += riga.get_real(RDOC_QTA) * riga.get_real(RDOC_PREZZO);
|
||||
}
|
||||
}
|
||||
if (consumotot<impconvtot)
|
||||
{
|
||||
const bool cicl2rig=contr.get_bool(LVCONDV_CICLAGGIO);
|
||||
if (cicl2rig)
|
||||
{
|
||||
TRiga_documento& congrow=doc.insert_row(++i, "01");
|
||||
doc.copy_data(congrow,rout);
|
||||
congrow.put(RDOC_DESCR,"Conguaglio valore convenzionale");
|
||||
congrow.put(RDOC_QTA, UNO);
|
||||
congrow.put(RDOC_PREZZO, impconvtot - consumotot);
|
||||
}
|
||||
else
|
||||
{
|
||||
rout.put(RDOC_QTA, UNO);
|
||||
rout.put(RDOC_PREZZO, impconvtot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user