Patch level : 10.0 278
Files correlati : lv2.exe Ricompilazione Demo : [ ] Commento : Ciclaggio e nolo nella fatturazione git-svn-id: svn://10.65.10.50/trunk@18671 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b8f94de2cc
commit
ab2395fe1b
@ -20,6 +20,7 @@
|
||||
class TFatturazione_lavanderie:public TFatturazione_bolle
|
||||
{
|
||||
TDate _data_elab;
|
||||
TToken_string _campi_raggruppamento;
|
||||
|
||||
|
||||
protected:
|
||||
@ -154,7 +155,28 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
|
||||
{
|
||||
TRiga_documento& nolorow=doc.insert_row(++i, "01");
|
||||
doc.copy_data(nolorow,rout);
|
||||
nolorow.put(RDOC_DESCR,"Nolo per");
|
||||
TString80 descr("Nolo");
|
||||
const int contrper = contr.get_int(LVCONDV_PERFAT);
|
||||
|
||||
switch (contrper)
|
||||
{
|
||||
case 0:
|
||||
descr << " per il giorno";
|
||||
break;
|
||||
case 1:
|
||||
descr << " per la settimana";
|
||||
break;
|
||||
case 2:
|
||||
descr << " per la quindicina";
|
||||
break;
|
||||
case 3:
|
||||
descr << " per il mese";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
nolorow.put(RDOC_DESCR,descr);
|
||||
|
||||
nolorow.put(RDOC_QTA, dot);
|
||||
nolorow.put(RDOC_PREZZO, rcont.get_real(LVRCONDV_PREZNOL));
|
||||
}
|
||||
@ -172,7 +194,7 @@ void TFatturazione_lavanderie::post_process_output(TLista_documenti& doc_out)
|
||||
{
|
||||
TRiga_documento& congrow=doc.insert_row(++i, "01");
|
||||
doc.copy_data(congrow,rout);
|
||||
congrow.put(RDOC_DESCR,"Pareggio minimo fatturabile");
|
||||
congrow.put(RDOC_DESCR,"Pareggio minimo ciclaggio");
|
||||
congrow.put(RDOC_QTA, cicl-qta);
|
||||
congrow.put(RDOC_PREZZO, rcont.get_real(LVRCONDV_PREZZO));
|
||||
}
|
||||
@ -242,35 +264,30 @@ void TFatturazione_lavanderie::add_rows(TRiga_documento & rout, TRiga_documento
|
||||
void TFatturazione_lavanderie::campi_raggruppamento_righe(TToken_string& campi_riga) const
|
||||
{
|
||||
TFatturazione_bolle::campi_raggruppamento_righe(campi_riga);
|
||||
campi_riga.add("LVTYPE");
|
||||
|
||||
if (campi_riga.empty())
|
||||
campi_riga = "CODART|UMQTA"; // Uguali sempre
|
||||
}
|
||||
|
||||
TRiga_documento& TFatturazione_lavanderie::find_or_create_row(TDocumento& doc_out, const TRiga_documento & rin,const char lavtype)
|
||||
{
|
||||
TToken_string campi_riga;
|
||||
campi_raggruppamento_righe(campi_riga);
|
||||
|
||||
const TString80 codart=rin.get(RDOC_CODARTMAG);
|
||||
int r;
|
||||
for (r=doc_out.physical_rows();r>0;r--)
|
||||
{
|
||||
const char tipo=doc_out[r].get_char("LVTYPE");
|
||||
const TString& cod=doc_out[r].get(RDOC_CODARTMAG);
|
||||
bool ok =doc_out[r].raggruppabile(rin, campi_riga);
|
||||
|
||||
if (ok)
|
||||
for (r=doc_out.physical_rows();r>0;r--)
|
||||
if (doc_out[r].raggruppabile(rin, _campi_raggruppamento) && (doc_out[r].get_char("LVTYPE") == lavtype))
|
||||
break;
|
||||
}
|
||||
if (r<=0)
|
||||
{
|
||||
TRiga_documento& row=doc_out.new_row("01");
|
||||
doc_out.copy_data(row,rin);
|
||||
row.put(RDOC_TIPORIGA, "01");
|
||||
row.zero(RDOC_CODAGG1);
|
||||
row.zero(RDOC_QTA);
|
||||
row.zero(RDOC_QTAGG1);
|
||||
row.zero(RDOC_CODMAGC);
|
||||
row.put("LVTYPE",lavtype);
|
||||
r=row.get_int(RDOC_NRIGA);
|
||||
|
||||
}
|
||||
|
||||
return doc_out[r];
|
||||
@ -293,9 +310,6 @@ void TFatturazione_lavanderie::create_row(TDocumento& doc_out, const TRiga_docum
|
||||
const int tipoprezzo=ini_get_int(CONFIG_DITTA, "lv", "TipoPr");
|
||||
real prezzo=rin.get_real(RDOC_PREZZO);
|
||||
|
||||
if (contr.get_bool(LVCONDV_FATTSOSP))
|
||||
return;
|
||||
|
||||
if (tipoprezzo == 0)
|
||||
{
|
||||
if (rcont.empty())
|
||||
@ -366,6 +380,7 @@ bool TFatturazione_lavanderie::elabora(TLista_documenti& doc_in, TLista_document
|
||||
const TDate& data_elab, bool interattivo)
|
||||
{
|
||||
_data_elab = data_elab;
|
||||
campi_raggruppamento_righe(_campi_raggruppamento);
|
||||
return TFatturazione_bolle::elabora(doc_in, doc_out, data_elab, interattivo);
|
||||
}
|
||||
|
||||
@ -486,8 +501,8 @@ void TFatturazione_lav_app::main_loop()
|
||||
indsped = recset.get(DOC_CODINDSP).as_int();
|
||||
TLaundry_contract contr(clifo, indsped, datafat);
|
||||
const int contrper = contr.get_int(LVCONDV_PERFAT);
|
||||
|
||||
if (contrper <= period)
|
||||
|
||||
if (!contr.get_bool(LVCONDV_FATTSOSP) && contrper <= period)
|
||||
docsin.add(new TDocumento(recset.cursor()->curr()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user