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 <mask.h>
|
||||
#include <printer.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "orlib.h"
|
||||
#include "or1100a.h"
|
||||
|
||||
#include "../ve/velib.h"
|
||||
|
||||
#include "doc.h"
|
||||
#include "rdoc.h"
|
||||
|
||||
// Tipi di stampa per selezionare il form
|
||||
enum tipo_stampa {
|
||||
numero, // or1100a.frm
|
||||
@ -25,7 +32,6 @@ class TStampa_ordini : public TSkeleton_application
|
||||
{
|
||||
TMask * _m;
|
||||
TOrdine_form * _frm;
|
||||
TTable * _fcg;
|
||||
tipo_stampa _tipo;
|
||||
TCodgiac_livelli *_codgiac;
|
||||
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->set_handler(F_STATOORD, stato_handler);
|
||||
_m->set_handler(F_DETTAGLIO, detail_handler);
|
||||
_fcg = new TTable("FCG");
|
||||
_codgiac = new TCodgiac_livelli;
|
||||
if (!_codgiac->enabled())
|
||||
{
|
||||
@ -142,15 +147,18 @@ bool TStampa_ordini::create()
|
||||
_m->hide(-GR_GIAC);
|
||||
}
|
||||
|
||||
int err = NOERR;
|
||||
|
||||
short id = F_GIAC1;
|
||||
for (_fcg->first(); _fcg->good(); _fcg->next(), id+=4)
|
||||
_m->set(id, _fcg->get("CODTAB"));
|
||||
TTable fcg("FCG");
|
||||
for (err = fcg.first(); err == NOERR; err = fcg.next(), id+=4)
|
||||
_m->set(id, fcg.get("CODTAB"));
|
||||
|
||||
// Carica i tipi riga dalla tabella 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);
|
||||
}
|
||||
|
||||
@ -160,7 +168,6 @@ bool TStampa_ordini::create()
|
||||
bool TStampa_ordini::destroy()
|
||||
{
|
||||
delete _m;
|
||||
delete _fcg;
|
||||
delete _codgiac;
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
@ -393,10 +400,10 @@ void TStampa_ordini::filter_for_number()
|
||||
// Applica il filtro per righe evase/aperte
|
||||
s = "";
|
||||
if (_TEA_rord == 'E')
|
||||
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
||||
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
||||
else
|
||||
if (_TEA_rord == 'A')
|
||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||
if (_TEA_rord == 'A')
|
||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||
|
||||
cond << s;
|
||||
|
||||
@ -685,13 +692,14 @@ void TStampa_ordini::filter_for_clifo_agent()
|
||||
else
|
||||
{
|
||||
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
|
||||
if (_TEA_rord == 'A')
|
||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||
|
||||
if (_force_evase)
|
||||
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
|
||||
if (_TEA_rord == 'A')
|
||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||
}
|
||||
|
||||
if (s.not_empty())
|
||||
@ -931,16 +939,21 @@ void TStampa_ordini::filter_for_articolo()
|
||||
filter_expr << s;
|
||||
}
|
||||
|
||||
s = "";
|
||||
if (_TEA_rord == 'E')
|
||||
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
||||
else
|
||||
if (_TEA_rord == 'A')
|
||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||
|
||||
if (s.not_empty())
|
||||
filter_expr << s;
|
||||
|
||||
if (_TEA_rord > ' ')
|
||||
{
|
||||
s = "";
|
||||
if (_TEA_rord == 'E')
|
||||
{
|
||||
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
||||
if (_force_evase)
|
||||
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
|
||||
}
|
||||
else
|
||||
if (_TEA_rord == 'A')
|
||||
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
||||
if (s.not_empty())
|
||||
filter_expr << s;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
TStampa_ordini a;
|
||||
a.run(argc,argv,"Stampa ordini");
|
||||
a.run(argc,argv, TR("Stampa ordini"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -10,15 +10,11 @@ DESCRIPTION
|
||||
BEGIN
|
||||
END
|
||||
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 0
|
||||
FONT "Courier New"
|
||||
SIZE 10
|
||||
END
|
||||
|
||||
|
||||
SECTION HEADER ODD 6
|
||||
|
||||
STRINGA 1 40 1
|
||||
@ -331,7 +327,7 @@ NUMBER 411 15
|
||||
BEGIN
|
||||
KEY "Residuo"
|
||||
PROMPT 11 1 ""
|
||||
PICTURE "########@,@@@@@"
|
||||
PICTURE "########@,@@@"
|
||||
FLAGS "D"
|
||||
MESSAGE ADD,511
|
||||
GROUP G_TOTALEART
|
||||
@ -388,18 +384,18 @@ FLAGS "D"
|
||||
PROMPT 7 1 ""
|
||||
END
|
||||
|
||||
NUMERO 508 15 5
|
||||
NUMERO 508 13 3
|
||||
BEGIN
|
||||
KEY "Tot Q.ta ordinata"
|
||||
PROMPT 8 1 ""
|
||||
PICTURE "########@,@@@@@"
|
||||
PICTURE "########@,@@@"
|
||||
END
|
||||
|
||||
NUMERO 509 15 5
|
||||
NUMERO 509 13 3
|
||||
BEGIN
|
||||
KEY "Tot Q.ta evasa"
|
||||
PROMPT 9 1 ""
|
||||
PICTURE "########@,@@@@@"
|
||||
PICTURE "########@,@@@"
|
||||
END
|
||||
|
||||
VALUTA 510 13
|
||||
@ -412,14 +408,14 @@ FLAGS "D"
|
||||
BEGIN
|
||||
KEY "Tot Residuo"
|
||||
PROMPT 11 1 ""
|
||||
PICTURE "########@,@@@@@"
|
||||
PICTURE "########@,@@@"
|
||||
END
|
||||
|
||||
NUMERO 512 15 5
|
||||
BEGIN
|
||||
KEY "Tot Giacenza"
|
||||
PROMPT 12 1 ""
|
||||
PICTURE "########@,@@@@@"
|
||||
PICTURE "########@,@@@"
|
||||
END
|
||||
|
||||
END // Fine sezione totale in valuta #1
|
||||
|
@ -2,9 +2,18 @@
|
||||
#include <applicat.h>
|
||||
#include <mask.h>
|
||||
#include <printer.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "doc.h"
|
||||
#include "rdoc.h"
|
||||
|
||||
#include "orlib.h"
|
||||
#include "or1200a.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
#include "../ve/velib.h"
|
||||
|
||||
|
||||
class TStampa_dettaglio_articoli : public TSkeleton_application
|
||||
{
|
||||
TMask *_m;
|
||||
@ -277,10 +286,10 @@ void TStampa_dettaglio_articoli::main_loop()
|
||||
int anno = _anno;
|
||||
if (anno <= 0)
|
||||
{
|
||||
TEsercizi_contabili ec;
|
||||
const int codes = ec.last();
|
||||
TEsercizi_contabili esc;
|
||||
const int codes = esc.last();
|
||||
if (codes > 0)
|
||||
anno = ec[codes].fine().year();
|
||||
anno = esc[codes].fine().year();
|
||||
}
|
||||
if (anno > _data_oss.year())
|
||||
_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 <tabutil.h>
|
||||
#include <doc.h>
|
||||
#include <rdoc.h>
|
||||
#include "../cg/cglib01.h"
|
||||
#include "../ve/velib.h"
|
||||
#include "../mg/mglib.h"
|
||||
|
||||
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 _totdisp; // Array di elementi per la stampa disponibilita'
|
||||
TCodgiac_livelli * _codgiac;
|
||||
TTable *_fcg;
|
||||
TArticolo_giacenza *_art_giac;
|
||||
TEsercizi_contabili *_esercizi;
|
||||
TAssoc_array _totvaluta;
|
||||
|
||||
protected:
|
||||
@ -47,3 +43,4 @@ class TOrdine_form : public TForm
|
||||
virtual ~TOrdine_form() ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,22 +1,21 @@
|
||||
#include "orlib.h"
|
||||
#include "or1100a.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
#include "../ve/velib.h"
|
||||
|
||||
// Prima colonna quantita' nel form per stampa disponibilita'
|
||||
#define COL1 4
|
||||
|
||||
TOrdine_form::TOrdine_form(const char* name) : TForm(name)
|
||||
{
|
||||
_art_giac = new TArticolo_giacenza;
|
||||
_esercizi = new TEsercizi_contabili;
|
||||
_fcg = new TTable("FCG");
|
||||
_codgiac = new TCodgiac_livelli;
|
||||
}
|
||||
|
||||
TOrdine_form::~TOrdine_form()
|
||||
{
|
||||
delete _codgiac;
|
||||
delete _fcg;
|
||||
delete _esercizi;
|
||||
delete _art_giac;
|
||||
}
|
||||
|
||||
@ -162,15 +161,19 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
||||
else
|
||||
if (action == "CONVUM") // Converte cazzilli quantitativi nella unita' di misura corrente
|
||||
{
|
||||
TString um(rdoc.get(RDOC_UMQTA));
|
||||
TString cur_um(cf.find_field("407").get());
|
||||
const TString4 um = rdoc.get(RDOC_UMQTA);
|
||||
const TString4 cur_um = cf.find_field("407").get();
|
||||
|
||||
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());
|
||||
/*
|
||||
const real fc = _art_giac->um().row(_art_giac->find_um(cur_um)).get("FC");
|
||||
qt *= fc;
|
||||
*/
|
||||
qt = _art_giac->convert_to_um(qt, cur_um, um, TRUE);
|
||||
|
||||
cf.set(qt.string());
|
||||
}
|
||||
}
|
||||
@ -293,7 +296,9 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
||||
//const int items = _date_array->items();
|
||||
TString16 annoes;
|
||||
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 livello(rdoc.get(RDOC_LIVELLO));
|
||||
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);
|
||||
if (codart.not_empty() && _art_giac->read(codart) == NOERR)
|
||||
{
|
||||
TEsercizi_contabili esc;
|
||||
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 livello(_level > 0 ? rdoc.get(RDOC_LIVELLO) : "");
|
||||
g = _art_giac->disponibilita(annoes, codmag, livello, TRUE); // Giacenza attuale
|
||||
|
Loading…
x
Reference in New Issue
Block a user