Migliorata gestione fattura P.A.:
flag di fattura temporanea (no P.A.) corretto calcolo rate in split payment git-svn-id: svn://10.65.10.50/branches/R_10_00@23099 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d40707a134
commit
5618a1b489
@ -1,33 +1,27 @@
|
||||
#include <applicat.h>
|
||||
#include <doc.h>
|
||||
#include <mask.h>
|
||||
#include <postman.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
|
||||
#include "ve5200.h"
|
||||
#include "velib.h"
|
||||
#include "velib04.h"
|
||||
|
||||
class TStatus_mask : public TMask
|
||||
{
|
||||
public:
|
||||
TStatus_mask() : TMask("ve5200") { }
|
||||
virtual ~TStatus_mask() { }
|
||||
};
|
||||
|
||||
|
||||
class TStatus_change : public TSkeleton_application
|
||||
{
|
||||
|
||||
virtual const char * extra_modules() const {return "dt";}
|
||||
virtual const char* extra_modules() const { return "dt"; }
|
||||
|
||||
protected: // TSkeleton_application
|
||||
virtual void main_loop();
|
||||
virtual bool create();
|
||||
|
||||
public:
|
||||
TStatus_change() { }
|
||||
virtual ~TStatus_change() { }
|
||||
void do_elab( TDocumento& doc);
|
||||
};
|
||||
|
||||
bool TStatus_change::create()
|
||||
@ -38,6 +32,56 @@ bool TStatus_change::create()
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
void TStatus_change::do_elab(TDocumento& doc) // C 90
|
||||
{
|
||||
TElaborazione * el = NULL;
|
||||
|
||||
const TString16 codelab = doc.tipo().elaborazione();
|
||||
if (codelab.full())
|
||||
{
|
||||
const TRectype& eld = cache().get("%ELD", codelab);
|
||||
if (!eld.empty())
|
||||
{
|
||||
switch (eld.get_int("I0"))
|
||||
{
|
||||
case _esterna :
|
||||
el = new TElaborazione_esterna(eld);
|
||||
break;
|
||||
case _consegna_ordini:
|
||||
el = new TConsegna_ordini(eld);
|
||||
break;
|
||||
case _fatturazione_bolle :
|
||||
el = new TFatturazione_bolle(eld);
|
||||
break;
|
||||
case _contabilizzazione :
|
||||
el = new TContabilizzazione(eld);
|
||||
break;
|
||||
case _copia_documento :
|
||||
el = new TCopia_documento(eld);
|
||||
break;
|
||||
case _generazione_effetti :
|
||||
el = new TGenerazione_effetti(eld);
|
||||
break;
|
||||
case _consuntivazione_produzione :
|
||||
el = new TConsuntivazione_produzione(eld);
|
||||
break;
|
||||
case _contabilizzazione_analitica :
|
||||
el = new TContabilizzazione_analitica(eld);
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (el != NULL && el->is_document_ok(doc))
|
||||
{
|
||||
TLista_documenti in; in.add(doc);
|
||||
TLista_documenti out;
|
||||
el->elabora(in, out, TDate(TODAY), false);
|
||||
}
|
||||
}
|
||||
|
||||
void TStatus_change::main_loop()
|
||||
{
|
||||
TStatus_mask m;
|
||||
@ -59,40 +103,43 @@ void TStatus_change::main_loop()
|
||||
const long total = cur.items();
|
||||
if (total > 0)
|
||||
{
|
||||
TString msg = "Confermare l'aggiornamento di ";
|
||||
msg.add_plural(total, "documento");
|
||||
TString msg = TR("Confermare l'aggiornamento di ");
|
||||
msg.add_plural(total, TR("documento"));
|
||||
if (yesno_box(msg))
|
||||
{
|
||||
TProgind pi(total, "Elaborazione in corso...", TRUE, TRUE, 60);
|
||||
TProgress_monitor pi(total, name());
|
||||
const TString& finale = m.get(F_FINALE);
|
||||
TDocumento* doc = new TDocumento;
|
||||
rel.lfile().set_curr(doc);
|
||||
cur.freeze();
|
||||
for (cur = 0; cur.pos() < total && !pi.iscancelled(); ++cur)
|
||||
for (cur = 0; cur.pos() < total; ++cur)
|
||||
{
|
||||
pi.addstatus(1);
|
||||
if (!pi.add_status())
|
||||
break;
|
||||
doc->put(DOC_STATO, finale);
|
||||
doc->rewrite();
|
||||
|
||||
int err = doc->rewrite();
|
||||
|
||||
if (err == NOERR)
|
||||
do_elab(*doc);
|
||||
|
||||
// Invia anche la transazione se necessario
|
||||
if (::can_dispatch_transaction(*doc))
|
||||
if (err = NOERR && ::can_dispatch_transaction(*doc))
|
||||
{
|
||||
TFilename tmpname; tmpname.temp();
|
||||
TFilename tmpname; tmpname.tempdir(); tmpname.add("ve5trans.ini");
|
||||
{ // Parentesi strategiche
|
||||
TConfig ini(tmpname, "Transaction");
|
||||
ini.set("Action", "MODIFY");
|
||||
ini.set("Firm", get_firm());
|
||||
ini.set("Mode", "A");
|
||||
TString8 paradoc; paradoc.format("%d", LF_DOC);
|
||||
ini.set_paragraph(paradoc);
|
||||
ini.set(DOC_PROVV, doc->get(DOC_PROVV));
|
||||
ini.set(DOC_ANNO, doc->get(DOC_ANNO));
|
||||
ini.set_paragraph("33");
|
||||
ini.set(DOC_PROVV, doc->get(DOC_PROVV));
|
||||
ini.set(DOC_ANNO, doc->get(DOC_ANNO));
|
||||
ini.set(DOC_CODNUM, doc->get(DOC_CODNUM));
|
||||
ini.set(DOC_NDOC, doc->get(DOC_NDOC));
|
||||
ini.set(DOC_STATO, finale);
|
||||
ini.set(DOC_NDOC, doc->get(DOC_NDOC));
|
||||
ini.set(DOC_STATO, finale);
|
||||
}
|
||||
::dispatch_transaction(*doc, tmpname);
|
||||
::remove(tmpname);
|
||||
xvt_fsys_remove_file(tmpname);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -479,20 +479,19 @@ int TElaborazione::read(const char* cod)
|
||||
bool TElaborazione::is_document_ok(const TRectype& doc) const
|
||||
{
|
||||
bool ok = false;
|
||||
const TString4 codnum(doc.get(DOC_CODNUM));
|
||||
const TString4 tipodoc(doc.get(DOC_TIPODOC));
|
||||
const char stato(doc.get_char(DOC_STATO));
|
||||
const TString4 codnum = doc.get(DOC_CODNUM);
|
||||
const TString& codnumel = codice_numerazione_iniziale();
|
||||
|
||||
if (codnumel.blank() || codnum == codnumel)
|
||||
{
|
||||
const TString4 tipodoc = doc.get(DOC_TIPODOC);
|
||||
const char stato = doc.get_char(DOC_STATO);
|
||||
for (int i = 0; !ok && i < TElaborazione::_max_tipi_doc_elab; i++)
|
||||
{
|
||||
const TString & tipel = tipo_iniziale(i);
|
||||
if (tipel.blank())
|
||||
break;
|
||||
if (tipodoc == tipel && stato == stato_iniziale(i))
|
||||
ok = true;
|
||||
const TString& tipel = tipo_iniziale(i);
|
||||
if (tipel.blank())
|
||||
break;
|
||||
const char stael = stato_iniziale(i);
|
||||
ok = tipodoc == tipel && stato == stael;
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
|
@ -143,9 +143,12 @@ void TDocumentoEsteso::scadenze_recalc()
|
||||
real totimposte = imposta(TRUE);
|
||||
real pagato = hh.get_real(DOC_IMPPAGATO);
|
||||
const bool saldo = hh.get_bool(DOC_ACCSALDO);
|
||||
real totimponibili = totale_doc() - ritenute() - totimposte - totspese;//tot_documento() - totimposte - totspese;
|
||||
real totimponibili = totale_doc() - ritenute() - totimposte - totspese;
|
||||
const bool is_in_valuta = in_valuta();
|
||||
|
||||
|
||||
if (is_split_payment())
|
||||
totimposte = ZERO;
|
||||
|
||||
if (saldo || pagato > totale_doc())
|
||||
{
|
||||
totimponibili = ZERO;
|
||||
|
@ -83,4 +83,5 @@
|
||||
#define F_CNTES 274
|
||||
#define F_ARCHIVE 275
|
||||
#define F_SPMSP 276
|
||||
#define F_REVLEN 277
|
||||
#define F_REVLEN 277
|
||||
#define F_NOPA 278
|
@ -130,7 +130,7 @@ END
|
||||
|
||||
BOOLEAN F_SAVEANDNEW
|
||||
BEGIN
|
||||
PROMPT 2 15 "Rimani in inserimento dopo la registrazione"
|
||||
PROMPT 2 15 "Rimanere in inserimento dopo la registrazione"
|
||||
FIELD B4
|
||||
END
|
||||
|
||||
@ -157,7 +157,7 @@ BEGIN
|
||||
PROMPT 2 19 "Numerazione speciale per MSP"
|
||||
FIELD B9
|
||||
END
|
||||
|
||||
|
||||
LIST F_REVLEN 1 8
|
||||
BEGIN
|
||||
PROMPT 2 20 "Cifre riservate alle revisioni (Preventivi) "
|
||||
@ -182,20 +182,25 @@ PAGE "Tipi documento validi" -1 -1 60 14
|
||||
PROMPT 2 2 "Tipo dei documenti "
|
||||
FIELD I1
|
||||
ITEM "|Altro"
|
||||
MESSAGE ENABLE,F_EMRI
|
||||
MESSAGE ENABLE,F_EMRI|HIDE,F_NOPA
|
||||
ITEM "1|Bolla"
|
||||
MESSAGE CLEAR,F_EMRI
|
||||
MESSAGE CLEAR,F_EMRI|HIDE,F_NOPA
|
||||
ITEM "2|Fattura"
|
||||
MESSAGE ENABLE,F_EMRI
|
||||
MESSAGE ENABLE,F_EMRI|SHOW,F_NOPA
|
||||
ITEM "3|Ordine"
|
||||
MESSAGE CLEAR,F_EMRI
|
||||
ITEM "4|Scontrino"
|
||||
MESSAGE ENABLE,F_EMRI
|
||||
MESSAGE CLEAR,F_EMRI|HIDE,F_NOPA
|
||||
ITEM "4|Scontrino"
|
||||
MESSAGE ENABLE,F_EMRI|HIDE,F_NOPA
|
||||
ITEM "5|Conferimento soci"
|
||||
MESSAGE CLEAR,F_EMRI
|
||||
MESSAGE CLEAR,F_EMRI|HIDE,F_NOPA
|
||||
ITEM "6|Prestazioni ai soci"
|
||||
MESSAGE CLEAR,F_EMRI
|
||||
MESSAGE CLEAR,F_EMRI|HIDE,F_NOPA
|
||||
END
|
||||
|
||||
BOOLEAN F_NOPA
|
||||
BEGIN
|
||||
PROMPT 2 3 "Fattura provvisioria (non valida per P.A.)"
|
||||
FIELD B10
|
||||
END
|
||||
|
||||
STRING F_TIPODOC1 4
|
||||
|
Loading…
x
Reference in New Issue
Block a user