Home / Community / Blog

I've found nicer invoice template. It's defined in files:

  • taxinvoice.scm
  • taxinvoice.eguile.scm
  • taxinvoice.css

It's heavily customizable, so you probably wouldn't need change those files.

GnuCash domyślnie nie ma czegoś takiego jak rachunek. Jest tylko możliwość wystawienia faktury. Na potrzeby stowarzyszenia (lub małej firmy) można jednak wystawić fakturę która będzie drukowana jak rachunek. Do tego trzeba stworzyć własny raport.

Żeby nie tworzyć całego raportu od nowa użyłem raportu "Prosta faktura" jako wzorca:

cp /usr/share/gnucash/guile-modules/gnucash/report/easy-invoice.scm ~/Dokumenty/rachunek.scm

teraz zmieniłem w pliku rachunek.scm wszystkie wystąpienia easy-invoice na rachunek-prosty oraz wygenerowałem nowy guid poleceniem

uuidgen | sed -e s/-//g

który wstawiłem zamiast oryginalnego (musi być unikalny). Usunąłem wpis menu-path oraz dodałem podpowiedź (opis wyświetlany w pasku stanu). Poniżej kompletny "diff":

--- /usr/share/gnucash/guile-modules/gnucash/report/easy-invoice.scm    2011-04-05 22:16:40.000000000 +0200
+++ /home/jaqb/Dokumenty/rachunek.scm    2013-08-22 20:42:41.951017739 +0200
@@ -28,7 +24,7 @@
 ;; Boston, MA  02110-1301,  USA       gnu@gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define-module (gnucash report easy-invoice))
+(define-module (gnucash report rachunek-prosty))
 
 (use-modules (srfi srfi-1))
 (use-modules (ice-9 slib))
@@ -708,7 +704,7 @@
      (invoice (opt-val invoice-page invoice-name))
      (owner '())
      (references? (opt-val "Display" "References"))
-     (default-title (_ "Invoice"))
+     (default-title (_ "Rachunek"))
      (custom-title (opt-val invoice-page "Custom Title"))
      (title "")
      (invoice? #f))
@@ -729,7 +725,7 @@
            (set! default-title (_ "Bill")))
           ((eqv? type GNC-OWNER-EMPLOYEE)
            (set! default-title (_ "Expense Voucher")))))
-      (set! title (sprintf #f (_"%s #%d") (title-string default-title custom-title)
+      (set! title (sprintf #f (_"%s nr. %d") (title-string default-title custom-title)
                    (gncInvoiceGetID invoice)))))
 
 ;    (gnc:html-document-set-title! document title)
@@ -887,22 +883,23 @@
 
     document))
 
-(define easy-invoice-guid "67112f318bef4fc496bdc27d106bbda4")
+(define rachunek-prosty-guid "b4488998de8642d7908f5e8939b9f338")
 
 (gnc:define-report
  'version 1
- 'name (N_ "Easy Invoice")
- 'report-guid easy-invoice-guid
- 'menu-path (list gnc:menuname-business-reports)
+ 'name (N_ "Rachunek")
+ 'report-guid rachunek-prosty-guid
+;; 'menu-path (list gnc:menuname-business-reports)
+ 'menu-tip (N_ "Unstable. Used for Testing.")
  'options-generator options-generator
  'renderer reg-renderer
  'in-menu? #t)
 
-(define (gnc:easy-invoice-report-create-internal invoice)
-  (let* ((options (gnc:make-report-options easy-invoice-guid))
+(define (gnc:rachunek-prosty-report-create-internal invoice)
+  (let* ((options (gnc:make-report-options rachunek-prosty-guid))
          (invoice-op (gnc:lookup-option options invoice-page invoice-name)))
 
     (gnc:option-set-value invoice-op invoice)
-    (gnc:make-report easy-invoice-guid options)))
+    (gnc:make-report rachunek-prosty-guid options)))
 
-(export gnc:easy-invoice-report-create-internal)
+(export gnc:rachunek-prosty-report-create-internal)

teraz raport powinien działać, ale nie widać go w programie.

Trzeba w pliku .gnucash/config.user (jak nie ma to utworzyć) wpisać:

(load "/home/jaqb/Dokumenty/rachunek.scm")

jak widać wpisałem pełną ścieżkę (bez użycia ~, ale nie wiem, czy to konieczne) i musi być w cudzysłowie.

Teraz restart programu GnuCash i w menu Raporty powinien się pokazać wpis Rachunek, w którym zamiast "Faktura #" jest "Rachunek nr.".

Docelowo trzeba by zmienić jeszcze kilka innych elementów, np. "Dziękujemy za patronat" (które jest akurat błędem tłumaczenia) lub napis "Odbiorca" przed danymi odbiorcy rachunku, ale to w następnym odcinku...

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31