Commit ef1c1405 authored by Frank Bergmann's avatar Frank Bergmann

- Localization and fix bugs

parent e09f3538
......@@ -2,10 +2,12 @@
<message_catalog package_key="intranet-invoices" package_version="2.1.0" locale="en_US" charset="ISO-8859-1">
<msg key="Add_a_Payment">Add a Payment</msg>
<msg key="Add_a_Project">Add a Project</msg>
<msg key="Add_a_user">Add a user</msg>
<msg key="Admin_Links">Admin Links</msg>
<msg key="Adress">Adress</msg>
<msg key="Amount">Amount</msg>
<msg key="Client">Client</msg>
<msg key="Company">Company</msg>
<msg key="Company_1">Company:</msg>
<msg key="Company_name">Company name</msg>
......@@ -23,8 +25,12 @@
<msg key="days">days</msg>
<msg key="Del">Del</msg>
<msg key="Description">Description</msg>
<msg key="Document_">Document #</msg>
<msg key="Document_hash_simbol">Document #</msg>
<msg key="Document_Status">Document Status:</msg>
<msg key="Document_Type">Document Type:</msg>
<msg key="Due_Date">Due Date</msg>
<msg key="Edit">Edit</msg>
<msg key="Edit_cost_type">Edit %cost_type%</msg>
<msg key="Edit_cost_type_1">Edit %cost_type</msg>
<msg key="Email">Email</msg>
......@@ -34,6 +40,7 @@
<msg key="Financial_Documents">Financial Documents</msg>
<msg key="From">From:</msg>
<msg key="Go">Go</msg>
<msg key="Hour">Hour</msg>
<msg key="Line">Line</msg>
<msg key="lt_Cant_find_the_documen">Can't find the document# %invoice_id%</msg>
<msg key="lt_Dear_accounting_conta">Dear %accounting_contact_name%,
......@@ -69,14 +76,22 @@ Best regards,
<msg key="lt_You_have_insufficient">You have insufficient privileges to see this page</msg>
<msg key="lt_You_have_insufficient_1">You have insufficient privileges to view this page.</msg>
<msg key="lt_You_need_to_specify_a">You need to specify a invoice_id</msg>
<msg key="New_Company_Invoice_from_Quote">New Company Invoice from Quote</msg>
<msg key="New_Company_Invoice_from_scratch">New Company Invoice from scratch</msg>
<msg key="New_cost_type">New %cost_type%</msg>
<msg key="New_Provider_Bill_from_Purchase_Order">New Provider Bill from Purchase Order</msg>
<msg key="New_Provider_Bill_from_scratch">New Provider Bill from scratch</msg>
<msg key="New_Purchase_Order_from_scratch">New Purchase Order from scratch</msg>
<msg key="New_Quote_from_scratch">New Quote from scratch</msg>
<msg key="Next_Page">Next Page</msg>
<msg key="No_command_specified">No command specified</msg>
<msg key="No_objects_found">No objects found</msg>
<msg key="No_payments_found">No payments found</msg>
<msg key="Note">Note:</msg>
<msg key="Notify_user">Notify user</msg>
<msg key="One_cost_type">One %cost_type%</msg>
<msg key="Our_Ref">Our Ref.</msg>
<msg key="Paid">Paid</msg>
<msg key="Payment_Method">Payment Method</msg>
<msg key="Payment_Method_1">Payment Method:</msg>
<msg key="Payment_Terms">Payment Terms:</msg>
......@@ -90,7 +105,11 @@ Best regards,
<msg key="Rate">Rate</msg>
<msg key="Recipient">Recipient</msg>
<msg key="Related_Payments">Related Payments</msg>
<msg key="Related_Projects">Related Projects</msg>
<msg key="S-Line">S-Line</msg>
<msg key="Save">Save</msg>
<msg key="Status">Status</msg>
<msg key="Subtotal">Subtotal</msg>
<msg key="TAX">TAX</msg>
<msg key="TAXnbsp">TAX&amp;nbsp;</msg>
<msg key="To">To:</msg>
......
......@@ -73,6 +73,10 @@ where
ascii(substr(i.nr,4,1)) < 58
"
set last_invoice_nr [db_string max_invoice_nr $sql -default ""]
set last_invoice_nr [string trimleft $last_invoice_nr "0"]
if {[empty_string_p $last_invoice_nr]} {
set last_invoice_nr 0
}
set next_number [expr $last_invoice_nr + 1]
ns_log notice "********** next_number is $next_number *************"
set sql "
......@@ -165,7 +169,7 @@ ad_proc im_invoices_object_list_component { user_id invoice_id return_url } {
if {0 == $ctr} {
append object_list_html "
<tr $bgcolor([expr $ctr % 2])>
<td><i>No objects found</i></td>
<td><i>[_ intranet-invoices.No_objects_found]</i></td>
</tr>\n"
}
......@@ -174,16 +178,16 @@ ad_proc im_invoices_object_list_component { user_id invoice_id return_url } {
[export_form_vars invoice_id return_url]
<table border=0 cellspacing=1 cellpadding=1>
<tr>
<td align=middle class=rowtitle colspan=2>Related Projects</td>
<td align=middle class=rowtitle colspan=2>[_ intranet-invoices.Related_Projects]</td>
</tr>
$object_list_html
<tr>
<td align=right>
<input type=submit name=add_project_action value='Add a Project'>
<input type=submit name=add_project_action value='[_ intranet-invoices.Add_a_Project]'>
</A>
</td>
<td>
<input type=submit name=del_action value='Del'>
<input type=submit name=del_action value='[_ intranet-invoices.Del]'>
</td>
</tr>
</table>
......
......@@ -430,6 +430,8 @@ if { ![empty_string_p $query_string] } {
append table_header_html "<tr>\n"
foreach col $column_headers {
regsub -all " " $col "_" col_key
regsub -all "#" $col_key "hash_simbol" col_key
#set col_key [lang::util::suggest_key $col]
if { [string compare $order_by $col] == 0 } {
append table_header_html " <td class=rowtitle>[_ intranet-invoices.$col_key]</td>\n"
} else {
......
......@@ -26,7 +26,7 @@ ad_page_contract {
template_id:integer
vat:float
tax:float
note
{note ""}
item_sort_order:array
item_name:array
item_units:float,array
......@@ -72,8 +72,8 @@ if {$invoice_or_bill_p && ("" == $payment_method_id || 0 == $payment_method_id)}
return
}
if {"" == $provider_id} { set provider_id [im_company_internal] }
if {"" == $company_id} { set company_id [im_company_internal] }
if {"" == $provider_id || 0 == $provider_id} { set provider_id [im_company_internal] }
if {"" == $company_id || 0 == $company_id} { set company_id [im_company_internal] }
set project_id ""
......@@ -183,7 +183,7 @@ foreach project_id $select_project {
from acs_rels
where object_id_one = :project_id
and object_id_two = :invoice_id"
if {0 = $v_rel_exists} {
if {0 == $v_rel_exists} {
set rel_id [db_exec_plsql create_rel ""]
}
}
......
......@@ -19,7 +19,7 @@
i.invoice_nr,
ci.customer_id,
ci.provider_id,
ci.effective_date,
to_char(ci.effective_date,'YYYY-MM-DD') as effective_date,
ci.payment_days,
ci.vat,
ci.tax,
......
......@@ -54,7 +54,7 @@ set user_id [ad_maybe_redirect_for_registration]
#}
set return_url [im_url_with_query]
set todays_date [db_string get_today "select sysdate from dual"]
set todays_date [db_string get_today "select to_char(sysdate,'YYYY-MM-DD') from dual"]
set page_focus "im_header_form.keywords"
set view_name "invoice_tasks"
......
......@@ -65,7 +65,7 @@ where
if {$cost_type_id == [im_cost_type_quote] || $cost_type_id == [im_cost_type_invoice]} {
set company_id $company_id
set company_id $customer_id
} else {
set company_id $provider_id
}
......
......@@ -26,7 +26,6 @@ if {![im_permission $user_id add_invoices]} {
ad_return_complaint 1 "<li>[_ intranet-invoices.lt_You_have_insufficient]"
return
}
if {"" != $del} {
ns_log Notice "payment-action: delete payments: $payment_id"
......
<?xml version="1.0"?>
<!DOCTYPE queryset PUBLIC "-//OpenACS//DTD XQL 1.0//EN" "/usr/share/emacs/DTDs/xql.dtd">
<!-- packages/intranet-invoices/www/view-oracle.xql -->
<!-- @author Juanjo Ruiz (juanjoruizx@yahoo.es) -->
<!-- @creation-date 2004-10-08 -->
<!-- @arch-tag 873b11b2-60e2-4bbf-9dd5-d6b06c019421 -->
<!-- @cvs-id $Id$ -->
<queryset>
<rdbms>
<type>oracle</type>
<version>8.1.6</version>
</rdbms>
<fullquery name = "invoice_items">
<querytext>
select
i.*,
p.*,
im_category_from_id(i.item_type_id) as item_type,
im_category_from_id(i.item_uom_id) as item_uom,
p.project_nr as project_short_name,
i.price_per_unit * i.item_units as amount
from
im_invoice_items i,
im_projects p
where
i.invoice_id=:invoice_id
and i.project_id=p.project_id(+)
order by
i.sort_order,
i.item_type_id
</querytext>
</fullquery>
</queryset>
<?xml version="1.0"?>
<!DOCTYPE queryset PUBLIC "-//OpenACS//DTD XQL 1.0//EN" "/usr/share/emacs/DTDs/xql.dtd">
<!-- packages/intranet-invoices/www/view-postgresql.xql -->
<!-- @author Juanjo Ruiz (juanjoruizx@yahoo.es) -->
<!-- @creation-date 2004-10-08 -->
<!-- @arch-tag ffe2b337-c79b-4b45-bfcb-41a371866d36 -->
<!-- @cvs-id $Id$ -->
<queryset>
<rdbms>
<type>postgresql</type>
<version>7.2</version>
</rdbms>
<fullquery name = "invoice_items">
<querytext>
select
i.*,
p.*,
im_category_from_id(i.item_type_id) as item_type,
im_category_from_id(i.item_uom_id) as item_uom,
p.project_nr as project_short_name,
i.price_per_unit * i.item_units as amount
from
im_invoice_items i
LEFT JOIN im_projects p on i.project_id=p.project_id
where
i.invoice_id=:invoice_id
order by
i.sort_order,
i.item_type_id;
</querytext>
</fullquery>
</queryset>
......@@ -52,7 +52,7 @@
</tr>
<tr>
<td class=roweven>#intranet-invoices.cost_type_date#</td>
<td class=roweven>@invoice_date@</td>
<td class=roweven>@invoice_date_pretty@</td>
</tr>
<!-- <tr>
<td class=rowodd>#intranet-invoices.cost_type_due_date#</td>
......@@ -79,7 +79,7 @@
<tr><td colspan=2 align=right>
<form action=new method=POST>
<%= [export_form_vars return_id invoice_id cost_type_id] %>
<input type=submit name=edit_invoice value='Edit'>
<input type=submit name=edit_invoice value='#intranet-invoices.Edit#'>
</form>
</td></tr>
</table>
......@@ -93,7 +93,7 @@
<tr>
<td class=rowodd>#intranet-invoices.Company_name#</td>
<td class=rowodd>
<A href="/intranet/companies/view?company_id=@company_id@">@company_name@</A>
<A href="/intranet/companies/view?company_id=@comp_id@">@company_name@</A>
</td>
</tr>
<tr>
......
......@@ -28,7 +28,6 @@ if {0 == $invoice_id} {
ad_return_complaint 1 "<li>[_ intranet-invoices.lt_You_need_to_specify_a]"
return
}
if {![im_permission $user_id view_companies]} {
ad_return_complaint "[_ intranet-invoices.lt_Insufficient_Privileg]" "
<li>[_ intranet-invoices.lt_You_have_insufficient_1]<BR>
......@@ -72,7 +71,7 @@ if {$cost_type_id == [im_cost_type_po]} {
if {$invoice_or_quote_p} {
# A Company document
set company_or_provider_join "and i.company_id = c.company_id"
set company_or_provider_join "and i.customer_id = c.company_id"
set provider_company "Company"
} else {
# A provider document
......@@ -93,6 +92,7 @@ select
c.*,
c.company_id as company_id,
o.*,
to_char(i.invoice_date,'YYYY-MM-DD') as invoice_date_pretty,
to_date(to_char(i.invoice_date,'YYYY-MM-DD'),'YYYY-MM-DD') + i.payment_days as calculated_due_date,
im_name_from_user_id(c.accounting_contact_id) as company_contact_name,
im_email_from_user_id(c.accounting_contact_id) as company_contact_email,
......@@ -116,7 +116,7 @@ if { ![db_0or1row projects_info_query $query] } {
ad_return_complaint 1 "[_ intranet-invoices.lt_Cant_find_the_documen]"
return
}
set comp_id "$company_id"
set query "
select
pm_cat.category as invoice_payment_method,
......@@ -168,7 +168,6 @@ where cost_id = :invoice_id
set payment_list_html ""
if {[db_table_exists im_payments]} {
set cost_id $invoice_id
set payment_list_html "
<form action=payment-action method=post>
......@@ -183,6 +182,7 @@ if {[db_table_exists im_payments]} {
set payment_list_sql "
select
p.*,
to_char(p.received_date,'YYYY-MM-DD') as received_date_pretty,
im_category_from_id(p.payment_type_id) as payment_type
from
im_payments p
......@@ -196,7 +196,7 @@ where
<tr $bgcolor([expr $payment_ctr % 2])>
<td>
<A href=/intranet-payments/view?payment_id=$payment_id>
$received_date
$received_date_pretty
</A>
</td>
<td>
......@@ -269,14 +269,12 @@ set ctr 1
set colspan 7
if {!$company_project_nr_exists} { set colspan [expr $colspan-1]}
db_foreach invoice_items $invoice_items_sql {
db_foreach invoice_items {} {
append item_html "
<tr $bgcolor([expr $ctr % 2])>
<td>$item_name</td>
<td align=right>$item_units</td>
<td align=left>$item_uom</td>
<td align=left>[_ intranet-core.$item_uom]</td>
<td align=right>[im_date_format_locale $price_per_unit 2 3]&nbsp;$currency</td>\n"
if {$company_project_nr_exists} {
# Only if intranet-translation has added the field
......@@ -313,7 +311,7 @@ set colspan_sub [expr $colspan - 1]
# Add a subtotal
append item_html "
<tr>
<td class=rowplain colspan=$colspan_sub align=right><B>Subtotal</B></td>
<td class=rowplain colspan=$colspan_sub align=right><B>[_ intranet-invoices.Subtotal]</B></td>
<td class=roweven align=right><B> [im_date_format_locale $subtotal 2 2] $currency</B></td>
</tr>
"
......@@ -321,8 +319,8 @@ append item_html "
#if {0 != $vat} {
append item_html "
<tr>
<td colspan=$colspan_sub align=right>[_ intranet-invoices.VAT]: $vat %&nbsp;</td>
<td class=roweven align=right>$vat_amount $currency</td>
<td colspan=$colspan_sub align=right>[_ intranet-invoices.VAT]: [format "%0.1f" $vat]%&nbsp;</td>
<td class=roweven align=right>[format "%0.2f" $vat_amount] $currency</td>
</tr>
"
#}
......@@ -330,8 +328,8 @@ append item_html "
if {0 != $tax} {
append item_html "
<tr>
<td colspan=$colspan_sub align=right>[_ intranet-invoices.TAX]: $tax %&nbsp;</td>
<td class=roweven align=right>$tax_amount $currency</td>
<td colspan=$colspan_sub align=right>[_ intranet-invoices.TAX]: [format "%0.1f" $tax] %&nbsp;</td>
<td class=roweven align=right>[format "%0.2f" $tax_amount] $currency</td>
</tr>
"
}
......@@ -363,7 +361,6 @@ append item_html "
</tr>
"
# ---------------------------------------------------------------
# 10. Format using a template
# ---------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment