Fix: Support of third party status.
This commit is contained in:
parent
ff7efa05fe
commit
4178f8f131
@ -5,6 +5,7 @@ $Id$
|
||||
|
||||
***** ChangeLog for 3.1 compared to 3.0 *****
|
||||
For users:
|
||||
- New: Add status for third parties.
|
||||
- New: Can send interventions cards by email.
|
||||
- New: Add option MAIN_FIRST_TO_UPPER to force upper case of first
|
||||
letters for names and firstname.
|
||||
|
||||
@ -46,6 +46,8 @@ ALTER TABLE llx_facturedet ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_excep
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN fk_currency integer DEFAULT 0 AFTER fk_forme_juridique;
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN status tinyint DEFAULT 1;
|
||||
|
||||
ALTER TABLE llx_societe_remise MODIFY remise_client double(6,3) DEFAULT 0 NOT NULL;
|
||||
|
||||
ALTER TABLE llx_menu ADD COLUMN fk_mainmenu varchar(16) after fk_menu;
|
||||
|
||||
@ -30,10 +30,12 @@ create table llx_societe
|
||||
datec datetime, -- creation date
|
||||
datea datetime, -- activation date
|
||||
|
||||
status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité)
|
||||
|
||||
nom varchar(60), -- company reference name
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
|
||||
ref_ext varchar(60), -- reference into an external system (not used by dolibarr)
|
||||
ref_ext varchar(60), -- reference into an external system (not used by dolibarr)
|
||||
|
||||
code_client varchar(15), -- code client
|
||||
code_fournisseur varchar(15), -- code founisseur
|
||||
|
||||
@ -46,6 +46,8 @@ DictionnarySetup=Dictionary setup
|
||||
DisableJavascript=Disable JavaScript and Ajax functions
|
||||
ConfirmAjax=Use Ajax confirmation popups
|
||||
UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||
ActivityStateToSelectCompany= Add a filter option to show/hide thirdparties which are currently in activity or has ceased it
|
||||
SearchFilter=Search filters options
|
||||
NumberOfKeyToSearch=Nbr of characters to trigger search: %s
|
||||
ViewFullDateActions=Show full dates actions in the third sheet
|
||||
NotAvailableWhenAjaxDisabled=Not available when Ajax disabled
|
||||
|
||||
@ -307,6 +307,9 @@ ListCustomersShort=List of customers
|
||||
ThirdPartiesArea=Third parties area
|
||||
LastModifiedThirdParties=Last %s modified third parties
|
||||
UniqueThirdParties=Total of unique third parties
|
||||
InActivity=In activity
|
||||
ActivityCeased=Activity ceased
|
||||
ActivityStateFilter=Activity status
|
||||
|
||||
# Monkey
|
||||
MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0.
|
||||
|
||||
@ -47,6 +47,8 @@ Dictionnary= Dictionnaires
|
||||
DisableJavascript= Désactiver les fonctions Javascript et Ajax
|
||||
ConfirmAjax= Utiliser les popups de confirmation Ajax
|
||||
UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
|
||||
ActivityStateToSelectCompany= Ajouter une option de filtrage lors des recherches pour afficher/masquer les tiers en exercice ou ayant cessés d'exercer
|
||||
SearchFilter=Options des filtres de recherche
|
||||
NumberOfKeyToSearch=Nb caractères déclenchant la recherche: %s
|
||||
ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers
|
||||
NotAvailableWhenAjaxDisabled= Non disponible quand Ajax désactivé
|
||||
|
||||
@ -314,6 +314,9 @@ ListCustomersShort=Liste clients
|
||||
ThirdPartiesArea=Espace Tiers
|
||||
LastModifiedThirdParties=Les %s derniers tiers modifiés
|
||||
UniqueThirdParties=Total de tiers uniques
|
||||
InActivity=En activité
|
||||
ActivityCeased=En cessation d'activité
|
||||
ActivityStateFilter=Statut d'activité
|
||||
|
||||
# Monkey
|
||||
MonkeyNumRefModelDesc=Renvoie le numéro sous la forme %syymm-nnnn pour les codes clients et %syymm-nnnn pour les codes fournisseurs où yy est l'année, mm le mois et nnnn un compteur séquentiel sans rupture et sans remise à 0.
|
||||
|
||||
@ -54,6 +54,7 @@ class Societe extends CommonObject
|
||||
var $adresse; // TODO obsolete
|
||||
var $cp;
|
||||
var $ville;
|
||||
var $status; // 0=activity ceased, 1= in activity
|
||||
|
||||
var $departement_id;
|
||||
var $departement_code;
|
||||
@ -155,6 +156,7 @@ class Societe extends CommonObject
|
||||
$this->prefixCustomerIsRequired = 0;
|
||||
$this->prefixSupplierIsRequired = 0;
|
||||
$this->tva_assuj = 1;
|
||||
$this->status = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -199,10 +201,11 @@ class Societe extends CommonObject
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, entity, datec, datea, fk_user_creat, canvas)";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, entity, datec, datea, fk_user_creat, canvas, status)";
|
||||
$sql.= " VALUES ('".$this->db->escape($this->name)."', ".$conf->entity.", '".$this->db->idate($now)."', '".$this->db->idate($now)."'";
|
||||
$sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null");
|
||||
$sql.= ", ".($this->canvas ? "'".$this->canvas."'":"null");
|
||||
$sql.= ", ".$this->status;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Societe::create sql=".$sql);
|
||||
@ -396,6 +399,7 @@ class Societe extends CommonObject
|
||||
|
||||
$this->tva_assuj=trim($this->tva_assuj);
|
||||
$this->tva_intra=dol_sanitizeFileName($this->tva_intra,'');
|
||||
if (empty($this->status)) $this->status = 0;
|
||||
|
||||
// Local taxes
|
||||
$this->localtax1_assuj=trim($this->localtax1_assuj);
|
||||
@ -456,6 +460,7 @@ class Societe extends CommonObject
|
||||
|
||||
$sql .= ",tva_assuj = ".($this->tva_assuj!=''?"'".$this->tva_assuj."'":"null");
|
||||
$sql .= ",tva_intra = '" . $this->db->escape($this->tva_intra) ."'";
|
||||
$sql .= ",status = " .$this->status;
|
||||
|
||||
// Local taxes
|
||||
$sql .= ",localtax1_assuj = ".($this->localtax1_assuj!=''?"'".$this->localtax1_assuj."'":"null");
|
||||
@ -576,6 +581,7 @@ class Societe extends CommonObject
|
||||
$sql .= ', s.fk_departement, s.fk_pays, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj';
|
||||
$sql .= ', s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang';
|
||||
$sql .= ', s.import_key';
|
||||
$sql .= ', s.status';
|
||||
$sql .= ', fj.libelle as forme_juridique';
|
||||
$sql .= ', e.libelle as effectif';
|
||||
$sql .= ', p.code as pays_code, p.libelle as pays';
|
||||
@ -674,6 +680,7 @@ class Societe extends CommonObject
|
||||
|
||||
$this->tva_assuj = $obj->tva_assuj;
|
||||
$this->tva_intra = $obj->tva_intra;
|
||||
$this->status = $obj->status;
|
||||
|
||||
// Local Taxes
|
||||
$this->localtax1_assuj = $obj->localtax1_assuj;
|
||||
|
||||
@ -162,14 +162,14 @@ else
|
||||
$soc->capital = $_POST["capital"];
|
||||
$soc->gencod = $_POST["gencod"];
|
||||
|
||||
$soc->tva_intra = $_POST["tva_intra"];
|
||||
$soc->tva_assuj = $_POST["assujtva_value"];
|
||||
$soc->status = $_POST["status"];
|
||||
|
||||
// Local Taxes
|
||||
$soc->localtax1_assuj = $_POST["localtax1assuj_value"];
|
||||
$soc->localtax2_assuj = $_POST["localtax2assuj_value"];
|
||||
|
||||
$soc->tva_intra = $_POST["tva_intra"];
|
||||
|
||||
$soc->forme_juridique_code = $_POST["forme_juridique_code"];
|
||||
$soc->effectif_id = $_POST["effectif_id"];
|
||||
if ($_REQUEST["private"] == 1)
|
||||
@ -509,6 +509,7 @@ else
|
||||
$soc->effectif_id=$_POST["effectif_id"];
|
||||
|
||||
$soc->tva_assuj = $_POST["assujtva_value"];
|
||||
$soc->status= $_POST["status"];
|
||||
|
||||
//Local Taxes
|
||||
$soc->localtax1_assuj = $_POST["localtax1assuj_value"];
|
||||
@ -684,7 +685,12 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
// Barcode
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">';
|
||||
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Barcode
|
||||
if ($conf->global->MAIN_MODULE_BARCODE)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Gencod').'</td><td colspan="3"><input type="text" name="gencod">';
|
||||
@ -965,6 +971,7 @@ else
|
||||
|
||||
$soc->tva_assuj = $_POST["assujtva_value"];
|
||||
$soc->tva_intra=$_POST["tva_intra"];
|
||||
$soc->status=$_POST["status"];
|
||||
|
||||
//Local Taxes
|
||||
$soc->localtax1_assuj = $_POST["localtax1assuj_value"];
|
||||
@ -1111,6 +1118,12 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$soc->status);
|
||||
print '</td></tr>';
|
||||
|
||||
// Barcode
|
||||
if ($conf->global->MAIN_MODULE_BARCODE)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans('Gencod').'</td><td colspan="3"><input type="text" name="gencod" value="'.$soc->gencod.'">';
|
||||
@ -1362,6 +1375,13 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
$activity_status = $soc->status == 1 ? $langs->trans('InActivity') : $langs->trans('ActivityCeased'); // nouvelle entrée statut activité
|
||||
print '<td colspan="3">'.$activity_status;
|
||||
print '</td></tr>';
|
||||
|
||||
// Barcode
|
||||
if ($conf->global->MAIN_MODULE_BARCODE)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Gencod').'</td><td colspan="3">'.$soc->gencod.'</td></tr>';
|
||||
|
||||
@ -105,7 +105,6 @@ if ($mode == 'search')
|
||||
{
|
||||
$sql .= " AND cs.fk_categorie = ".$search_categ;
|
||||
}
|
||||
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@ -333,7 +332,7 @@ if ($resql)
|
||||
print_liste_field_titre($form->textwithpicto($langs->trans("ProfId2Short"),$textprofid[2],1,0),$_SERVER["PHP_SELF"],"s.siret","",$params,'nowrap="nowrap"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($form->textwithpicto($langs->trans("ProfId3Short"),$textprofid[3],1,0),$_SERVER["PHP_SELF"],"s.ape","",$params,'nowrap="nowrap"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$params,'nowrap="nowrap"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre" colspan="2" align="center"> </td>';
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -388,7 +387,7 @@ if ($resql)
|
||||
print "<td>".$obj->idprof2."</td>\n";
|
||||
print "<td>".$obj->idprof3."</td>\n";
|
||||
print "<td>".$obj->idprof4."</td>\n";
|
||||
print '<td align="center">';
|
||||
print '<td colspan="2" align="center">';
|
||||
$s='';
|
||||
if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user