Commit 430cb5eb authored by Frank Bergmann's avatar Frank Bergmann

- Fixed im_project -> im_projects in invoices-procs

- Added a -default 0 to get groups in permission-procs
- Added a check for im_companies.default_* in defs-procs
parent 6f6b1754
......@@ -220,7 +220,7 @@ ad_proc im_invoices_default_company_contact { company_id { project_id ""} } {
# Determine the projects' contact (if exists)
#
set project_contact_id ""
if {0 != $project_id && "" != $project_id || [db_column_exists im_project company_contact_id]} {
if {0 != $project_id && "" != $project_id || [db_column_exists im_projects company_contact_id]} {
set project_contact_id [db_string project_info "
select company_contact_id
from im_projects
......
......@@ -166,22 +166,25 @@ if {$invoice_or_quote_p} {
# Get default values for VAT and invoice_id from company
# ---------------------------------------------------------------
if {0 == $vat} {
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 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 default_payment_method_id from im_companies where company_id = :company_id" -default ""]
if {[db_column_exists im_companies default_invoice_template_id]} {
if {0 == $vat} {
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 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 default_payment_method_id 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
}
}
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
}
# Get a reasonable default value for the invoice_office_id,
# either from the invoice or then from the company_main_office.
......
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