Index: openacs-4/packages/invoices/invoices.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/invoices.info,v diff -u -r1.30 -r1.31 --- openacs-4/packages/invoices/invoices.info 10 Aug 2006 07:34:59 -0000 1.30 +++ openacs-4/packages/invoices/invoices.info 24 Aug 2006 09:18:13 -0000 1.31 @@ -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.42 -r1.43 --- openacs-4/packages/invoices/catalog/invoices.de_DE.ISO-8859-1.xml 10 Aug 2006 07:34:59 -0000 1.42 +++ openacs-4/packages/invoices/catalog/invoices.de_DE.ISO-8859-1.xml 24 Aug 2006 09:18:14 -0000 1.43 @@ -144,7 +144,6 @@ <html><body><h3>Stornorechnung</h3>%data.contact_salutation%,<p>anbei finden Sie die Stornorechnung %data.invoice_nr%.<p>Mit freundlichen Gr&uuml;&szlig;en<br>WIENERS + WIENERS GmbH<br></html></body> Stornorechnung # %invoice_nr% Storno durch - Storniert Storno f�r beendet am Kundenkontakt @@ -155,15 +154,13 @@ erstellt am Datum an dem die Rechnung angelegt wurde erstellt von - Ersteller der Rechnung Gutschrift Gutschrift erstellen <html><body><h3>Gutschrift</h3>%data.contact_salutation%,<p>anbei finden Sie die Rechnungsgutschrift %data.invoice_nr%.<p>Mit freundlichen Gr&uuml;&szlig;en<br>WIENERS + WIENERS GmbH<br></html></body> Gutschrift # %invoice_nr% Neue Gutschrift Neue Gutschrift erstellen W�hrung - W�hrung der Rechnung Rechnung l�schen Beschreibung Beschreibung auf der Rechnung @@ -297,7 +294,6 @@ Zum L�schen von Dateien die entsprechende Checkbox markieren. Dateien zur internen Verwendung - diese werden nicht mit dem Angebot verschickt! Dateien - Angebotsdatei ansehen Lieferdatum Abgabetermin, zu dem das Projekt an den Kunden ausgeliefert werden muss Timing Uhrzeit @@ -417,7 +413,6 @@ Letztes Jahr Anwendungen verlinken In der URL ist leider die Angebotsnummer nicht enthalten. M�glicherweise hat Ihr E-Mail-Programm beim Anklicken des Links nicht die gesamte URL �bergeben - einige E-Mail-Programme umbrechen die URLs, dann geht beim Klick auf den Link die zweite Zeile verloren. In diesem Fall bitte den zweiten Teil der URL einfach kopieren und im Browser an den ersten Teil anh�ngen. Vielen Dank! - Leider konnten wir keine Organisation als Rechnungsempf�nger finden. Bitte stellen Sie sicher, das der Rechnungsempf�nger als Angestellter einer Firma im System hinterlegt ist (�ber eine employment_relationship) Leider k�nnen wir die von Ihnen angeforderte Rechnungsnummer nicht in unserem System finden. Bitte �berpr�fen Sie ob die Nummer richtig ist. Verbunden Die Stapelverarbeitung der Rechungen ist abschlossen. <p> %failed_projects_html% @@ -431,7 +426,6 @@ Neu Neue Kunden Nein - Keine Organisation f�r die Rechnung gefunden. Unbekannte Rechnungsnummer Keine Anzahl Stunden @@ -470,6 +464,7 @@ Empf�nger Kundentyp Neukunden + Report der Projekte Alle Projekte Alle Angebote Zeige alle Angebote 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.44 -r1.45 --- openacs-4/packages/invoices/catalog/invoices.en_US.ISO-8859-1.xml 10 Aug 2006 07:34:59 -0000 1.44 +++ openacs-4/packages/invoices/catalog/invoices.en_US.ISO-8859-1.xml 24 Aug 2006 09:18:14 -0000 1.45 @@ -414,7 +414,6 @@ Last Years Link package instances Sorry, the offer_id cannot be found on the URL. It is possible that when you left clicked, your email program did not transfer the whole URL - some email programs break up the URLs, which means the second part is lost when you left click. If this is the case, please just copy the second part of the URL and attach it to the first part in the browser. Thank you! - Sadly we were not able to find an organization where to send the invoice to. Please make sure that the invoice recipient is working at an organization and has an employment_relationship. We are sorry but the invoice number you are searching for does not exist in our system. Mapped The mass generation of invoices is finished.<p> %failed_projects_html% @@ -428,7 +427,6 @@ New New Clients No - No organization for invoice found No such invoice number None Number of units @@ -467,6 +465,7 @@ Recipient Customer type New customer + Report of projects All projects All Offers Show all offers Index: openacs-4/packages/invoices/lib/report-projects-offers.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/report-projects-offers.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/lib/report-projects-offers.adp 24 Aug 2006 09:18:14 -0000 1.1 @@ -0,0 +1,2 @@ + + \ No newline at end of file Index: openacs-4/packages/invoices/lib/report-projects-offers.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/report-projects-offers.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/lib/report-projects-offers.tcl 24 Aug 2006 09:18:14 -0000 1.1 @@ -0,0 +1,94 @@ +# author Nils Lohse (nils.lohse@cognovis.de) +# creation-date 2006-08-21 +# creation-date 2006-08-22 + + +# if { [exists_and_not_null orderby] } + +set today [clock format [clock seconds] -format "%Y-%m-%d"] + +if { [exists_and_not_null start_date] } { + if {[string equal $start_date "YYYY-MM-DD"]} { + set date_range_start $today + } else { + set date_range_start $start_date + } +} else { + set date_range_start $today +} + +if { [exists_and_not_null end_date] } { + if {[string equal $end_date "YYYY-MM-DD"]} { + #set date_range_end $today + unset -nocomplain date_range_end + } else { + set date_range_end $end_date + } +} else { + #set date_range_end $today +} + +set date_range_clause "" + +if { [exists_and_not_null date_range_start] } { + set date_range 1 + catch { set date_range_start [lc_time_fmt $date_range_start %y-%m-%d] } errMsg + append date_range_clause " and to_char(p.latest_finish_date,'yy-mm-dd') >= :date_range_start" +} + +if { [exists_and_not_null date_range_end] } { + set date_range 1 + catch { set date_range_end [lc_time_fmt $date_range_end %y-%m-%d] } errMsg + append date_range_clause " and to_char(p.latest_finish_date,'yy-mm-dd') <= :date_range_end" +} + +template::list::create \ + -name report \ + -multirow report \ + -elements { + title { + label {[_ invoices.iv_offer_project]} + csv_col title + } + customer_name { + label {[_ invoices.Customer]} + csv_col customer_name + } + prj_sum { + label {[_ invoices.Amount_total]} + csv_col prj_sum + } + } -formats { + normal { + label "[_ logger.Table]" + layout table + } + csv { + label "[_ logger.CSV]" + output csv + page_size 0 + } + } -filters { + start_date {} + end_date {} + } + +db_multirow -extend {prj_sum customer_url} report main_projects {} { + # was copy&paste (2006/08/22) set customer_url "${contacts_url}$customer_id" + set allsubs [pm::project::get_all_subprojects -project_item_id $item_id] + set prj_sum $allsubs + set prj_and_subs [linsert $allsubs 0 $item_id] + set total_sum 0 + foreach project_item_id $prj_and_subs { + db_foreach get_project_amount_values {} { + set total_sum [expr $total_sum + $amount_total] + } + } + set prj_sum [lc_numeric $total_sum] +} + +# This spits out the CSV if we happen to be in CSV layout +if {$format eq "csv"} { + template::list::write_csv -name report + ad_script_abort +} Index: openacs-4/packages/invoices/lib/report-projects-offers.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/report-projects-offers.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/lib/report-projects-offers.xql 24 Aug 2006 09:18:14 -0000 1.1 @@ -0,0 +1,45 @@ + + + + + + select + p.project_id, + i.item_id, + cr.title, + p.latest_finish_date, + p.customer_id, + org.name as customer_name + from + pm_projects p, cr_revisions cr, cr_items i, cr_items i2, organizations org + where + p.project_id = i.latest_revision + and p.project_id = cr.revision_id + $date_range_clause + and i.parent_id = i2.item_id + and i2.content_type = 'content_folder' + and p.customer_id = org.organization_id + order by + latest_finish_date + + + + + + select + amount_total + from + iv_offers o, + cr_items i, + acs_data_links r, + cr_items i2 + + where + o.offer_id = i.latest_revision + and r.object_id_one = i.item_id + and r.object_id_two = i2.item_id + and i2.item_id = :project_item_id + + + + 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.25 -r1.26 --- openacs-4/packages/invoices/tcl/invoice-procs.tcl 11 Aug 2006 19:37:52 -0000 1.25 +++ openacs-4/packages/invoices/tcl/invoice-procs.tcl 24 Aug 2006 09:18:14 -0000 1.26 @@ -302,7 +302,7 @@ if {$price_per_unit > 1} { set item_units [expr $item_units * (1. + ($credit_percent / 100.))] } else { - set item_units [format "%.1f" $item_units] + set item_units $item_units } set amount_sum [format "%.2f" [expr $multiplier * $item_units * $price_per_unit]] set amount_total [format "%.2f" [expr (1. - ($rebate / 100.)) * $amount_sum]] Index: openacs-4/packages/invoices/www/#index.adp# =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/Attic/#index.adp#,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/www/#index.adp# 24 Aug 2006 09:18:14 -0000 1.1 @@ -0,0 +1,28 @@ + +@page_title;noquote@ +@context;noquote@ + + + #invoices.admin# +

+ + +

Index: openacs-4/packages/invoices/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/index.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/invoices/www/index.adp 3 Jun 2006 18:26:48 -0000 1.9 +++ openacs-4/packages/invoices/www/index.adp 24 Aug 2006 09:18:14 -0000 1.10 @@ -20,6 +20,7 @@
  • #invoices.First_Order_Reports#
  • #invoices.Customer_Invoices_Reports#
  • +
  • #invoices.Report_Projects#
  • #invoices.iv_journal#
  • Index: openacs-4/packages/invoices/www/offer-projects-reports.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/offer-projects-reports.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/www/offer-projects-reports.adp 24 Aug 2006 09:18:14 -0000 1.1 @@ -0,0 +1,33 @@ + +@page_title;noquote@ +@context;noquote@ + + + + + + + Index: openacs-4/packages/invoices/www/offer-projects-reports.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/offer-projects-reports.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/www/offer-projects-reports.tcl 24 Aug 2006 09:18:14 -0000 1.1 @@ -0,0 +1,27 @@ +ad_page_contract { + Generates reports about the projects + + @author Nils Lohse (nils.lohse@cognovis.de) + @creation-date 2006-08-21 + @creation-date 2006-08-22 +} { + {start_date "YYYY-MM-DD"} + {end_date "YYYY-MM-DD"} + {orderby ""} + {format "normal"} +} + +set page_title "[_ invoices.Report_Projects]" +set context [list $page_title] + +set base_url [ad_conn url] +set current_url [ad_conn url] +set clear_link [export_vars -base $current_url {page orderby organization_id}] +set export_vars [export_vars -form {page orderby organization_id}] + +set clear_p 1 +if {$start_date == "YYYY-MM-DD" && $end_date == "YYYY-MM-DD"} { + set clear_p 0 +} + +ad_return_template
    +
    + @export_vars;noquote@ + + + + + + + + + + + +
    #invoices.iv_invoice_start_date# #invoices.iv_invoice_end_date#
    #invoices.clear#
    +
    +