Skip to content
Snippets Groups Projects
Commit 9050431f authored by Spangaro Alexandre's avatar Spangaro Alexandre
Browse files

Simply way to update chart of accounts

parent 7db8c8aa
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ $hookmanager->initHooks(array('admin'));
// Put here declaration of dictionnaries properties
// Sort order to show dictionnary (0 is space). All other dictionnaries (added by modules) will be at end of this.
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15);
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,23);
// Name of SQL tables of dictionnaries
$tabname=array();
......@@ -96,6 +96,7 @@ $tabname[19]= MAIN_DB_PREFIX."c_effectif";
$tabname[20]= MAIN_DB_PREFIX."c_input_method";
$tabname[21]= MAIN_DB_PREFIX."c_availability";
$tabname[22]= MAIN_DB_PREFIX."c_input_reason";
$tabname[23]= MAIN_DB_PREFIX."accountingaccount";
// Dictionary labels
$tablib=array();
......@@ -121,6 +122,7 @@ $tablib[19]= "DictionnaryStaff";
$tablib[20]= "DictionnaryOrderMethods";
$tablib[21]= "DictionnaryAvailability";
$tablib[22]= "DictionnarySource";
$tablib[23]= "DictionnaryAccountancyplan";
// Requete pour extraction des donnees des dictionnaires
$tabsql=array();
......@@ -146,6 +148,7 @@ $tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREF
$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_input_method";
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount";
// Critere de tri du dictionnaire
$tabsqlsort=array();
......@@ -171,6 +174,7 @@ $tabsqlsort[19]="id ASC";
$tabsqlsort[20]="code ASC, libelle ASC";
$tabsqlsort[21]="code ASC, label ASC";
$tabsqlsort[22]="code ASC, label ASC";
$tabsqlsort[23]="fk_pcg_version ASC, account_number ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array();
......@@ -196,6 +200,7 @@ $tabfield[19]= "code,libelle";
$tabfield[20]= "code,libelle";
$tabfield[21]= "code,label";
$tabfield[22]= "code,label";
$tabfield[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label";
// Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue=array();
......@@ -221,6 +226,7 @@ $tabfieldvalue[19]= "code,libelle";
$tabfieldvalue[20]= "code,libelle";
$tabfieldvalue[21]= "code,label";
$tabfieldvalue[22]= "code,label";
$tabfieldvalue[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label";
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array();
......@@ -246,6 +252,7 @@ $tabfieldinsert[19]= "code,libelle";
$tabfieldinsert[20]= "code,libelle";
$tabfieldinsert[21]= "code,label";
$tabfieldinsert[22]= "code,label";
$tabfieldinsert[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label";
// Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on
......@@ -273,6 +280,7 @@ $tabrowid[19]= "id";
$tabrowid[20]= "";
$tabrowid[21]= "rowid";
$tabrowid[22]= "rowid";
$tabrowid[23]= "";
// Condition to show dictionnary in setup page
$tabcond=array();
......@@ -298,6 +306,7 @@ $tabcond[19]= ! empty($conf->societe->enabled);
$tabcond[20]= ! empty($conf->fournisseur->enabled);
$tabcond[21]= ! empty($conf->propal->enabled);
$tabcond[22]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled));
$tabcond[23]= (! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled));
// List of help for fields
$tabhelp=array();
......@@ -323,6 +332,7 @@ $tabhelp[19] = array();
$tabhelp[20] = array();
$tabhelp[21] = array();
$tabhelp[22] = array();
$tabhelp[23] = array();
// Complete all arrays with entries found into modules
complete_dictionnary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp);
......@@ -698,6 +708,11 @@ if ($id)
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='account_number') { $valuetoshow=$langs->trans("Account"); }
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountparent"); }
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
if ($valuetoshow != '')
{
print '<td>';
......@@ -791,6 +806,11 @@ if ($id)
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='account_number') { $valuetoshow=$langs->trans("Accounts"); }
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountsparent"); }
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
// Affiche nom du champ
if ($showfield)
{
......
This diff is collapsed.
......@@ -80,3 +80,5 @@ ALTER TABLE llx_propaldet ADD COLUMN label varchar(255) DEFAULT NULL AFTER fk_pr
ALTER TABLE llx_commandedet ADD COLUMN label varchar(255) DEFAULT NULL AFTER fk_product;
ALTER TABLE llx_facturedet ADD COLUMN label varchar(255) DEFAULT NULL AFTER fk_product;
ALTER TABLE llx_facturedet_rec ADD COLUMN label varchar(255) DEFAULT NULL AFTER product_type;
ALTER TABLE llx_accountingaccount ADD COLUMN active tinyint DEFAULT 1 NOT NULL AFTER label;
......@@ -25,5 +25,6 @@ create table llx_accountingaccount
pcg_subtype varchar(20) NOT NULL,
account_number varchar(20) NOT NULL,
account_parent varchar(20),
label varchar(128) NOT NULL
label varchar(128) NOT NULL,
active tinyint DEFAULT 1 NOT NULL,
)ENGINE=innodb;
......@@ -678,6 +678,7 @@ DictionnaryStaff=Staff
DictionnaryAvailability=Delivery delay
DictionnaryOrderMethods=Ordering methods
DictionnarySource=Origin of proposals/orders
DictionnaryAccountancyplan=Chart of accounts
SetupSaved=Setup saved
BackToModuleList=Back to modules list
BackToDictionnaryList=Back to dictionaries list
......
......@@ -18,6 +18,8 @@ AmountToBeCharged=Total amount to pay :
AccountsGeneral=Accounts
Account=Account
Accounts=Accounts
Accountparent=Account parent
Accountsparent=Accounts parent
BillsForSuppliers=Bills for suppliers
Income=Income
Outcome=Expense
......@@ -143,3 +145,6 @@ CodeNotDef=Not defined
AddRemind=Dispatch available amount
RemainToDivide= Remain to dispatch :
WarningDepositsNotIncluded=Deposits invoices are not included in this version with this accountancy module.
Pcg_version=Pcg version
Pcg_type=Pcg type
Pcg_subtype=Pcg subtype
\ No newline at end of file
......@@ -686,6 +686,7 @@ DictionnaryStaff= Effectifs
DictionnaryAvailability= Délai de livraison
DictionnaryOrderMethods=Méthodes de commandes
DictionnarySource=Origines des propales/commandes
DictionnaryAccountancyplan=Plan comptable
SetupSaved= Configuration sauvegardée
BackToModuleList= Retour liste des modules
BackToDictionnaryList= Retour liste des dictionnaires
......
......@@ -18,6 +18,8 @@ AmountToBeCharged=Montant total à payer :
AccountsGeneral=Comptes généraux
Account=Compte
Accounts=Comptes
Accountparent=Racine du compte
Accountsparent=Racine des comptes
BillsForSuppliers=Factures des fournisseurs
Income=Recettes
Outcome=Dépenses
......@@ -155,3 +157,6 @@ COMPTA_ACCOUNT_SUPPLIER=Code comptable fournisseur par défaut (si non défini s
AddRemind=Ventiler montant disponible
RemainToDivide=Reste à répartir :
WarningDepositsNotIncluded=Les factures d'accomptes ne sont pas encore prises en compte dans cette version avec ce module de comptabilité.
Pcg_version=Version du plan
Pcg_type=Classe de compte
Pcg_subtype=Sous classe de compte
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment