no inner join
This commit is contained in:
parent
e9de415dc0
commit
86e9398b79
@ -494,7 +494,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town);
|
|||||||
if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
|
if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
|
||||||
if ($search_state) $sql .= natural_search("state.nom", $search_state);
|
if ($search_state) $sql .= natural_search("state.nom", $search_state);
|
||||||
if ($search_country) $sql .= " AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).')';
|
if ($search_country) $sql .= " AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).')';
|
||||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
if ($search_type_thirdparty != '' && $search_type_thirdparty != '-1') $sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
||||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||||
if ($search_company_alias) $sql .= natural_search('s.name_alias', $search_company_alias);
|
if ($search_company_alias) $sql .= natural_search('s.name_alias', $search_company_alias);
|
||||||
if ($search_montant_ht != '') $sql .= natural_search('f.total', $search_montant_ht, 1);
|
if ($search_montant_ht != '') $sql .= natural_search('f.total', $search_montant_ht, 1);
|
||||||
@ -894,7 +894,7 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['typent.code']['checked']))
|
if (!empty($arrayfields['typent.code']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth100');
|
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth100', '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Payment mode
|
// Payment mode
|
||||||
|
|||||||
@ -264,7 +264,7 @@ print '</td></tr>';
|
|||||||
// ThirdParty Type
|
// ThirdParty Type
|
||||||
print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>';
|
||||||
$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||||
print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent);
|
print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam_typent, '' , 1);
|
||||||
if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1031,7 +1031,7 @@ class FormCompany extends Form
|
|||||||
$out .= '<input type="hidden" name="action" value="set_thirdpartytype">';
|
$out .= '<input type="hidden" name="action" value="set_thirdpartytype">';
|
||||||
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$sortparam = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
$sortparam = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||||
$out .= $this->selectarray($htmlname, $this->typent_array(0, $filter), $selected, 0, 0, 0, '', 0, 0, 0, $sortparam, '', 1);
|
$out .= $this->selectarray($htmlname, $this->typent_array(0, $filter), $selected, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1);
|
||||||
$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
|
$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$out .= '</form>';
|
$out .= '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -532,7 +532,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town);
|
|||||||
if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
|
if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
|
||||||
if ($search_state) $sql .= natural_search("state.nom", $search_state);
|
if ($search_state) $sql .= natural_search("state.nom", $search_state);
|
||||||
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
|
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
|
||||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
if ($search_type_thirdparty != '' && $search_type_thirdparty >= 0) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
||||||
if ($search_montant_ht != '') $sql .= natural_search('f.total_ht', $search_montant_ht, 1);
|
if ($search_montant_ht != '') $sql .= natural_search('f.total_ht', $search_montant_ht, 1);
|
||||||
if ($search_montant_vat != '') $sql .= natural_search('f.total_tva', $search_montant_vat, 1);
|
if ($search_montant_vat != '') $sql .= natural_search('f.total_tva', $search_montant_vat, 1);
|
||||||
if ($search_montant_localtax1 != '') $sql .= natural_search('f.localtax1', $search_montant_localtax1, 1);
|
if ($search_montant_localtax1 != '') $sql .= natural_search('f.localtax1', $search_montant_localtax1, 1);
|
||||||
@ -917,7 +917,7 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['typent.code']['checked']))
|
if (!empty($arrayfields['typent.code']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT));
|
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),'', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Condition of payment
|
// Condition of payment
|
||||||
@ -1298,7 +1298,7 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['typent.code']['checked']))
|
if (!empty($arrayfields['typent.code']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if (count($typenArray) == 0) $typenArray = $formcompany->typent_array(1);
|
if (empty($typenArray)) $typenArray = $formcompany->typent_array(1);
|
||||||
print $typenArray[$obj->typent_code];
|
print $typenArray[$obj->typent_code];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|||||||
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
delete from llx_c_typent;
|
delete from llx_c_typent;
|
||||||
-- Entries for all countries
|
-- Entries for all countries
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 0, 'TE_UNKNOWN', '-', NULL, 1);
|
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 1, 'TE_STARTUP', 'Start-up', NULL, 0);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 1, 'TE_STARTUP', 'Start-up', NULL, 0);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 2, 'TE_GROUP', 'Grand groupe', NULL, 1);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 2, 'TE_GROUP', 'Grand groupe', NULL, 1);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 3, 'TE_MEDIUM', 'PME/PMI', NULL, 1);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 3, 'TE_MEDIUM', 'PME/PMI', NULL, 1);
|
||||||
|
|||||||
@ -119,3 +119,7 @@ ALTER TABLE llx_societe CHANGE fk_entrepot fk_warehouse INTEGER DEFAULT NULL;
|
|||||||
--ALTER TABLE llx_societe ADD CONSTRAINT fk_propal_fk_warehouse FOREIGN KEY (fk_warehouse) REFERENCES llx_entrepot(rowid);
|
--ALTER TABLE llx_societe ADD CONSTRAINT fk_propal_fk_warehouse FOREIGN KEY (fk_warehouse) REFERENCES llx_entrepot(rowid);
|
||||||
ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse);
|
ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse);
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe MODIFY COLUMN fk_typent integer DEFAULT NULL;
|
||||||
|
UPDATE llx_societe SET fk_typent=NULL WHERE fk_typent=0;
|
||||||
|
DELETE FROM llx_c_typent WHERE code='TE_UNKNOWN';
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ create table llx_societe
|
|||||||
whatsapp varchar(255), -- deprecated
|
whatsapp varchar(255), -- deprecated
|
||||||
|
|
||||||
fk_effectif integer DEFAULT 0, --
|
fk_effectif integer DEFAULT 0, --
|
||||||
fk_typent integer DEFAULT 0, --
|
fk_typent integer DEFAULT NULL, -- type ent
|
||||||
fk_forme_juridique integer DEFAULT 0, -- juridical status
|
fk_forme_juridique integer DEFAULT 0, -- juridical status
|
||||||
fk_currency varchar(3), -- default currency
|
fk_currency varchar(3), -- default currency
|
||||||
siren varchar(128), -- IDProf1: depends on country (example: siren or RCS for france, ...)
|
siren varchar(128), -- IDProf1: depends on country (example: siren or RCS for france, ...)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user