Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     wx.Panel.__init__(self, *args, **kwargs)
     self.tree = None
     self.user = None
     self.timer = None
     self.reminder = None
     self.pmdisp = []
     self.soloatt = True
     self.pm = adb.DbTable(bt.TABNAME_PROMEM, "promem", writable=True)
     pmu = self.pm.AddJoin(bt.TABNAME_PROMEMU,
                           "pmu",
                           idLeft="id",
                           idRight="id_promem",
                           join=adb.JOIN_LEFT)
     self.pm.AddFilter("promem.globale=1 OR pmu.utente=%s",
                       Env.Azienda.Login.usercode)
     self.pm.AddGroupOn("promem.id")
     self.pm.AddOrder("promem.datasca")
     #refresh utenti
     self.pmu = adb.DbTable(bt.TABNAME_PROMEMU, 'pmu', writable=True)
     self.pmu.AddFilter("utente=%s", Env.Azienda.Login.usercode)
     self.pmu.AddFilter("id_promem=-1")
     wdr.PromemRiepFunc(self)
     cn = lambda x: self.FindWindowByName(x)
     cn('_soloatt').Bind(wx.EVT_CHECKBOX, self.OnSoloAtt)
     cn('_nuovopm').Bind(wx.EVT_BUTTON, self.OnNuovoPM)
     self.Bind(wx.EVT_TIMER, self.OnTimer)
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     
     self.values = {}
     
     aw.Panel.__init__(self, *args, **kwargs)
     wdr.ProgrLiqIvaFunc(self)
     
     ci = lambda x: self.FindWindowById(x)
     cn = lambda x: self.FindWindowByName(x)
     
     s = adb.DbTable(bt.TABNAME_CFGSETUP, 'setup')
     s.Retrieve('setup.chiave=%s', 'liqiva_periodic')
     self.periodic = s.flag
     
     curyear = Env.Azienda.Esercizio.dataElab.year
     
     self.progr = adb.DbTable(bt.TABNAME_CFGPROGR, "progr", writable=True)
      
     p = adb.DbTable(bt.TABNAME_CFGPROGR, "progr")
     p.Retrieve('progr.codice=%s', "iva_liqreg")
     cn('intestaz').SetValue(p.progrdesc or '')
     cn('regiva').SetValue(p.progrimp1)
     
     p = adb.DbTable(bt.TABNAME_CFGPROGR, "progr", fields=None)
     
     p.AddGroupOn("progr.keydiff")
     p.AddOrder("progr.keydiff")
     p.AddFilter("progr.keydiff<%s", curyear)
     p.AddFilter("progr.codice IN %s" % repr(
         ('iva_debcred', 'iva_cricomstart', 'iva_cricomdisp')))
     p.ClearOrders()
     p.AddOrder("progr.keydiff", adb.ORDER_DESCENDING)
     
     l = ci(wdr.ID_ANNI)
     l.Append(str(curyear), curyear)
     if p.Retrieve():
         for p in p:
             l.Append(p.keydiff, int(p.keydiff))
     else:
         awu.MsgDialog(self, "Problema nella lettura dei progressivi\n%s"\
                       % repr(p.GetError()))
     cn = self.FindWindowByName
     for name in 'periodo debcred cricomstart cricomdisp'.split():
         self.Bind(wx.EVT_TEXT, self.OnValueChanged, cn(name))
     from awc.controls.datectrl import EVT_DATECHANGED
     self.Bind(EVT_DATECHANGED, self.OnValueChanged, cn('datlast'))
     self.Bind(wx.EVT_RADIOBOX, self.OnValueChanged, cn('laspom'))
     self.Bind(wx.EVT_LISTBOX, self.OnYear,   ci(wdr.ID_ANNI))
     self.Bind(wx.EVT_BUTTON,  self.OnSave,   ci(wdr.ID_SALVA))
     self.Bind(wx.EVT_BUTTON,  self.OnLiqEff, ci(wdr.ID_LIQEFF))
     
     self.SetYear(curyear)
     l.SetSelection(0)
Ejemplo n.º 3
0
    def __init__(self):

        adb.DbTable.__init__(self, bt.TABNAME_PROCOS, 'procos')
        self.Reset()

        i = self._info
        i.dbmag = dba.TabMagazz()
        i.dbpro = adb.DbTable(bt.TABNAME_PROD,
                              'prod',
                              fields='id,codice,costo,prezzo')
        i.dbpro.AddOrder('prod.codice')
        i.dbinv = Inventario(flatmag=True)
        i.dbgia = adb.DbTable(bt.TABNAME_PROGIA)
        i.dbgia.Reset()
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     k = 'allow_empty_esercizio'
     if k in kwargs:
         self.allow_empty_esercizio = kwargs.pop(k)
     awch.Choice.__init__(self, *args, **kwargs)
     reg = adb.DbTable(bt.TABNAME_CONTAB_H, 'reg', fields=None)
     reg.Synthetize()
     reg.AddGroupOn('esercizio')
     reg.AddOrder('esercizio')  #, adb.ORDER_DESCENDING)
     reg.Retrieve()
     self.dbreg = reg
     self.dbprg = adb.DbTable(bt.TABNAME_CFGPROGR, 'progr')
     self.dbese = ProgrEsercizio()
     self.esercizi = list()
     self.ReadEsercizi()
Ejemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     
     aw.Panel.__init__(self, *args, **kwargs)
     
     self.dbdif = dbc.PdcQuadPcfCont()
     
     wdr.PdcQuadPcfContFunc(self)
     
     ci = lambda x: self.FindWindowById(x)
     ci(wdr.ID_CTRQUADCF).SetDataLink('clifor', ('CF'))
     ci(wdr.ID_CTRQUADCF).SetValue('C')
     
     self.gridif = PdcQuadPcfContGrid(ci(wdr.ID_CTRPANDIFF), self.dbdif)
     
     self.tipicf = {'C': [],
                    'F': []}
     tipana = adb.DbTable(bt.TABNAME_PDCTIP, 'tipana', writable=False)
     for tipo in 'CF':
         if tipana.Retrieve('tipana.tipo=%s', tipo):
             self.tipicf[tipo] = [t.id for t in tipana]
         else:
             raise Exception, repr(tipana.GetError())
         if len(self.tipicf['C']) == 0:
             raise Exception, "Tipi anagrafici mancanti per tipo %s" % tipo
     del tipana
     self.SetCliForFilters()
     
     for cid, func in ((wdr.ID_BTNUPD, self.OnUpdateFilters),
                       (wdr.ID_BTNPRT, self.OnStampa)):
         self.Bind(wx.EVT_BUTTON, func, id=cid)
     self.Bind(wx.EVT_RADIOBOX, self.OnCliFor, id=wdr.ID_CTRQUADCF)
     self.Bind(gl.EVT_GRID_CELL_LEFT_DCLICK, self.OnShowDiff, self.gridif)
Ejemplo n.º 6
0
 def InitAnagCard(self, parent):
     ci = lambda x: self.FindWindowById(x)
     p = wx.Panel(parent, -1)
     wdr.FtDifCardFunc(p, True)
     self.FindWindowByName('descriz').ForceUpperCase(False)
     for cbi, name in (
         (wdr.ID_SEPALL, 'f_sepall'),
         (wdr.ID_SEPMP, 'f_sepmp'),
         (wdr.ID_SEPDEST, 'f_sepdest'),
         (wdr.ID_SOLOSTA, 'f_solosta'),
         (wdr.ID_SETACQ, 'f_setacq'),
         (wdr.ID_SETANN, 'f_setann'),
         (wdr.ID_SETGEN, 'f_setgen'),
         (wdr.ID_NODESRIF, 'f_nodesrif'),
     ):
         ci(cbi).SetDataLink(name, {True: 1, False: 0})
     ci(wdr.ID_F_CHGMAG).SetDataLink(values=[0, 1])
     docs = adb.DbTable(bt.TABNAME_CFGMAGDOC, writable=False)
     docs.AddOrder('descriz')
     if docs.Retrieve():
         l = ci(wdr.ID_DOCS)
         for d in docs:
             l.Append(d.descriz)
             self.docs.append(d.id)
         self.Bind(wx.EVT_CHECKLISTBOX, self.OnDdrModif, l)
     self.Bind(wx.EVT_RADIOBOX, self.OnChgMag, ci(wdr.ID_F_CHGMAG))
     return p
Ejemplo n.º 7
0
def _GetPdcClass(id_tipo, w_tipo, **kwargs):
    """
    Ritorna la classe Panel, Frame o Dialog di gestione del sottoconto, in base al suo tipo.
    La classe viene cercata in base all'id_tipo e può riferirsi al Frame, Dialog o Panel a seconda
    di quanto passato in w_tipo (0,1,2)
    """
    cls = None
    tipibase = "ABDCF"
    tipo = None
    if 'tipo' in kwargs:
        tipo = kwargs['tipo']
    else:
        dbtip = adb.DbTable("pdctip", "tipo", writable=False)
        if dbtip.Get(id_tipo) and dbtip.RowsCount() == 1:
            tipo = dbtip.tipo
    from contab.pdcint import PdcInterrPanel, PdcInterrFrame, PdcInterrDialog
    if tipo is not None:
        from contab.pdcint import CasseInterrPanel, CasseInterrFrame, CasseInterrDialog, BancheInterrPanel, BancheInterrFrame, BancheInterrDialog, EffettiInterrPanel, EffettiInterrFrame, EffettiInterrDialog, ClientiInterrPanel, ClientiInterrFrame, ClientiInterrDialog, FornitInterrPanel, FornitInterrFrame, FornitInterrDialog
        clss = [PdcInterrPanel, PdcInterrFrame, PdcInterrDialog]
        if tipo in tipibase:
            clss = ((CasseInterrPanel,   CasseInterrFrame,   CasseInterrDialog),\
                    (BancheInterrPanel,  BancheInterrFrame,  BancheInterrDialog),\
                    (EffettiInterrPanel, EffettiInterrFrame, EffettiInterrDialog),\
                    (ClientiInterrPanel, ClientiInterrFrame, ClientiInterrDialog),\
                    (FornitInterrPanel,  FornitInterrFrame,  FornitInterrDialog))[tipibase.index(tipo)]
        cls = clss[w_tipo]
    if cls is None:
        cls = [PdcInterrPanel, PdcInterrFrame, PdcInterrDialog][w_tipo]
    return cls
Ejemplo n.º 8
0
def _GetRegConClass(id_reg, w_tipo):
    """
    Ritorna il Frame (se w_tipo=0) o il Dialog (se w_tipo=1) della registrazione
    contabile congruente con la registrazione passata mediante id.
    Il Frame/Dialog è da instaziare.
    """
    cls = None
    reg = adb.DbTable(bt.TABNAME_CONTAB_H,  'reg', writable=False)
    cau = reg.AddJoin(bt.TABNAME_CFGCONTAB, 'cau', idLeft="id_caus",
                      join=adb.JOIN_LEFT)
    if reg.Get(id_reg) and reg.OneRow():
        tipcontab = bt.TIPO_CONTAB
        if   cau.tipo == "S" and cau.pcf == '1' and cau.pcfscon == '1':
            #saldaconto
            clss = (ContabFrameTipo_SC,   ContabDialogTipo_SC)
        elif cau.tipo == "I" and tipcontab == "O":
            #reg.iva in ordinaria
            clss = (ContabFrameTipo_I_O,  ContabDialogTipo_I_O)
        elif cau.tipo == "I" and tipcontab == "S":
            #reg.iva in semplificata
            clss = (ContabFrameTipo_I_S,  ContabDialogTipo_I_S)
        elif cau.tipo == "E":
            #reg.sola iva
            clss = (ContabFrameTipo_I_SI, ContabDialogTipo_I_SI)
        elif cau.tipo in "SC":
            #reg.semplici/composte
            clss = (ContabFrameTipo_C, ContabDialogTipo_C)
        cls = clss[w_tipo]
    return cls
Ejemplo n.º 9
0
 def InitAnagCard(self, parent):
     p = wx.Panel(parent, -1)
     EffettiCardFunc(p, True)
     cn = lambda x: self.FindWindowById(x)
     cn(ID_TIPO).SetDataLink('tipo', 'RI')
     #filtro su banca associata
     tipana = adb.DbTable(bt.TABNAME_PDCTIP, 'tipana', writable=False)
     if tipana.Retrieve('tipo="B"'):
         cn(ID_EFFBANCA).SetFilter("id_tipo IN (%s)"\
                                   % ','.join([str(t.id) for t in tipana]))
     tipi = {}
     for tipo in "CBD":
         tipi[tipo] = [None, []]
         tipana.ClearFilters()
         tipana.AddFilter("tipana.tipo='%s'" % tipo)
         if tipana.Retrieve():
             tipi[tipo][0] = tipana.id
             for t in tipana:
                 tipi[tipo][1].append(t.id)
     del tipana
     #filtro su causale contabile da generare
     lt = cn(ID_EFFCAUS)
     lt.SetFilter("pcf=1 AND pcfscon=1 AND id_pdctippa IN (%s)"\
                  % ",".join(map(str, tipi["C"][1])))
     return p
Ejemplo n.º 10
0
    def __init__(self, *args, **kwargs):

        parms = {"writable":        True,\
                 "mandatoryFields": "codice,descriz,id_tipo"}

        for key, val in parms.iteritems():
            if not kwargs.has_key(key):
                kwargs[key] = val

        adb.DbTable.__init__(\
            self, bt.TABNAME_PDC,  "pdc", **kwargs)

        bilmas = self.AddJoin(\
            bt.TABNAME_BRIMAS, "bilmas",  idLeft="id_brimas",
        dbTabClass=TabMastriRicl)

        bilcon = self.AddJoin(\
            bt.TABNAME_BRICON, "bilcon",  idLeft="id_bricon",\
            join=adb.JOIN_LEFT)

        tipana = self.AddJoin(\
            bt.TABNAME_PDCTIP, "tipana",  idLeft="id_tipo",\
            join=adb.JOIN_LEFT)

        self._info.autom = adb.DbTable(bt.TABNAME_CFGAUTOM, "autom",\
                                       writable=False)
Ejemplo n.º 11
0
def _GetInterrPdcClass(id_tipo, w_tipo):
    """
    Ritorna il Frame (se w_tipo=0) o il Dialog (se w_tipo=1) di interrogazione
    anagrafica congruente con il tipo di sottoconto passato.
    Il Frame/Dialog è da instaziare.
    """
    cls = None
    tipibase = "ABCFD"
    tipo = adb.DbTable("pdctip", "tipo", writable=False)
    if tipo.Get(id_tipo) and tipo.RowsCount() == 1:
        from contab.pdcint import PdcInterrDialog, PdcInterrFrame
        from contab.pdcint import CasseInterrDialog, CasseInterrFrame
        from contab.pdcint import BancheInterrDialog, BancheInterrFrame
        from contab.pdcint import ClientiInterrDialog, ClientiInterrFrame
        from contab.pdcint import FornitInterrDialog, FornitInterrFrame
        from contab.pdcint import EffettiInterrDialog, EffettiInterrFrame
        if tipo.tipo in tipibase:
            clss = ((CasseInterrFrame,   CasseInterrDialog),\
                    (BancheInterrFrame,  BancheInterrDialog),\
                    (ClientiInterrFrame, ClientiInterrDialog),\
                    (FornitInterrFrame,  FornitInterrDialog),\
                    (EffettiInterrFrame, EffettiInterrDialog))[tipibase.index(tipo.tipo)]
        else:
            clss = [PdcInterrFrame, PdcInterrDialog]
        cls = clss[w_tipo]
    del tipo
    return cls
Ejemplo n.º 12
0
    def __init__(self, *args, **kwargs):

        _SetupPanel.__init__(self, *args, **kwargs)
        self.dbsetup = adb.DbTable(self.tabname, 'setup')
        self.dbsetup.AddBaseFilter('setup.azienda=%s', Env.Azienda.codice)
        self.wdr_filler(self)
        self.SetupRead()
Ejemplo n.º 13
0
    def __init__(self, *args, **kwargs):
        tipana = kwargs.pop('tipana')
        wx.Panel.__init__(self, *args, **kwargs)
        wdr.ChiCosaFunc(self)
        r = adb.DbTable(bt.TABNAME_PDC, 'pdc', fields=None)
        r.AddJoin(bt.TABNAME_PDCTIP,
                  'tipana',
                  fields=None,
                  idLeft='id_tipo',
                  idRight='id')
        r.AddJoin(bt.TABNAME_GRIGLIE,
                  'grip',
                  fields=None,
                  idLeft='id',
                  idRight='id_pdc')
        r.Synthetize()
        r.AddGroupOn('pdc.id')
        r.AddGroupOn('pdc.codice')
        r.AddGroupOn('pdc.descriz')
        r.AddCountOf('grip.id', 'numprod')
        r.AddFilter('tipana.tipo=%s', tipana)
        r.Retrieve()
        self.dbriep = r

        def cn(x):
            return self.FindWindowByName(x)

        self.gridriep = ChiCosaGrid(cn('pangridriep'), self.dbriep)
Ejemplo n.º 14
0
def GetPdcTipo(id_tipo):
    ctip = None
    tipibase = "ABDCF"
    tipo = adb.DbTable("pdctip", "tipo", writable=False)
    if tipo.Get(id_tipo) and tipo.RowsCount() == 1:
        if tipo.tipo in tipibase:
            ctip = tipo.tipo
    return ctip
Ejemplo n.º 15
0
 def __init__(self, *args, **kwargs):
     
     ga.AnagPanel.__init__(self, *args, **kwargs)
     self.SetDbSetup( bt.tabelle[ bt.TABSETUP_TABLE_CFGCONTAB ] )
     
     self._sqlrelcol += ', regiva.id, regiva.codice, regiva.descriz'
     
     self._sqlrelfrm =\
         " LEFT JOIN %s AS regiva ON regiva.id=cfgcontab.id_regiva" % bt.TABNAME_REGIVA
     
     mag = adb.DbTable(bt.TABNAME_MAGAZZ, 'magazz', writable=False)
     mag.AddOrder('magazz.codice')
     mag.Retrieve()
     self.dbmag = mag
     self.dbrim = adb.DbTable(bt.TABNAME_CFGMAGRIV, 'rim', writable=True)
     self.dbrim.AddJoin(bt.TABNAME_REGIVA, 'regiva')
     self.rsrim = None #recordset x i/o cfgmagriv
Ejemplo n.º 16
0
 def __init__(self, *args, **kwargs):
     aw.Panel.__init__(self, *args, **kwargs)
     wdr.PdcRangeFunc(self)
     self.dbr = adb.DbTable(bt.TABNAME_PDCRANGE, 'pr', writable=True)
     self.dbr.AddOrder('rangemin')
     self.dbr.Retrieve()
     cid = lambda x: self.FindWindowById(x)
     self.grid = PdcRangeGrid(cid(wdr.ID_PANGRID), self.dbr)
     self.Bind(wx.EVT_BUTTON, self.OnSave, id=wdr.ID_BTNOK)
Ejemplo n.º 17
0
 def __init__(self, *args, **kwargs):
     adb.DbTable.__init__(self, 'x4.bilcee', 'bilcee')
     self.AddOrder('bilcee.sezione')
     self.AddOrder('bilcee.voce')
     self.AddOrder('bilcee.capitolo')
     self.AddOrder('bilcee.dettaglio')
     self.AddOrder('bilcee.subdett')
     self.Reset()
     self._info.dbcee = adb.DbTable(self.GetTableName(),
                                    self.GetTableAlias())
Ejemplo n.º 18
0
 def OnDelLast(self, event):
     if self.lastliqid is not None:
         if aw.awu.MsgDialog(self, "Confermi l'eliminazione dei dati relativi\nall'ultima liquidazione?", style=wx.ICON_QUESTION|wx.YES_NO|wx.NO_DEFAULT) == wx.ID_YES:
             le = adb.DbTable(bt.TABNAME_LIQIVA,  'liqeff', writable=True)
             if le.Get(self.lastliqid) and le.OneRow():
                 le.Delete()
                 if le.Save():
                     aw.awu.MsgDialog(self, "Liquidazione eliminata")
                     event.Skip()
                 else:
                     aw.awu.MsgDialog(self, repr(le.GetError()))
Ejemplo n.º 19
0
 def __init__(self, *args, **kwargs):
     self.allow_none = kwargs.pop('allow_none', False)
     awch.Choice.__init__(self, *args, **kwargs)
     l = adb.DbTable(bt.TABNAME_TIPLIST, 'tiplist')
     l.AddOrder('tiplist.codice')
     l.Retrieve()
     for l in l:
         self.Append(('%s - %s' % (l.codice, l.descriz)))
     if self.allow_none:
         self.Append('')
     self.dbtlis = l
Ejemplo n.º 20
0
 def SetDataChiusura(self):
     p = adb.DbTable(bt.TABNAME_CFGPROGR, 'progr')
     p.Retrieve('progr.codice=%s', 'ccg_chiusura')
     dc = p.progrdate
     p.Retrieve('progr.codice=%s', 'ccg_aggcon')
     if p.IsEmpty():
         p.CreateNewRow()
         p.codice = 'ccg_aggcon'
         p.descriz = 'Ultima chiusura contabile'
     p.progrdate = dc
     return p.Save()
Ejemplo n.º 21
0
 def __init__(self, *args, **kwargs):
     wx.Panel.__init__(self, *args, **kwargs)
     self.pm = adb.DbTable(bt.TABNAME_PROMEM, "promem", writable=True)
     self.wdr_filler(self)
     cn = lambda x: self.FindWindowByName(x)
     cn('_rimanda').Bind(wx.EVT_BUTTON, self.OnRimanda)
     cn('_finito').Bind(wx.EVT_BUTTON, self.OnFinito)
     cn('_tempo').Bind(wx.EVT_CHOICE, self.OnTempo)
     cn('_modifica').Bind(wx.EVT_BUTTON, self.OnModifica)
     cn('_tempo').SetSelection(0)
     self.Bind(EVT_PROMEMDELETED, self.OnPromemDeleted)
Ejemplo n.º 22
0
    def __init__(self, *args, **kwargs):

        ga.AnagPanel.__init__(self, *args, **kwargs)

        self.SetDbSetup(bt.tabelle[bt.TABSETUP_TABLE_MAGAZZ])

        self._sqlrelcol += ", pdc.id, pdc.codice, pdc.descriz"
        self._sqlrelfrm +=\
            " LEFT JOIN %s ON magazz.id_pdc=pdc.id" % bt.TABNAME_PDC

        self.db_report = "Magazzini"
        cau = adb.DbTable(bt.TABNAME_CFGCONTAB, 'cau', writable=False)
        cau.AddOrder('cau.codice')
        cau.AddFilter('cau.regivadyn=1')
        cau.Retrieve()
        self.dbcau = cau
        self.dbrim = adb.DbTable(bt.TABNAME_CFGMAGRIV, 'rim', writable=True)
        self.dbrim.AddJoin(bt.TABNAME_REGIVA, 'regiva')
        self.rsrim = None  #recordset x i/o cfgmagriv
        self.gridrim = None
Ejemplo n.º 23
0
 def __init__(self, *args, **kwargs):
     wx.Panel.__init__(self, *args, **kwargs)
     self.pm = adb.DbTable(bt.TABNAME_PROMEM, "promem", writable=True)
     self.pm.AddMultiJoin(bt.TABNAME_PROMEMU,
                          "users",
                          idLeft="id",
                          idRight="id_promem",
                          writable=True)
     dbu = adb.DB(globalConnection=False, openMode=adb.OPENMODE_READONLY)
     dbu.Connect(host=Env.Azienda.DB.servername,
                 user=Env.Azienda.DB.username,
                 passwd=Env.Azienda.DB.password,
                 db='x4')
     self.utenti = adb.DbTable("utenti",
                               fields="id,codice,descriz",
                               writable=False,
                               db=dbu)
     self.utenti.AddOrder("descriz")
     self.ucod = []
     wdr.PromemPanelFunc(self)
     cn = lambda x: self.FindWindowByName(x)
     for name, flags in (
         ('globale', {
             True: 1,
             False: 0
         }),
         ('avvisa', {
             True: 1,
             False: 0
         }),
         ('status', {
             True: 1,
             False: 0
         }),
     ):
         cn(name).SetDataLink(name, flags)
     cn('_save').Bind(wx.EVT_BUTTON, self.OnSave)
     cn('_delete').Bind(wx.EVT_BUTTON, self.OnDelete)
     cn('globale').Bind(wx.EVT_CHECKBOX, self.OnGlobale)
     cn('avvisa').Bind(wx.EVT_CHECKBOX, self.OnAvviso)
     self._evtAvviso = False
Ejemplo n.º 24
0
 def SetYear(self, year):
     cn = self.FindWindowByName
     cn('year').SetValue(year)
     le = adb.DbTable(bt.TABNAME_LIQIVA,  'liqeff', writable=True)
     le.AddFilter("liqeff.anno=%s", year)
     le.AddOrder("liqeff.datliq")
     le.AddOrder("liqeff.datmin")
     if le.Retrieve() and not le.IsEmpty():
         le.MoveLast()
         self.lastliqid = le.id
         ctbliq.GridUtiCIC(cn('pangridliq'), le)
         cn('butdelast').Enable()
Ejemplo n.º 25
0
    def __init__(self, *args, **kwargs):

        ga.AnagPanel.__init__(self, *args, **kwargs)
        self.SetDbSetup(bt.tabelle[bt.TABSETUP_TABLE_CFGMAGDOC])

        self.dbmov = adb.DbTable(bt.TABNAME_CFGMAGMOV,
                                 'tipmov',
                                 fields=movfields)
        self.dbmov.AddOrder('tipmov.codice')
        self.dbmov.Reset()
        self._grid_mov = None
        self.loadmovs = True
Ejemplo n.º 26
0
 def TestMagazzini(self):
     """
     Verifica che tutti i magazzini esistenti abbiano il legame con il 
     relativo sottoconto magazzino.
     """
     mag = adb.DbTable(bt.TABNAME_MAGAZZ, 'magazz')
     pdc = mag.AddJoin(bt.TABNAME_PDC, 'pdc', join=adb.JOIN_LEFT)
     mag.AddOrder('magazz.codice')
     mag.Retrieve()
     for mag in mag:
         if mag.pdc.id is None:
             return False
     return True
Ejemplo n.º 27
0
 def SaveData(self):
     years = self.values.keys()
     years.sort()
     p = adb.DbTable(bt.TABNAME_CFGPROGR, "progr")
     p.Retrieve('progr.codice=%s', "iva_liqreg")
     if p.IsEmpty():
         p.CreateNewRow()
         p.codice = 'iva_liqreg'
     cn = self.FindWindowByName
     p.progrdesc = cn('intestaz').GetValue()
     p.progrimp1 = cn('regiva').GetValue()
     if not p.Save():
         aw.awu.MsgDialog(self, repr(p.GetError()))
         return False
     p = self.progr
     for year in years:
         v = self.values[year]
         p.ClearFilters()
         p.AddFilter("progr.keydiff=%s", year)
         p.AddFilter("progr.codice='iva_debcred'")
         p.Retrieve()
         if p.IsEmpty():
             p.CreateNewRow()
             p.keydiff = year
             p.codice = 'iva_debcred'
         p.progrdate = v[0]
         p.progrnum = v[1]
         p.progrimp1 = v[2]
         p.progrimp2 = v[3]
         p.Save()
         p.ClearFilters()
         p.AddFilter("progr.keydiff=%s", year)
         p.AddFilter("progr.codice='iva_cricomstart'")
         p.Retrieve()
         if p.IsEmpty():
             p.CreateNewRow()
             p.keydiff = year
             p.codice = 'iva_cricomstart'
         p.progrimp1 = v[4]
         p.Save()
         p.ClearFilters()
         p.AddFilter("progr.keydiff=%s", year)
         p.AddFilter("progr.codice='iva_cricomdisp'")
         p.Retrieve()
         if p.IsEmpty():
             p.CreateNewRow()
             p.keydiff = year
             p.codice = 'iva_cricomdisp'
         p.progrimp1 = v[5]
         p.Save()
     return True
Ejemplo n.º 28
0
 def existSupervisor(self, id):
     lEsito = False
     db = adb.DB()
     db._dbCon = self.db_conn
     db.connected = True
     ute = adb.DbTable('utenti', db=db, writable=False)
     if not ute.Retrieve("amministratore='X' and not id=%s" % id):
         util.MsgDialog(None,\
                        "Impossibile accedere alla tabella Utenti:\n"\
                        % repr(ute.GetError()))
     else:
         if ute.RowsCount() > 0:
             lEsito = True
     return lEsito
Ejemplo n.º 29
0
    def __init__(self, *args, **kwargs):

        aw.Panel.__init__(self, *args, **kwargs)
        wdr.CliFor_DatiFiscaliFunc(self)
        cn = self.FindWindowByName

        self.dbana = adb.DbTable(self.tabanag, 'anag')
        self.dbana.AddJoin(bt.TABNAME_PDC, 'pdc', idLeft='id')
        self.dbana.AddJoin('x4.stati', 'stato', join=adb.JOIN_LEFT)
        self.dbana.AddOrder('pdc.descriz')
        self.dbana.Retrieve()

        self.gridpdc = self._GridClass(cn('pangridpdc'), self.dbana)

        self.Bind(wx.EVT_BUTTON, self.OnSaveData)
Ejemplo n.º 30
0
    def __init__(self, *args, **kwargs):
        self.tipana = kwargs.pop('tipana')
        if self.tipana == "C":
            self._desana = "Cliente"
            anag = bt.TABNAME_CLIENTI
        else:
            self._desana = "Fornitore"
            anag = bt.TABNAME_FORNIT
        self.dbana = adb.DbTable(anag, 'anag', fields='id,id_pdcgrp')
        stalis.ListiniAttualiPanel.__init__(self, *args, **kwargs)

        def cn(x):
            return self.FindWindowByName(x)

        self.Bind(wx.EVT_BUTTON, self.OnCercaChiCosa, cn('butchicosa'))