Index: openacs-4/packages/invoices/lib/projects-billable.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/projects-billable.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/invoices/lib/projects-billable.tcl 18 Jun 2006 11:42:26 -0000 1.17 +++ openacs-4/packages/invoices/lib/projects-billable.tcl 11 Aug 2006 19:37:51 -0000 1.18 @@ -23,6 +23,11 @@ } } +# Quickfix +if {[exists_and_not_null orderby] && $orderby eq "invoice_nr"} { + set orderby "" +} + if {[empty_string_p $no_actions_p]} { set no_actions_p 0 } @@ -43,6 +48,7 @@ set base_url [apm_package_url_from_id $package_id] } + set row_list "" set org_p 1 Index: openacs-4/packages/invoices/sql/postgresql/invoices-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/sql/postgresql/invoices-create.sql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/invoices/sql/postgresql/invoices-create.sql 18 May 2006 12:48:46 -0000 1.13 +++ openacs-4/packages/invoices/sql/postgresql/invoices-create.sql 11 Aug 2006 19:37:52 -0000 1.14 @@ -143,7 +143,7 @@ constraint iv_offer_items_offer_fk references iv_offers, comment text, - item_units numeric(12,1), + item_units numeric(12,3), price_per_unit numeric(12,3), rebate numeric(12,2), file_count integer, @@ -244,7 +244,7 @@ offer_item_id integer constraint iv_invoice_items_offer_fk references iv_offer_items, - item_units numeric(12,1), + item_units numeric(12,3), price_per_unit numeric(12,3), rebate numeric(12,2), amount_total numeric(12,2), Index: openacs-4/packages/invoices/tcl/invoice-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/invoice-procs.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/invoices/tcl/invoice-procs.tcl 29 Jun 2006 14:46:45 -0000 1.24 +++ openacs-4/packages/invoices/tcl/invoice-procs.tcl 11 Aug 2006 19:37:52 -0000 1.25 @@ -36,7 +36,7 @@ } set folder_id [content::folder::get_folder_from_package -package_id $package_id] - set item_id [db_nextval t_acs_object_id_seq] + set item_id [db_string acs "select nextval('t_acs_object_id_seq') from dual"] db_transaction { if {[empty_string_p $name]} { @@ -292,13 +292,15 @@ if {[empty_string_p $credit_percent]} { set credit_percent 0 } + set credit_percent [string trimright $credit_percent 0] + set credit_percent [string trimright $credit_percent .] if {$prev_project_id != $project_id} { set prev_project_id $project_id incr project_count set project_sum 0. } if {$price_per_unit > 1} { - set item_units [format "%.1f" [expr $item_units * (1. + ($credit_percent / 100.))]] + set item_units [expr $item_units * (1. + ($credit_percent / 100.))] } else { set item_units [format "%.1f" $item_units] } Index: openacs-4/packages/invoices/tcl/offer-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/offer-procs.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/invoices/tcl/offer-procs.tcl 11 Aug 2006 18:06:28 -0000 1.26 +++ openacs-4/packages/invoices/tcl/offer-procs.tcl 11 Aug 2006 19:37:52 -0000 1.27 @@ -37,8 +37,8 @@ set folder_id [content::folder::get_folder_from_package -package_id $package_id] # Always set the sequence outside the transaction - set item_id [db_nextval t_acs_object_id_seq] - set revision_id [db_nextval t_acs_object_id_seq] + set item_id [db_string acs "select nextval('t_acs_object_id_seq') from dual"] + set revision_id [db_string acs "select nextval('t_acs_object_id_seq') from dual"] db_transaction { if {[empty_string_p $name]} { set name "iv_offer_$item_id" @@ -113,7 +113,7 @@ set status new } set old_rev_id [content::item::get_best_revision -item_id $offer_id] - set new_rev_id [db_nextval t_acs_object_id_seq] + set new_rev_id [db_string acs "select nextval('t_acs_object_id_seq') from dual"] if {[catch {content::revision::new \ -item_id $offer_id \ -revision_id $new_rev_id \ @@ -137,7 +137,7 @@ [list vat $vat] \ [list credit_percent $credit_percent] ]} ] } { - set new_rev_id [db_nextval t_acs_object_id_seq] + set new_rev_id [db_string acs "select nextval('t_acs_object_id_seq') from dual"] set new_rev_id [content::revision::new \ -item_id $offer_id \ -revision_id $new_rev_id \ @@ -271,6 +271,13 @@ set data(credit_percent) 0 } + # Deutsche AGB f�r Deutschsprachige Kontakte + if {[string range $locale 0 1] eq "de"} { + set agb_link "http://www.wienersundwieners.de/pdf/WIENERS+WIENERS_AGB.pdf" + } else { + set agb_link "http://www.wienersundwieners.de/pdf/WIENERS+WIENERS_General_Terms_and_Conditions.pdf" + } + # offer contact data contact::employee::get -employee_id $data(contact_id) -array contact_data foreach attribute {name company_name_ext address town_line country country_code salutation salutation_letter} { Index: openacs-4/packages/invoices/www/invoice-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-ae.tcl,v diff -u -r1.37 -r1.38 --- openacs-4/packages/invoices/www/invoice-ae.tcl 11 Aug 2006 18:06:28 -0000 1.37 +++ openacs-4/packages/invoices/www/invoice-ae.tcl 11 Aug 2006 19:37:52 -0000 1.38 @@ -345,14 +345,16 @@ set offer(credit_percent) 0. } if {$offer(price_per_unit) > 1.} { - set offer(credit) [expr $offer(item_units) * (($offer(credit_percent) + 100.) / 100.)] + set offer(credit_units) [expr $offer(item_units) * (($offer(credit_percent) + 100.) / 100.)] } else { # do not add credit to items with price of 1 or less - set offer(credit) $offer(item_units) + set offer(credit_units) $offer(item_units) } - set offer(credit) [format "%.2f" [expr $offer(credit) * $offer(price_per_unit)]] + set offer(credit) [format "%.2f" [expr $offer(credit_units) * $offer(price_per_unit)]] + ns_log Notice "Granted credit:: $offer(credit)" set offer(credit) [format "%.2f" [expr (1. - ($offer(rebate) / 100.)) * $offer(credit)]] set offer(credit) [format "%.2f" [expr $offer(credit) - $offer(amount)]] + ns_log Notice "Total credit:: $offer(credit)" set offer_name "" if {![empty_string_p $offer(category)]} { Index: openacs-4/packages/invoices/www/offer-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/offer-ae.tcl,v diff -u -r1.35 -r1.36 --- openacs-4/packages/invoices/www/offer-ae.tcl 11 Aug 2006 18:06:28 -0000 1.35 +++ openacs-4/packages/invoices/www/offer-ae.tcl 11 Aug 2006 19:37:52 -0000 1.36 @@ -306,7 +306,10 @@ set item(item_units) 0 } - ns_log Notice "Units $item(item_units)" + # Format the display of the units + set item(item_units) [string trimright $item(item_units) 0] + set item(item_units) [string trimright $item(item_units) .] + regsub {\[} $item(comment) {\(} item(comment) regsub {\[} $item(description) {\(} item(description) set item(price_per_unit) [format "%.2f" $item(price_per_unit)]