Commit 34516129 authored by Frank Bergmann's avatar Frank Bergmann

- changed the name of the default fields of the companies to "default-*"

parent 89d934ec
......@@ -33,8 +33,8 @@
im_email_from_user_id(i.company_contact_id) as company_contact_email,
c.company_name as company_name,
c.company_path as company_short_name,
c.vat as company_vat,
c.invoice_template_id as company_template_id,
c.default_vat as company_vat,
c.default_invoice_template_id as company_template_id,
p.company_name as provider_name,
p.company_path as provider_short_name
from
......
......@@ -165,18 +165,18 @@ if {$invoice_or_quote_p} {
# ---------------------------------------------------------------
if {0 == $vat} {
set vat [db_string default_vat "select vat from im_companies where company_id = :company_id" -default "0"]
set vat [db_string default_vat "select default_vat from im_companies where company_id = :company_id" -default "0"]
}
if {"" == $template_id} {
set template_id [db_string default_template "select invoice_template_id from im_companies where company_id = :company_id" -default ""]
set template_id [db_string default_template "select default_invoice_template_id from im_companies where company_id = :company_id" -default ""]
}
if {"" == $payment_method_id} {
set payment_method_id [db_string default_payment_method "select payment_method_id from im_companies where company_id = :company_id" -default ""]
set payment_method_id [db_string default_payment_method "select default_payment_method_id from im_companies where company_id = :company_id" -default ""]
}
set company_payment_days [db_string default_payment_days "select payment_days from im_companies where company_id = :company_id" -default ""]
set company_payment_days [db_string default_payment_days "select default_payment_days from im_companies where company_id = :company_id" -default ""]
if {"" != $company_payment_days} {
set payment_days $company_payment_days
}
......
......@@ -126,11 +126,7 @@ select
ci.*,
ci.note as cost_note,
ci.project_id as cost_project_id,
c.company_id,
c.company_name,
c.company_path,
c.vat_number,
c.accounting_contact_id,
c.*,
o.*,
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,
......@@ -156,6 +152,7 @@ if { ![db_0or1row invoice_info_query $query] } {
return
}
# ---------------------------------------------------------------
# Determine the language of the template from the template name
# ---------------------------------------------------------------
......@@ -182,6 +179,7 @@ if {[catch {
set locale $user_locale
}
# ---------------------------------------------------------------
# Format Invoice date information according to locale
# ---------------------------------------------------------------
......@@ -227,6 +225,18 @@ if {!$read} {
return
}
# ---------------------------------------------------------------
# Page Title and Context Bar
# ---------------------------------------------------------------
set page_title [lang::message::lookup $locale intranet-invoices.One_cost_type]
set context_bar [im_context_bar [list /intranet-invoices/ "[lang::message::lookup $locale intranet-invoices.Finance]"] $page_title]
# ---------------------------------------------------------------
#
# ---------------------------------------------------------------
set comp_id "$company_id"
set query "
select
......@@ -243,20 +253,18 @@ if { ![db_0or1row category_info_query $query] } {
}
# ---------------------------------------------------------------
# Determine the country name and localize
# ---------------------------------------------------------------
set query "
select
cc.country_name
from
country_codes cc
where
cc.iso = :address_country_code
"
select cc.country_name
from country_codes cc
where cc.iso = :address_country_code"
if { ![db_0or1row country_info_query $query] } {
set country_name ""
set country_name $address_country_code
}
set page_title "[lang::message::lookup $locale intranet-invoices.One_cost_type]"
set context_bar [im_context_bar [list /intranet-invoices/ "[lang::message::lookup $locale intranet-invoices.Finance]"] $page_title]
set country_name [lang::message::lookup $locale intranet-core.$country_name $country_name]
# ---------------------------------------------------------------
......
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