Patch level : 2.0 512
Files correlati : or1.exe or1100d.frm Ricompilazione Demo : [ ] Commento : GF20040 Se stampo con il dettaglio articoli solo per gli ordini evasi con la spunta STAMPA RIGHE EVASE CON RESIDUO mi elenca anche quegli ordini che sono stati evasi per la quantità ordinata. git-svn-id: svn://10.65.10.50/trunk@11294 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2d41198b3e
commit
59fec4b029
@ -2,9 +2,16 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
|
||||||
#include "orlib.h"
|
#include "orlib.h"
|
||||||
#include "or1100a.h"
|
#include "or1100a.h"
|
||||||
|
|
||||||
|
#include "../ve/velib.h"
|
||||||
|
|
||||||
|
#include "doc.h"
|
||||||
|
#include "rdoc.h"
|
||||||
|
|
||||||
// Tipi di stampa per selezionare il form
|
// Tipi di stampa per selezionare il form
|
||||||
enum tipo_stampa {
|
enum tipo_stampa {
|
||||||
numero, // or1100a.frm
|
numero, // or1100a.frm
|
||||||
@ -25,7 +32,6 @@ class TStampa_ordini : public TSkeleton_application
|
|||||||
{
|
{
|
||||||
TMask * _m;
|
TMask * _m;
|
||||||
TOrdine_form * _frm;
|
TOrdine_form * _frm;
|
||||||
TTable * _fcg;
|
|
||||||
tipo_stampa _tipo;
|
tipo_stampa _tipo;
|
||||||
TCodgiac_livelli *_codgiac;
|
TCodgiac_livelli *_codgiac;
|
||||||
TAssoc_array _tipi_riga; // Cache dei tipi riga attivati: tipo M, S, P, C, O D
|
TAssoc_array _tipi_riga; // Cache dei tipi riga attivati: tipo M, S, P, C, O D
|
||||||
@ -134,7 +140,6 @@ bool TStampa_ordini::create()
|
|||||||
_m = new TMask ("or1100a");
|
_m = new TMask ("or1100a");
|
||||||
//_m->set_handler(F_STATOORD, stato_handler);
|
//_m->set_handler(F_STATOORD, stato_handler);
|
||||||
_m->set_handler(F_DETTAGLIO, detail_handler);
|
_m->set_handler(F_DETTAGLIO, detail_handler);
|
||||||
_fcg = new TTable("FCG");
|
|
||||||
_codgiac = new TCodgiac_livelli;
|
_codgiac = new TCodgiac_livelli;
|
||||||
if (!_codgiac->enabled())
|
if (!_codgiac->enabled())
|
||||||
{
|
{
|
||||||
@ -142,15 +147,18 @@ bool TStampa_ordini::create()
|
|||||||
_m->hide(-GR_GIAC);
|
_m->hide(-GR_GIAC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int err = NOERR;
|
||||||
|
|
||||||
short id = F_GIAC1;
|
short id = F_GIAC1;
|
||||||
for (_fcg->first(); _fcg->good(); _fcg->next(), id+=4)
|
TTable fcg("FCG");
|
||||||
_m->set(id, _fcg->get("CODTAB"));
|
for (err = fcg.first(); err == NOERR; err = fcg.next(), id+=4)
|
||||||
|
_m->set(id, fcg.get("CODTAB"));
|
||||||
|
|
||||||
// Carica i tipi riga dalla tabella TRI
|
// Carica i tipi riga dalla tabella TRI
|
||||||
TTable tri ("%TRI");
|
TTable tri ("%TRI");
|
||||||
for (tri.first(); !tri.eof(); tri.next())
|
for (err = tri.first(); err == NOERR; err = tri.next())
|
||||||
{
|
{
|
||||||
TString* ss = new TString(tri.get("CODTAB"));
|
const TString& ss = tri.get("CODTAB");
|
||||||
_tipi_riga.add(tri.get("S7"), ss);
|
_tipi_riga.add(tri.get("S7"), ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +168,6 @@ bool TStampa_ordini::create()
|
|||||||
bool TStampa_ordini::destroy()
|
bool TStampa_ordini::destroy()
|
||||||
{
|
{
|
||||||
delete _m;
|
delete _m;
|
||||||
delete _fcg;
|
|
||||||
delete _codgiac;
|
delete _codgiac;
|
||||||
return TSkeleton_application::destroy();
|
return TSkeleton_application::destroy();
|
||||||
}
|
}
|
||||||
@ -685,13 +692,14 @@ void TStampa_ordini::filter_for_clifo_agent()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_TEA_rord == 'E')
|
if (_TEA_rord == 'E')
|
||||||
|
{
|
||||||
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
||||||
|
if (_force_evase)
|
||||||
|
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (_TEA_rord == 'A')
|
if (_TEA_rord == 'A')
|
||||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||||
|
|
||||||
if (_force_evase)
|
|
||||||
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.not_empty())
|
if (s.not_empty())
|
||||||
@ -931,16 +939,21 @@ void TStampa_ordini::filter_for_articolo()
|
|||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_TEA_rord > ' ')
|
||||||
|
{
|
||||||
s = "";
|
s = "";
|
||||||
if (_TEA_rord == 'E')
|
if (_TEA_rord == 'E')
|
||||||
|
{
|
||||||
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
||||||
|
if (_force_evase)
|
||||||
|
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (_TEA_rord == 'A')
|
if (_TEA_rord == 'A')
|
||||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||||
|
|
||||||
if (s.not_empty())
|
if (s.not_empty())
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
|
}
|
||||||
|
|
||||||
cur->setfilter(filter_expr,TRUE,2); // Setta il filtro e serra i ranghi
|
cur->setfilter(filter_expr,TRUE,2); // Setta il filtro e serra i ranghi
|
||||||
|
|
||||||
@ -1114,6 +1127,6 @@ void TStampa_ordini::main_loop()
|
|||||||
int or1100(int argc, char** argv)
|
int or1100(int argc, char** argv)
|
||||||
{
|
{
|
||||||
TStampa_ordini a;
|
TStampa_ordini a;
|
||||||
a.run(argc,argv,"Stampa ordini");
|
a.run(argc,argv, TR("Stampa ordini"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -10,15 +10,11 @@ DESCRIPTION
|
|||||||
BEGIN
|
BEGIN
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
GENERAL
|
GENERAL
|
||||||
BEGIN
|
BEGIN
|
||||||
OFFSET 0 0
|
OFFSET 0 0
|
||||||
FONT "Courier New"
|
|
||||||
SIZE 10
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
SECTION HEADER ODD 6
|
SECTION HEADER ODD 6
|
||||||
|
|
||||||
STRINGA 1 40 1
|
STRINGA 1 40 1
|
||||||
@ -331,7 +327,7 @@ NUMBER 411 15
|
|||||||
BEGIN
|
BEGIN
|
||||||
KEY "Residuo"
|
KEY "Residuo"
|
||||||
PROMPT 11 1 ""
|
PROMPT 11 1 ""
|
||||||
PICTURE "########@,@@@@@"
|
PICTURE "########@,@@@"
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
MESSAGE ADD,511
|
MESSAGE ADD,511
|
||||||
GROUP G_TOTALEART
|
GROUP G_TOTALEART
|
||||||
@ -388,18 +384,18 @@ FLAGS "D"
|
|||||||
PROMPT 7 1 ""
|
PROMPT 7 1 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMERO 508 15 5
|
NUMERO 508 13 3
|
||||||
BEGIN
|
BEGIN
|
||||||
KEY "Tot Q.ta ordinata"
|
KEY "Tot Q.ta ordinata"
|
||||||
PROMPT 8 1 ""
|
PROMPT 8 1 ""
|
||||||
PICTURE "########@,@@@@@"
|
PICTURE "########@,@@@"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMERO 509 15 5
|
NUMERO 509 13 3
|
||||||
BEGIN
|
BEGIN
|
||||||
KEY "Tot Q.ta evasa"
|
KEY "Tot Q.ta evasa"
|
||||||
PROMPT 9 1 ""
|
PROMPT 9 1 ""
|
||||||
PICTURE "########@,@@@@@"
|
PICTURE "########@,@@@"
|
||||||
END
|
END
|
||||||
|
|
||||||
VALUTA 510 13
|
VALUTA 510 13
|
||||||
@ -412,14 +408,14 @@ FLAGS "D"
|
|||||||
BEGIN
|
BEGIN
|
||||||
KEY "Tot Residuo"
|
KEY "Tot Residuo"
|
||||||
PROMPT 11 1 ""
|
PROMPT 11 1 ""
|
||||||
PICTURE "########@,@@@@@"
|
PICTURE "########@,@@@"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMERO 512 15 5
|
NUMERO 512 15 5
|
||||||
BEGIN
|
BEGIN
|
||||||
KEY "Tot Giacenza"
|
KEY "Tot Giacenza"
|
||||||
PROMPT 12 1 ""
|
PROMPT 12 1 ""
|
||||||
PICTURE "########@,@@@@@"
|
PICTURE "########@,@@@"
|
||||||
END
|
END
|
||||||
|
|
||||||
END // Fine sezione totale in valuta #1
|
END // Fine sezione totale in valuta #1
|
||||||
|
@ -2,9 +2,18 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
|
||||||
|
#include "doc.h"
|
||||||
|
#include "rdoc.h"
|
||||||
|
|
||||||
#include "orlib.h"
|
#include "orlib.h"
|
||||||
#include "or1200a.h"
|
#include "or1200a.h"
|
||||||
|
|
||||||
|
#include "../cg/cglib01.h"
|
||||||
|
#include "../ve/velib.h"
|
||||||
|
|
||||||
|
|
||||||
class TStampa_dettaglio_articoli : public TSkeleton_application
|
class TStampa_dettaglio_articoli : public TSkeleton_application
|
||||||
{
|
{
|
||||||
TMask *_m;
|
TMask *_m;
|
||||||
@ -277,10 +286,10 @@ void TStampa_dettaglio_articoli::main_loop()
|
|||||||
int anno = _anno;
|
int anno = _anno;
|
||||||
if (anno <= 0)
|
if (anno <= 0)
|
||||||
{
|
{
|
||||||
TEsercizi_contabili ec;
|
TEsercizi_contabili esc;
|
||||||
const int codes = ec.last();
|
const int codes = esc.last();
|
||||||
if (codes > 0)
|
if (codes > 0)
|
||||||
anno = ec[codes].fine().year();
|
anno = esc[codes].fine().year();
|
||||||
}
|
}
|
||||||
if (anno > _data_oss.year())
|
if (anno > _data_oss.year())
|
||||||
_data_oss.set_year(anno);
|
_data_oss.set_year(anno);
|
||||||
|
11
or/orlib.h
11
or/orlib.h
@ -1,9 +1,7 @@
|
|||||||
|
#ifndef __ORLIB_H
|
||||||
|
#define __ORLIB_H
|
||||||
|
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <tabutil.h>
|
|
||||||
#include <doc.h>
|
|
||||||
#include <rdoc.h>
|
|
||||||
#include "../cg/cglib01.h"
|
|
||||||
#include "../ve/velib.h"
|
|
||||||
#include "../mg/mglib.h"
|
#include "../mg/mglib.h"
|
||||||
|
|
||||||
class _TTotale_valuta : public TObject
|
class _TTotale_valuta : public TObject
|
||||||
@ -31,9 +29,7 @@ class TOrdine_form : public TForm
|
|||||||
TArray* _date_array; // Do not delete: e' passato dall'applicazione
|
TArray* _date_array; // Do not delete: e' passato dall'applicazione
|
||||||
TArray _totdisp; // Array di elementi per la stampa disponibilita'
|
TArray _totdisp; // Array di elementi per la stampa disponibilita'
|
||||||
TCodgiac_livelli * _codgiac;
|
TCodgiac_livelli * _codgiac;
|
||||||
TTable *_fcg;
|
|
||||||
TArticolo_giacenza *_art_giac;
|
TArticolo_giacenza *_art_giac;
|
||||||
TEsercizi_contabili *_esercizi;
|
|
||||||
TAssoc_array _totvaluta;
|
TAssoc_array _totvaluta;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -47,3 +43,4 @@ class TOrdine_form : public TForm
|
|||||||
virtual ~TOrdine_form() ;
|
virtual ~TOrdine_form() ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,22 +1,21 @@
|
|||||||
#include "orlib.h"
|
#include "orlib.h"
|
||||||
#include "or1100a.h"
|
#include "or1100a.h"
|
||||||
|
|
||||||
|
#include "../cg/cglib01.h"
|
||||||
|
#include "../ve/velib.h"
|
||||||
|
|
||||||
// Prima colonna quantita' nel form per stampa disponibilita'
|
// Prima colonna quantita' nel form per stampa disponibilita'
|
||||||
#define COL1 4
|
#define COL1 4
|
||||||
|
|
||||||
TOrdine_form::TOrdine_form(const char* name) : TForm(name)
|
TOrdine_form::TOrdine_form(const char* name) : TForm(name)
|
||||||
{
|
{
|
||||||
_art_giac = new TArticolo_giacenza;
|
_art_giac = new TArticolo_giacenza;
|
||||||
_esercizi = new TEsercizi_contabili;
|
|
||||||
_fcg = new TTable("FCG");
|
|
||||||
_codgiac = new TCodgiac_livelli;
|
_codgiac = new TCodgiac_livelli;
|
||||||
}
|
}
|
||||||
|
|
||||||
TOrdine_form::~TOrdine_form()
|
TOrdine_form::~TOrdine_form()
|
||||||
{
|
{
|
||||||
delete _codgiac;
|
delete _codgiac;
|
||||||
delete _fcg;
|
|
||||||
delete _esercizi;
|
|
||||||
delete _art_giac;
|
delete _art_giac;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,15 +161,19 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
else
|
else
|
||||||
if (action == "CONVUM") // Converte cazzilli quantitativi nella unita' di misura corrente
|
if (action == "CONVUM") // Converte cazzilli quantitativi nella unita' di misura corrente
|
||||||
{
|
{
|
||||||
TString um(rdoc.get(RDOC_UMQTA));
|
const TString4 um = rdoc.get(RDOC_UMQTA);
|
||||||
TString cur_um(cf.find_field("407").get());
|
const TString4 cur_um = cf.find_field("407").get();
|
||||||
|
|
||||||
if (cur_um != um)
|
if (cur_um != um)
|
||||||
if (_art_giac->read(rdoc.get(RDOC_CODART)) == NOERR)
|
if (_art_giac->read(rdoc.get(RDOC_CODART)) == NOERR) // Perche' non RDOC_CODARTMAG ???
|
||||||
{
|
{
|
||||||
const real fc = _art_giac->um().row(_art_giac->find_um(cur_um)).get("FC");
|
|
||||||
real qt(cf.get());
|
real qt(cf.get());
|
||||||
|
/*
|
||||||
|
const real fc = _art_giac->um().row(_art_giac->find_um(cur_um)).get("FC");
|
||||||
qt *= fc;
|
qt *= fc;
|
||||||
|
*/
|
||||||
|
qt = _art_giac->convert_to_um(qt, cur_um, um, TRUE);
|
||||||
|
|
||||||
cf.set(qt.string());
|
cf.set(qt.string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,7 +296,9 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
//const int items = _date_array->items();
|
//const int items = _date_array->items();
|
||||||
TString16 annoes;
|
TString16 annoes;
|
||||||
real giacenza, scorta_min;
|
real giacenza, scorta_min;
|
||||||
annoes << _esercizi->date2esc(doc.get_date(DOC_DATADOC));
|
|
||||||
|
TEsercizi_contabili esc;
|
||||||
|
annoes << esc.date2esc(doc.get_date(DOC_DATADOC));
|
||||||
//TString16 codmag(rdoc.get(RDOC_CODMAG));
|
//TString16 codmag(rdoc.get(RDOC_CODMAG));
|
||||||
//TString16 livello(rdoc.get(RDOC_LIVELLO));
|
//TString16 livello(rdoc.get(RDOC_LIVELLO));
|
||||||
const int codmag_len = (_detail_dep || _detail_mag) ? _codmag.len() : 0;
|
const int codmag_len = (_detail_dep || _detail_mag) ? _codmag.len() : 0;
|
||||||
@ -396,8 +401,9 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
const TString& codart = rdoc.get(RDOC_CODARTMAG);
|
const TString& codart = rdoc.get(RDOC_CODARTMAG);
|
||||||
if (codart.not_empty() && _art_giac->read(codart) == NOERR)
|
if (codart.not_empty() && _art_giac->read(codart) == NOERR)
|
||||||
{
|
{
|
||||||
|
TEsercizi_contabili esc;
|
||||||
const TDate oggi(TODAY);
|
const TDate oggi(TODAY);
|
||||||
TString16 annoes; annoes.format("%04d", _esercizi->date2esc(oggi));
|
TString16 annoes; annoes.format("%04d", esc.date2esc(oggi));
|
||||||
const TString16 codmag(rdoc.get("CODMAG")); // Riferito al magazzino indicato sulla riga...
|
const TString16 codmag(rdoc.get("CODMAG")); // Riferito al magazzino indicato sulla riga...
|
||||||
const TString16 livello(_level > 0 ? rdoc.get(RDOC_LIVELLO) : "");
|
const TString16 livello(_level > 0 ? rdoc.get(RDOC_LIVELLO) : "");
|
||||||
g = _art_giac->disponibilita(annoes, codmag, livello, TRUE); // Giacenza attuale
|
g = _art_giac->disponibilita(annoes, codmag, livello, TRUE); // Giacenza attuale
|
||||||
|
Loading…
x
Reference in New Issue
Block a user