Corretta gestione anno esercizio sulla maschera di query
git-svn-id: svn://10.65.10.50/trunk@1403 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
61f440602f
commit
e945ac1a8d
@ -1,7 +1,8 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <printer.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <printer.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
@ -57,6 +57,8 @@ const real& TPrimanota_application::cod2IVA(const TMask& m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Scorpora dall'imponibile la percentuale d'imposta(0.0%-100.0%) e ritorna l'imposta stessa
|
||||||
|
// Certified 99% Non sono sicurissimo degli imponibili negativi
|
||||||
real TPrimanota_application::scorpora(real& imponibile, const real& percent)
|
real TPrimanota_application::scorpora(real& imponibile, const real& percent)
|
||||||
{
|
{
|
||||||
real imposta = abs(imponibile) * percent / (percent + 100.0); imposta.ceil();
|
real imposta = abs(imponibile) * percent / (percent + 100.0); imposta.ceil();
|
||||||
@ -129,7 +131,7 @@ bool TPrimanota_application::showpartite_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
|
|
||||||
// Determina se un codice sospeso o no
|
// Determina se un codice sospeso o no
|
||||||
// Certified 90%
|
// Certified 99%
|
||||||
bool TPrimanota_application::suspended_handler(TMask_field& f, KEY k)
|
bool TPrimanota_application::suspended_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (f.to_check(k))
|
if (f.to_check(k))
|
||||||
@ -139,7 +141,7 @@ bool TPrimanota_application::suspended_handler(TMask_field& f, KEY k)
|
|||||||
const TBrowse* b = c.browse();
|
const TBrowse* b = c.browse();
|
||||||
CHECKD(b, "Can't check suspension of a edit-field without a USE ", f.dlg());
|
CHECKD(b, "Can't check suspension of a edit-field without a USE ", f.dlg());
|
||||||
const TLocalisamfile& i = b->cursor()->file();
|
const TLocalisamfile& i = b->cursor()->file();
|
||||||
|
// Tabella File
|
||||||
const char* sf = i.tab() ? "B2" : "SOSPESO";
|
const char* sf = i.tab() ? "B2" : "SOSPESO";
|
||||||
const bool suspended = i.get_bool(sf);
|
const bool suspended = i.get_bool(sf);
|
||||||
if (suspended)
|
if (suspended)
|
||||||
@ -213,14 +215,15 @@ int TPrimanota_application::bill2pos(const TBill& conto, char tipo)
|
|||||||
// Trova nelle righe contabili un conto di contropartita per il conto dato
|
// Trova nelle righe contabili un conto di contropartita per il conto dato
|
||||||
int TPrimanota_application::bill2contr(const TBill& conto, char sezione) const
|
int TPrimanota_application::bill2contr(const TBill& conto, char sezione) const
|
||||||
{
|
{
|
||||||
const TArray& rows = cgs().rows_array();
|
TString_array& rows = cgs().rows_array();
|
||||||
for (int i = 0; i < rows.items(); i++)
|
for (int i = 0; i < rows.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string& row = (TToken_string&)rows[i];
|
TToken_string& r = rows.row(i);
|
||||||
const char sez = row.get(0)[0] > ' ' ? 'D' : 'A';
|
const real dare(r.get(0));
|
||||||
|
const char sez = dare.is_zero() ? 'A' : 'D';
|
||||||
if (sez == sezione) // Devo cercare sezione contraria
|
if (sez == sezione) // Devo cercare sezione contraria
|
||||||
continue;
|
continue;
|
||||||
const TBill c(row, 3, 0x0);
|
const TBill c(r, 3, 0x0);
|
||||||
if (conto == c)
|
if (conto == c)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -1202,10 +1205,8 @@ bool TPrimanota_application::sheet_clifo_handler(TMask_field& f, KEY k)
|
|||||||
bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
if (!m.is_running()) return TRUE;
|
|
||||||
|
|
||||||
const long num = atol(f.get());
|
const long num = atol(f.get());
|
||||||
if (key == K_TAB && num > 0)
|
if (key == K_TAB && m.is_running() && num > 0)
|
||||||
{
|
{
|
||||||
const long max = app()._lastreg+1;
|
const long max = app()._lastreg+1;
|
||||||
|
|
||||||
@ -1241,8 +1242,8 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
m.set(F_DATAREG, mov.get("DATAREG"));
|
m.set(F_DATAREG, mov.get("DATAREG"), TRUE);
|
||||||
m.set(F_DATACOMP, mov.get("DATACOMP"));
|
m.set(F_DATACOMP, mov.get("DATACOMP"), TRUE);
|
||||||
m.set(F_CODCAUS, mov.get("CODCAUS"));
|
m.set(F_CODCAUS, mov.get("CODCAUS"));
|
||||||
m.stop_run(K_AUTO_ENTER);
|
m.stop_run(K_AUTO_ENTER);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user