Patch level :
Files correlati : ve1 Ricompilazione Demo : [ ] Commento : Corretta gestione conferma e-mail git-svn-id: svn://10.65.10.50/trunk@20415 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b4aeec6e56
commit
f34e8ca09a
@ -950,7 +950,7 @@ protected:
|
||||
virtual bool get_next_pdf(int anno, long ditta, const char* codnum, long numdoc, long codcf, TFilename& pdf) const;
|
||||
const TString& get_mail_address() const;
|
||||
virtual bool get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
||||
TString& subj, TString& text, TToken_string& attach, bool& ui) const ;
|
||||
TString& subj, TString& text, TToken_string& attach, short& ui) const ;
|
||||
void print_extra_copies(TReport_doc& report, const TRecordset& doc, TReport_book& book) const;
|
||||
|
||||
public:
|
||||
@ -984,7 +984,7 @@ const TString& TReport_doc_app::get_mail_address() const
|
||||
}
|
||||
|
||||
bool TReport_doc_app::get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
||||
TString& subj, TString& text, TToken_string& attach, bool& ui) const
|
||||
TString& subj, TString& text, TToken_string& attach, short& ui) const
|
||||
{
|
||||
bool ok = TApplication::get_next_mail(to, cc, ccn, subj, text, attach, ui);
|
||||
|
||||
@ -999,7 +999,9 @@ bool TReport_doc_app::get_next_mail(TToken_string& to, TToken_string& cc, TToken
|
||||
if (subj.blank())
|
||||
subj = doc.tipo().descrizione();
|
||||
text << TR("Invio documento ") << subj;
|
||||
ui = false;
|
||||
if (to.full())
|
||||
ui &= ~0x1; // No user interface
|
||||
ui |= 0x2; // Query receipt
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
|
@ -74,9 +74,9 @@ class TCache_articoli;
|
||||
class TSmart_card;
|
||||
|
||||
|
||||
bool is_sconto_not_zero(const char * exp);
|
||||
bool scontoexpr2perc(const char * exp, bool signal , TString & goodexp, real & val_perc );
|
||||
real prezzo_scontato(const real& prezzo, const char * sconto);
|
||||
bool is_real_discount(const TString& exp);
|
||||
bool scontoexpr2perc(const char* exp, bool signal , TString& goodexp, real & val_perc );
|
||||
real prezzo_scontato(const real& prezzo, const TString& sconto);
|
||||
|
||||
bool ora_hndl(TMask_field& field, KEY key);
|
||||
bool totdoc_hndl(TMask_field& field, KEY key);
|
||||
|
@ -159,9 +159,12 @@ real TSpesa_prest::prezzo() const
|
||||
return r;
|
||||
}
|
||||
|
||||
bool is_sconto_not_zero(const char * exp)
|
||||
bool is_real_discount(const TString& exp)
|
||||
{
|
||||
TString good;
|
||||
if (exp.blank())
|
||||
return false;
|
||||
|
||||
TString80 good;
|
||||
real perc;
|
||||
|
||||
return scontoexpr2perc(exp, false , good, perc) && perc != UNO;
|
||||
@ -257,16 +260,15 @@ bool scontoexpr2perc(const char * exp, bool signal , TString & goodexp, real & v
|
||||
return valid;
|
||||
}
|
||||
|
||||
real prezzo_scontato(const real& prezzo, const char * sconto)
|
||||
real prezzo_scontato(const real& prezzo, const TString& sconto)
|
||||
{
|
||||
real scontato = prezzo;
|
||||
if (sconto && *sconto)
|
||||
if (sconto.full())
|
||||
{
|
||||
TString80 exp;
|
||||
real val_sconto;
|
||||
scontoexpr2perc(sconto, FALSE , exp, val_sconto);
|
||||
scontato *= val_sconto;
|
||||
if (scontoexpr2perc(sconto, false , exp, val_sconto) && val_sconto != UNO)
|
||||
return prezzo * val_sconto;
|
||||
}
|
||||
return scontato;
|
||||
return prezzo;
|
||||
}
|
||||
|
||||
|
@ -444,29 +444,27 @@ real TRiga_documento::prezzo(bool scontato, bool lordo, int ndec) const
|
||||
if (doc().tipo().calcolo_lordo())
|
||||
{
|
||||
prezzo = get_real(RDOC_PREZZOL);
|
||||
if (prezzo == ZERO)
|
||||
if (prezzo.is_zero())
|
||||
{
|
||||
prezzo = get_real("PREZZO");
|
||||
|
||||
prezzo = get_real(RDOC_PREZZO);
|
||||
if (scontato)
|
||||
prezzo = prezzo_scontato(prezzo, get("SCONTO"));
|
||||
prezzo = prezzo_scontato(prezzo, get(RDOC_SCONTO));
|
||||
if (lordo)
|
||||
prezzo = iva().lordo(prezzo, ndec);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (scontato)
|
||||
prezzo = prezzo_scontato(prezzo, get("SCONTO"));
|
||||
prezzo = prezzo_scontato(prezzo, get(RDOC_SCONTO));
|
||||
if (!lordo)
|
||||
iva().scorpora(prezzo, ndec);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
prezzo = get_real("PREZZO");
|
||||
prezzo = get_real(RDOC_PREZZO);
|
||||
if (scontato)
|
||||
prezzo = prezzo_scontato(prezzo, get("SCONTO"));
|
||||
// prezzo.round(ndec);
|
||||
prezzo = prezzo_scontato(prezzo, get(RDOC_SCONTO));
|
||||
if (lordo)
|
||||
prezzo = iva().lordo(prezzo, ndec);
|
||||
}
|
||||
|
@ -848,7 +848,7 @@ void TDocumento::set_riga_sconto()
|
||||
{
|
||||
const TString80 sconto(get(DOC_SCONTOPERC));
|
||||
|
||||
if (sconto.blank() || !is_sconto_not_zero(sconto))
|
||||
if (!is_real_discount(sconto))
|
||||
{
|
||||
if(_sconto != NULL)
|
||||
delete _sconto;
|
||||
|
Loading…
x
Reference in New Issue
Block a user