Index: openacs-4/packages/invoices/invoices.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/invoices.info,v diff -u -r1.25 -r1.26 --- openacs-4/packages/invoices/invoices.info 3 May 2006 05:52:35 -0000 1.25 +++ openacs-4/packages/invoices/invoices.info 18 May 2006 12:48:45 -0000 1.26 @@ -7,15 +7,15 @@ f t - + Timo Hentschel Invoices package that will collect costs to invoice items in invoices and store data about received payment. 2005-11-15 Cognovis Collect costs to invoice items and invoices, store payment information. 0 - + Index: openacs-4/packages/invoices/catalog/invoices.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/catalog/invoices.de_DE.ISO-8859-1.xml,v diff -u -r1.33 -r1.34 --- openacs-4/packages/invoices/catalog/invoices.de_DE.ISO-8859-1.xml 15 May 2006 19:37:59 -0000 1.33 +++ openacs-4/packages/invoices/catalog/invoices.de_DE.ISO-8859-1.xml 18 May 2006 12:48:46 -0000 1.34 @@ -340,6 +340,8 @@ Angebot schicken Auftragsbest�tigung schicken Angebot erneut schicken + Gesamtsumme im Angebot + Soll die Gesamtsumme im Angebots-PDF angezeigt werden Interne Deadline des Subprojektes Angebotsvorlage Titel Index: openacs-4/packages/invoices/catalog/invoices.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/catalog/invoices.en_US.ISO-8859-1.xml,v diff -u -r1.37 -r1.38 --- openacs-4/packages/invoices/catalog/invoices.en_US.ISO-8859-1.xml 15 May 2006 19:37:59 -0000 1.37 +++ openacs-4/packages/invoices/catalog/invoices.en_US.ISO-8859-1.xml 18 May 2006 12:48:46 -0000 1.38 @@ -338,6 +338,8 @@ Send Offer Send confirmation Send offer again + Total sum in offer + Display the total offer sum in offer-pdf Interne Deadline des Subprojektes Template des Angebots Title 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.12 -r1.13 --- openacs-4/packages/invoices/sql/postgresql/invoices-create.sql 3 May 2006 05:52:35 -0000 1.12 +++ openacs-4/packages/invoices/sql/postgresql/invoices-create.sql 18 May 2006 12:48:46 -0000 1.13 @@ -115,8 +115,12 @@ -- %credit status varchar(10) default 'new', -- new, accepted, billed, credit - accepted_date timestamptz + accepted_date timestamptz, -- offer accepted by customer? + show_sum_p char(1) default 't' + constraint iv_offers_show_sum_p + check (show_sum_p in ('t','f')) + -- show sum when creating offer pdf? ); -- offers are linked to a project via cr_items.parent_id Index: openacs-4/packages/invoices/sql/postgresql/upgrade/upgrade-1.0d7-1.0d8.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/sql/postgresql/upgrade/upgrade-1.0d7-1.0d8.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/sql/postgresql/upgrade/upgrade-1.0d7-1.0d8.sql 18 May 2006 12:48:46 -0000 1.1 @@ -0,0 +1,3 @@ +alter table iv_offers add column show_sum_p char(1) constraint iv_offers_show_sum_p check (show_sum_p in ('t','f')); +alter table iv_offers alter column show_sum_p set default 't'; +update iv_offers set show_sum_p = 't'; Index: openacs-4/packages/invoices/tcl/iv-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/iv-install-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/invoices/tcl/iv-install-procs.tcl 3 May 2006 05:52:35 -0000 1.12 +++ openacs-4/packages/invoices/tcl/iv-install-procs.tcl 18 May 2006 12:48:46 -0000 1.13 @@ -57,6 +57,7 @@ content::type::attribute::new -content_type {iv_offer} -attribute_name {credit_percent} -datatype {number} -pretty_name {[_ invoices.Credit]} -column_spec {numeric(12,5)} content::type::attribute::new -content_type {iv_offer} -attribute_name {status} -datatype {string} -pretty_name {[_ invoices.Status]} -column_spec {varchar(10)} content::type::attribute::new -content_type {iv_offer} -attribute_name {accepted_date} -datatype {date} -pretty_name {[_ invoices.Accepted_date]} -column_spec {timestamptz} + content::type::attribute::new -content_type {iv_offer} -attribute_name {show_sum_p} -datatype {boolean} -pretty_name {[_ invoices.Show_Sum]} -column_spec {char(1)} # Offer Item content::type::attribute::new -content_type {iv_offer_item} -attribute_name {item_nr} -datatype {string} -pretty_name {[_ invoices.Offer_item_number]} -column_spec {varchar(200)} @@ -274,6 +275,9 @@ content::type::attribute::new -content_type {iv_invoice} -attribute_name {pdf_status} -datatype {string} -pretty_name {[_ invoices.PDF_Status]} -column_spec {varchar(10)} content::type::attribute::new -content_type {iv_invoice} -attribute_name {pdf_file_id} -datatype {number} -pretty_name {[_ invoices.PDF_File]} -column_spec {integer} } + 1.0d7 1.0d8 { + content::type::attribute::new -content_type {iv_offer} -attribute_name {show_sum_p} -datatype {boolean} -pretty_name {[_ invoices.Show_Sum]} -column_spec {char(1)} + } } } 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.22 -r1.23 --- openacs-4/packages/invoices/tcl/offer-procs.tcl 2 May 2006 12:07:11 -0000 1.22 +++ openacs-4/packages/invoices/tcl/offer-procs.tcl 18 May 2006 12:48:46 -0000 1.23 @@ -21,6 +21,7 @@ {-finish_date ""} {-date_comment ""} {-payment_days ""} + {-show_sum_p ""} {-vat_percent ""} {-vat ""} {-credit_percent 0} @@ -58,6 +59,7 @@ [list finish_date $finish_date] \ [list date_comment $date_comment] \ [list payment_days $payment_days] \ + [list show_sum_p $show_sum_p] \ [list vat_percent $vat_percent] \ [list vat $vat] \ [list status new] \ @@ -93,6 +95,7 @@ {-finish_date ""} {-date_comment ""} {-payment_days ""} + {-show_sum_p ""} {-vat_percent ""} {-vat ""} {-credit_percent 0} @@ -124,6 +127,7 @@ [list finish_date $finish_date] \ [list date_comment $date_comment] \ [list payment_days $payment_days] \ + [list show_sum_p $show_sum_p] \ [list status $status] \ [list vat_percent $vat_percent] \ [list vat $vat] \ Index: openacs-4/packages/invoices/tcl/offer-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/offer-procs.xql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/invoices/tcl/offer-procs.xql 2 May 2006 12:07:11 -0000 1.11 +++ openacs-4/packages/invoices/tcl/offer-procs.xql 18 May 2006 12:48:46 -0000 1.12 @@ -43,7 +43,7 @@ t.offer_nr, t.amount_total, t.vat, t.vat_percent, t.comment, to_char(t.finish_date, 'YYYY-MM-DD HH24:MI:SS') as finish_ansi, to_char(t.finish_date, :timestamp_format) as finish_date, - o.creation_user, p.first_names, p.last_name, + o.creation_user, p.first_names, p.last_name, t.show_sum_p, to_char(o.creation_date, :timestamp_format) as creation_date, to_char(t.accepted_date, :timestamp_format) as accepted_date, t.amount_sum as amount_sum_, t.payment_days, t.date_comment, @@ -70,7 +70,7 @@ to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date, to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as current_date, to_char(t.accepted_date, 'YYYY-MM-DD HH24:MI:SS') as accepted_date, - t.amount_sum, t.payment_days, t.date_comment, t.currency, + t.amount_sum, t.payment_days, t.date_comment, t.currency, t.show_sum_p, t.organization_id, pr.title as project_title, ci.item_id as offer_id, pp.project_code, pi.item_id as project_id, pp.contact_id, t.reservation from iv_offers t, cr_revisions cr, cr_items ci, acs_objects o, 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.26 -r1.27 --- openacs-4/packages/invoices/www/offer-ae.tcl 2 May 2006 12:07:11 -0000 1.26 +++ openacs-4/packages/invoices/www/offer-ae.tcl 18 May 2006 12:48:46 -0000 1.27 @@ -118,6 +118,7 @@ set package_id [ad_conn package_id] array set container_objects [iv::util::get_default_objects -package_id $package_id] set timestamp_format "$date_format [lc_get formbuilder_time_format]" +set boolean_options [list [list "[_ invoices.yes]" t] [list "[_ invoices.no]" f]] set language [lang::conn::language] set currency_options [db_list_of_lists currencies {}] @@ -232,6 +233,7 @@ ad_form -extend -name iv_offer_form -form { {payment_days:integer,optional {mode display} {label "[_ invoices.iv_offer_payment_days]"} {html {size 5 maxlength 5}} {help_text "[_ invoices.iv_offer_payment_days_help]"}} + {show_sum_p:text(select),optional {label "[_ invoices.iv_offer_show_sum_p]"} {options $boolean_options} {help_text "[_ invoices.iv_offer_show_sum_p_help]"}} } if {!$has_submit} { @@ -572,6 +574,7 @@ } else { set comment "" } + set show_sum_p t set today [db_string today {}] set finish_date "" set finish_time "" @@ -693,6 +696,13 @@ set item_sum [format "%.2f" $item_sum] } -new_data { + set old_offer_id [lindex [application_data_link::get_linked_content -from_object_id $project_id -to_content_type iv_offer] 0] + if {![empty_string_p $old_offer_id]} { + # offer already created, redirect to offer + ad_returnredirect [export_vars -base offer-ae {{offer_id $old_offer_id} project_id return_url}] + ad_script_abort + } + db_transaction { if {[empty_string_p $amount_total]} { set amount_total $amount_sum @@ -710,6 +720,7 @@ -finish_date $finish_date \ -date_comment $date_comment \ -payment_days $payment_days \ + -show_sum_p $show_sum_p \ -vat_percent $vat_percent \ -vat $vat \ -credit_percent $credit_percent] @@ -757,6 +768,7 @@ -finish_date $finish_date \ -date_comment $date_comment \ -payment_days $payment_days \ + -show_sum_p $show_sum_p \ -vat_percent $vat_percent \ -vat $vat \ -credit_percent $credit_percent] Index: openacs-4/packages/invoices/www/offer-ae.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/offer-ae.xql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/invoices/www/offer-ae.xql 2 Apr 2006 22:08:02 -0000 1.11 +++ openacs-4/packages/invoices/www/offer-ae.xql 18 May 2006 12:48:46 -0000 1.12 @@ -139,7 +139,7 @@ o.creation_user, p.first_names, p.last_name, t.reservation, to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_ansi, to_char(t.accepted_date, 'YYYY-MM-DD HH24:MI:SS') as accepted_ansi, - t.amount_sum as amount_sum_, t.payment_days, t.date_comment + t.amount_sum as amount_sum_, t.payment_days, t.date_comment, t.show_sum_p from iv_offers t, cr_revisions r, cr_items i, acs_objects o, persons p where r.revision_id = t.offer_id