Patch level : 2.0 678
Files correlati : sc2.exe sc2100a.msk Ricompilazione Demo : [ ] Commento : CM20092 Nel caso esistano documenti iva che hanno generato rate con valori negativi tali rate devono rientrare nella stampa in oggetto, così come avviene per la stampa dello scadenzarioe dell'estratto conto git-svn-id: svn://10.65.10.50/trunk@11741 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c666ff82be
commit
46ff07594b
@ -67,16 +67,7 @@ STRING F_LINPROF 1
|
||||
BEGIN
|
||||
PROMPT 19 3 ""
|
||||
FLAGS "U"
|
||||
USE LF_FORM
|
||||
INPUT TIPOPROF BASE_EC_PROFILE
|
||||
INPUT CODPROF[1,4] F_CODPROF
|
||||
INPUT CODPROF[5,5] F_LINPROF
|
||||
DISPLAY "Codice" CODPROF[1,4]
|
||||
DISPLAY "Lingua" CODPROF[5,5]
|
||||
DISPLAY "Descrizione@50" DESC
|
||||
OUTPUT F_CODPROF CODPROF[1,4]
|
||||
OUTPUT F_LINPROF CODPROF[5,5]
|
||||
OUTPUT F_DESPROF DESC
|
||||
COPY ALL F_CODPROF
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice profilo o lingua errato"
|
||||
END
|
||||
|
@ -1,14 +1,9 @@
|
||||
#include <prefix.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "sc2101.h"
|
||||
#include "sc2100a.h"
|
||||
|
||||
#include <comuni.h>
|
||||
|
||||
bool TEC_mask::codprof_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (f.to_check(k))
|
||||
if (!f.empty() && f.to_check(k))
|
||||
{
|
||||
TEdit_field & e = (TEdit_field &) f;
|
||||
|
||||
@ -35,11 +30,11 @@ bool TEC_mask::lingua_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_TAB && f.focusdirty())
|
||||
{
|
||||
TCursor& cur = *(((TEdit_field&)(f.mask().field(F_CODPROF))).browse()->cursor());
|
||||
// whew
|
||||
TString16 lin = f.get();
|
||||
TEdit_field& cod = f.mask().efield(F_CODPROF);
|
||||
TCursor& cur = *(cod.browse()->cursor());
|
||||
const TString& lin = f.get();
|
||||
if (lin != cur.curr().get("CODPROF").mid(4))
|
||||
f.mask().field(F_CODPROF).check(RUNNING_CHECK);
|
||||
cod.check(RUNNING_CHECK);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ class TStampaScaduto : public TPrintapp
|
||||
TArray _t, // Array per i totali
|
||||
_s_date; // Date per lo scaduto
|
||||
|
||||
static TString _last_game;
|
||||
static TString80 _last_game;
|
||||
static bool fil_function(const TRelation *);
|
||||
|
||||
protected:
|
||||
@ -136,7 +136,7 @@ public:
|
||||
TStampaScaduto();
|
||||
};
|
||||
|
||||
TString TStampaScaduto::_last_game;
|
||||
TString80 TStampaScaduto::_last_game;
|
||||
|
||||
inline TStampaScaduto& app() {return (TStampaScaduto&)main_app();}
|
||||
|
||||
@ -212,7 +212,7 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
||||
const TRiga_partite& rp = p.riga(r);
|
||||
// se la data di registrazione della partita ' > di _limop (data lim operazione)
|
||||
// non deve scorrere le scadenze
|
||||
const TDate data_reg(rp.get_date(PART_DATAREG));
|
||||
const TDate data_reg = rp.get_date(PART_DATAREG);
|
||||
if (data_reg > _limop) continue;
|
||||
for (int n=rp.rate(); n > 0; n--) // Browse all rows (scadenze)
|
||||
{
|
||||
@ -298,18 +298,30 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
||||
if (b == ZERO) // Se le scadenze sono a zero, vuol dire che sono state stornate
|
||||
res = ZERO; // da qualche nota di credito o non assegnato percio' non si ha residuo
|
||||
|
||||
/*
|
||||
if (res < ZERO) // Significa che l'importo pagato e' maggiore dell'importo in scadenza
|
||||
{ // c'e' un residuo positivo, e quindi va memorizzato
|
||||
res *= -1.0; // cambia il segno
|
||||
res_pagati+= res; // Residui pagati in piu'
|
||||
res = ZERO;
|
||||
}
|
||||
*/
|
||||
#ifdef __LONGDOUBLE__
|
||||
res.round(5);
|
||||
#endif
|
||||
if (res.sign() * b.sign() < 0) // Ho pagato piu' della scadenza
|
||||
{
|
||||
res_pagati -= res; // Residui pagati in piu'
|
||||
res = ZERO;
|
||||
}
|
||||
|
||||
if (d > _limscad)
|
||||
nonscad += res;
|
||||
else
|
||||
{
|
||||
// Detrae dal residuo scaduto eventuali pagamenti in piu' effettuati
|
||||
real gap = (res_pagati > res ? res : res_pagati);
|
||||
// real gap = (res_pagati > res ? res : res_pagati);
|
||||
const real gap = abs(res_pagati) > abs(res) ? res : res_pagati; // Guy was here
|
||||
res -= gap;
|
||||
res_pagati -= gap;
|
||||
}
|
||||
@ -342,34 +354,34 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
||||
const bool stampa_in_valuta = _stvaluta && _codval != " ";
|
||||
|
||||
if (residuo != ZERO)
|
||||
print_real(_residuo, residuo, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_residuo, residuo, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (nonscad != ZERO)
|
||||
print_real(_nonscad, nonscad, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_nonscad, nonscad, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (buonf != ZERO)
|
||||
print_real(_buonfin, buonf, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_buonfin, buonf, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (s1 != ZERO)
|
||||
print_real(_sc_1, s1, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_sc_1, s1, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (s2 != ZERO)
|
||||
print_real(_sc_2, s2, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_sc_2, s2, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (s3 != ZERO)
|
||||
print_real(_sc_3, s3, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_sc_3, s3, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (s4 != ZERO)
|
||||
print_real(_sc_4, s4, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_sc_4, s4, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (s5 != ZERO)
|
||||
print_real(_sc_5, s5, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_sc_5, s5, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (s6 != ZERO)
|
||||
print_real(_sc_6, s6, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_sc_6, s6, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
if (s7 != ZERO)
|
||||
print_real(_sc_7, s7, stampa_in_valuta ? _codval : "_FIRM");
|
||||
print_real(_sc_7, s7, stampa_in_valuta ? _codval : EMPTY_STRING);
|
||||
|
||||
// Aggiorna i totali...
|
||||
if (residuo!=ZERO || nonscad!=ZERO || buonf!=ZERO || s1!=ZERO || s2!=ZERO || s3!=ZERO || s4!= ZERO || s5!= ZERO || s6!=ZERO || s7!=ZERO)
|
||||
@ -671,43 +683,43 @@ void TStampaScaduto::print_totali_rows(int& nriga, bool what)
|
||||
if (k != " ")
|
||||
set_row(nriga,"@37g%-3s",(const char*)k);
|
||||
|
||||
print_real(value, v._rd, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._rd, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._rd != ZERO)
|
||||
set_row(nriga,"@41g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._ns, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._ns, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._ns != ZERO)
|
||||
set_row(nriga,"@60g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._bf, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._bf, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._bf != ZERO)
|
||||
set_row(nriga,"@79g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._s1, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._s1, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._s1 != ZERO)
|
||||
set_row(nriga,"@98g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._s2, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._s2, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._s2 != ZERO)
|
||||
set_row(nriga,"@117g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._s3, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._s3, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._s3 != ZERO)
|
||||
set_row(nriga,"@136g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._s4, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._s4, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._s4 != ZERO)
|
||||
set_row(nriga,"@155g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._s5, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._s5, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._s5 != ZERO)
|
||||
set_row(nriga,"@174g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._s6, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._s6, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._s6 != ZERO)
|
||||
set_row(nriga,"@193g%18s",(const char*) value);
|
||||
|
||||
print_real(value, v._s7, stampa_in_valuta ? k : "_FIRM");
|
||||
print_real(value, v._s7, stampa_in_valuta ? k : EMPTY_STRING);
|
||||
if (v._s7 != ZERO)
|
||||
set_row(nriga,"@212g%18s",(const char*) value);
|
||||
set_row(++nriga,"");
|
||||
@ -717,14 +729,18 @@ void TStampaScaduto::print_totali_rows(int& nriga, bool what)
|
||||
|
||||
void TStampaScaduto::print_totali(int& nriga)
|
||||
{
|
||||
TString s("CLIENTE");
|
||||
const char* s = "";
|
||||
switch (_tipost)
|
||||
{
|
||||
case fornitori: s = TR("TOTALE FORNITORE"); break;
|
||||
case altri : s = TR("TOTALE CONTO"); break;
|
||||
default : s = TR("TOTALE CLIENTE"); break;
|
||||
}
|
||||
|
||||
if (_tipost == fornitori) s = "FORNITORE";
|
||||
else if (_tipost == altri) s = "CONTO";
|
||||
reset_row(nriga);
|
||||
set_row(nriga++,"");
|
||||
reset_row(nriga);
|
||||
set_row(nriga,FR("TOTALE %s"),(const char*) s);
|
||||
set_row(nriga, s);
|
||||
print_totali_rows(nriga,0);
|
||||
set_row(++nriga,"");
|
||||
nriga++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user