Skip to content
Snippets Groups Projects
Commit 1d780e7e authored by aspangaro's avatar aspangaro Committed by Laurent Destailleur
Browse files

NEW: Accountancy - Add category to manage the display of the income

statement and the balance sheet

Conflicts:
	htdocs/install/mysql/migration/3.9.0-4.0.0.sql
parent f8f55e05
No related branches found
No related tags found
No related merge requests found
...@@ -78,7 +78,7 @@ $hookmanager->initHooks(array('admin')); ...@@ -78,7 +78,7 @@ $hookmanager->initHooks(array('admin'));
// Put here declaration of dictionaries properties // Put here declaration of dictionaries properties
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,0); $taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0);
// Name of SQL tables of dictionaries // Name of SQL tables of dictionaries
$tabname=array(); $tabname=array();
...@@ -113,6 +113,7 @@ $tabname[28]= MAIN_DB_PREFIX."c_holiday_types"; ...@@ -113,6 +113,7 @@ $tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
$tabname[29]= MAIN_DB_PREFIX."c_lead_status"; $tabname[29]= MAIN_DB_PREFIX."c_lead_status";
$tabname[30]= MAIN_DB_PREFIX."c_format_cards"; $tabname[30]= MAIN_DB_PREFIX."c_format_cards";
$tabname[31]= MAIN_DB_PREFIX."accounting_system"; $tabname[31]= MAIN_DB_PREFIX."accounting_system";
$tabname[32]= MAIN_DB_PREFIX."c_accountancy_category";
// Dictionary labels // Dictionary labels
$tablib=array(); $tablib=array();
...@@ -147,6 +148,7 @@ $tablib[28]= "DictionaryHolidayTypes"; ...@@ -147,6 +148,7 @@ $tablib[28]= "DictionaryHolidayTypes";
$tablib[29]= "DictionaryOpportunityStatus"; $tablib[29]= "DictionaryOpportunityStatus";
$tablib[30]= "DictionaryFormatCards"; $tablib[30]= "DictionaryFormatCards";
$tablib[31]= "DictionaryAccountancysystem"; $tablib[31]= "DictionaryAccountancysystem";
$tablib[32]= "DictionaryAccountancyCategory";
// Requests to extract data // Requests to extract data
$tabsql=array(); $tabsql=array();
...@@ -181,6 +183,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new ...@@ -181,6 +183,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
$tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; $tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1"; $tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1";
$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label AS label, a.range AS range, a.position, a.fk_country as country_id, a.active FROM ".MAIN_DB_PREFIX."c_accountancy_category AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid";
// Criteria to sort dictionaries // Criteria to sort dictionaries
$tabsqlsort=array(); $tabsqlsort=array();
...@@ -215,6 +218,7 @@ $tabsqlsort[28]="country ASC, code ASC"; ...@@ -215,6 +218,7 @@ $tabsqlsort[28]="country ASC, code ASC";
$tabsqlsort[29]="position ASC"; $tabsqlsort[29]="position ASC";
$tabsqlsort[30]="code ASC"; $tabsqlsort[30]="code ASC";
$tabsqlsort[31]="pcg_version ASC"; $tabsqlsort[31]="pcg_version ASC";
$tabsqlsort[32]="code ASC, label ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire // Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array(); $tabfield=array();
...@@ -249,6 +253,7 @@ $tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country"; ...@@ -249,6 +253,7 @@ $tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country";
$tabfield[29]= "code,label,percent,position"; $tabfield[29]= "code,label,percent,position";
$tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
$tabfield[31]= "pcg_version,country_id,country,label"; $tabfield[31]= "pcg_version,country_id,country,label";
$tabfield[32]= "code,label,range,position,country_id,country";
// Nom des champs d'edition pour modification d'un enregistrement // Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue=array(); $tabfieldvalue=array();
...@@ -283,6 +288,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country"; ...@@ -283,6 +288,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country";
$tabfieldvalue[29]= "code,label,percent,position"; $tabfieldvalue[29]= "code,label,percent,position";
$tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
$tabfieldvalue[31]= "pcg_version,country,label"; $tabfieldvalue[31]= "pcg_version,country,label";
$tabfieldvalue[32]= "code,label,range,position,country_id,country";
// Nom des champs dans la table pour insertion d'un enregistrement // Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array(); $tabfieldinsert=array();
...@@ -317,6 +323,7 @@ $tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country"; ...@@ -317,6 +323,7 @@ $tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country";
$tabfieldinsert[29]= "code,label,percent,position"; $tabfieldinsert[29]= "code,label,percent,position";
$tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
$tabfieldinsert[31]= "pcg_version,fk_pays,label"; $tabfieldinsert[31]= "pcg_version,fk_pays,label";
$tabfieldinsert[32]= "code,label,range,position,fk_country";
// Nom du rowid si le champ n'est pas de type autoincrement // Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on // Example: "" if id field is "rowid" and has autoincrement on
...@@ -353,6 +360,7 @@ $tabrowid[28]= ""; ...@@ -353,6 +360,7 @@ $tabrowid[28]= "";
$tabrowid[29]= ""; $tabrowid[29]= "";
$tabrowid[30]= ""; $tabrowid[30]= "";
$tabrowid[31]= ""; $tabrowid[31]= "";
$tabrowid[32]= "";
// Condition to show dictionary in setup page // Condition to show dictionary in setup page
$tabcond=array(); $tabcond=array();
...@@ -387,6 +395,7 @@ $tabcond[28]= ! empty($conf->holiday->enabled); ...@@ -387,6 +395,7 @@ $tabcond[28]= ! empty($conf->holiday->enabled);
$tabcond[29]= ! empty($conf->projet->enabled); $tabcond[29]= ! empty($conf->projet->enabled);
$tabcond[30]= ! empty($conf->label->enabled); $tabcond[30]= ! empty($conf->label->enabled);
$tabcond[31]= ! empty($conf->accounting->enabled); $tabcond[31]= ! empty($conf->accounting->enabled);
$tabcond[32]= ! empty($conf->accounting->enabled);
// List of help for fields // List of help for fields
$tabhelp=array(); $tabhelp=array();
...@@ -420,6 +429,8 @@ $tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode")); ...@@ -420,6 +429,8 @@ $tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically")); $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList")); $tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize")); $tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
$tabhelp[31] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
// List of check for fields (NOT USED YET) // List of check for fields (NOT USED YET)
$tabfieldcheck=array(); $tabfieldcheck=array();
...@@ -454,6 +465,7 @@ $tabfieldcheck[28] = array(); ...@@ -454,6 +465,7 @@ $tabfieldcheck[28] = array();
$tabfieldcheck[29] = array(); $tabfieldcheck[29] = array();
$tabfieldcheck[30] = array(); $tabfieldcheck[30] = array();
$tabfieldcheck[31] = array(); $tabfieldcheck[31] = array();
$tabfieldcheck[32] = array();
// Complete all arrays with entries found into modules // Complete all arrays with entries found into modules
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
......
...@@ -323,3 +323,15 @@ ALTER TABLE llx_expensereport_det ADD COLUMN multicurrency_total_ttc double(24,8 ...@@ -323,3 +323,15 @@ ALTER TABLE llx_expensereport_det ADD COLUMN multicurrency_total_ttc double(24,8
ALTER TABLE llx_product_lang ADD COLUMN import_key varchar(14) DEFAULT NULL; ALTER TABLE llx_product_lang ADD COLUMN import_key varchar(14) DEFAULT NULL;
ALTER TABLE llx_actioncomm MODIFY COLUMN elementtype varchar(255) DEFAULT NULL; ALTER TABLE llx_actioncomm MODIFY COLUMN elementtype varchar(255) DEFAULT NULL;
CREATE TABLE llx_c_accountancy_category (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
code varchar(16) NOT NULL,
label varchar(255) NOT NULL,
range varchar(255) NOT NULL,
position integer DEFAULT 0,
fk_country integer DEFAULT NULL, -- This category is dedicated to a country
active integer DEFAULT 1
) ENGINE=innodb;
ALTER TABLE llx_c_accountancy_category ADD UNIQUE INDEX uk_c_accountancy_category(code);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment