Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Stampa cartellini Tetractis git-svn-id: svn://10.65.10.50/branches/R_10_00@22181 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
eeef219f7a
commit
3ef106f1aa
14
ps/pl1048.cpp
Executable file
14
ps/pl1048.cpp
Executable file
@ -0,0 +1,14 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include "pl1048.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int n = argc > 1 ? atoi(argv[1]+1) : 0;
|
||||
switch(n)
|
||||
{
|
||||
case 1: pl1048100(argc, argv); break; // Creazione Cartellini
|
||||
default: pl1048100(argc, argv); break; // Creazione Cartellini
|
||||
}
|
||||
return 0;
|
||||
}
|
1
ps/pl1048.h
Executable file
1
ps/pl1048.h
Executable file
@ -0,0 +1 @@
|
||||
int pl1048100(int argc, char* argv[]); // Creazione cartellini
|
806
ps/pl1048100.cpp
Executable file
806
ps/pl1048100.cpp
Executable file
@ -0,0 +1,806 @@
|
||||
#include <applicat.h>
|
||||
#include <files.h>
|
||||
#include <prefix.h>
|
||||
#include <reprint.h>
|
||||
|
||||
#include "pl1048100a.h"
|
||||
#include "../ve/packlist.h"
|
||||
#include "../ve/velib.h"
|
||||
#include "../ve/velib07.h"
|
||||
#include "../lv/lvlib.h"
|
||||
#include "../lv/lvrcondv.h"
|
||||
|
||||
#include <utility.h>
|
||||
|
||||
// LV047
|
||||
|
||||
#define RIEMPI_C_XS "I0"
|
||||
#define RIEMPI_C_M "I1"
|
||||
#define RIEMPI_C_XL "I2"
|
||||
#define NORMALE_XS "I3"
|
||||
#define NORMALE_M "I4"
|
||||
#define NORMALE_XL "I5"
|
||||
#define RIEMPI_S_XS "I6"
|
||||
#define RIEMPI_S_M "I7"
|
||||
#define RIEMPI_S_XL "I8"
|
||||
#define PRECEDENZA "I9"
|
||||
#define TPARTICOLO "I10"
|
||||
#define DESCR_ETI "S0"
|
||||
|
||||
// LV020
|
||||
|
||||
#define TPIMBALLO "S0"
|
||||
#define RIEMPIMENTO "S1"
|
||||
#define DIMENSIONE "S2"
|
||||
#define ARTSEP "B0"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCartellini_report
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TCartellini_report : public TDocument_report
|
||||
{
|
||||
size_t _first_msg;
|
||||
TDocument_cache _cache;
|
||||
int _contnum;
|
||||
|
||||
protected:
|
||||
virtual size_t get_usr_words(TString_array& words) const;
|
||||
virtual bool execute_usr_word(unsigned int opcode, TVariant_stack& stack);
|
||||
bool msg_cart_parent_doc(TVariant_stack& stack);
|
||||
bool msg_cart_parent_row(TVariant_stack& stack);
|
||||
bool msg_currcont(TVariant_stack& stack);
|
||||
bool msg_contnum(TVariant_stack& stack);
|
||||
|
||||
public:
|
||||
|
||||
TCartellini_report(const char * name, int contnum) : _contnum(contnum) { load(name);}
|
||||
};
|
||||
|
||||
bool TCartellini_report::msg_cart_parent_doc(TVariant_stack& stack)
|
||||
{
|
||||
TReport_field& cf = *curr_field();
|
||||
|
||||
int idx =((TISAM_recordset *)recordset())->cursor()->relation()->log2ind(LF_PACKLIST);
|
||||
|
||||
if (idx < 0)
|
||||
return false;
|
||||
|
||||
const TRectype& rec = ((TISAM_recordset*)recordset())->cursor()->relation()->file(idx).curr();
|
||||
TRectype head(LF_DOC);
|
||||
|
||||
head.put(DOC_PROVV, rec.get_char(PACKLIST_PROVV));
|
||||
head.put(DOC_ANNO, rec.get_int(PACKLIST_ANNO));
|
||||
head.put(DOC_CODNUM, rec.get(PACKLIST_CODNUM));
|
||||
head.put(DOC_NDOC, rec.get_long(PACKLIST_NDOC));
|
||||
|
||||
TDocumento & doc = _cache.doc(head);
|
||||
const TString& values = stack.pop().as_string();
|
||||
|
||||
output_values(doc, values);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TCartellini_report::msg_cart_parent_row(TVariant_stack& stack)
|
||||
{
|
||||
int idx =((TISAM_recordset *)recordset())->cursor()->relation()->log2ind(LF_PACKLIST);
|
||||
|
||||
if (idx < 0)
|
||||
return false;
|
||||
|
||||
const TRectype& rec = ((TISAM_recordset*)recordset())->cursor()->relation()->file(idx).curr();
|
||||
TRectype head(LF_DOC);
|
||||
|
||||
head.put(DOC_PROVV, rec.get_char(PACKLIST_PROVV));
|
||||
head.put(DOC_ANNO, rec.get_int(PACKLIST_ANNO));
|
||||
head.put(DOC_CODNUM, rec.get(PACKLIST_CODNUM));
|
||||
head.put(DOC_NDOC, rec.get_long(PACKLIST_NDOC));
|
||||
|
||||
TDocumento & doc = _cache.doc(head);
|
||||
const int idriga = rec.get_int(PACKLIST_IDRIGA);
|
||||
|
||||
int nrows = doc.physical_rows();
|
||||
for (int r = 1; r <= nrows; r++)
|
||||
if (doc[r].get_int(RDOC_IDRIGA) == idriga)
|
||||
{
|
||||
const TString& values = stack.pop().as_string();
|
||||
|
||||
output_values(doc[r], values);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TCartellini_report::msg_currcont(TVariant_stack& stack)
|
||||
{
|
||||
int idx =((TISAM_recordset *)recordset())->cursor()->relation()->log2ind(LF_PACKLIST);
|
||||
|
||||
if (idx < 0)
|
||||
return false;
|
||||
|
||||
const TRectype& rec = ((TISAM_recordset*)recordset())->cursor()->relation()->file(idx).curr();
|
||||
|
||||
curr_field()->set(rec.get(PACKLIST_CODICE).sright(4));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TCartellini_report::msg_contnum(TVariant_stack& stack)
|
||||
{
|
||||
curr_field()->set(format("%d", _contnum));
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t TCartellini_report::get_usr_words(TString_array& words) const
|
||||
{
|
||||
TReport::get_usr_words(words);
|
||||
|
||||
const char* const name[] = { "CART_PARENT_DOC", "CART_PARENT_ROW", "CURRCONT", "CONTNUM", NULL };
|
||||
|
||||
((TCartellini_report*)this)->_first_msg = words.items(); // Calcola il primo numero disponibile
|
||||
for (size_t i = 0; name[i] != NULL; i++)
|
||||
words.add(name[i]);
|
||||
|
||||
return words.items();
|
||||
}
|
||||
|
||||
bool TCartellini_report::execute_usr_word(unsigned int opcode, TVariant_stack& stack)
|
||||
{
|
||||
if (opcode < _first_msg)
|
||||
return TReport::execute_usr_word(opcode, stack);
|
||||
opcode -= _first_msg;
|
||||
switch (opcode)
|
||||
{
|
||||
case 0 : msg_parent_doc(stack); break;
|
||||
case 1 : msg_parent_row(stack); break;
|
||||
case 2 : msg_currcont(stack); break;
|
||||
case 3 : msg_contnum(stack); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
while (!stack.pop().is_null()); // Svuota eventuali parametri variabili inutilizzati
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCartellini_report
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TCarrello : public TRecord_array
|
||||
{
|
||||
real _perc;
|
||||
public:
|
||||
const real perc() const {return _perc;}
|
||||
real & perc() { return _perc;}
|
||||
|
||||
TCarrello(const char * key) : TRecord_array(key, LF_PACKLIST) {}
|
||||
};
|
||||
|
||||
static TLaundry_contract * __contract = NULL;
|
||||
|
||||
class TPrecedenza : public TObject
|
||||
{
|
||||
int _tipoart;
|
||||
int _prec;
|
||||
TString _codart;
|
||||
int _anno;
|
||||
char _provv;
|
||||
TString4 _codnum;
|
||||
long _ndoc;
|
||||
int _idriga;
|
||||
int _nrow;
|
||||
real _qta;
|
||||
real _pacchi;
|
||||
char _tipocf;
|
||||
long _codcf;
|
||||
|
||||
protected:
|
||||
public:
|
||||
const int tipoart() const { return _tipoart; }
|
||||
const int prec() const { return _prec; }
|
||||
const TString & codart() const { return _codart; }
|
||||
const int anno() const { return _anno; }
|
||||
const char provv() const { return _provv; }
|
||||
const TString & codnum() const { return _codnum; }
|
||||
const long ndoc() const { return _ndoc; }
|
||||
const int idriga() const { return _idriga; }
|
||||
const int nrow() const { return _nrow; }
|
||||
const real qta() const { return _qta; }
|
||||
const real pacchi() const { return _pacchi; }
|
||||
real & qta() { return _qta; }
|
||||
real & pacchi() { return _pacchi; }
|
||||
const char tipocf() const { return _tipocf; }
|
||||
const long codcf() const { return _codcf; }
|
||||
const char * key_carrello(int num)const ;
|
||||
real get_qta_max() const;
|
||||
real get_pacchi_max() const;
|
||||
real get_qta_nor() const;
|
||||
real get_pacchi_nor() const;
|
||||
const TString & tipo_contenitore() const;
|
||||
const TString & dimensione() const;
|
||||
const char * contr_field_max() const;
|
||||
const char * field_max() const;
|
||||
const char * contr_field_nor() const;
|
||||
const char * field_nor() const;
|
||||
void prec2rec(TRectype & rec) const;
|
||||
|
||||
virtual void print_on(ostream& out) const;
|
||||
|
||||
TPrecedenza(const char * codart, int anno, char provv, const char * codnum, long ndoc, int idriga, int nrow, real & qta, real & pacchi, char tipocf, long codcf);
|
||||
};
|
||||
|
||||
const char * TPrecedenza::key_carrello(int num) const
|
||||
{
|
||||
TString & key = get_tmp_string(25);
|
||||
|
||||
key.format("%s|%c%04d%-4s%-6ld%04d", (const char *) tipo_contenitore(), _provv, _anno, _codnum, _ndoc, num);
|
||||
return key;
|
||||
}
|
||||
|
||||
TPrecedenza::TPrecedenza(const char * codart, int anno, char provv, const char * codnum, long ndoc, int idriga, int nrow, real & qta, real & pacchi, char tipocf, long codcf) :
|
||||
_codart(codart), _anno(anno), _provv(provv), _codnum(codnum), _ndoc(ndoc), _idriga(idriga), _nrow(nrow), _qta(qta), _pacchi(pacchi), _tipocf(tipocf), _codcf(codcf)
|
||||
{
|
||||
TString key; key << tipocf << codcf; // verificare
|
||||
const bool separa_articoli = cache().get("&LV020", key).get_bool(ARTSEP);
|
||||
|
||||
_tipoart = separa_articoli ? atoi(cache().get("&LV047", codart, TPARTICOLO)) : 0;
|
||||
if (__contract = NULL)
|
||||
{
|
||||
TString key; key.format("%c|%d|%S|%ld", _provv, _anno, _codnum, _ndoc);
|
||||
__contract = new TLaundry_contract(_codcf, 0, TDate(cache().get(LF_DOC, key, DOC_DATADOC)));
|
||||
}
|
||||
const TRectype & rec = __contract->row(_codart);
|
||||
|
||||
_prec = 0;
|
||||
_prec = rec.get_int(LVRCONDV_PRECEDENZA);
|
||||
if (_prec == 0)
|
||||
_prec = atoi(cache().get("&LV047", _codart, PRECEDENZA));
|
||||
}
|
||||
|
||||
const char * TPrecedenza::contr_field_max() const
|
||||
{
|
||||
const TString & dim = dimensione();
|
||||
|
||||
if (dim == "XS")
|
||||
return LVRCONDV_QTAMAXXS;
|
||||
else
|
||||
if (dim == "M")
|
||||
return LVRCONDV_QTAMAXM;
|
||||
else
|
||||
if (dim == "XL")
|
||||
return LVRCONDV_QTAMAXXL;
|
||||
return LVRCONDV_QTAMAXXS;
|
||||
}
|
||||
|
||||
const char * TPrecedenza::field_max() const
|
||||
{
|
||||
const TString4 tipo = tipo_contenitore();
|
||||
const TString & dim = dimensione();
|
||||
|
||||
if (tipo == "C")
|
||||
{
|
||||
if (dim == "XS")
|
||||
return RIEMPI_C_XS;
|
||||
else
|
||||
if (dim == "M")
|
||||
return RIEMPI_C_M;
|
||||
else
|
||||
if (dim == "XL")
|
||||
return RIEMPI_C_XL;
|
||||
return RIEMPI_C_XS;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dim == "XS")
|
||||
return RIEMPI_S_XS;
|
||||
else
|
||||
if (dim == "M")
|
||||
return RIEMPI_S_M;
|
||||
else
|
||||
if (dim == "XL")
|
||||
return RIEMPI_S_XL;
|
||||
}
|
||||
return RIEMPI_S_XS;
|
||||
}
|
||||
|
||||
const char * TPrecedenza::contr_field_nor() const
|
||||
{
|
||||
const TString & dim = dimensione();
|
||||
if (dim == "XS")
|
||||
return LVRCONDV_QTANORMXS;
|
||||
else
|
||||
if (dim == "M")
|
||||
return LVRCONDV_QTANORMM;
|
||||
else
|
||||
if (dim == "XL")
|
||||
return LVRCONDV_QTANORMXL;
|
||||
return LVRCONDV_QTANORMXS;
|
||||
}
|
||||
|
||||
const char * TPrecedenza::field_nor() const
|
||||
{
|
||||
const TString4 tipo = tipo_contenitore();
|
||||
const TString & dim = dimensione();
|
||||
|
||||
if (tipo == "C")
|
||||
{
|
||||
if (dim == "XS")
|
||||
return NORMALE_XS;
|
||||
else
|
||||
if (dim == "M")
|
||||
return NORMALE_M;
|
||||
else
|
||||
if (dim == "XL")
|
||||
return NORMALE_XL;
|
||||
return NORMALE_XS;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dim == "XS")
|
||||
return RIEMPI_S_XS;
|
||||
else
|
||||
if (dim == "M")
|
||||
return RIEMPI_S_M;
|
||||
else
|
||||
if (dim == "XL")
|
||||
return RIEMPI_S_XL;
|
||||
}
|
||||
return RIEMPI_S_XS;
|
||||
}
|
||||
|
||||
real TPrecedenza::get_qta_max() const
|
||||
{
|
||||
const TRectype & rec = __contract->row(_codart);
|
||||
real qta;
|
||||
|
||||
qta = rec.get_int(contr_field_max());
|
||||
if (qta == 0)
|
||||
qta = real(cache().get("&LV047", _codart, field_max()));
|
||||
return qta;
|
||||
}
|
||||
|
||||
real TPrecedenza::get_pacchi_max() const
|
||||
{
|
||||
real pacchi = get_qta_max();
|
||||
real pppacco = cached_article(_codart).get(ANAMAG_PPCONF);
|
||||
|
||||
if (pppacco > 0)
|
||||
pacchi /= pppacco;
|
||||
pppacco.floor();
|
||||
return pacchi;
|
||||
}
|
||||
|
||||
real TPrecedenza::get_qta_nor() const
|
||||
{
|
||||
const TRectype & rec = __contract->row(_codart);
|
||||
real qta;
|
||||
|
||||
qta = rec.get_int(contr_field_nor());
|
||||
if (qta == 0)
|
||||
qta = real(cache().get("&LV047", _codart, field_nor()));
|
||||
return qta;
|
||||
}
|
||||
|
||||
real TPrecedenza::get_pacchi_nor() const
|
||||
{
|
||||
real pacchi = get_qta_nor();
|
||||
real pppacco = cached_article(_codart).get(ANAMAG_PPCONF);
|
||||
|
||||
if (pppacco > 0)
|
||||
pacchi /= pppacco;
|
||||
pppacco.floor();
|
||||
return pacchi;
|
||||
}
|
||||
|
||||
const TString & TPrecedenza::tipo_contenitore() const
|
||||
{
|
||||
TString key; key << _tipocf << _codcf; // verificare
|
||||
|
||||
return cache().get("&LV020", key, TPIMBALLO);
|
||||
}
|
||||
|
||||
const TString & TPrecedenza::dimensione() const
|
||||
{
|
||||
TString key; key << _tipocf << _codcf; // verificare
|
||||
|
||||
return cache().get("&LV020", key, DIMENSIONE);
|
||||
}
|
||||
|
||||
void TPrecedenza::prec2rec(TRectype & rec) const
|
||||
{
|
||||
|
||||
TToken_string key;
|
||||
|
||||
rec.put(PACKLIST_DATA, TDate(TODAY));
|
||||
rec.put(PACKLIST_CODART, _codart);
|
||||
rec.put(PACKLIST_TIPOCF, _tipocf);
|
||||
rec.put(PACKLIST_CODCF, _codcf);
|
||||
rec.put(PACKLIST_CODNUM, _codnum);
|
||||
rec.put(PACKLIST_ANNO, _anno);
|
||||
rec.put(PACKLIST_PROVV, _provv);
|
||||
rec.put(PACKLIST_NDOC, _ndoc);
|
||||
rec.put(PACKLIST_IDRIGA, _idriga);
|
||||
rec.put(PACKLIST_NRIGADOC, _nrow);
|
||||
}
|
||||
|
||||
void TPrecedenza::print_on(ostream& out) const
|
||||
{
|
||||
out << _tipoart << _prec << ';' << _codart << ';' << _anno << ';' << _provv << ';' << _codnum << ';' << _ndoc << ';' << _idriga << ';' << _nrow << ';' << _qta << ';' << _pacchi << ';' << _tipocf << ';' << _codcf;
|
||||
}
|
||||
|
||||
int sort_prec(const TObject** o1, const TObject** o2)
|
||||
{
|
||||
const TPrecedenza & p1 = (const TPrecedenza &) **o1;
|
||||
const TPrecedenza & p2 = (const TPrecedenza &) **o2;
|
||||
|
||||
if (p1.tipoart() != p2.tipoart())
|
||||
return p1.tipoart() - p2.tipoart();
|
||||
if (p1.prec() != p2.prec())
|
||||
return p1.prec() - p2.prec();
|
||||
return strcmp(p1.codart(), p2.codart());
|
||||
}
|
||||
class TCrea_cartellini : public TSkeleton_application
|
||||
{
|
||||
TDocumento * _doc;
|
||||
int _contnum;
|
||||
|
||||
private:
|
||||
|
||||
protected:
|
||||
const TDocumento & doc() const { return *_doc;}
|
||||
virtual void main_loop();
|
||||
void crea_precedenze(ofstream & outfile, TArray & precs);
|
||||
void crea_carrelli(TArray & precs);
|
||||
void riempi_max(TArray & carrelli, TArray & precs);
|
||||
void resto_max(TArray & carrelli, TArray & precs);
|
||||
void riempi_normale(TArray & carrelli, TArray & precs, int level);
|
||||
void riempi_resti(TArray & carrelli, TArray & precs);
|
||||
|
||||
public:
|
||||
void ottimizza(const char * dir);
|
||||
void stampa();
|
||||
bool set_params();
|
||||
bool set_params(const TMask & m);
|
||||
};
|
||||
|
||||
void TCrea_cartellini::crea_precedenze(ofstream & outfile, TArray & precs)
|
||||
{
|
||||
const TDocumento & d = doc();
|
||||
const int rows = d.physical_rows();
|
||||
const char provv = d.get_char(DOC_PROVV);
|
||||
const int anno = d.get_int(DOC_ANNO);
|
||||
const char tipocf = d.get_char(DOC_TIPOCF);
|
||||
const long codcf = d.get_long(DOC_CODCF);
|
||||
const TString4 codnum = d.get(DOC_CODNUM);
|
||||
const long ndoc = d.get_long(DOC_NDOC);
|
||||
|
||||
for(int r = 1; r <= rows; r++)
|
||||
{
|
||||
const TRiga_documento row = d[r];
|
||||
real qta = row.get_real(RDOC_QTA); qta.floor();
|
||||
const TString codart = row.get(RDOC_CODART);
|
||||
const TString caus = row.get(RDOC_CODAGG1);
|
||||
real pacchi = qta; // se non
|
||||
real pppacco = cached_article(codart).get(ANAMAG_PPCONF);
|
||||
|
||||
if (pppacco > 0)
|
||||
pacchi /= pppacco;
|
||||
pppacco.floor();
|
||||
int nrow = row.get_int(RDOC_NRIGA);
|
||||
int idriga = row.get_int(RDOC_IDRIGA);
|
||||
|
||||
precs.add(new TPrecedenza(codart, anno, provv, codnum, ndoc, idriga, nrow, qta, pacchi, tipocf, codcf));
|
||||
}
|
||||
|
||||
precs.sort();
|
||||
const int prec_nrows = precs.items();
|
||||
|
||||
outfile << "Precedenze\nPrecedenza;Articolo;Anno;;Numerazione;Numero;ID Riga;Numero riga;Quantità;Pacchi;Cliente";
|
||||
for (int r = 1; r <= prec_nrows; r++)
|
||||
outfile << precs[r] << '\n';
|
||||
}
|
||||
|
||||
void TCrea_cartellini::riempi_max(TArray & carrelli, TArray & precs)
|
||||
{
|
||||
const int items = precs.items();
|
||||
|
||||
for(int r = 1; r <= items; r++)
|
||||
{
|
||||
TPrecedenza & p = (TPrecedenza &) precs[r];
|
||||
const real max_qta = p.get_qta_max();
|
||||
const real max_pacchi = p.get_pacchi_max();
|
||||
|
||||
while (p.pacchi() > max_pacchi)
|
||||
{
|
||||
TCarrello * c = new TCarrello(p.key_carrello(carrelli.items() + 1));
|
||||
|
||||
carrelli.add(c);
|
||||
|
||||
TRectype & rec = c->row(c->rows() + 1, true);
|
||||
|
||||
p.prec2rec(rec);
|
||||
rec.put(PACKLIST_QTA, max_qta);
|
||||
rec.put(PACKLIST_CONF, max_pacchi);
|
||||
c->perc() = UNO;
|
||||
p.qta() -= max_qta;
|
||||
p.pacchi() -= max_pacchi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TCrea_cartellini::resto_max(TArray & carrelli, TArray & precs)
|
||||
{
|
||||
const int items = precs.items();
|
||||
|
||||
for(int r = 1; r <= items; r++)
|
||||
{
|
||||
TPrecedenza &p = (TPrecedenza &) precs[r];
|
||||
|
||||
if (p.pacchi() > ZERO)
|
||||
{
|
||||
TCarrello * c = (TCarrello *)carrelli.objptr(carrelli.items());
|
||||
const real max_qta = p.get_qta_max();
|
||||
const real max_pacchi = p.get_qta_max();
|
||||
real perc = p.pacchi() / max_pacchi;
|
||||
|
||||
perc.round(4);
|
||||
if (c == NULL || c->perc() + perc > UNO)
|
||||
{
|
||||
c = new TCarrello(p.key_carrello(carrelli.items() + 1));
|
||||
carrelli.add(c);
|
||||
}
|
||||
|
||||
TRectype & rec = c->row(c->rows() + 1, true);
|
||||
|
||||
p.prec2rec(rec);
|
||||
rec.put(PACKLIST_QTA, p.qta());
|
||||
rec.put(PACKLIST_CONF, p.pacchi());
|
||||
c->perc() += perc;
|
||||
p.qta() = ZERO;
|
||||
p.pacchi() = ZERO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TCrea_cartellini::riempi_normale(TArray & carrelli, TArray & precs, int level)
|
||||
{
|
||||
const int items = precs.items();
|
||||
|
||||
for(int r = 1; r <= items; r++)
|
||||
{
|
||||
TPrecedenza & p = (TPrecedenza &) precs[r];
|
||||
if (p.prec() <= level)
|
||||
{
|
||||
const real qta = p.get_qta_nor();
|
||||
const real pacchi = p.get_pacchi_nor();
|
||||
const real max_pacchi = p.get_pacchi_max();
|
||||
real perc = p.pacchi() / max_pacchi;
|
||||
|
||||
perc.round(4);
|
||||
|
||||
while (p.pacchi() > pacchi)
|
||||
{
|
||||
TCarrello * c = new TCarrello(p.key_carrello(carrelli.items() + 1));
|
||||
|
||||
carrelli.add(c);
|
||||
|
||||
TRectype & rec = c->row(c->rows() + 1, true);
|
||||
|
||||
p.prec2rec(rec);
|
||||
rec.put(PACKLIST_QTA, qta);
|
||||
rec.put(PACKLIST_CONF, pacchi);
|
||||
c->perc() = perc;
|
||||
p.qta() -= qta;
|
||||
p.pacchi() -= pacchi;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TCrea_cartellini::riempi_resti(TArray & carrelli, TArray & precs)
|
||||
{
|
||||
const int items = precs.items();
|
||||
|
||||
for(int r = 1; r <= items; r++)
|
||||
{
|
||||
TPrecedenza &p = (TPrecedenza &) precs[r];
|
||||
|
||||
if (p.pacchi() > ZERO)
|
||||
{
|
||||
TCarrello * c = (TCarrello *) carrelli.objptr(carrelli.items());
|
||||
const real max_qta = p.get_qta_max();
|
||||
const real max_pacchi = p.get_qta_max();
|
||||
real qta = p.qta();
|
||||
real pacchi = p.pacchi();
|
||||
real perc = pacchi / max_pacchi;
|
||||
|
||||
perc.round(4);
|
||||
if (c == NULL)
|
||||
{
|
||||
c = new TCarrello(p.key_carrello(carrelli.items() + 1));
|
||||
carrelli.add(c);
|
||||
}
|
||||
if (c->perc() + perc > UNO)
|
||||
{
|
||||
real pppacco = cached_article(p.codart()).get(ANAMAG_PPCONF);
|
||||
real perc = UNO - c->perc();
|
||||
|
||||
pacchi = perc * max_pacchi;
|
||||
pacchi.floor();
|
||||
perc = pacchi / max_pacchi;
|
||||
if (pppacco == 0)
|
||||
pppacco = 1;
|
||||
qta = pacchi * pppacco;
|
||||
}
|
||||
|
||||
TRectype & rec = c->row(c->rows() + 1, true);
|
||||
|
||||
p.prec2rec(rec);
|
||||
rec.put(PACKLIST_QTA, qta);
|
||||
rec.put(PACKLIST_CONF, pacchi);
|
||||
c->perc() += perc;
|
||||
p.qta() -= qta;
|
||||
p.pacchi() -= pacchi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TCrea_cartellini::crea_carrelli(TArray & precs)
|
||||
{
|
||||
TString key; key << doc().get(DOC_TIPOCF) << doc().get_long(DOC_CODCF); // verificare
|
||||
const bool cli_max = cache().get("&LV020", key, RIEMPIMENTO) == "A";
|
||||
TArray carrelli;
|
||||
|
||||
if (cli_max)
|
||||
{
|
||||
riempi_max(carrelli, precs);
|
||||
resto_max(carrelli, precs);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int pr = 1; pr < 10; pr++)
|
||||
riempi_normale(carrelli, precs, pr);
|
||||
riempi_resti(carrelli, precs);
|
||||
}
|
||||
|
||||
for (int c = 0; c < carrelli.items(); c++)
|
||||
{
|
||||
TCarrello & carrello = (TCarrello &) carrelli[c];
|
||||
|
||||
carrello.write(true);
|
||||
}
|
||||
|
||||
for (int c = carrelli.items() + 1 ; ; c++)
|
||||
{
|
||||
TCarrello carrello(((TPrecedenza &) precs[0]).key_carrello(c));
|
||||
|
||||
|
||||
if (carrello.read(carrello.key()) == NOERR)
|
||||
{
|
||||
if (carrello.rows() == 0)
|
||||
break;
|
||||
carrello.remove();
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
_contnum = carrelli.items();
|
||||
}
|
||||
|
||||
void TCrea_cartellini::stampa()
|
||||
{
|
||||
TCartellini_report rep("pl1048100", _contnum);
|
||||
TRecordset * pset = rep.recordset();
|
||||
if (pset != NULL)
|
||||
{
|
||||
TTrec docs(LF_DOC);
|
||||
const int nfield = docs.fields();
|
||||
|
||||
for (int i = 0; i < nfield; i++)
|
||||
{
|
||||
TToken_string fieldname(docs.fielddef(i));
|
||||
|
||||
fieldname = fieldname.get(0);
|
||||
TVariant var(_doc->get(DOC_PROVV));
|
||||
fieldname.insert("#");
|
||||
pset->set_var(fieldname, var);
|
||||
}
|
||||
}
|
||||
|
||||
TReport_book book;
|
||||
TString key; key << _doc->get(DOC_TIPOCF) << _doc->get_long(DOC_CODCF);
|
||||
|
||||
pset->set_var("#CONT", cache().get("&LV020", key, TPIMBALLO));
|
||||
for (int c = 1; c <= _contnum; c++)
|
||||
{
|
||||
pset->set_var("#KEY", format("%c%04d%-4s%-6ld%04d", _doc->get_char(DOC_PROVV), _doc->get_int(DOC_ANNO), (const char *)_doc->get(DOC_CODNUM), _doc->get_long(DOC_NDOC), c));
|
||||
|
||||
book.add(rep);
|
||||
}
|
||||
book.print_or_preview();
|
||||
}
|
||||
|
||||
void TCrea_cartellini::ottimizza(const char * dir)
|
||||
{
|
||||
TString outname;
|
||||
|
||||
outname.format("%s/bo%s%06ld.xls", dir, doc().get(RDOC_CODNUM), doc().get_long(RDOC_NDOC));
|
||||
TString_array prec_rows;
|
||||
ofstream outfile(outname);
|
||||
|
||||
crea_precedenze(outfile, prec_rows);
|
||||
crea_carrelli(prec_rows);
|
||||
}
|
||||
|
||||
bool TCrea_cartellini::set_params(const TMask & m)
|
||||
{
|
||||
const char provv = m.get(F_PROVV)[0];
|
||||
const int anno = m.get_int(F_ANNO);
|
||||
const TString4 codnum = m.get(F_CODNUM);
|
||||
const long ndoc = m.get_long(F_NDOC);
|
||||
|
||||
_doc = new TDocumento(provv, anno, codnum,ndoc);
|
||||
return _doc != NULL && _doc->physical_rows() > 0;
|
||||
}
|
||||
|
||||
bool TCrea_cartellini::set_params()
|
||||
{
|
||||
const TFixed_string arg = argv(3);
|
||||
if ((arg[0] != '-' && arg[0] != '/') || (arg[1] != 'i' && arg[1] != 'I'))
|
||||
return false;
|
||||
|
||||
TString ini_name = arg.mid(2);
|
||||
|
||||
//controlla che il file su cui deve scrivere ci sia; se non c'é dá una segnalazione di errore
|
||||
if (!fexist(ini_name))
|
||||
return false;
|
||||
|
||||
TString4 para; para.format("%d", LF_DOC);
|
||||
TConfig ini(ini_name, para);
|
||||
|
||||
const char provv = ini.get(DOC_PROVV)[0];
|
||||
const int anno = ini.get_int(DOC_ANNO);
|
||||
const TString4 codnum = ini.get(DOC_CODNUM);
|
||||
const long ndoc = ini.get_long(DOC_NDOC);
|
||||
|
||||
_doc = new TDocumento(provv, anno, codnum,ndoc);
|
||||
return _doc != NULL && _doc->physical_rows() > 0;
|
||||
}
|
||||
|
||||
void TCrea_cartellini::main_loop() //definizione della member function main_loop, della classe TCrea_cartellini
|
||||
{
|
||||
TString outdir(firm2dir(prefix().firm().codice())); // ditta
|
||||
|
||||
outdir << "/golem/ps1048";
|
||||
if (!fexist(outdir))
|
||||
make_dir(outdir);
|
||||
if (argc() <= 2)
|
||||
{
|
||||
TMask m("ps1048100a");
|
||||
|
||||
m.set(F_CODNUM, ini_get_string(CONFIG_DITTA, "ve", "NUM_GEN"));
|
||||
|
||||
while (m.run() == K_ENTER && set_params(m))
|
||||
{
|
||||
ottimizza(outdir);
|
||||
stampa();
|
||||
delete _doc;
|
||||
_doc = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (set_params())
|
||||
{
|
||||
ottimizza(outdir);
|
||||
stampa();
|
||||
}
|
||||
}
|
||||
|
||||
////// Esecuzione del programma ///////////
|
||||
|
||||
int pl1048100(int argc, char* argv[])
|
||||
{
|
||||
TCrea_cartellini app;
|
||||
app.run(argc,argv,"Generazione cartellini");
|
||||
return 0;
|
||||
}
|
258
ps/pl1048100.rep
Executable file
258
ps/pl1048100.rep
Executable file
@ -0,0 +1,258 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<report libraries="ve1300" name="pl1048100" lpi="6">
|
||||
<description>bolla standard</description>
|
||||
<font face="Courier New" size="10" />
|
||||
<section type="Head" height="26.5" pattern="1">
|
||||
<font face="Arial" size="10" />
|
||||
<field x="10" y="4.5" type="Stringa" width="2" id="9" pattern="1">
|
||||
<prescript description="H0.9 PRESCRIPT">MESSAGE _CURRCONT</prescript>
|
||||
</field>
|
||||
<field x="24" y="5" type="Stringa" width="2" id="9" pattern="1">
|
||||
<prescript>MESSAGE _CURRCONT</prescript>
|
||||
</field>
|
||||
<field x="67" y="4.5" type="Stringa" align="right" width="6.5" id="11" pattern="1">
|
||||
<font face="Arial" bold="1" size="10" />
|
||||
<source>NDOC</source>
|
||||
</field>
|
||||
<field x="14" y="0.5" type="Stringa" width="50" height="2" id="20" pattern="1">
|
||||
<font face="Arial" bold="1" size="10" />
|
||||
<source>20.RAGSOC</source>
|
||||
<prescript description="H0.20 PRESCRIPT">MESSAGE _CLIENTE,!RAGSOC</prescript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Head" level="1" pattern="1" />
|
||||
<section type="Body" pattern="1">
|
||||
<field border="1" x="2" y="1" type="Rettangolo" bg_color="#C0C0C0" width="36" height="5" pattern="5" />
|
||||
<field x="54" y="1" type="Testo" width="16.5" pattern="1" text="INTESTAZIONE DITTA">
|
||||
<font face="Times New Roman" bold="1" size="9" />
|
||||
</field>
|
||||
<field x="54" y="1.75" type="Testo" width="13" pattern="1" text="Via ">
|
||||
<font face="Times New Roman" size="8" />
|
||||
</field>
|
||||
<field x="54" y="2.5" type="Testo" width="33" pattern="1" text="CAP COMUNE PROV Italy">
|
||||
<font face="Times New Roman" size="8" />
|
||||
</field>
|
||||
<field x="9.5" y="3.25" type="Testo" width="20" pattern="1" text="Logo Personalizzato">
|
||||
<font face="Courier New" bold="1" size="10" />
|
||||
</field>
|
||||
<field x="54" y="3.25" type="Testo" width="33" pattern="1" text="Tel. +39 xxxxxxx Fax +39 xxxxxxxxxxxxxxx">
|
||||
<font face="Times New Roman" size="8" />
|
||||
</field>
|
||||
<field x="54" y="4" type="Testo" width="33" pattern="1" text="P.IVA 01234567890 Trib. XX n. 12345 CCIAA n. 123456">
|
||||
<font face="Times New Roman" size="8" />
|
||||
</field>
|
||||
<field x="54" y="4.75" type="Testo" width="33" pattern="1" text="Cap. Soc. Euro 99.999 i.v.">
|
||||
<font face="Times New Roman" size="8" />
|
||||
</field>
|
||||
<field x="54" y="5.5" type="Testo" width="33" pattern="1" text="www.vostraditta.com info@vostraditta.com">
|
||||
<font face="Times New Roman" size="8" />
|
||||
</field>
|
||||
<field border="1" radius="100" x="0.25" y="8.75" type="Rettangolo" shade_offset="50" width="45.5" height="8" pattern="2" />
|
||||
<field border="1" radius="100" x="47.5" y="8.75" type="Rettangolo" shade_offset="50" width="45" height="8" pattern="2" />
|
||||
<field border="1" radius="100" x="0.25" y="17.25" type="Rettangolo" shade_offset="50" width="92.5" height="6.5" pattern="2" />
|
||||
<field x="1" y="17.5" type="Testo" width="14.5" pattern="2" text="Magazzino">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="30" y="17.5" type="Testo" width="11" pattern="2" text="Tipo Documento">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="69.5" y="17.5" type="Testo" width="6" pattern="2" text="Numero">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="79" y="17.5" type="Testo" width="7" pattern="2" text="Data">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="87" y="17.5" type="Testo" width="5" pattern="2" text="Pagina">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field border="1" x="0.5" y="19.5" type="Linea" width="92" height="0" pattern="1" />
|
||||
<field x="1" y="19.5" type="Testo" width="8" pattern="1" text="Cod.Cliente">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="10.25" y="19.5" type="Testo" width="6" pattern="1" text="P.IVA">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="26.5" y="19.5" type="Testo" width="10" pattern="1" text="Cod. Fisc.">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="43.75" y="19.5" type="Testo" width="8.5" pattern="1" text="Agente">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="81.75" y="19.5" type="Testo" width="8.5" pattern="1" text="Valuta">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field border="1" x="0.66" y="21.5" type="Linea" width="92" height="0" pattern="1" />
|
||||
<field x="0.75" y="21.5" type="Testo" width="8" pattern="1" text="Pagamento">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="43.5" y="21.5" type="Testo" width="8" pattern="1" text="Banca">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field border="1" radius="100" x="0.25" y="24.5" type="Rettangolo" shade_offset="50" width="92.5" height="30" pattern="2" />
|
||||
<field border="1" x="20.5" y="25" type="Linea" height="29" pattern="1" />
|
||||
<field border="1" x="74" y="25" type="Linea" height="29" pattern="1" />
|
||||
<field border="1" x="78" y="25" type="Linea" height="29" pattern="1" />
|
||||
<field border="1" radius="100" x="0.25" y="55" type="Rettangolo" shade_offset="50" width="92.5" height="8.75" pattern="2" />
|
||||
<field x="0.75" y="55" type="Testo" width="14.5" pattern="1" text="Trasporto a Mezzo">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="21.25" y="55" type="Testo" width="17.5" pattern="1" text="Aspetto Esteriore dei Beni">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="59.25" y="55" type="Testo" width="17" pattern="1" text="Causale del Trasporto">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field border="1" x="0.25" y="57.25" type="Linea" width="92" height="0" pattern="1" />
|
||||
<field x="0.75" y="57.25" type="Testo" align="right" width="6.5" pattern="1" text="Colli">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="10" y="57.25" type="Testo" align="right" width="7" pattern="1" text="N.Palette">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="23" y="57.25" type="Testo" width="6.5" pattern="1" text="Peso Kg.">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="30" y="57.25" type="Testo" width="8.5" pattern="1" text="Porto">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field border="1" x="77.5" y="57.25" type="Linea" height="6.5" pattern="1" />
|
||||
<field x="78.5" y="57.25" type="Testo" width="14" pattern="1" text="Firma Conducente">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="59.75" y="57.5" type="Testo" width="17" pattern="2" text="Data e Ora Inizio Trasporto">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field border="1" x="0.25" y="59.25" type="Linea" width="92" height="0" pattern="1" />
|
||||
<field x="1" y="59.25" type="Testo" width="8" pattern="1" text="Annotazioni">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="78.5" y="59.25" type="Testo" width="14" pattern="1" text="Firma Destinatario">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field border="1" x="0.25" y="61.5" type="Linea" width="92" height="0" pattern="1" />
|
||||
<field x="0.75" y="61.5" type="Testo" width="15.5" pattern="1" text="Incaricato del Trasporto">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="78.5" y="61.5" type="Testo" width="14" pattern="1" text="Firma Vettore">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="1.5" y="8.25" type="Testo" width="16" id="50" pattern="2" text=" Indirizzo di Consegna">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="49" y="8.25" type="Testo" width="16" id="50" pattern="2" text=" Intestatario Documento">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="1.5" y="25" type="Testo" width="9.5" id="202" pattern="1" text="Articolo">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
</field>
|
||||
<field x="21.25" y="25" type="Testo" width="28" id="203" pattern="1" text="Descrizione">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
</field>
|
||||
<field x="75" y="25" type="Testo" width="3" id="204" pattern="1" text="UM">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
</field>
|
||||
<field x="83.5" y="25" type="Testo" width="6.5" id="209" pattern="1" text="Quantit&#E0;">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
</field>
|
||||
</section>
|
||||
<section type="Body" level="1" can_break="1" pattern="1">
|
||||
<condition>!((34.TIPORIGA='08'))</condition>
|
||||
<font face="Arial" size="10" />
|
||||
<field type="Stringa" width="20" id="51" pattern="1">
|
||||
<source>34.CODART</source>
|
||||
</field>
|
||||
<field x="21" type="Stringa" bg_color="#D4D4D4" dynamic_height="1" width="50" height="15" id="52" pattern="1">
|
||||
<prescript description="B1.52 PRESCRIPT">MESSAGE _DESCRIGA</prescript>
|
||||
</field>
|
||||
<field x="72" type="Numero" align="right" bg_color="#00FFFF" width="11" id="54" pattern="1" hide_zero="1" text="###.###,@@">
|
||||
<groups>30</groups>
|
||||
<source>QTA</source>
|
||||
<prescript description="B1.54 PRESCRIPT">MESSAGE _ALIGN,#52,TOP</prescript>
|
||||
</field>
|
||||
<field x="85" y="4" type="Numero" align="right" bg_color="#00FFFF" width="11" id="55" pattern="1" hide_zero="1" text="###.###,@@">
|
||||
<source>PACCHI</source>
|
||||
<prescript description="B1.55 PRESCRIPT">MESSAGE _ALIGN,#52,TOP</prescript>
|
||||
</field>
|
||||
</section>
|
||||
<section y="53" hidden_if_needed="1" type="Foot" pattern="1">
|
||||
<font face="Arial" size="10" />
|
||||
<field x="72" y="12" type="Testo" width="17" id="100" pattern="1" text="E;E;E; SEGUE E;E;E;">
|
||||
<font italic="1" face="Arial" bold="1" size="10" />
|
||||
</field>
|
||||
</section>
|
||||
<section y="54" type="Foot" level="1" pattern="1">
|
||||
<field x="59" y="2" type="Stringa" width="22.5" id="34" pattern="1">
|
||||
<source>207@.S0</source>
|
||||
</field>
|
||||
<field x="1.25" y="2" type="Array" width="19" id="101" pattern="1">
|
||||
<source>CODSPMEZZO</source>
|
||||
<list>
|
||||
<li Value=" " Code=" " />
|
||||
<li Value="DESTINATARIO" Code="D" />
|
||||
<li Value="MITTENTE" Code="M" />
|
||||
<li Value="VETTORE" Code="V" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="36" y="8.5" type="Stringa" hidden="1" width="29" id="105" pattern="1">
|
||||
<source>TRIM(205@.S0)</source>
|
||||
<prescript description="F1.105 PRESCRIPT">MESSAGE COPY,107</prescript>
|
||||
</field>
|
||||
<field x="27" y="7.5" type="Stringa" hidden="1" width="35" id="106" pattern="1">
|
||||
<source>TRIM(205@.S1[1,35])</source>
|
||||
<prescript description="F1.106 PRESCRIPT">MESSAGE APPEND,107</prescript>
|
||||
</field>
|
||||
<field x="1" y="8.5" type="Stringa" width="76.5" id="107" pattern="1" />
|
||||
<field x="45" y="7.5" type="Stringa" hidden="1" width="10" id="108" pattern="1">
|
||||
<source>TRIM(205@.S1[36,45])</source>
|
||||
<prescript description="F1.108 PRESCRIPT">MESSAGE APPEND,107</prescript>
|
||||
</field>
|
||||
<field x="57.5" y="8" type="Stringa" hidden="1" width="5" id="110" pattern="1">
|
||||
<source>TRIM(205@.S7)</source>
|
||||
<prescript description="F1.110 PRESCRIPT">MESSAGE APPEND,107</prescript>
|
||||
</field>
|
||||
<field x="18" y="8.5" type="Stringa" hidden="1" width="18" id="111" pattern="1">
|
||||
<source>TRIM(205@.S1[46,70])</source>
|
||||
<prescript description="F1.111 PRESCRIPT">MESSAGE APPEND,107</prescript>
|
||||
</field>
|
||||
<field x="21" y="7.5" type="Stringa" hidden="1" width="5" id="112" pattern="1">
|
||||
<source>205@.S9</source>
|
||||
</field>
|
||||
<field x="9" y="8.5" type="Stringa" hidden="1" width="35" id="113" pattern="1">
|
||||
<prescript description="F1.113 PRESCRIPT">MESSAGE _ISAMREAD,13,COM=#112,DENCOM
|
||||
MESSAGE APPEND,107</prescript>
|
||||
</field>
|
||||
<field x="15" y="7.5" type="Stringa" hidden="1" width="2" id="114" pattern="1">
|
||||
<prescript description="F1.114 PRESCRIPT">MESSAGE _ISAMREAD,13,COM=#112,PROVCOM
|
||||
MESSAGE APPEND,107</prescript>
|
||||
</field>
|
||||
<field x="51" y="8.5" deactivated="1" type="Stringa" width="38" id="115" pattern="1" />
|
||||
<field x="69.75" y="4.25" type="Stringa" width="5" id="117" pattern="1" text="##:##">
|
||||
<source>ORAPART</source>
|
||||
</field>
|
||||
<field x="59.75" y="4.25" type="Data" width="8" id="118" pattern="1">
|
||||
<source>DATAPART</source>
|
||||
</field>
|
||||
<field x="20.75" y="2" type="Stringa" width="34.5" id="120" pattern="1">
|
||||
<source>206@.S0</source>
|
||||
</field>
|
||||
<field x="16.5" y="4.25" type="Numero" align="right" width="12" id="121" pattern="1" text="#########">
|
||||
<source>IF(33.PNETTO=0,TOTPESO,33.PNETTO)</source>
|
||||
</field>
|
||||
<field x="0.5" y="4.25" type="Numero" align="right" width="6" id="122" pattern="1">
|
||||
<source>IF(33.NCOLLI=0,TOTCOLLI,33.NCOLLI)</source>
|
||||
</field>
|
||||
<field x="9" y="4.25" type="Numero" align="right" width="6" id="132" pattern="1">
|
||||
<source>IF(33.NBANC=0,TOTBANC,33.NBANC)</source>
|
||||
</field>
|
||||
<field x="0.5" y="6.25" type="Stringa" width="76.5" id="157" pattern="1">
|
||||
<source>33.NOTE</source>
|
||||
</field>
|
||||
<field x="30.25" y="4.25" type="Stringa" width="27.5" id="158" pattern="1">
|
||||
<source>203@.S0</source>
|
||||
</field>
|
||||
</section>
|
||||
<sql>USE 126
|
||||
JOIN 20 INTO TIPOCF==TIPOCF CODCF==CODCF
|
||||
FROM TIPOCONT=#CONT CODICE=#KEY
|
||||
TO TIPOCONT=#CONT CODICE=#KEY</sql>
|
||||
</report>
|
9
ps/pl1048100a.h
Executable file
9
ps/pl1048100a.h
Executable file
@ -0,0 +1,9 @@
|
||||
#define F_CODNUM 101
|
||||
#define F_ANNO 102
|
||||
#define F_PROVV 103
|
||||
#define F_NDOC 104
|
||||
#define F_TIPOCF 107
|
||||
#define F_CODCF 108
|
||||
#define F_TIPODOC 172
|
||||
#define F_DESNUM 173
|
||||
#define F_DESTIPODOC 176
|
148
ps/pl1048100a.uml
Executable file
148
ps/pl1048100a.uml
Executable file
@ -0,0 +1,148 @@
|
||||
#include "veuml.h"
|
||||
|
||||
TOOLBAR "Toolbar" 0 0 0 2
|
||||
|
||||
#include <relapbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Estremi della bolla" 0 0 0 0
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 1 1 "@bDitta"
|
||||
END
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 3 2 "Codice "
|
||||
FLAGS "FD"
|
||||
USE LF_NDITTE
|
||||
CHECKTYPE NORMAL
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
OUTPUT F_RAGSOCDITTA RAGSOC
|
||||
END
|
||||
|
||||
STRING F_RAGSOCDITTA 50
|
||||
BEGIN
|
||||
PROMPT 17 2 "Ragione "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 7
|
||||
BEGIN
|
||||
PROMPT 1 4 "Estremi del documento"
|
||||
END
|
||||
|
||||
LISTBOX F_PROVV 14
|
||||
BEGIN
|
||||
FIELD PROVV
|
||||
PROMPT 46 7 "Tipo "
|
||||
ITEM "D|Definitiva "
|
||||
ITEM "P|Provvisoria"
|
||||
FLAGS "DPG"
|
||||
END
|
||||
|
||||
STRING F_CODNUM 4
|
||||
BEGIN
|
||||
PROMPT 2 5 "Numerazione "
|
||||
FIELD CODNUM
|
||||
HELP "Codice numerazione"
|
||||
USE %NUM
|
||||
INPUT CODTAB F_CODNUM
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_CODNUM CODTAB
|
||||
OUTPUT F_DESNUM S0
|
||||
CHECKTYPE FORCED
|
||||
FLAG "UPAD"
|
||||
WARNING "Numerazione assente"
|
||||
END
|
||||
|
||||
STRING F_DESNUM 50
|
||||
BEGIN
|
||||
PROMPT 24 5 ""
|
||||
HELP "Descrizione numerazione"
|
||||
USE %NUM KEY 2
|
||||
INPUT S0 F_DESNUM
|
||||
DISPLAY "Descrizione@60" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_CODNUM
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
PROMPT 2 7 "Esercizio "
|
||||
FIELD ANNO
|
||||
CHECKTYPE REQUIRED
|
||||
NUM_EXPR #F_ANNO>0
|
||||
FLAG "AP"
|
||||
KEY 1 2
|
||||
WARNING "Inserire un anno valido"
|
||||
END
|
||||
|
||||
NUMBER F_NDOC 6
|
||||
BEGIN
|
||||
PROMPT 24 7 "Numero "
|
||||
FIELD NDOC
|
||||
USE LF_DOC SELECT (#F_STATO=="")||(STATO==#F_STATO)
|
||||
JOIN LF_CLIFO TO LF_DOC INTO TIPOCF==TIPOCF CODCF==CODCF
|
||||
INPUT PROVV F_PROVV SELECT
|
||||
INPUT ANNO F_ANNO SELECT
|
||||
INPUT CODNUM F_CODNUM SELECT
|
||||
INPUT NDOC F_NDOC
|
||||
DISPLAY "Num." CODNUM
|
||||
DISPLAY "Anno" ANNO
|
||||
DISPLAY "Provv" PROVV
|
||||
DISPLAY "Tipo" TIPODOC
|
||||
DISPLAY "N.Doc. " NDOC
|
||||
DISPLAY "Stato@R" STATO
|
||||
DISPLAY "Data\ndocumento" DATADOC
|
||||
DISPLAY "C/F" TIPOCF
|
||||
DISPLAY "Codice" CODCF
|
||||
DISPLAY "Ragione Sociale@50" LF_CLIFO->RAGSOC
|
||||
OUTPUT F_NDOC NDOC
|
||||
OUTPUT F_TIPODOC TIPODOC
|
||||
OUTPUT F_PROVV PROVV
|
||||
CHECKTYPE REQUIRED
|
||||
FLAG "R"
|
||||
END
|
||||
|
||||
LIST F_TIPOCF 1 12
|
||||
BEGIN
|
||||
PROMPT 2 8 "Tipo "
|
||||
ITEM "C|Cliente"
|
||||
ITEM "F|Fornitore"
|
||||
END
|
||||
|
||||
NUMBER F_CODCF 6
|
||||
BEGIN
|
||||
PROMPT 24 8 "Codice "
|
||||
USE LF_DOC KEY 2 SELECT (CODNUM==#F_CODNUM) && (PROVV==#F_PROVV) && (ANNO==#F_ANNO) && ((#F_STATO=="")||(STATO==#F_STATO))
|
||||
JOIN LF_CLIFO INTO TIPOCF==TIPOCF CODCF==CODCF
|
||||
INPUT TIPOCF F_TIPOCF SELECT
|
||||
INPUT CODCF F_CODCF
|
||||
INPUT PROVV F_PROVV
|
||||
INPUT ANNO F_ANNO
|
||||
DISPLAY "Codice" CODCF
|
||||
DISPLAY "Ragione Sociale@50" LF_CLIFO->RAGSOC
|
||||
DISPLAY "Partita IVA@12" LF_CLIFO->PAIV
|
||||
DISPLAY "Num." CODNUM
|
||||
DISPLAY "Anno" ANNO
|
||||
DISPLAY "Provv" PROVV
|
||||
DISPLAY "Tipo" TIPODOC
|
||||
DISPLAY "N.Doc. " NDOC
|
||||
DISPLAY "Stato@R" STATO
|
||||
DISPLAY "Data\ndocumento" DATADOC
|
||||
DISPLAY "Valuta" CODVAL
|
||||
DISPLAY "Totale\ndocumento@18V" G1:TOTDOC
|
||||
DISPLAY "Stato" STATO
|
||||
COPY OUTPUT F_NDOC
|
||||
OUTPUT F_CODCF CODCF
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user