|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /home/jackjohn/public_html/shopsite-images/en-IE/javascript/ |
Upload File : |
function qb_highlight_missing_values()
{
var trns_type = document.getElementsByName('trns_type');
var item_import = document.getElementsByName('item_import');
var payment_import = document.getElementById('payment_import');
var customer_import = document.getElementsByName('customer_import');
var invoice_accnt = document.getElementById('invoice_accnt');
var payment_accnt = document.getElementById('payment_accnt');
var cash_accnt = document.getElementById('cash_accnt');
var item_accnt = document.getElementById('item_accnt');
var single_item_name = document.getElementById('single_item_name');
var single_customer_name = document.getElementById('single_customer_name');
var customer_sales_tax = document.getElementById('customer_sales_tax');
var salestax_item = document.getElementById('salestax_item');
var salestax_accnt = document.getElementById('salestax_accnt');
var salestax_agency = document.getElementById('salestax_agency');
var missing_value = null;
if (trns_type.length == 0) // not in products download
{
if (item_accnt.value.length == 0)
{
item_accnt.style.borderColor = 'red';
return item_accnt;
}
else
return null;
}
invoice_accnt.style.borderColor = '';
payment_accnt.style.borderColor = '';
cash_accnt.style.borderColor = '';
item_accnt.style.borderColor = '';
single_item_name.style.borderColor = '';
single_customer_name.style.borderColor = '';
salestax_item.style.borderColor = '';
salestax_accnt.style.borderColor = '';
salestax_agency.style.borderColor = '';
if (trns_type[0].checked && invoice_accnt.value.length == 0)
{
invoice_accnt.style.borderColor = 'red';
if (missing_value == null)
missing_value = invoice_accnt;
}
if (trns_type[1].checked && cash_accnt.value.length == 0)
{
cash_accnt.style.borderColor = 'red';
if (missing_value == null)
missing_value = cash_accnt;
}
if (payment_import.checked && payment_accnt.value.length == 0)
{
payment_accnt.style.borderColor = 'red';
if (missing_value == null)
missing_value = payment_accnt;
}
if (item_import[0].checked && item_accnt.value.length == 0)
{
item_accnt.style.borderColor = 'red';
if (missing_value == null)
missing_value = item_accnt;
}
if (item_import[1].checked && single_item_name.value.length == 0)
{
single_item_name.style.borderColor = 'red';
if (missing_value == null)
missing_value = single_item_name;
}
if (customer_import[1].checked && single_customer_name.value.length == 0)
{
single_customer_name.style.borderColor = 'red';
if (missing_value == null)
missing_value = single_customer_name;
}
if (customer_import[0].checked && customer_sales_tax.checked)
{
if (salestax_item.value.length == 0)
{
salestax_item.style.borderColor = 'red';
if (missing_value == null)
missing_value = salestax_item;
}
if (salestax_accnt.value.length == 0)
{
salestax_accnt.style.borderColor = 'red';
if (missing_value == null)
missing_value = salestax_accnt;
}
if (salestax_agency.value.length == 0)
{
salestax_agency.style.borderColor = 'red';
if (missing_value == null)
missing_value = salestax_agency;
}
}
if (salestax_item.value.length > 0)
{
if (salestax_accnt.value.length == 0)
{
salestax_accnt.style.borderColor = 'red';
if (missing_value == null)
missing_value = salestax_accnt_name;
}
if (salestax_agency.value.length == 0)
{
salestax_agency.style.borderColor = 'red';
if (missing_value == null)
missing_value = salestax_agency_name;
}
}
return missing_value;
}
function qb_validate()
{
var missing_values = qb_highlight_missing_values();
if (missing_values != null)
{
alert(qb_missing_values);
missing_values.focus(); // first one
return false;
}
return true;
}
function check_qb_configuration(qb_button)
{
switch (qb_config)
{
case 'no':
alert(qb_configure);
qb_button.checked = false;
break;
case 'ok':
select_all_fields();
select_file_extension(qb_button);
break;
}
}
function trns_type_changed()
{
var choices = document.getElementsByName('trns_type');
if (choices[0].checked)
{
var cash_accnt = document.getElementById('cash_accnt');
cash_accnt.style.borderColor = '';
}
else
if (choices[1].checked)
{
var invoice_accnt = document.getElementById('invoice_accnt');
invoice_accnt.style.borderColor = '';
}
}
function item_import_changed()
{
var choices = document.getElementsByName('item_import');
if (choices[0].checked)
{
var single_item_name = document.getElementById('single_item_name');
single_item_name.style.borderColor = '';
}
else
if (choices[1].checked)
{
var item_accnt = document.getElementById('item_accnt');
item_accnt.style.borderColor = '';
}
}
function customer_import_changed()
{
var choices = document.getElementsByName('customer_import');
if (choices[0].checked)
{
var single_customer_name = document.getElementById('single_customer_name');
single_customer_name.style.borderColor = '';
}
else
if (choices[1].checked)
{
var salestax_item = document.getElementById('salestax_item');
var salestax_accnt = document.getElementById('salestax_accnt');
var salestax_agency = document.getElementById('salestax_agency');
var customer_sales_tax = document.getElementById('customer_sales_tax');
customer_sales_tax.checked = false;
salestax_item.style.borderColor = '';
salestax_accnt.style.borderColor = '';
salestax_agency.style.borderColor = '';
}
}
function customer_sales_tax_changed()
{
var choices = document.getElementsByName('customer_import');
var customer_sales_tax = document.getElementById('customer_sales_tax');
var single_customer_name = document.getElementById('single_customer_name');
if (customer_sales_tax.checked)
{
choices[0].checked = true;
single_customer_name.style.borderColor = '';
}
else
{
var salestax_item = document.getElementById('salestax_item');
var salestax_accnt = document.getElementById('salestax_accnt');
var salestax_agency = document.getElementById('salestax_agency');
salestax_item.style.borderColor = '';
salestax_accnt.style.borderColor = '';
salestax_agency.style.borderColor = '';
}
}
function default_value(name, value)
{
document.getElementById(name).value = value;
return false;
}