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:
rajitgill 2009-04-17 10:27:55 +00:00
parent 5a901414d9
commit 1dd2896c14
2 changed files with 68 additions and 25 deletions

View File

@ -176,17 +176,17 @@ LISTBOX F_TIPOFORF 1 23
BEGIN BEGIN
PROMPT 1 14 "Forfait " PROMPT 1 14 "Forfait "
ITEM "0|Nessuno" 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" 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" 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" 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." 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" 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 END
LISTBOX F_NOLCIC 1 20 LISTBOX F_NOLCIC 1 20
@ -197,12 +197,11 @@ BEGIN
GROUP 1 GROUP 1
END END
LISTBOX F_VCARTCLI 1 20 LISTBOX F_VCARTCLI 1 13
BEGIN BEGIN
PROMPT 39 14 "Per " PROMPT 60 15 "Per "
ITEM "N|Nessuno"
ITEM "C|Cliente"
ITEM "A|Articolo" ITEM "A|Articolo"
ITEM "C|Cliente"
GROUP 1 GROUP 1
END END
@ -698,7 +697,7 @@ BEGIN
ITEM "3|Ciclaggio" ITEM "3|Ciclaggio"
MESSAGE ENABLE,S_NOLCIC|DISABLE,S_VCARTCLI|DISABLE,S_IMPFISART|DISABLE,3@|ENABLE,S_MINCIC|ENABLE,2@ MESSAGE ENABLE,S_NOLCIC|DISABLE,S_VCARTCLI|DISABLE,S_IMPFISART|DISABLE,3@|ENABLE,S_MINCIC|ENABLE,2@
ITEM "4|% sul val. convenz." 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" ITEM "5|Fisso su dot. iniziale"
MESSAGE DISABLE,1@|ENABLE,S_IMPFISART|DISABLE,3@|DISABLE,S_MINCIC|DISABLE,2@ MESSAGE DISABLE,1@|ENABLE,S_IMPFISART|DISABLE,3@|DISABLE,S_MINCIC|DISABLE,2@
FIELD TIPOFORF FIELD TIPOFORF

View File

@ -116,6 +116,7 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
const long clifo = doc.get_long(DOC_CODCF); const long clifo = doc.get_long(DOC_CODCF);
const int indsped = doc.get_int(DOC_CODINDSP); const int indsped = doc.get_int(DOC_CODINDSP);
TLaundry_contract contr(clifo,indsped,_data_elab); TLaundry_contract contr(clifo,indsped,_data_elab);
bool valconvcli=false;
for (int i = 1; i <= doc.physical_rows(); i++) for (int i = 1; i <= doc.physical_rows(); i++)
{ {
@ -183,7 +184,7 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
break; break;
case 3: 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 consumo=qta * rout.get_real(RDOC_PREZZO);
const real ciclaggio=dot * rcont.get_real(LVRCONDV_PREZZO) * rcont.get_real(LVRCONDV_MINCIC); const real ciclaggio=dot * rcont.get_real(LVRCONDV_PREZZO) * rcont.get_real(LVRCONDV_MINCIC);
if (consumo<ciclaggio) if (consumo<ciclaggio)
@ -208,23 +209,66 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
break; break;
case 4: case 4:
{ {
const real qta=rout.get(RDOC_QTA); const char tipovalconv = rcont.get_char(LVRCONDV_VCARTCLI);
const real consumo=qta * rout.get_real(RDOC_PREZZO); if (tipovalconv=='A')
const real impconv=dot * rcont.get_real(LVRCONDV_VALCONV) * rcont.get_real(LVRCONDV_FORFPERCL);
if (consumo<impconv)
{ {
const bool cicl2rig=contr.get_bool(LVCONDV_CICLAGGIO); const real qta=rout.get_real(RDOC_QTA);
if (cicl2rig) 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"); const bool cicl2rig=contr.get_bool(LVCONDV_CICLAGGIO);
doc.copy_data(congrow,rout); if (cicl2rig)
congrow.put(RDOC_DESCR,"Conguaglio valore convenzionale"); {
congrow.put(RDOC_PREZZO, rcont.get_real(LVRCONDV_PREZZO)); 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); valconvcli=true;
rout.put(RDOC_PREZZO, impconv); 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);
}
}
} }
} }
} }