/[papo]/papo/sql/conv/0.1.10-0.1.11
ViewVC logotype

Diff of /papo/sql/conv/0.1.10-0.1.11

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by jlenton, Fri Aug 1 20:39:55 2003 UTC revision 1.8 by mhepp, Wed Aug 6 17:35:29 2003 UTC
# Line 158  INSERT INTO own_document_tax (tax, amoun Line 158  INSERT INTO own_document_tax (tax, amoun
158    
159  INSERT INTO own_document_tax (tax, amount, taxed_amount, own_document) SELECT tax, SUM(own_item_tax.amount) AS amount, SUM( round( (own_descriptive_item.amount - bonus - discount)*(1-discount_percent/100) ,2)  ) AS taxed_amount, own_document FROM own_document, own_descriptive_item, own_item, own_item_tax WHERE own_descriptive_item.own_item = own_item.id AND own_document.id = own_item.own_document AND own_item.id = own_item_tax.own_item GROUP BY own_item.own_document, own_item_tax.tax;  INSERT INTO own_document_tax (tax, amount, taxed_amount, own_document) SELECT tax, SUM(own_item_tax.amount) AS amount, SUM( round( (own_descriptive_item.amount - bonus - discount)*(1-discount_percent/100) ,2)  ) AS taxed_amount, own_document FROM own_document, own_descriptive_item, own_item, own_item_tax WHERE own_descriptive_item.own_item = own_item.id AND own_document.id = own_item.own_document AND own_item.id = own_item_tax.own_item GROUP BY own_item.own_document, own_item_tax.tax;
160    
 INSERT INTO own_document_tax (tax, amount, own_document) SELECT tax, sum(amount), own_document FROM own_item_tax, own_item WHERE own_item_tax.own_item = own_item.id GROUP BY own_document, tax;  
161    
162  --cambio los códigos  --cambio los códigos
163    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26