コード例 #1
0
    def _init_ctrls(self, prnt):
	self.cfg = configuration()
	title = self.cfg.get("title")
	wxFrame.__init__(self, id=-1, name='', parent=prnt,
			pos=wxPoint(35, 47), 
                        style=wxDEFAULT_FRAME_STYLE, title=title)
        self._init_utils()
        
        self.Fit()
コード例 #2
0
ファイル: wxFrame1.py プロジェクト: johm/infoshopkeeper
 def _init_ctrls(self, prnt):
     self.cfg = configuration()
     title = self.cfg.get("title")
     wxFrame.__init__(
         self, id=-1, name="", parent=prnt, pos=wxPoint(35, 47), style=wxDEFAULT_FRAME_STYLE, title=title
     )
     self._init_utils()
     self.SetSizer(self.build_GUI())
     self.Fit()
     self.global_sizer.SetSizeHints(self)
コード例 #3
0
    def update_pages(self,event):
        print "HERE"
        master_page_name=[m for m in self.pages.keys() if self.pages[m].master][0]
        master_page=self.pages[master_page_name]
        new_master_price=float(string.replace(master_page.GetValue(),"$",""))
	cfg = configuration()
	for mp in cfg.get("multiple_prices"):
            if mp[0] != master_page_name:
                print mp[1]
                self.pages[mp[0]].SetValue("%s" % (mp[1]*new_master_price))
コード例 #4
0
    def _init_ctrls(self, prnt):
        self.cfg = configuration()
        title = self.cfg.get("title")
        wxFrame.__init__(self,
                         id=-1,
                         name='',
                         parent=prnt,
                         pos=wxPoint(35, 47),
                         style=wxDEFAULT_FRAME_STYLE,
                         title=title)
        self._init_utils()

        self.Fit()
コード例 #5
0
 def update_pages(self, event):
     print "HERE"
     master_page_name = [
         m for m in self.pages.keys() if self.pages[m].master
     ][0]
     master_page = self.pages[master_page_name]
     new_master_price = float(
         string.replace(master_page.GetValue(), "$", ""))
     cfg = configuration()
     for mp in cfg.get("multiple_prices"):
         if mp[0] != master_page_name:
             print mp[1]
             self.pages[mp[0]].SetValue("%s" % (mp[1] * new_master_price))
コード例 #6
0
    def Add(self,event):
    	retval = true;
        first_name = self.first_name.GetValue()
        last_name = self.last_name.GetValue()
        phone = self.phone.GetValue()
        e_mail = self.e_mail.GetValue()
        paid=self.paid.GetSelection()
        if paid == 0:
            paid = true
        else:
            paid = false
        if first_name != "" and last_name != "" and phone != "" and len(phone) >= 7 and e_mail != "":
            try:
                id = self.main_window.membersList.addToMembers(
                                first_name=first_name,
                                last_name=last_name,
                                phone=phone,
                                e_mail=e_mail,
                                paid=paid)
            except:   
                self.statusBar.SetStatusText("didn't add stuff, system crashed instead")
		retval = false
		raise 
	    if paid == true:
		cfg = configuration()
                conn = db.connect()
                cursor = conn.cursor()
                cursor.execute ("""
                INSERT INTO transactionLog SET
                action = "MEMBER ADD",
                amount = %s,
                cashier = %s,
                date = NOW(),
                info = %s,
    	        paid_how= "CASH"
                """, (cfg.get("membershipfees"),self.parent.parent.cashbox.cashier, (first_name + u" " + last_name).encode("ascii", "backslashreplace")))
                self.parent.parent.cashbox.addAmount(cfg.get("membershipfees"))
	        cursor.close()


        else:
            dlg = wxMessageDialog(self, "Fill all fields !!!")
	    dlg.ShowModal()
	    retval = false
	return retval
コード例 #7
0
    def finalizeOrder(self,cursor,cashier,paid_how):
        try:
            owner=self.book.owner
        except:
            cfg = configuration()
	    owner = cfg.get("default_owner")
        cursor.execute ("""
        INSERT INTO transactionLog SET
        action = "SALE",
        amount = %s,
        cashier = %s,
        date = NOW(),
        info = %s,
        schedule = %s,
        owner = %s,
	paid_how =%s
        """,(self.price,cashier,"[%s] %s" % (self.getDistributor().encode("ascii", "backslashreplace"),self.getName().encode("ascii", "backslashreplace")),self.price_schedule,owner,paid_how))

        try:
            self.book.sellme() # marks as sold
        except:
            pass

        cursor.close()
コード例 #8
0
# Infoshopkeeper is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with Infoshopkeeper; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA

import types
from infoshopkeeper_config import configuration
from wxPython.wx import *
from reports.PdfReport import PdfReport
cfg = configuration()

class GenPdfPopup(wxDialog):
    def GetListCtrl(self):
        return self.stuff.list
    
    def __init__(self,parent):
        self.parent=parent
        wxDialog.__init__(self, parent, -1, "Generate pdf reports")
        self.browser = 0
        self.stuff = GenPdfPanel(parent=self,
                                is_dialog=1)
        
    def close_the_window(self):
        self.EndModal(1)