Beispiel #1
0
    def InitControls(self, *args, **kwargs):
        self.baseclass.InitControls(self, *args, **kwargs)

        nb = self.FindWindowById(wdr.ID_WORKZONE)

        if getattr(Env.Azienda.Login.userdata, 'can_magazzint', True):
            nb.AddPage(aw.Panel(nb), "Mastro movimenti")
            nb.AddPage(aw.Panel(nb), "Evasioni")
            nb.AddPage(aw.Panel(nb), "Giacenze e progressivi")
            nb.AddPage(aw.Panel(nb), "Statistiche")

        self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanging, nb)
Beispiel #2
0
 def __init__(self, *args, **kwargs):
     kwargs['title'] = 'Dettaglio righe IVA'
     aw.Dialog.__init__(self, *args, **kwargs)
     p = aw.Panel(self, -1)
     wdr.DettaglioRigheIvaFunc(p)
     self.AddSizedPanel(p)
     self.CenterOnScreen()
Beispiel #3
0
def GruArtCardFunc(parent, call_fit=True, set_sizer=True):
    item0 = wx.FlexGridSizer(0, 1, 0, 0)

    item1 = AnagCardPanel(parent)
    item0.Add(item1, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

    item3 = WorkZoneNotebook(parent, ID_WORKZONE, wx.DefaultPosition,
                             [200, 160], 0)
    item2 = item3

    item4 = aw.Panel(item3, -1)
    item4.SetName('GruArtAnagPage')
    GruArtCardAnagFunc(item4, False)
    item3.AddPage(item4, "Dati anagrafici")

    item0.Add(
        item2, 0,
        wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)

    item0.AddGrowableCol(0)

    item0.AddGrowableRow(1)

    if set_sizer == True:
        parent.SetSizer(item0)
        if call_fit == True:
            item0.SetSizeHints(parent)

    return item0
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        kwargs['title'] = 'Selezione stampa'
        aw.Dialog.__init__(self, *args, **kwargs)
        self.report_type = None
        p = aw.Panel(self)
        wdr.FatturatoPrintSelFunc(p)
        self.AddSizedPanel(p)
        self.CenterOnScreen()

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

        p.Bind(wx.EVT_BUTTON, self.OnPrintCat, cn('btnfatcat'))
        p.Bind(wx.EVT_BUTTON, self.OnPrintPro, cn('btnfatpro'))
Beispiel #5
0
    def InitAnagCard(self, parent):
        wdr.LinkTableClienteFornitore = wdr.LinkTableCliente
        p = aw.Panel(parent, -1)
        wdr.ClientiCardFunc(p, True)

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

        cn('allegcf').SetDataLink('allegcf', {True: 1, False: 0})
        cn('piva').SetStateControl(cn('nazione'))
        self.InitGrigliaPrezzi()

        self.Bind(EVT_LINKTABCHANGED, self.OnPdcGrpChanged, cn('id_pdcgrp'))
        self.Bind(EVT_LINKTABCHANGED, self.OnStatoChanged, cn('id_stato'))

        return p
Beispiel #6
0
 def HttpInfo(self):
     dlpath = self.GetDownloadPath()
     tmpath = self.GetTemporaryPath()
     try:
         if not os.path.isdir(tmpath):
             try:
                 os.mkdir(tmpath)
             except Exception, e:
                 raise Exception, "Impossibile creare cartella file temporanei"
         dlfile = self.dlfile.replace('.exe', '-changes.txt')
         url = '%s/%s' % (self.dlurl, dlfile)
         nametemp = '%s/%s.tmp' % (tmpath, dlfile)
         filetemp = open(nametemp, 'wb')
         stream = urlopen(url)
         filesize = int(stream.headers['content-length'])
         bytes = 0
         while True:
             data = stream.read(BUFSIZE)
             if data:
                 filetemp.write(data)
                 bytes += len(data)
             else:
                 break
         stream.close()
         filetemp = open(nametemp, 'r')
         #filetemp.seek(0,2)
         #wrisize = filetemp.tell()
         #filetemp.seek(0,0)
         info = filetemp.read()
         filetemp.close()
         nametxt = '%s/%s' % (dlpath, dlfile)
         if os.path.isfile(nametxt):
             os.remove(nametxt)
         os.rename(nametemp, nametxt)
         dlg = aw.Dialog(self, title="X4 :: Informazioni sull'aggiornamento")
         panel = aw.Panel(dlg)
         wdr.VersionInfoFunc(panel)
         txt = panel.FindWindowById(wdr.ID_VERINFO)
         txt.SetValue(info)
         txt.SetEditable(False)
         dlg.AddSizedPanel(panel)
         def OnQuit(event):
             dlg.EndModal(wx.ID_OK)
         dlg.Bind(wx.EVT_BUTTON, OnQuit, id=wdr.ID_OK)
         dlg.ShowModal()
         dlg.Destroy()
Beispiel #7
0
 def InitAnagCard(self, parent):
     p = aw.Panel(parent, -1)
     PdcCardFunc(p, True)
     return p
Beispiel #8
0
 def GetSpecializedSearchPanel(self, parent):
     p = aw.Panel(parent, -1)
     wdr.ClientiSpecSearchFunc(p)
     return p
Beispiel #9
0
def MultiReportFunc(parent, call_fit=True, set_sizer=True):
    item0 = wx.FlexGridSizer(0, 1, 0, 0)

    item1 = TitlePanel(parent, ID_FOREIGN)
    item0.Add(item1, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL, 5)

    item2 = wx.StaticLine(parent, ID_LINE, wx.DefaultPosition, [20, -1],
                          wx.LI_HORIZONTAL)
    item0.Add(item2, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL, 5)

    item3 = wx.FlexGridSizer(1, 0, 0, 0)

    item4 = wx.StaticText(parent, ID_TEXT, "Stampa su:", wx.DefaultPosition,
                          wx.DefaultSize, 0)
    item3.Add(item4, 0, wx.ALIGN_CENTER | wx.LEFT | wx.TOP | wx.BOTTOM, 5)

    item5 = PrintersComboBox(parent, ID_REPORTDIRECTURL, "",
                             wx.DefaultPosition, [100, -1], [],
                             wx.CB_DROPDOWN | wx.CB_READONLY)
    item5.SetName("printername")
    item3.Add(item5, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

    item6 = wx.StaticText(parent, ID_TEXT, "Copie:", wx.DefaultPosition,
                          wx.DefaultSize, 0)
    item3.Add(item6, 0, wx.ALIGN_CENTER | wx.LEFT | wx.TOP | wx.BOTTOM, 5)

    item7 = NumCtrl(parent,
                    ID_NUMCOPIE,
                    integerWidth=3,
                    allowNegative=False,
                    groupDigits=False)
    item7.SetName("numcopie")
    item3.Add(item7, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

    item3.AddGrowableCol(1)

    item0.Add(item3, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL, 5)

    item8 = wx.StaticLine(parent, ID_LINE, wx.DefaultPosition, [20, -1],
                          wx.LI_HORIZONTAL)
    item0.Add(item8, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

    item9 = wx.FlexGridSizer(0, 2, 0, 0)

    item10 = wx.FlexGridSizer(0, 1, 0, 0)

    item11 = wx.StaticText(parent, ID_TEXT, "Seleziona il report:",
                           wx.DefaultPosition, wx.DefaultSize, 0)
    item10.Add(item11, 0, wx.ALIGN_BOTTOM | wx.LEFT | wx.RIGHT, 5)

    item12 = wx.ListBox(parent, ID_REPORTS, wx.DefaultPosition, [300, 120], [],
                        wx.LB_SINGLE)
    item12.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
    item12.SetName("reports")
    item10.Add(item12, 0,
               wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)

    item13 = MultiReportBottomPanel(parent, ID_PANEL, wx.DefaultPosition,
                                    wx.DefaultSize, 0)
    item10.Add(item13, 0,
               wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)

    item10.AddGrowableRow(2)

    item9.Add(item10, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL, 5)

    item14 = wx.FlexGridSizer(0, 1, 0, 0)

    item15 = wx.StaticText(parent, ID_TEXT, "Anteprima stile",
                           wx.DefaultPosition, [240, -1], wx.ST_NO_AUTORESIZE)
    item14.Add(item15, 0, wx.ALIGN_BOTTOM | wx.RIGHT, 5)

    item16 = PreviewPanel(parent, ID_PANELPREVIEW, wx.DefaultPosition,
                          [240, 240], wx.SUNKEN_BORDER)
    item16.SetBackgroundColour(wx.WHITE)
    item14.Add(item16, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)

    item9.Add(item14, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL, 5)

    item9.AddGrowableCol(1)

    item9.AddGrowableRow(1)

    item0.Add(item9, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL, 5)

    item17 = aw.Panel(parent, ID_PANQUESTIONS, wx.DefaultPosition, [-1, 20], 0)
    item17.SetName("otherquestionspanel")
    item0.Add(item17, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

    item18 = wx.BoxSizer(wx.HORIZONTAL)

    item19 = wx.Button(parent, ID_PREVIEW, "&Visualizza anteprima",
                       wx.DefaultPosition, wx.DefaultSize, 0)
    item19.SetName("btnpreview")
    item18.Add(item19, 0, wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)

    item20 = wx.Button(parent, ID_PRINT, "&Stampa", wx.DefaultPosition,
                       wx.DefaultSize, 0)
    item20.SetName("btnprint")
    item18.Add(item20, 0, wx.ALIGN_CENTER | wx.RIGHT | wx.BOTTOM, 5)

    item0.Add(item18, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)

    item0.AddGrowableCol(0)

    item0.AddGrowableRow(2)

    if set_sizer == True:
        parent.SetSizer(item0)
        if call_fit == True:
            item0.SetSizeHints(parent)

    return item0