Esempio n. 1
0
    def print_invoice(self, id=None):
        c.invoice = Invoice.query.get_or_abort(id)
        c.user = User.query.get(h.auth.user_id())
        c.config = g

        c.invoice.isBooked = True
        c.invoice.save()

        return h.generate_pdf("/prints/invoice.xhtml", "faktura")
Esempio n. 2
0
 def print_demand_payment(self, request, queryset):        
     if len(set([invoice.company.id for invoice in queryset])) != 1:
         flash(u'Faktury nie należą do jednego kontrahenta')
         return
     
     c.config = app_globals
     c.invoices = queryset        
     c.sum = sum([round(invoice.brutto_value, 2) for invoice in c.invoices])        
     
     return h.generate_pdf('/prints/demand_payment.html', 'wezwanie_do_zaplaty')        
Esempio n. 3
0
    def print_demand_payment(self, id):
        c.invoices = [Invoice.query.get_or_abort(id)]
        c.sum = sum([round(invoice.brutto_value, 2) for invoice in c.invoices])
        c.config = g

        return h.generate_pdf("/prints/demand_payment.html", "wezwanie_do_zaplaty")
Esempio n. 4
0
 def print_holiday(self, id):        
     c.holiday = HolidayDocument.query.get_or_abort(id)
     c.config = g
     c.user = User.query.get(h.auth.user_id())
     
     return h.generate_pdf('/prints/holiday_document.xhtml', 'urlopowka')
Esempio n. 5
0
 def print_transport_order(self, id):
     #c.config = Globals()        
     c.order = Order.query.get_or_abort(id)
     c.user = User.query.get_or_abort(h.auth.user_id())
     
     return h.generate_pdf('/prints/transport_order.xhtml', 'zlecenie_transportowe')               
Esempio n. 6
0
 def print_correct(self, id):
     c.user = User.query.get(h.auth.user_id())
     c.config = g
     c.correct = InvoiceCorrect.query.get(id)
     return h.generate_pdf('/prints/correct.xhtml', 'korekta_faktury')
Esempio n. 7
0
 def print_delegation(self, id):
     c.delegation = Delegation.query.get_or_abort(id)
     return h.generate_pdf('/prints/delegation.xhtml', 'delegacja')