[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r159 - in gnue-invoice: . schema scripts
From: |
kilo |
Subject: |
r159 - in gnue-invoice: . schema scripts |
Date: |
Tue, 7 Dec 2004 03:27:12 -0600 (CST) |
Author: kilo
Date: 2004-12-07 03:27:11 -0600 (Tue, 07 Dec 2004)
New Revision: 159
Added:
gnue-invoice/schema/invoice-hu.gcd
gnue-invoice/scripts/setup-db-hu.sh
Modified:
gnue-invoice/news
gnue-invoice/schema/invoice.gcd
Log:
GNUe Invoice.
Added support for Hungarian invoices.
Modified: gnue-invoice/news
===================================================================
--- gnue-invoice/news 2004-12-06 10:56:35 UTC (rev 158)
+++ gnue-invoice/news 2004-12-07 09:27:11 UTC (rev 159)
@@ -2,6 +2,9 @@
*************************
GNUe Invoice - Project CV
*************************
+New features / changes by 2004.12.07
+* Added summing support for Hungarian invoices.
+
New features / changes by 2004.12.06
* Added 'seller' field to the invoice. Report also contains this.
* Updated example database to include default supplier.
Added: gnue-invoice/schema/invoice-hu.gcd
===================================================================
--- gnue-invoice/schema/invoice-hu.gcd 2004-12-06 10:56:35 UTC (rev 158)
+++ gnue-invoice/schema/invoice-hu.gcd 2004-12-07 09:27:11 UTC (rev 159)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- INV Module Hungarian extensions
+
+ Copyright 2004 Free Software Foundation
+
+ This file is part of GNU Enterprise.
+
+ GNU Enterprise is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ GNU Enterprise 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 GNU Enterprise; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ $Id$ -->
+
+<module name="INVHU">
+ <!--**************************************************************
+ Provide convenient ways to put different summing by VAT categories
+ on the report, as needed by Hungarian tax laws.
+ ***************************************************************-->
+ <class name="INV_Head" comment="Invoice head">
+ <property name="totalNet25" type="number(10,2)" >
+ return self.sumByRate(type = 'Net', rate = 25)
+ </property>
+
+ <property name="totalVAT25" type="number(10,2)" >
+ return self.sumByRate(type = 'VAT', rate = 25)
+ </property>
+
+ <property name="totalGross25" type="number(10,2)" >
+ return self.sumByRate(type = 'Gross', rate = 25)
+ </property>
+
+ <property name="totalNet15" type="number(10,2)" >
+ return self.sumByRate(type = 'Net', rate = 15)
+ </property>
+
+ <property name="totalVAT15" type="number(10,2)" >
+ return self.sumByRate(type = 'VAT', rate = 15)
+ </property>
+
+ <property name="totalGross15" type="number(10,2)" >
+ return self.sumByRate(type = 'Gross', rate = 15)
+ </property>
+
+ <property name="totalNet5" type="number(10,2)" >
+ return self.sumByRate(type = 'Net', rate = 5)
+ </property>
+
+ <property name="totalVAT5" type="number(10,2)" >
+ return self.sumByRate(type = 'VAT', rate = 5)
+ </property>
+
+ <property name="totalGross5" type="number(10,2)" >
+ return self.sumByRate(type = 'Gross', rate = 5)
+ </property>
+ </class>
+</module>
Property changes on: gnue-invoice/schema/invoice-hu.gcd
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: gnue-invoice/schema/invoice.gcd
===================================================================
--- gnue-invoice/schema/invoice.gcd 2004-12-06 10:56:35 UTC (rev 158)
+++ gnue-invoice/schema/invoice.gcd 2004-12-07 09:27:11 UTC (rev 159)
@@ -107,6 +107,30 @@
return self.buyer and self.buyer.PARTY_name or ''
</property>
+ <!--************************************
+ Returns summed Net, VAT or Gross values,
+ filtered by VAT rate
+ *************************************-->
+ <procedure name="sumByRate" type="number(10,2)">
+ <parameter name="type" type="string(5)" comment="Net, VAT or Gross"/>
+ <parameter name="rate" type="number(10,2)"/>
+ SumTypes = {
+ 'Net':'INV_valueNet', \
+ 'VAT':'INV_valueVAT', \
+ 'Gross':'INV_valueGross'
+ }
+
+ try:
+ items = find('INV_Item', \
+ {'INV_head':self.gnue_id, 'INV_product.ITEM_vat.TAX_rate':rate}, \
+ [], \
+ [SumTypes[type]])
+
+ return sum([eval('i.' + SumTypes[type]) for i in items])
+ except KeyError:
+ return 0
+ </procedure>
+
<!--******************************************************
Calculates date due based on payment method's day property
and the current dateIssued property of the invoice.
Added: gnue-invoice/scripts/setup-db-hu.sh
===================================================================
--- gnue-invoice/scripts/setup-db-hu.sh 2004-12-06 10:56:35 UTC (rev 158)
+++ gnue-invoice/scripts/setup-db-hu.sh 2004-12-07 09:27:11 UTC (rev 159)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+gsscvs --connection=invoice-backend --createdb gnue.gsd
+
+gcdcvs --connection=invoice-backend ../schema/filter.gcd
+gldcvs --connection=invoice-backend ../schema/filter.gld
+gcdcvs --connection=invoice-backend ../schema/loc.gcd
+gcdcvs --connection=invoice-backend ../schema/tax.gcd
+gcdcvs --connection=invoice-backend ../schema/party.gcd
+gcdcvs --connection=invoice-backend ../schema/item.gcd
+gcdcvs --connection=invoice-backend ../schema/invoice.gcd
+gcdcvs --connection=invoice-backend ../schema/invoice-hu.gcd
+
+#standard data
+gsscvs --connection=invoice-backend ../schema/invoice-hu.gsd
Property changes on: gnue-invoice/scripts/setup-db-hu.sh
___________________________________________________________________
Name: svn:executable
+ *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r159 - in gnue-invoice: . schema scripts,
kilo <=