if(GETPOST("button_removefilter_x")||GETPOST("button_removefilter.x")||GETPOST("button_removefilter"))// All test are required to be compatible with all browsers
{
$search_ref='';
$search_label='';
$search_desc='';
}
// Sales or Purchase mode ?
if($action=='update'){
if(!empty($btn_changetype)){
...
...
@@ -158,6 +164,12 @@ if ($action == 'update') {
}
}
/*
* View
*/
$form=newFormVentilation($db);
// Defaut AccountingAccount RowId Product / Service
if(GETPOST("button_removefilter_x")||GETPOST("button_removefilter.x")||GETPOST("button_removefilter"))// All test are required to be compatible with all browsers
$sql.=" OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN
(SELECT aa.account_number FROM ".MAIN_DB_PREFIX."accounting_account as aa , ".MAIN_DB_PREFIX."accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = ".$pcgver."))";
}
$sql.=")";
if(!empty($conf->multicompany->enabled)){
$sql.=' AND p.entity IN ('.getEntity('product',1).')';
}
// Add search filter like
if(strlen(trim($search_ref))){
$sql.=" AND (p.ref like '".$search_ref."%')";
$sql.=natural_search("p.ref",$search_ref);
}
if(strlen(trim($search_label))){
$sql.=" AND (p.label like '".$search_label."%')";
$sql.=natural_search("p.label",$search_label);
}
if(strlen(trim($search_desc))){
$sql.=" AND (p.description like '%".$search_desc."%')";