Errori aga074-075-076-077
git-svn-id: svn://10.65.10.50/trunk@4394 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
62a19c614b
commit
f99445f2b0
@ -11,19 +11,19 @@ BEGIN
|
||||
PROMPT 1 1 "@bElaborazione"
|
||||
END
|
||||
|
||||
STRING F_CODICE 8
|
||||
STRING F_CODICE 8
|
||||
BEGIN
|
||||
PROMPT 2 2 "Codice "
|
||||
PROMPT 2 2 "Codice "
|
||||
FLAG "U"
|
||||
FIELD CODTAB
|
||||
CHECKTYPE REQUIRED
|
||||
FIELD CODTAB
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "E' necessario specificare un valore"
|
||||
USE %ELD
|
||||
INPUT CODTAB F_CODICE
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_CODICE CODTAB
|
||||
OUTPUT F_DESCR S0
|
||||
USE %ELD
|
||||
INPUT CODTAB F_CODICE
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_CODICE CODTAB
|
||||
OUTPUT F_DESCR S0
|
||||
KEY 1
|
||||
HELP "Codice dell'elaborazione differita da eseguire"
|
||||
END
|
||||
@ -38,19 +38,20 @@ BEGIN
|
||||
INPUT S0 F_DESCR
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_CODICE
|
||||
COPY OUTPUT F_CODICE
|
||||
KEY 2
|
||||
END
|
||||
|
||||
LIST F_TIPO 50
|
||||
BEGIN
|
||||
PROMPT 2 4 "Tipo "
|
||||
ITEM " |Altro"
|
||||
ITEM "CO|Consegna Ordini"
|
||||
ITEM "FB|Fatturazione bolle"
|
||||
ITEM "SM|Scarico magazzino"
|
||||
ITEM "TC|Trasferimento a contabilita'"
|
||||
FIELD S3
|
||||
ITEM " |Esterna"
|
||||
ITEM "1|Consegna Ordini"
|
||||
ITEM "2|Fatturazione bolle"
|
||||
ITEM "3|Trasferimento a contabilita'"
|
||||
ITEM "4|Copia documento"
|
||||
ITEM "5|Generazione effetti"
|
||||
FIELD I0
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
@ -108,10 +109,10 @@ BEGIN
|
||||
END
|
||||
|
||||
STRING F_TIPODOC_I_1 4
|
||||
BEGIN
|
||||
BEGIN
|
||||
PROMPT 2 8 "Tipo documento "
|
||||
FLAGS "U"
|
||||
FIELD S2[1,4]
|
||||
FIELD S2[1,4]
|
||||
USE %TIP
|
||||
INPUT CODTAB F_TIPODOC_I_1
|
||||
DISPLAY "Codice" CODTAB
|
||||
@ -123,10 +124,10 @@ BEGIN
|
||||
END
|
||||
|
||||
STRING F_TIPODOC_I_2 4
|
||||
BEGIN
|
||||
BEGIN
|
||||
PROMPT 30 8 ""
|
||||
FLAGS "U"
|
||||
FIELD S2[5,8]
|
||||
FIELD S2[5,8]
|
||||
COPY USE F_TIPODOC_I_1
|
||||
INPUT CODTAB F_TIPODOC_I_2
|
||||
COPY DISPLAY F_TIPODOC_I_1
|
||||
@ -137,10 +138,10 @@ BEGIN
|
||||
END
|
||||
|
||||
STRING F_TIPODOC_I_3 4
|
||||
BEGIN
|
||||
BEGIN
|
||||
PROMPT 39 8 ""
|
||||
FLAGS "U"
|
||||
FIELD S2[9,12]
|
||||
FIELD S2[9,12]
|
||||
COPY USE F_TIPODOC_I_1
|
||||
INPUT CODTAB F_TIPODOC_I_3
|
||||
COPY DISPLAY F_TIPODOC_I_1
|
||||
@ -151,10 +152,10 @@ BEGIN
|
||||
END
|
||||
|
||||
STRING F_TIPODOC_I_4 4
|
||||
BEGIN
|
||||
BEGIN
|
||||
PROMPT 48 8 ""
|
||||
FLAGS "U"
|
||||
FIELD S2[13,15]
|
||||
FIELD S2[13,15]
|
||||
COPY USE F_TIPODOC_I_1
|
||||
INPUT CODTAB F_TIPODOC_I_4
|
||||
COPY DISPLAY F_TIPODOC_I_1
|
||||
@ -165,10 +166,10 @@ BEGIN
|
||||
END
|
||||
|
||||
STRING F_TIPODOC_I_5 4
|
||||
BEGIN
|
||||
BEGIN
|
||||
PROMPT 57 8 ""
|
||||
FLAGS "U"
|
||||
FIELD S2[16,19]
|
||||
FIELD S2[16,19]
|
||||
COPY USE F_TIPODOC_I_1
|
||||
INPUT CODTAB F_TIPODOC_I_4
|
||||
COPY DISPLAY F_TIPODOC_I_1
|
||||
@ -217,7 +218,7 @@ END
|
||||
|
||||
STRING F_STATO_F_DOC_I 1
|
||||
BEGIN
|
||||
PROMPT 2 10 "Stato finale "
|
||||
PROMPT 2 10 "Stato finale "
|
||||
FLAGS "U"
|
||||
FIELD S4
|
||||
CHECKTYPE REQUIRED
|
||||
@ -281,6 +282,26 @@ BEGIN
|
||||
FIELD B4
|
||||
END
|
||||
|
||||
BOOLEAN F_INTERATTIVO
|
||||
BEGIN
|
||||
PROMPT 2 18 "Interattivo"
|
||||
FIELD B5
|
||||
MESSAGE FALSE CLEAR,F_INSERT_MODE
|
||||
MESSAGE TRUE ENABLE,F_INSERT_MODE
|
||||
END
|
||||
|
||||
BOOLEAN F_INSERT_MODE
|
||||
BEGIN
|
||||
PROMPT 42 18 "Attivo solo in creazione"
|
||||
FIELD B6
|
||||
END
|
||||
|
||||
STRING F_APPLICAZIONE 20
|
||||
BEGIN
|
||||
PROMPT 2 19 "Applicazione esterna"
|
||||
FIELD S3
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Parametri per raggruppamenti" -1 -1 78 20
|
||||
@ -369,7 +390,7 @@ BEGIN
|
||||
FLAG "R"
|
||||
END
|
||||
|
||||
BOOLEAN F_SOMMA_RIGHE
|
||||
BOOLEAN F_SOMMA_RIGHE
|
||||
BEGIN
|
||||
PROMPT 2 11 "Somma righe simili"
|
||||
MESSAGE FALSE ENABLE,F_RIFERIMENTI_IN_TESTA
|
||||
@ -409,9 +430,10 @@ END
|
||||
|
||||
BOOLEAN F_IGNORA_DESCRIZIONI
|
||||
BEGIN
|
||||
PROMPT 2 15 "Ignora righe con la sola descrizione"
|
||||
PROMPT 2 15 "Ignora righe con solo descrizione"
|
||||
FIELD B3
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
188
ve/ve6300.cpp
188
ve/ve6300.cpp
@ -37,6 +37,7 @@
|
||||
#include "../cg/saldacon.h"
|
||||
#include "../ef/ef0101.h"
|
||||
#include "velib01.h"
|
||||
#include "sconti.h"
|
||||
#include "ve6300a.h"
|
||||
|
||||
// Enum di possibili errori
|
||||
@ -72,6 +73,8 @@ class TGenerazioneEffetti_app : public TApplication
|
||||
*_tab; // tabella di ditta
|
||||
TTable *_cpg; // tabella condizioni di pagamento
|
||||
TDocumento *_doc; // documento corrente
|
||||
TCond_vendita *_condv; // Condizioni di vendita
|
||||
TCliFor *_clifor; // Cliente
|
||||
TPagamento *_pagamento; // pagamento corrente, ricalcolato prima di scrivere le scadenze
|
||||
TBit_array _valid_array; // array dei tipi di pagamento validi per la generazione di effetti
|
||||
TArray_sheet *_num_sheet; // Array sheet selezionabile dei codici numerazione
|
||||
@ -277,7 +280,10 @@ bool TGenerazioneEffetti_app::create()
|
||||
_efffile = new TLocalisamfile(LF_EFFETTI);
|
||||
_refffile = new TLocalisamfile(LF_REFFETTI);
|
||||
_cessfile = new TLocalisamfile(LF_CESS);
|
||||
_doc = new TDocumento;
|
||||
_clifor = new TCliFor();
|
||||
_condv = new TCond_vendita(_clifor);
|
||||
_doc = new TDocumento();
|
||||
_doc->set_condv(_condv);
|
||||
_cpg = new TTable("%CPG");
|
||||
_tab = new TLocalisamfile(LF_TAB);
|
||||
_clifo = new TRelation(LF_CLIFO);
|
||||
@ -500,8 +506,14 @@ void TGenerazioneEffetti_app::build_group_key(TString& key)
|
||||
// campi obbligatori
|
||||
key.format("%7ld%3s",cli,(const char*)val);
|
||||
// campi opzionali
|
||||
if (_group_by_date)
|
||||
key << _doc->get(DOC_DATAINSC);
|
||||
if (_group_by_date)
|
||||
{
|
||||
TString16 d(_doc->get(DOC_DATAINSC));
|
||||
|
||||
if (d.empty())
|
||||
d = _doc->get(DOC_DATADOC);
|
||||
key << d;
|
||||
}
|
||||
// Qual'e' il flag di sospensione d'imposta del documento ??
|
||||
// if (_group_by_sosp)
|
||||
// key << _doc->get(DOC_????);
|
||||
@ -615,86 +627,96 @@ void TGenerazioneEffetti_app::generate_bill() // bill in inglese significa anche
|
||||
_error = codpag_error;
|
||||
return;
|
||||
}
|
||||
TString16 data(_doc->get(DOC_DATAINSC));
|
||||
const real totale_fatt = _doc->totale_doc(); // Importo in valuta
|
||||
const bool valuta = _doc->in_valuta();
|
||||
const real change = _doc->cambio();
|
||||
|
||||
// calcolo delle scadenze
|
||||
calc_pagamento(codpag,totale_fatt,data,valuta,change);
|
||||
|
||||
CHECK(_pagamento,"Failed to create a TPagamento");
|
||||
const int numrate = _pagamento->n_rate( );
|
||||
if (numrate < 1)
|
||||
TString16 data(_doc->get(DOC_DATAINSC));
|
||||
|
||||
if (data.empty())
|
||||
data = _doc->get(DOC_DATADOC);
|
||||
|
||||
const real totale_fatt = _doc->totale_doc(); // Importo in valuta
|
||||
if (totale_fatt > ZERO)
|
||||
{
|
||||
_error = scadenze_error;
|
||||
return;
|
||||
}
|
||||
|
||||
_efffile->last();
|
||||
// Variabili per la scrittura dell'effetto
|
||||
long nprog = _efffile->get_long(EFF_NPROGTR)+1;
|
||||
const long codcf = _doc->get_long(DOC_CODCF);
|
||||
const TString16 codval(_doc->get(DOC_CODVAL));
|
||||
const TDate data_cambio = _doc->get_date(DOC_DATACAMBIO);
|
||||
const long codabi = _doc->get_long(DOC_CODABIA);
|
||||
const long codcab = _doc->get_long(DOC_CODCABA);
|
||||
const TString16 provv(_doc->get(DOC_PROVV));
|
||||
const int anno = _doc->get_int(DOC_ANNO);
|
||||
const TString16 codnum(_doc->get(DOC_CODNUM));
|
||||
const long nfatt = _doc->get_long(DOC_NDOC);
|
||||
const TDate datafatt = _doc->get_date(DOC_DATADOC);
|
||||
TRectype& effetto = _efffile->curr();
|
||||
TRectype& reffetto = _refffile->curr();
|
||||
real importo;
|
||||
for (int i = 0; i < numrate && good(); i++)
|
||||
{
|
||||
effetto.zero();
|
||||
reffetto.zero();
|
||||
effetto.put(EFF_NPROGTR,nprog);
|
||||
effetto.put(EFF_DATASCAD, _pagamento->data_rata(i));
|
||||
effetto.put(EFF_TIPOPAG,_pagamento->tipo_rata(i));
|
||||
effetto.put(EFF_ULTCLASS,_pagamento->ulc_rata(i));
|
||||
effetto.put(EFF_CODCF, codcf);
|
||||
effetto.put(EFF_CODVAL, codval);
|
||||
if (valuta)
|
||||
const bool valuta = _doc->in_valuta();
|
||||
const real change = _doc->cambio();
|
||||
|
||||
// calcolo delle scadenze
|
||||
calc_pagamento(codpag,totale_fatt,data,valuta,change);
|
||||
|
||||
CHECK(_pagamento,"Failed to create a TPagamento");
|
||||
const int numrate = _pagamento->n_rate( );
|
||||
if (numrate < 1)
|
||||
{
|
||||
effetto.put(EFF_CAMBIO, change);
|
||||
effetto.put(EFF_DATACAMBIO,data_cambio);
|
||||
}
|
||||
effetto.put(EFF_CODABI,codabi);
|
||||
effetto.put(EFF_CODCAB,codcab);
|
||||
effetto.put(EFF_EFFCOMP,TRUE);
|
||||
if (i == numrate - 1) effetto.put(EFF_ULTRATA,TRUE);
|
||||
// Put sulla riga dell'effetto
|
||||
reffetto.put(REFF_NPROGTR,nprog);
|
||||
reffetto.put(REFF_NRIGATR,1);
|
||||
reffetto.put(REFF_DATAFATT, datafatt);
|
||||
reffetto.put(REFF_NRATA,i+1);
|
||||
reffetto.put(REFF_PROVV,provv);
|
||||
reffetto.put(REFF_ANNODOC,anno);
|
||||
reffetto.put(REFF_CODNUM,codnum);
|
||||
reffetto.put(REFF_NFATT,nfatt);
|
||||
importo = _pagamento->importo_rata(i,FALSE);
|
||||
effetto.put(EFF_IMPORTO,importo);
|
||||
reffetto.put(REFF_IMPFATT,totale_fatt);
|
||||
reffetto.put(REFF_IMPORTO,importo);
|
||||
if (valuta)
|
||||
{
|
||||
importo = _pagamento->importo_rata(i,TRUE); // Importo in valuta
|
||||
real totfatlit = totale_fatt*change; //Not sure about this...
|
||||
effetto.put(EFF_IMPORTOVAL,importo);
|
||||
reffetto.put(REFF_IMPFATTVAL,totale_fatt);
|
||||
reffetto.put(REFF_IMPFATT,totfatlit);
|
||||
reffetto.put(REFF_IMPORTOVAL,importo);
|
||||
_error = scadenze_error;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_efffile->write() == NOERR && _refffile->write() == NOERR)
|
||||
_efffile->last();
|
||||
// Variabili per la scrittura dell'effetto
|
||||
long nprog = _efffile->get_long(EFF_NPROGTR)+1;
|
||||
const long codcf = _doc->get_long(DOC_CODCF);
|
||||
const TString16 codval(_doc->get(DOC_CODVAL));
|
||||
const TDate data_cambio = _doc->get_date(DOC_DATACAMBIO);
|
||||
const long codabi = _doc->get_long(DOC_CODABIA);
|
||||
const long codcab = _doc->get_long(DOC_CODCABA);
|
||||
const TString16 provv(_doc->get(DOC_PROVV));
|
||||
const int anno = _doc->get_int(DOC_ANNO);
|
||||
const TString16 codnum(_doc->get(DOC_CODNUM));
|
||||
const long nfatt = _doc->get_long(DOC_NDOC);
|
||||
const TDate datafatt = _doc->get_date(DOC_DATADOC);
|
||||
TRectype& effetto = _efffile->curr();
|
||||
TRectype& reffetto = _refffile->curr();
|
||||
real importo;
|
||||
for (int i = 0; i < numrate && good(); i++)
|
||||
{
|
||||
_total_bills++;
|
||||
nprog++;
|
||||
if (valid_type(_pagamento->tipo_rata(i)))
|
||||
{
|
||||
effetto.zero();
|
||||
reffetto.zero();
|
||||
effetto.put(EFF_NPROGTR,nprog);
|
||||
effetto.put(EFF_DATASCAD, _pagamento->data_rata(i));
|
||||
effetto.put(EFF_TIPOPAG,_pagamento->tipo_rata(i));
|
||||
effetto.put(EFF_ULTCLASS,_pagamento->ulc_rata(i));
|
||||
effetto.put(EFF_CODCF, codcf);
|
||||
effetto.put(EFF_CODVAL, codval);
|
||||
if (valuta)
|
||||
{
|
||||
effetto.put(EFF_CAMBIO, change);
|
||||
effetto.put(EFF_DATACAMBIO,data_cambio);
|
||||
}
|
||||
effetto.put(EFF_CODABI,codabi);
|
||||
effetto.put(EFF_CODCAB,codcab);
|
||||
effetto.put(EFF_EFFCOMP,TRUE);
|
||||
if (i == numrate - 1) effetto.put(EFF_ULTRATA,TRUE);
|
||||
// Put sulla riga dell'effetto
|
||||
reffetto.put(REFF_NPROGTR,nprog);
|
||||
reffetto.put(REFF_NRIGATR,1);
|
||||
reffetto.put(REFF_DATAFATT, datafatt);
|
||||
reffetto.put(REFF_NRATA,i+1);
|
||||
reffetto.put(REFF_PROVV,provv);
|
||||
reffetto.put(REFF_ANNODOC,anno);
|
||||
reffetto.put(REFF_CODNUM,codnum);
|
||||
reffetto.put(REFF_NFATT,nfatt);
|
||||
importo = _pagamento->importo_rata(i,FALSE);
|
||||
effetto.put(EFF_IMPORTO,importo);
|
||||
reffetto.put(REFF_IMPFATT,totale_fatt);
|
||||
reffetto.put(REFF_IMPORTO,importo);
|
||||
if (valuta)
|
||||
{
|
||||
importo = _pagamento->importo_rata(i,TRUE); // Importo in valuta
|
||||
real totfatlit = totale_fatt*change; //Not sure about this...
|
||||
effetto.put(EFF_IMPORTOVAL,importo);
|
||||
reffetto.put(REFF_IMPFATTVAL,totale_fatt);
|
||||
reffetto.put(REFF_IMPFATT,totfatlit);
|
||||
reffetto.put(REFF_IMPORTOVAL,importo);
|
||||
}
|
||||
|
||||
if (_efffile->write() == NOERR && _refffile->write() == NOERR)
|
||||
{
|
||||
_total_bills++;
|
||||
nprog++;
|
||||
}
|
||||
else _error = write_error;
|
||||
}
|
||||
}
|
||||
else _error = write_error;
|
||||
}
|
||||
|
||||
if (_pagamento) delete _pagamento;
|
||||
@ -760,6 +782,10 @@ void TGenerazioneEffetti_app::group_bills()
|
||||
return;
|
||||
}
|
||||
TString16 data(_doc->get(DOC_DATAINSC));
|
||||
|
||||
if (data.empty())
|
||||
data = _doc->get(DOC_DATADOC);
|
||||
|
||||
const real totale_fatt = _doc->totale_doc();
|
||||
const bool valuta = _doc->in_valuta();
|
||||
const real change = _doc->cambio();
|
||||
@ -906,8 +932,9 @@ void TGenerazioneEffetti_app::generate()
|
||||
if (_doc->read(doc_cur.curr()) != NOERR) continue;// legge il documento
|
||||
if (codnum != _doc->get(DOC_CODNUM)) continue; // patch del cazzo
|
||||
if (doc_tipo_stato_ok()) // controlla che il tipo documento e lo stato siano coerenti con la ELD selezionata
|
||||
{
|
||||
if (valid_type(_doc->pagamento().tipo_rata(0))) // il tipo di pagamento puo' generare effetti ?
|
||||
{
|
||||
TPagamento & pag = _doc->pagamento();
|
||||
if (pag.code().not_empty()) // && valid_type(pag.tipo_rata(0))) // il tipo di pagamento puo' generare effetti ?
|
||||
{
|
||||
const bool raggruppabile = _doc->get_bool(DOC_RAGGREFF);
|
||||
if (!_raggruppa || (_raggruppa && !raggruppabile))
|
||||
@ -915,6 +942,9 @@ void TGenerazioneEffetti_app::generate()
|
||||
else
|
||||
add_to_group_list();
|
||||
}
|
||||
else
|
||||
if (good() && _can_write)
|
||||
change_doc_status();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ STRING F_CODICE_ELAB 8
|
||||
BEGIN
|
||||
PROMPT 2 2 "Codice elaborazione "
|
||||
FLAG "U"
|
||||
USE %ELD SELECT S3 == "TC"
|
||||
USE %ELD SELECT I0 == 5
|
||||
INPUT CODTAB F_CODICE_ELAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@55" S0
|
||||
@ -19,7 +19,7 @@ END
|
||||
STRING F_DESC_ELAB 50 39
|
||||
BEGIN
|
||||
PROMPT 35 2 ""
|
||||
USE %ELD KEY 2 SELECT S3 == "TC"
|
||||
USE %ELD KEY 2 SELECT I0 == 4
|
||||
INPUT S0 F_DESC_ELAB
|
||||
DISPLAY "Descrizione@55" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
|
Loading…
x
Reference in New Issue
Block a user