Patch level :aga 2.0

Files correlati     :or1.exe
Ricompilazione Demo : [ ]
Commento            :corretto errore di riporto


git-svn-id: svn://10.65.10.50/trunk@10725 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2003-01-13 12:04:10 +00:00
parent dd8e575daf
commit 1741319a11

View File

@ -337,87 +337,70 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
} }
// Ignore any other command // Ignore any other command
} }
} else }
else
if (action == "PREZZONS") if (action == "PREZZONS")
{ {
real pns = rdoc.prezzo(TRUE,FALSE); // Prezzo netto scontato real pns = rdoc.prezzo(TRUE,FALSE); // Prezzo netto scontato
cf.set(pns.string()); cf.set(pns.string());
} else }
if (action == "RAGSOC") else
{ if (action == "RAGSOC")
// Compone la ragione sociale (considera gli occasionali)
// Il formato è il seguente: CODICE (OCFPI) RAGIONE_SOCIALE
TString ws;
const bool print_cod = s.get_int(2);
TDocumento& documento = (TDocumento&)cf.form().cursor()->curr(LF_DOC);
TCli_for& cli_for = documento.clifor();
TOccasionale& cli_occ = documento.occas();
const bool occasionale = cli_for.occasionale();
if (print_cod)
ws << cli_for.get("CODCF") << " ";
if (occasionale)
{ {
ws << "(" << cli_occ.get("CFPI") << ") " ; // Compone la ragione sociale (considera gli occasionali)
ws << cli_occ.get("RAGSOC"); // Il formato è il seguente: CODICE (OCFPI) RAGIONE_SOCIALE
} TString ws;
else const bool print_cod = s.get_int(2) != 0;
if (action == "RAGSOC") TDocumento& documento = (TDocumento&)cf.form().cursor()->curr(LF_DOC);
TCli_for& cli_for = documento.clifor();
TOccasionale& cli_occ = documento.occas();
const bool occasionale = cli_for.occasionale();
if (print_cod)
ws << cli_for.get("CODCF") << " ";
if (occasionale)
{ {
// Compone la ragione sociale (considera gli occasionali) ws << "(" << cli_occ.get("CFPI") << ") " ;
// Il formato è il seguente: CODICE (OCFPI) RAGIONE_SOCIALE ws << cli_occ.get("RAGSOC");
TString ws;
const bool print_cod = s.get_int(2)!=0;
TDocumento& documento = (TDocumento&)cf.form().cursor()->file(LF_DOC).curr();
TCli_for& cli_for = documento.clifor();
TOccasionale& cli_occ = documento.occas();
const bool occasionale = cli_for.occasionale();
if (print_cod)
ws << cli_for.get("CODCF") << " ";
if (occasionale)
{
ws << "(" << cli_occ.get("CFPI") << ") " ;
ws << cli_occ.get("RAGSOC");
}
else
ws << cli_for.get("RAGSOC");
cf.set(ws);
} }
else else
if (action == "QTA") ws << cli_for.get("RAGSOC");
cf.set(ws);
}
else
if (action == "QTA")
{
cf.set(rdoc.quantita().string());
} else
if (action == "QTAEVASA")
{
cf.set(rdoc.qtaevasa().string());
} else
if (action == "RESIDUO")
{
cf.set(rdoc.qtaresidua().string());
} else
if (action == "VALORE")
{
cf.set(rdoc.valore(TRUE, AUTO_DECIMALS).string());
} else
if (action == "VALRES")
{
cf.set(rdoc.valore(FALSE, AUTO_DECIMALS).string());
} else
if (action == "GIACENZA")
{
real g = ZERO;
const TString& codart = rdoc.get(RDOC_CODARTMAG);
if (codart.not_empty() && _art_giac->read(codart) == NOERR)
{ {
cf.set(rdoc.quantita().string()); const TDate oggi(TODAY);
} else TString16 annoes; annoes.format("%04d", _esercizi->date2esc(oggi));
if (action == "QTAEVASA") const TString16 codmag(rdoc.get("CODMAG")); // Riferito al magazzino indicato sulla riga...
{ const TString16 livello(_level > 0 ? rdoc.get(RDOC_LIVELLO) : "");
cf.set(rdoc.qtaevasa().string()); g = _art_giac->disponibilita(annoes, codmag, livello, TRUE); // Giacenza attuale
} else
if (action == "RESIDUO")
{
cf.set(rdoc.qtaresidua().string());
} else
if (action == "VALORE")
{
cf.set(rdoc.valore(TRUE, AUTO_DECIMALS).string());
} else
if (action == "VALRES")
{
cf.set(rdoc.valore(FALSE, AUTO_DECIMALS).string());
} else
if (action == "GIACENZA")
{
real g = ZERO;
const TString& codart = rdoc.get(RDOC_CODARTMAG);
if (codart.not_empty() && _art_giac->read(codart) == NOERR)
{
const TDate oggi(TODAY);
TString16 annoes; annoes.format("%04d", _esercizi->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
}
cf.set(g.string());
} }
cf.set(g.string());
}
//Ignore any other command //Ignore any other command
return TRUE; return TRUE;
} }