Aggiustata selezione ditte
git-svn-id: svn://10.65.10.50/trunk@1025 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4aefec0909
commit
03c911f29d
@ -5,6 +5,7 @@
|
||||
#include <sheet.h>
|
||||
#include <relation.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#define F_YEAR 101
|
||||
|
||||
@ -85,7 +86,8 @@ void TRipristino_liq::build_nomiditte()
|
||||
// ricostruire _nomiditte e rifare build_ditte_sheet
|
||||
TLocalisamfile& dt = _nditte->lfile();
|
||||
TString fr("??");
|
||||
|
||||
TTable lia("%LIA");
|
||||
|
||||
for (dt.first(); !dt.eof(); dt.next())
|
||||
{
|
||||
// check no archivi
|
||||
@ -95,9 +97,10 @@ void TRipristino_liq::build_nomiditte()
|
||||
if (good)
|
||||
{
|
||||
// check no parametri liquidazione
|
||||
TApplication::set_firm(dt.get_long("CODDITTA"));
|
||||
TTable lia("LIA");
|
||||
lia.put("CODTAB", _year);
|
||||
lia.zero();
|
||||
TString diocan = format("%05ld%4s", dt.get_long("CODDITTA"),
|
||||
(const char*)_year);
|
||||
lia.put("CODTAB", diocan);
|
||||
if (lia.read() != NOERR) good = FALSE;
|
||||
else fr = lia.get("S7");
|
||||
}
|
||||
@ -180,8 +183,8 @@ bool TRipristino_liq::restore_firm(long firm)
|
||||
// cancella: tutti PPA, LIM, PIM, RMB, PLM, PTM
|
||||
set_firm(firm);
|
||||
|
||||
TTable lia("LIA");
|
||||
TTable pla("PLA");
|
||||
TTable lia("%LIA");
|
||||
TTable pla("%PLA");
|
||||
TTable pim("PIM");
|
||||
TTable plm("PLM");
|
||||
TTable ptm("PTM");
|
||||
@ -194,7 +197,8 @@ bool TRipristino_liq::restore_firm(long firm)
|
||||
{
|
||||
TString codtab(lia.get("CODTAB"));
|
||||
|
||||
if (codtab.mid(0,4) == _year)
|
||||
if (atol(codtab.mid(0,5)) == firm &&
|
||||
codtab.mid(5,4) == _year)
|
||||
{
|
||||
lia.put("R1","");
|
||||
lia.put("R2","");
|
||||
@ -212,7 +216,8 @@ bool TRipristino_liq::restore_firm(long firm)
|
||||
{
|
||||
TString codtab(pla.get("CODTAB"));
|
||||
|
||||
if (codtab.mid(0,4) == _year)
|
||||
if (atol(codtab.mid(0,5)) == firm &&
|
||||
codtab.mid(5,4) == _year)
|
||||
{
|
||||
pla.put("R0","");
|
||||
pla.put("R1","");
|
||||
|
Loading…
x
Reference in New Issue
Block a user