Patch level :10.0 256
Files correlati :lv2.exe Ricompilazione Demo : [ ] Commento Primo commit della fatturazioine git-svn-id: svn://10.65.10.50/trunk@18488 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
95ebb9bf7e
commit
cadf5145fb
@ -59,6 +59,7 @@
|
|||||||
#define F_GESTSACA 241
|
#define F_GESTSACA 241
|
||||||
#define F_ALMANAC 242
|
#define F_ALMANAC 242
|
||||||
#define F_USEINDSP 243
|
#define F_USEINDSP 243
|
||||||
|
#define F_VALFIX 244
|
||||||
|
|
||||||
#define S_CODNUM_RIT 101
|
#define S_CODNUM_RIT 101
|
||||||
#define S_TIPODOC_RIT 102
|
#define S_TIPODOC_RIT 102
|
||||||
|
@ -517,7 +517,7 @@ BEGIN
|
|||||||
FIELD PathLavacontinua
|
FIELD PathLavacontinua
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 5
|
GROUPBOX DLG_NULL 78 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 12 "@bOpzioni documenti"
|
PROMPT 1 12 "@bOpzioni documenti"
|
||||||
END
|
END
|
||||||
@ -552,32 +552,38 @@ BEGIN
|
|||||||
FIELD Perarr
|
FIELD Perarr
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER F_VALFIX 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 16 "Codice per forfait a valore fisso "
|
||||||
|
FIELD Valfix
|
||||||
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 4
|
GROUPBOX DLG_NULL 78 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 17 "@bOpzioni articoli"
|
PROMPT 1 18 "@bOpzioni articoli"
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_RIFOR
|
BOOLEAN F_RIFOR
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 18 "Rigo forfait"
|
PROMPT 2 19 "Rigo forfait"
|
||||||
FIELD Rifor
|
FIELD Rifor
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_ARTCANFIS
|
BOOLEAN F_ARTCANFIS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 30 18 "Articolo a canone fisso"
|
PROMPT 30 19 "Articolo a canone fisso"
|
||||||
FIELD Artcanfis
|
FIELD Artcanfis
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_GESTSACA
|
BOOLEAN F_GESTSACA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 19 "Gestione sacchi/carrello"
|
PROMPT 2 20 "Gestione sacchi/carrello"
|
||||||
FIELD Gestsaca
|
FIELD Gestsaca
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_USEINDSP
|
BOOLEAN F_USEINDSP
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 30 19 "Utilizza indirizzo di spedizione su contratto"
|
PROMPT 30 20 "Utilizza indirizzo di spedizione su contratto"
|
||||||
FIELD Useindsp
|
FIELD Useindsp
|
||||||
END
|
END
|
||||||
|
|
||||||
|
1
lv/lv2.h
1
lv/lv2.h
@ -5,6 +5,7 @@ int lv2100(int argc, char* argv[]);
|
|||||||
int lv2200(int argc, char* argv[]);
|
int lv2200(int argc, char* argv[]);
|
||||||
int lv2300(int argc, char* argv[]);//Stampa Giri -2
|
int lv2300(int argc, char* argv[]);//Stampa Giri -2
|
||||||
int lv2400(int argc, char* argv[]);
|
int lv2400(int argc, char* argv[]);
|
||||||
|
int lv2500(int argc, char* argv[]);//Fatturazione
|
||||||
int lv2600(int argc, char* argv[]);
|
int lv2600(int argc, char* argv[]);
|
||||||
int lv2700(int argc, char* argv[]);//Riepilogo Bolle di Lavanderie -6
|
int lv2700(int argc, char* argv[]);//Riepilogo Bolle di Lavanderie -6
|
||||||
int lv2800(int argc, char* argv[]);//Venduto Per Cliente nei 12 Mesi -7
|
int lv2800(int argc, char* argv[]);//Venduto Per Cliente nei 12 Mesi -7
|
||||||
|
298
lv/lv2500.cpp
Executable file
298
lv/lv2500.cpp
Executable file
@ -0,0 +1,298 @@
|
|||||||
|
#include <applicat.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <recarray.h>
|
||||||
|
#include "../ve/ve6200.h"
|
||||||
|
#include "../ve/ve6200a.h"
|
||||||
|
#include <doc.h>
|
||||||
|
#include "lvlib.h"
|
||||||
|
#include "lvcondv.h"
|
||||||
|
#include "lvrcondv.h"
|
||||||
|
#include "lv2500a.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TFatturazione_lavanderie
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TFatturazione_lavanderie:public TFatturazione_bolle
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual void add_rows(TRiga_documento & rout, TRiga_documento & rin);
|
||||||
|
virtual void create_row(TDocumento& doc_out, const TRiga_documento & rin);
|
||||||
|
// void fat_lav(TRiga_documento & rin, int& qta, real& prezzo);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TFatturazione_lavanderie(const char* cod);
|
||||||
|
virtual bool elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
|
||||||
|
const TDate& data_elab, bool interattivo = false);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
TFatturazione_lavanderie::TFatturazione_lavanderie(const char* cod)
|
||||||
|
: TFatturazione_bolle(cod)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* void TFatturazione_lavanderie::fat_lav_pre(TRiga_documento & rin, int& qta)
|
||||||
|
{
|
||||||
|
const TString80 codart=rin.get(RDOC_CODART);
|
||||||
|
const long clifo=rin.get_long(RDOC_CLIFO);
|
||||||
|
const int indsped=rin.get_int(RDOC_CODINDSP);
|
||||||
|
|
||||||
|
const TRectype& cau = cache().get("&CAU", causale);
|
||||||
|
//movimento o meno la dotazione temporanea/odierna a seconda di cosa prevede la causale
|
||||||
|
int sgn_con = 0;
|
||||||
|
if (cau.get_bool("B0"))
|
||||||
|
{
|
||||||
|
const TCausale_magazzino& rit = cached_causale_magazzino(cau.get("S1"));
|
||||||
|
if (codmagcoll.blank() && rit.has_default_mag())
|
||||||
|
{
|
||||||
|
codmagcoll = rit.default_mag();
|
||||||
|
coddepcoll = rit.default_dep();
|
||||||
|
}
|
||||||
|
sgn_rit = rit.sgn(s_consmese);
|
||||||
|
}
|
||||||
|
if (cau.get_bool("B1"))
|
||||||
|
{
|
||||||
|
const TCausale_magazzino& con = cached_causale_magazzino(cau.get("S2"));
|
||||||
|
if (codmag.blank() && con.has_default_mag())
|
||||||
|
{
|
||||||
|
codmag = con.default_mag();
|
||||||
|
coddep = con.default_dep();
|
||||||
|
}
|
||||||
|
sgn_con = con.sgn(s_consmese);
|
||||||
|
}
|
||||||
|
|
||||||
|
TFatturazione_msk msk;
|
||||||
|
TDate datafat=msk.get_date(F_DATAFAT);
|
||||||
|
|
||||||
|
TLaundry_contract contr(clifo,indsped,datafat);
|
||||||
|
const TRectype & rcont=contr.row(codart);
|
||||||
|
|
||||||
|
const TString4 tipodot=rcont.get(LVRCONDV_NOLCIC);
|
||||||
|
const TString4 artcli=rcont.get(LVRCONDV_VCARTCLI);
|
||||||
|
const real dot;
|
||||||
|
|
||||||
|
TArticolo_lavanderie artlav(codart,'C',clifo,indsped);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TFatturazione_lavanderie::fat_lav_post(TRiga_documento & rin, t& qta)
|
||||||
|
{
|
||||||
|
const TString80 codart=rin.get(RDOC_CODART);
|
||||||
|
const long clifo=rin.get_long(RDOC_CLIFO);
|
||||||
|
const int indsped=rin.get_int(RDOC_CODINDSP);
|
||||||
|
|
||||||
|
TFatturazione_msk msk;
|
||||||
|
TDate datafat=msk.get_date(F_DATAFAT);
|
||||||
|
|
||||||
|
TLaundry_contract contr(clifo,indsped,datafat);
|
||||||
|
const TRectype & rcont=contr.row(codart);
|
||||||
|
|
||||||
|
const TString4 tipodot=rcont.get(LVRCONDV_NOLCIC);
|
||||||
|
const TString4 artcli=rcont.get(LVRCONDV_VCARTCLI);
|
||||||
|
const real dot;
|
||||||
|
|
||||||
|
if (tipodot=="I")
|
||||||
|
dot=artlav.get('DOTIN');
|
||||||
|
else
|
||||||
|
dot=artlav.get('DOTOD');
|
||||||
|
|
||||||
|
TArticolo_lavanderie artlav(codart,'C',clifo,indsped);
|
||||||
|
|
||||||
|
int tipoforf=rcont.get_int(LVRCONDV_TIPOFORF);
|
||||||
|
|
||||||
|
switch (tipoforf)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
qta=rin.get_int(RDOC_QTA);
|
||||||
|
prezzo=rin.get_real(RODC_PREZZO);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
qta=rin.get_int(RDOC_QTA);
|
||||||
|
prezzo=rcont.get_real(LVRCONDV_PREZZO);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
qta=1;
|
||||||
|
prezzo=rcont.get_real(LVRCONDV_IMPFISART);
|
||||||
|
// gestione in base codice per valore fisso ??? tolta la scelta dell'articolo o del cliente
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
int tipolist=contr.get_int(LVCONDV_TIPOLIST);
|
||||||
|
|
||||||
|
if (tipolist==0)
|
||||||
|
prezzo=rcont.get_real(LVRCONDV_PREZZO);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TString query;
|
||||||
|
query << "USE UMART KEY 2 \n"
|
||||||
|
<< "FROM " << "CODART=#CODART UM=#UM \n"
|
||||||
|
<< "TO " << "TCODART=#CODART UM=#UM \n";
|
||||||
|
|
||||||
|
TISAM_recordset recset(query);
|
||||||
|
recset.set_var("#CODART",clifo);
|
||||||
|
recset.set_var("#UM",rcont.get(LVRCONDV_UM));
|
||||||
|
|
||||||
|
prezzo=recset.get(UMART_PREZZO).as_real();
|
||||||
|
}
|
||||||
|
|
||||||
|
qta=dot;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
prezzo=rcont.get_real(LVRCONDV_PREZZO);
|
||||||
|
|
||||||
|
const real mincic=rcont.get_real(LVRCONDV_MINCIC);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
prezzo=rcont.get_real(LVRCONDV_VALCONV);
|
||||||
|
|
||||||
|
qta=dot*prezzo;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
{
|
||||||
|
prezzo=rcont.get_real(LVRCONDV_VALCONV);
|
||||||
|
|
||||||
|
qta=dot*;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} */
|
||||||
|
|
||||||
|
void TFatturazione_lavanderie::add_rows(TRiga_documento & rout, TRiga_documento & rin)
|
||||||
|
{
|
||||||
|
rout.add(RDOC_QTA, rin.get_real(RDOC_QTA));
|
||||||
|
}
|
||||||
|
|
||||||
|
void TFatturazione_lavanderie::create_row(TDocumento& doc_out, const TRiga_documento & rin)
|
||||||
|
{
|
||||||
|
TFatturazione_bolle::create_row(doc_out, rin);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TFatturazione_lavanderie::elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
|
||||||
|
const TDate& data_elab, bool interattivo)
|
||||||
|
{
|
||||||
|
bool ok=TFatturazione_bolle::elabora(doc_in, doc_out, data_elab, interattivo);
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TFatturazione_msk
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
class TFatturazione_msk: public TAutomask
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual bool on_field_event(TOperable_field& o,TField_event e,long jolly){return true;}
|
||||||
|
public:
|
||||||
|
TFatturazione_msk();
|
||||||
|
};
|
||||||
|
|
||||||
|
TFatturazione_msk::TFatturazione_msk():TAutomask("lv2500a")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TFatturazione_lav_app
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TFatturazione_lav_app: public TSkeleton_application
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual void main_loop();
|
||||||
|
};
|
||||||
|
|
||||||
|
void TFatturazione_lav_app::main_loop()
|
||||||
|
{
|
||||||
|
TFatturazione_msk msk;
|
||||||
|
while (msk.run()!=K_QUIT)
|
||||||
|
{
|
||||||
|
TString query;
|
||||||
|
query << "USE DOC KEY 2 SELECT BETWEEN(DATADOC,#DADATA,#ADATA)\n"
|
||||||
|
<< "FROM " << "TIPOCF=C PROVV=D ANNO=#ANNO DATADOC=#DADATA \n"
|
||||||
|
<< "TO " << "TIPOCF=C PROVV=D ANNO=#ANNO DATADOC=#ADATA \n";
|
||||||
|
|
||||||
|
TISAM_recordset recset(query);
|
||||||
|
recset.set_var("#DADATA",msk.get_date(F_DADATA));
|
||||||
|
recset.set_var("#ADATA",msk.get_date(F_ADATA));
|
||||||
|
recset.set_var("#ANNO",long(msk.get_date(F_ADATA).year()));
|
||||||
|
|
||||||
|
TFatturazione_lavanderie elab(msk.get(F_CODICE_ELAB));
|
||||||
|
TLista_documenti docsin;
|
||||||
|
TLista_documenti docsout;
|
||||||
|
long lastcli=0;
|
||||||
|
const int period=msk.get_int(F_PERFAT);
|
||||||
|
const TDate datafat=msk.get_date(F_DATAFAT);
|
||||||
|
long indsped;
|
||||||
|
|
||||||
|
|
||||||
|
for (bool ok=recset.move_first(); ok; ok=recset.move_next())
|
||||||
|
{
|
||||||
|
const long clifo=recset.get(DOC_CODCF).as_int();
|
||||||
|
|
||||||
|
if (clifo!=lastcli)
|
||||||
|
{
|
||||||
|
if (docsin.items()!=0)
|
||||||
|
{
|
||||||
|
elab.elabora(docsin,docsout,datafat);
|
||||||
|
docsout.write();
|
||||||
|
docsout.destroy(-1) ;
|
||||||
|
docsin.rewrite();
|
||||||
|
docsin.destroy(-1);
|
||||||
|
// gestire qui salvataggio fatture
|
||||||
|
}
|
||||||
|
lastcli=clifo;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elab.is_document_ok(recset.cursor()->curr()))
|
||||||
|
{
|
||||||
|
indsped=recset.get(DOC_CODINDSP).as_int();
|
||||||
|
TLaundry_contract contr(clifo,indsped,datafat);
|
||||||
|
int contrper=contr.get_int(LVCONDV_PERFATT);
|
||||||
|
|
||||||
|
if (contrper<=period)
|
||||||
|
{
|
||||||
|
docsin.add(new TDocumento(recset.cursor()->curr()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (docsin.items()!=0)
|
||||||
|
{
|
||||||
|
elab.elabora(docsin,docsout,datafat);
|
||||||
|
docsout.write();
|
||||||
|
docsout.destroy(-1);
|
||||||
|
docsin.rewrite();
|
||||||
|
docsin.destroy(-1);
|
||||||
|
// gestire qui salvataggio fatture
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int lv2500(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
TFatturazione_lav_app a;
|
||||||
|
a.run (argc, argv, "Fatturazione lavanderie");
|
||||||
|
return TRUE;
|
||||||
|
}
|
10
lv/lv2500a.h
Executable file
10
lv/lv2500a.h
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#define F_DADATA 101
|
||||||
|
#define F_ADATA 102
|
||||||
|
#define F_DATAFAT 103
|
||||||
|
#define F_COD_ELAB 104
|
||||||
|
#define F_DESC_ELAB 105
|
||||||
|
#define F_PERFAT 106
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
66
lv/lv2500a.uml
Executable file
66
lv/lv2500a.uml
Executable file
@ -0,0 +1,66 @@
|
|||||||
|
#include "lv2600a.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 0 0 2
|
||||||
|
#include <elabar.h>
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Fatturazione" -1 -1 40 5
|
||||||
|
|
||||||
|
DATE F_DADATA
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Fattura dal "
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_ADATA
|
||||||
|
BEGIN
|
||||||
|
PROMPT 45 1 "al "
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAFAT
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 "Data di fatturazione "
|
||||||
|
FLAGS "A"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_COD_ELAB 8
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 3 "Codice "
|
||||||
|
FLAG "U"
|
||||||
|
USE %ELD SELECT I0==2
|
||||||
|
INPUT CODTAB F_COD_ELAB
|
||||||
|
DISPLAY "Codice@8" CODTAB
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
DISPLAY "Numerazione" S5
|
||||||
|
OUTPUT F_COD_ELAB CODTAB
|
||||||
|
OUTPUT F_DESC_ELAB S0
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESC_ELAB 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Descrizione "
|
||||||
|
USE %ELD KEY 2 SELECT I0==2
|
||||||
|
INPUT S0 F_DESC_ELAB
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
DISPLAY "Codice@8" CODTAB
|
||||||
|
DISPLAY "Numerazione" S5
|
||||||
|
COPY OUTPUT F_COD_ELAB
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
RADIOBUTTON F_PERFAT 1 70
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "@bPeriodicità di fatturazione "
|
||||||
|
ITEM "0|Giornaliera"
|
||||||
|
ITEM "1|Settimanale"
|
||||||
|
ITEM "2|Quindicinale"
|
||||||
|
ITEM "3|Mensile"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user