From 8710cf570d5997e6ee5fec42d3d5734d8d9e6631 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 17 May 2018 16:52:16 +0200 Subject: [PATCH 01/72] Add table thead and tbody for object lines --- htdocs/core/class/commonobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4c236324373..d240835c1b5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3658,6 +3658,8 @@ abstract class CommonObject $reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { + print "\n"; + print ''; if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ' '; @@ -3735,11 +3737,13 @@ abstract class CommonObject } print "\n"; + print "\n"; } $var = true; $i = 0; - + + print "\n"; foreach ($this->lines as $line) { //Line extrafield @@ -3767,6 +3771,7 @@ abstract class CommonObject $i++; } + print "\n"; } /** From 1b4dcefcb0bb30207478e88298989c050485b058 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 18 May 2018 08:52:13 +0200 Subject: [PATCH 02/72] fix hookname as uniq by card --- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/time.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 69c62416e9b..17e89b7d21a 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -64,7 +64,7 @@ $socid=0; $result = restrictedArea($user, 'projet', $id, 'projet&project'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('projecttaskcard','globalcard')); +$hookmanager->initHooks(array('projecttaskscard','globalcard')); $progress=GETPOST('progress', 'int'); $label=GETPOST('label', 'alpha'); diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index cf6e29d5ef6..fff98bc3c5f 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -53,7 +53,7 @@ $socid=0; if (! $user->rights->projet->lire) accessforbidden(); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('projecttaskcard','globalcard')); +$hookmanager->initHooks(array('projecttaskcommentcard','globalcard')); $object = new Task($db); $extrafields = new ExtraFields($db); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 86a2027b3b7..7e4122262f7 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -74,7 +74,7 @@ if (! $sortorder) $sortorder='DESC'; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context //$object = new TaskTime($db); -$hookmanager->initHooks(array('projecttaskcard','globalcard')); +$hookmanager->initHooks(array('projecttasktime','globalcard')); $object = new Task($db); $projectstatic = new Project($db); From a27c2637470c64a4dcc3b03b12f94fef25841ccd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 18 May 2018 10:33:32 +0200 Subject: [PATCH 03/72] NEW: add filter on project task list --- htdocs/core/lib/project.lib.php | 14 ++- htdocs/projet/tasks.php | 176 ++++++++++++++++++++++++++++---- 2 files changed, 169 insertions(+), 21 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 6a8ef760a04..f7068998e26 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -327,9 +327,10 @@ function project_admin_prepare_head() * @param int $projectsListId List of id of project allowed to user (string separated with comma) * @param int $addordertick Add a tick to move task * @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project) + * @param string $filterprogresscalc filter text * @return void */ -function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0) +function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc='') { global $user, $bc, $langs, $conf; global $projectstatic, $taskstatic; @@ -337,6 +338,17 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $lastprojectid=0; $projectsArrayId=explode(',',$projectsListId); + if ($filterprogresscalc!=='') { + foreach ($lines as $key=>$line) { + if (!empty($line->planned_workload) && !empty($line->duration)) { + $filterprogresscalc = str_replace(' = ', ' == ', $filterprogresscalc); + if (!eval($filterprogresscalc)) { + unset($lines[$key]); + $lines=array_values($lines); + } + } + } + } $numlines=count($lines); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 17e89b7d21a..0205f2b5e33 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $langs->loadLangs(array("users", "projects")); @@ -41,6 +42,18 @@ $backtopage=GETPOST('backtopage','alpha'); $cancel=GETPOST('cancel','alpha'); $search_user_id = GETPOST('search_user_id', 'int'); +$search_taskref=GETPOST('search_taskref'); +$search_tasklabel=GETPOST('search_tasklabel'); +$search_dtstartday=GETPOST('search_dtstartday'); +$search_dtstartmonth=GETPOST('search_dtstartmonth'); +$search_dtstartyear=GETPOST('search_dtstartyear'); +$search_dtendday=GETPOST('search_dtendday'); +$search_dtendmonth=GETPOST('search_dtendmonth'); +$search_dtendyear=GETPOST('search_dtendyear'); +$search_planedworkload=GETPOST('search_planedworkload'); +$search_timespend=GETPOST('search_timespend'); +$search_progresscalc=GETPOST('search_progresscalc'); +$search_progressdeclare=GETPOST('search_progressdeclare'); //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects @@ -87,10 +100,86 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_user_id=""; + $search_taskref=''; + $search_tasklabel=''; + $search_dtstartday=''; + $search_dtstartmonth=''; + $search_dtstartyear=''; + $search_dtendday=''; + $search_dtendmonth=''; + $search_dtendyear=''; + $search_planedworkload=''; + $search_timespend=''; + $search_progresscalc=''; + $search_progressdeclare=''; $toselect=''; $search_array_options=array(); } +$morewherefilterarray=array(); + +if (!empty($search_taskref)) { + $morewherefilterarray[]= natural_search('t.ref', $search_taskref, 0, 1); +} + +if (!empty($search_tasklabel)) { + $morewherefilterarray[]= natural_search('t.label', $search_tasklabel, 0, 1); +} + +if ($search_dtstartmonth > 0) +{ + if ($search_dtstartyear > 0 && empty($search_dtstartday)) { + $morewherefilterarray[]= " (t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_dtstartyear,$search_dtstartmonth,false))."' AND '".$db->idate(dol_get_last_day($search_dtstartyear,$search_dtstartmonth,false))."')"; + }else if ($search_dtstartyear > 0 && ! empty($search_dtstartday)) { + $morewherefilterarray[]= " (t.dateo BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_dtstartmonth, $search_dtstartday, $search_dtstartyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_dtstartmonth, $search_dtstartday, $search_dtstartyear))."')"; + }else { + $morewherefilterarray[]= " date_format(t.dateo, '%m') = '".$search_dtstartmonth."'"; + } +} +else if ($search_dtstartyear > 0) +{ + $morewherefilterarray[]= " (t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_dtstartyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_dtstartyear,12,false))."')"; +} + +if ($search_dtendmonth > 0) +{ + if ($search_dtendyear > 0 && empty($search_dtendday)) { + $morewherefilterarray[]= " (t.datee BETWEEN '".$db->idate(dol_get_first_day($search_dtendyear,$search_dtendmonth,false))."' AND '".$db->idate(dol_get_last_day($search_dtendyear,$search_dtendmonth,false))."')"; + }else if ($search_dtendyear > 0 && ! empty($search_dtendday)) { + $morewherefilterarray[]= " (t.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_dtendmonth, $search_dtendday, $search_dtendyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_dtendmonth, $search_dtendday, $search_dtendyear))."')"; + }else { + $morewherefilterarray[]= " date_format(t.datee, '%m') = '".$search_dtendmonth."'"; + } +} +else if ($search_dtendyear > 0) +{ + $morewherefilterarray[]= " (t.datee BETWEEN '".$db->idate(dol_get_first_day($search_dtendyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_dtendyear,12,false))."')"; +} + +if (!empty($search_planedworkload)) { + $morewherefilterarray[]= natural_search('t.planned_workload', $search_planedworkload, 1, 1); +} + +if (!empty($search_timespend)) { + $morewherefilterarray[]= natural_search('t.duration_effective', $search_timespend, 1, 1); +} + +if (!empty($search_progresscalc)) { + $filterprogresscalc='if '.natural_search('round(100 * $line->duration / $line->planned_workload,2)',$search_progresscalc,1,1). '{return 1;} else {return 0;}'; +} else { + $filterprogresscalc=''; +} + +if (!empty($search_progressdeclare)) { + $morewherefilterarray[]= natural_search('t.progress', $search_progressdeclare, 1, 1); +} + + +$morewherefilter=''; +if (count($morewherefilterarray)>0) { + $morewherefilter= ' AND '. implode(' AND ', $morewherefilterarray); +} + if ($action == 'createtask' && $user->rights->projet->creer) { $error=0; @@ -208,7 +297,7 @@ if ($id > 0 || ! empty($ref)) { $object->fetch($id, $ref); $object->fetch_thirdparty(); - $res=$object->fetch_optionals(); + $res=$object->fetch_optionals($object->id,$extralabels_projet); // To verify role of users @@ -282,9 +371,9 @@ if ($id > 0 || ! empty($ref)) // Date start - end print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; - $start = dol_print_date($object->date_start,'day'); + $start = dol_print_date($object->date_start,'dayhour'); print ($start?$start:'?'); - $end = dol_print_date($object->date_end,'day'); + $end = dol_print_date($object->date_end,'dayhour'); print ' - '; print ($end?$end:'?'); if ($object->hasDelay()) print img_warning("Late"); @@ -417,7 +506,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (empty($reshook)) + if (empty($reshook) && ! empty($extrafields_task->attribute_label)) { print $object->showOptionals($extrafields_task,'edit'); } @@ -496,7 +585,7 @@ else if ($id > 0 || ! empty($ref)) // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him). $filteronthirdpartyid = $socid; - $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0); + $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0,'',-1,$morewherefilter); // We load also tasks limited to a particular user $tmpuser=new User($db); if ($search_user_id > 0) $tmpuser->fetch($search_user_id); @@ -510,26 +599,73 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } + // Filter on categories + $moreforfilter=''; + if (count($tasksarray) > 0) + { + $moreforfilter.='
'; + $moreforfilter.=$langs->trans("TasksAssignedTo").': '; + $moreforfilter.=$form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', 1); + $moreforfilter.='
'; + } + if ($moreforfilter) + { + print '
'; + print $moreforfilter; + print '
'; + } + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'; - print ''; + print '
'; - if (count($tasksarray) > 0) - { - // Link to switch in "my task" / "all task" - print ''; + // Fields title search + print ''; - // Action column - print ''; - } + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + // Action column + print ''; + print "\n"; print ''; // print ''; @@ -549,7 +685,7 @@ else if ($id > 0 || ! empty($ref)) { // Show all lines in taskarray (recursive function to go down on tree) $j=0; $level=0; - $nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id); + $nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc); } else { From 986b4f78ba2921528ce190e530eac0d24fac2f24 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 18 May 2018 13:54:07 +0200 Subject: [PATCH 04/72] fix eldy comment --- htdocs/core/lib/project.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f7068998e26..3c1ea553a66 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -344,10 +344,10 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $filterprogresscalc = str_replace(' = ', ' == ', $filterprogresscalc); if (!eval($filterprogresscalc)) { unset($lines[$key]); - $lines=array_values($lines); } } } + $lines=array_values($lines); } $numlines=count($lines); From 4c3f9d6d5e1b5f86cfbe2cf2016e626b6387f580 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 18 May 2018 15:20:16 +0200 Subject: [PATCH 05/72] FIX : test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url --- htdocs/compta/facture/card.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d79b8d0bae5..9d5cc64c2a4 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -186,13 +186,17 @@ if (empty($reshook)) $qualified_for_stock_change = $object->hasProductsOrServices(1); } - $result = $object->delete($user, 0, $idwarehouse); - if ($result > 0) { - header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php'); - exit(); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; + if($object->is_erasable()) { + + $result = $object->delete($user, 0, $idwarehouse); + if ($result > 0) { + header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php'); + exit(); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; + } + } } From 5fef8c2dc1e26422b17ff2384dfbc6cb5017f040 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Fri, 18 May 2018 14:59:42 +0100 Subject: [PATCH 06/72] Add generateDocument function to entrepot class --- htdocs/product/stock/class/entrepot.class.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 1dfc3c21481..039918ea66c 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -707,5 +707,37 @@ class Entrepot extends CommonObject return $TChildWarehouses; } + + /** + * Create object on disk + * + * @param string $modele force le modele a utiliser ('' to not force) + * @param Translate $outputlangs Object langs to use for output + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs='',$hidedetails=0,$hidedesc=0,$hideref=0) + { + global $conf,$user,$langs; + + $langs->load("stocks"); + + if (! dol_strlen($modele)) { + + $modele = 'standard'; + + if ($this->modelpdf) { + $modele = $this->modelpdf; + } elseif (! empty($conf->global->STOCK_ADDON_PDF)) { + $modele = $conf->global->STOCK_ADDON_PDF; + } + } + + $modelpath = "core/modules/stock/doc/"; + + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); + } } From 1af4a857be673d85ce6df9106c04632c8cd425bf Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 19 May 2018 08:06:24 +0200 Subject: [PATCH 07/72] Remove old code --- htdocs/core/menus/standard/eldy.lib.php | 1 - htdocs/loan/calc.php | 393 ------------------------ 2 files changed, 394 deletions(-) delete mode 100644 htdocs/loan/calc.php diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 03beab47323..d52818700a9 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -942,7 +942,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); //if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); - if (($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) && ! empty($conf->global->LOAN_SHOW_CALCULATOR)) $newmenu->add("/loan/calc.php?leftmenu=tax_loan",$langs->trans("Calculator"),2,$user->rights->loan->calc); } // Various payment diff --git a/htdocs/loan/calc.php b/htdocs/loan/calc.php deleted file mode 100644 index fedf26e6a36..00000000000 --- a/htdocs/loan/calc.php +++ /dev/null @@ -1,393 +0,0 @@ - - * Copyright (C) 2014 Alexandre Spangaro - * Copyright (C) 2015 Frederic France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -require '../main.inc.php'; - -$langs->load("loan"); - -/* --------------------------------------------------- * - * Set Form DEFAULT values - * --------------------------------------------------- */ -$default_sale_price = "150000"; -$default_annual_interest_percent = 7.0; -$default_year_term = 30; -$default_down_percent = 10; -$default_show_progress = true; - -/* --------------------------------------------------- * - * Initialize Variables - * --------------------------------------------------- */ -$sale_price = 0; -$annual_interest_percent = 0; -$year_term = 0; -$down_percent = 0; -$this_year_interest_paid = 0; -$this_year_principal_paid = 0; -$form_complete = false; -$show_progress = false; -$monthly_payment = false; -$show_progress = false; -$error = false; - -/* --------------------------------------------------- * - * Set the USER INPUT values - * --------------------------------------------------- */ -if (isset($_REQUEST['form_complete'])) { - $sale_price = GETPOST('sale_price'); - $annual_interest_percent = GETPOST('annual_interest_percent'); - $year_term = GETPOST('year_term'); - $down_percent = GETPOST('down_percent'); - $show_progress = (isset($_REQUEST['show_progress'])) ? GETPOST('show_progress') : false; - $form_complete = GETPOST('form_complete'); -} - -// This function does the actual mortgage calculations -// by plotting a PVIFA (Present Value Interest Factor of Annuity) -// table... -function get_interest_factor($year_term, $monthly_interest_rate) { - global $base_rate; - - $factor = 0; - $base_rate = 1 + $monthly_interest_rate; - $denominator = $base_rate; - for ($i=0; $i < ($year_term * 12); $i++) { - $factor += (1 / $denominator); - $denominator *= $base_rate; - } - return $factor; -} - -// If the form is complete, we'll start the math -if ($form_complete) { - // We'll set all the numeric values to JUST - // numbers - this will delete any dollars signs, - // commas, spaces, and letters, without invalidating - // the value of the number - $sale_price = preg_replace( "[^0-9.]", "", $sale_price); - $annual_interest_percent = preg_replace( "[^0-9.]", "", $annual_interest_percent); - $year_term = preg_replace( "[^0-9.]", "", $year_term); - $down_percent = preg_replace( "[^0-9.]", "", $down_percent); - - if ((float) $year_term <= 0) { - $errors[] = "You must enter a Sale Price of Home"; - } - if ((float) $sale_price <= 0) { - $errors[] = "You must enter a Length of Mortgage"; - } - if ((float) $annual_interest_percent <= 0) { - $errors[] = "You must enter an Annual Interest Rate"; - } - if (!$errors) { - $month_term = $year_term * 12; - $down_payment = $sale_price * ($down_percent / 100); - $annual_interest_rate = $annual_interest_percent / 100; - $monthly_interest_rate = $annual_interest_rate / 12; - $financing_price = $sale_price - $down_payment; - $monthly_factor = get_interest_factor($year_term, $monthly_interest_rate); - $monthly_payment = $financing_price / $monthly_factor; - } -} else { - if (!$sale_price) { $sale_price = $default_sale_price; } - if (!$annual_interest_percent) { $annual_interest_percent = $default_annual_interest_percent; } - if (!$year_term) { $year_term = $default_year_term; } - if (!$down_percent) { $down_percent = $default_down_percent; } - if (!$show_progress) { $show_progress = $default_show_progress; } -} - -if (! empty($errors)) { - setEventMessages('', $errors, 'errors'); - $form_complete = false; -} - - - -/* - * View - */ - -llxHeader(); - -print load_fiche_titre($langs->trans("LoanCalc"), '', 'title_accountancy.png'); - -print $langs->trans('LoanCalcDesc'); - -print '
'; -print '
'; - -dol_fiche_head(''); - -print '
'; - print $langs->trans("TasksAssignedTo"); - print $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', 1); - print '
'; - $searchpicto=$form->showFilterButtons(); - print $searchpicto; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $formother->select_year($search_dtstartyear?$search_dtstartyear:-1,'search_dtstartyear',1, 20, 5); + print ''; + print ''; + print ''; + $formother->select_year($search_dtendyear?$search_dtendyear:-1,'search_dtendyear',1, 20, 5); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $searchpicto=$form->showFilterButtons(); + print $searchpicto; + print '
'.$langs->trans("Project").'
'; -//print ''; -//print ''; -//print ''; -//print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print '';print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -if (! empty($show_progress)) -{ - print ''; -} -else -{ - print ''; -} - -print ''; -print '
'.$langs->trans('PurchaseFinanceInfo').'
'.$langs->trans('SalePriceOfAsset').': '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans('PercentageDown').':%
'.$langs->trans('LengthOfMortgage').': '.$langs->trans("years").'
'.$langs->trans('AnnualInterestRate').':%
'.$langs->trans('ExplainCalculations').':'.$langs->trans('ShowMeCalculationsAndAmortization').''.$langs->trans('ShowMeCalculationsAndAmortization').'
'; - -dol_fiche_end(); - -print '
    '; -print '
'; - -// If the form has already been calculated, the $down_payment -// and $monthly_payment variables will be figured out, so we can show them in this table -if ($form_complete && $monthly_payment) -{ - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - if ($down_percent < 20) - { - $pmi_per_month = 55 * ($financing_price / 100000); - - /*print ''; - print ''; - print ''; - print '';*/ - print ''; - print ''; - print ''; - print ''; - } - - /*print ''; - print ''; - print ''; - print ''; - */ - - print ''; - print ''; - print ''; - print ''; -} - -print '
'.$langs->trans('MortgagePaymentInformation').'
'.$langs->trans('DownPayment').':' . number_format($down_payment, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
'.$langs->trans('AmountFinanced').':' . number_format($financing_price, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
'.$langs->trans('MonthlyPayment').':' . number_format($monthly_payment, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
(Principal & Interest ONLY)
 '; - print '
'; - echo 'Since you are putting LESS than 20% down, you will need to pay PMI - (Private Mortgage Insurance), which tends - to be about $55 per month for every $100,000 financed (until you have paid off 20% of your loan). This could add - '."\$" . number_format($pmi_per_month, "2", ".", ",").' to your monthly payment.'; - print '
'.$langs->trans('MonthlyPayment').':' . number_format(($monthly_payment + $pmi_per_month), "2", ".", ",") . $langs->trans("Currency".$conf->currency) . '
'; - print '(Principal & Interest, and PMI)
 '; - print '
';*/ - - $assessed_price = ($sale_price * .85); - $residential_yearly_tax = ($assessed_price / 1000) * 14; - $residential_monthly_tax = $residential_yearly_tax / 12; - - if ($pmi_per_month) - { - $pmi_text = "PMI"; - } - /*echo "Residential (or Property) Taxes are a little harder to figure out... In Massachusetts, the average resedential tax rate seems - to be around $14 per year for every $1,000 of your property's assessed value.";*/ - //print '

'; - //print "Let's say that your property's assessed value is 85% of what you actually paid for it - "; - /*print number_format($assessed_price, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . 'This would mean that your yearly residential taxes will be around'; - print number_format($residential_yearly_tax, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency); - print 'This could add ' . number_format($residential_monthly_tax, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . 'to your monthly payment'; - print '
TOTAL Monthly Payment:' . number_format(($monthly_payment + $pmi_per_month + $residential_monthly_tax), "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
'; - print '(including '.$pmi_text.')
'; -print ''; - -// This prints the calculation progress and -// the instructions of HOW everything is figured -// out -if ($form_complete && $show_progress) { - $step = 1; - - print '

'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'. $step++ .''; - print $langs->trans('DownPaymentDesc').'

'; - print number_format($down_payment,"2",".",",") . ' ' . $langs->trans("Currency".$conf->currency) . ' = '; - print number_format($sale_price,"2",".",",") . ' ' . $langs->trans("Currency".$conf->currency) . ' X (' . $down_percent . ' / 100)'; - print '
' . $step++ . ''; - print $langs->trans('InterestRateDesc') . '

'; - print $annual_interest_rate . ' = ' . $annual_interest_percent . '% / 100'; - print '
'; - print $langs->trans('MonthlyFactorDesc') . ':'; - print '
' . $step++ . ''; - print $langs->trans('MonthlyInterestRateDesc') . '

'; - print $monthly_interest_rate . ' = ' . $annual_interest_rate . ' / 12'; - print '
' . $step++ . ''; - print $langs->trans('MonthTermDesc') . '

'; - print $month_term . ' '. $langs->trans('Months') . ' = ' . $year_term . ' '. $langs->trans('Years') . ' X 12'; - print '
' . $step++ . ''; - print $langs->trans('MonthlyPaymentDesc') . ':
'; - print $langs->trans('MonthlyPayment').' = ' . number_format($financing_price, "2", "", "") . ' * '; - print '(1 - ((1 + ' . number_format($monthly_interest_rate, "4", "", "") . ')'; - print '-(' . $month_term . '))))'; - print '

'; - print $langs->trans('AmortizationPaymentDesc'); - print '
'; - print '
'; - - - // Set some base variables - $principal = $financing_price; - $current_month = 1; - $current_year = 1; - - // This basically, re-figures out the monthly payment, again. - $power = -($month_term); - $denom = pow((1 + $monthly_interest_rate), $power); - $monthly_payment = $principal * ($monthly_interest_rate / (1 - $denom)); - - print '

'.$langs->trans('AmortizationMonthlyPaymentOverYears', number_format($monthly_payment, "2", ".", ","), $year_term)."
\n"; - - print ''; - - // This LEGEND will get reprinted every 12 months - $legend = ''; - $legend.= ''; - $legend.= ''; - $legend.= ''; - $legend.= ''; - $legend.= ''; - - print $legend; - - // Loop through and get the current month's payments for - // the length of the loan - while ($current_month <= $month_term) - { - $interest_paid = $principal * $monthly_interest_rate; - $principal_paid = $monthly_payment - $interest_paid; - $remaining_balance = $principal - $principal_paid; - - $this_year_interest_paid = $this_year_interest_paid + $interest_paid; - $this_year_principal_paid = $this_year_principal_paid + $principal_paid; - - $var = !$var; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - ($current_month % 12) ? ($show_legend = false) : ($show_legend = true); - - if ($show_legend) { - print ''; - print ''; - print ''; - - $total_spent_this_year = $this_year_interest_paid + $this_year_principal_paid; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - - $current_year++; - $this_year_interest_paid = 0; - $this_year_principal_paid = 0; - - if (($current_month + 6) < $month_term) - { - echo $legend; - } - } - $principal = $remaining_balance; - $current_month++; - } - print "
' . $langs->trans("Month") . '' . $langs->trans("Interest") . '' . $langs->trans("LoanCapital") . '' . $langs->trans("Position") . '
' . $current_month . '' . number_format($interest_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '' . number_format($principal_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '' . number_format($remaining_balance, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
' . $langs->trans("Totalsforyear") . ' ' . $current_year . '
 '; - print $langs->trans('YouWillSpend', number_format($total_spent_this_year, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency), $current_year) . '
'; - print $langs->trans('GoToInterest', number_format($this_year_interest_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency)) . '
'; - print $langs->trans('GoToPrincipal', number_format($this_year_principal_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency)) . '
'; - print '
 
\n"; -} - -llxFooter(); - -$db->close(); From 0b581fc507dd1e1f9b05bc5a011fca9118178d80 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 19 May 2018 08:06:52 +0200 Subject: [PATCH 08/72] loadLangs --- htdocs/accountancy/index.php | 4 ++-- htdocs/loan/card.php | 10 ++++------ htdocs/loan/class/loan.class.php | 5 ++--- htdocs/loan/createschedule.php | 11 ++++++----- htdocs/loan/document.php | 10 +++------- htdocs/loan/index.php | 11 ++++------- htdocs/loan/info.php | 8 +++----- htdocs/loan/note.php | 8 ++++---- htdocs/loan/payment/card.php | 7 ++----- htdocs/loan/payment/payment.php | 5 ++--- 10 files changed, 32 insertions(+), 47 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 8de7209ef93..ba79f9ee78e 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016 Alexandre Spangaro +/* Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2016-2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 53cf9e7cb82..62b294f7108 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Frederic France * Copyright (C) 2017 Laurent Destailleur * @@ -32,9 +32,7 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accoun require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("loan"); +$langs->loadLangs(array("compta","bills","loan")); $id=GETPOST('id','int'); $action=GETPOST('action','aZ09'); @@ -308,7 +306,7 @@ if ($action == 'create') $formproject=new FormProjets($db); // Projet associe - $langs->load("projects"); + $langs->loadLangs(array("projects")); print ''.$langs->trans("Project").''; @@ -444,7 +442,7 @@ if ($id > 0) // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); + $langs->loadLangs(array("projects")); $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 1de0e908c97..02832c0ecf5 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify @@ -369,8 +369,7 @@ class Loan extends CommonObject function LibStatut($statut,$mode=0,$alreadypaid=-1) { global $langs; - $langs->load('customers'); - $langs->load('bills'); + $langs->loadLangs(array("customers","bills")); if ($mode == 0) { diff --git a/htdocs/loan/createschedule.php b/htdocs/loan/createschedule.php index 0ecc0038835..6988839fa51 100644 --- a/htdocs/loan/createschedule.php +++ b/htdocs/loan/createschedule.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017 Franck Moreau + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +17,9 @@ */ /** - * \file htdocs/loan/createecheancier.php - * \ingroup loan - * \brief Schedule card + * \file htdocs/loan/createschedule.php + * \ingroup loan + * \brief Schedule card */ require '../main.inc.php'; @@ -33,7 +34,7 @@ $action = GETPOST('action','aZ09'); $object = new Loan($db); $object->fetch($loanid); -$langs->load('loan'); +$langs->loadLangs(array("loan")); if ($action == 'createecheancier') { diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 54333029689..b6504d0a776 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2014-2018 Alexandre Spangaro + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,11 +32,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load("other"); -$langs->load("companies"); -$langs->load("compta"); -$langs->load("bills"); -$langs->load("loan"); +$langs->loadLangs(array("other","companies","compta","bills","loan")); $id = GETPOST('id','int'); $action = GETPOST('action','aZ09'); diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 7a6bee5d79f..bf5b6590c33 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -1,8 +1,8 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Frederic France - * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2016 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,10 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; -$langs->load("loan"); -$langs->load("compta"); -$langs->load("banks"); -$langs->load("bills"); +$langs->loadLangs(array("loan","compta","banks","bills")); // Security check $socid = GETPOST('socid', 'int'); diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index ea7237cdd34..d94bedbf9fb 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2014-2018 Alexandre Spangaro + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,9 +30,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } -$langs->load("compta"); -$langs->load("bills"); -$langs->load("loan"); +$langs->loadLangs(array("compta","bills","loan")); $id=GETPOST('id','int'); $action=GETPOST('action','aZ09'); diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 8f64036f819..9e5fedc423b 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -4,8 +4,8 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Frederic France - * Copyright (C) 2016 Alexandre Spangaro - * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2016-2018 Alexandre Spangaro + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ if (! empty($conf->projet->enabled)) { $action = GETPOST('action','aZ09'); -$langs->load('loan'); +$langs->loadLangs(array("loan")); // Security check $id = GETPOST('id','int'); @@ -82,7 +82,7 @@ if ($id > 0) $morehtmlref.=$form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); + $langs->loadLangs(array("projects")); $morehtmlref .= '
' . $langs->trans('Project') . ' : '; if ($user->rights->loan->write) { //if ($action != 'classify') diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 47efb9c8cde..f7b687caed9 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,10 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -$langs->load('bills'); -$langs->load('banks'); -$langs->load('companies'); -$langs->load('loan'); +$langs->loadLangs(array("bills","banks","companies","loan")); // Security check $id=GETPOST("id",'int'); diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 8faac08fb60..ee83bf17f00 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify @@ -27,8 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -$langs->load("bills"); -$langs->load("loan"); +$langs->loadLangs(array("bills","loan")); $chid=GETPOST('id','int'); $action=GETPOST('action','aZ09'); From a4d3c4bed07c8b5490b6b5d8d6f1d64cba1080a4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 20 May 2018 06:16:12 +0200 Subject: [PATCH 09/72] Fix language --- htdocs/langs/en_US/loan.lang | 30 ++++-------------------------- htdocs/loan/createschedule.php | 2 +- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/htdocs/langs/en_US/loan.lang b/htdocs/langs/en_US/loan.lang index 9aae3869cc3..3c54bde8c35 100644 --- a/htdocs/langs/en_US/loan.lang +++ b/htdocs/langs/en_US/loan.lang @@ -17,34 +17,12 @@ ConfirmDeleteLoan=Confirm deleting this loan LoanDeleted=Loan Deleted Successfully ConfirmPayLoan=Confirm classify paid this loan LoanPaid=Loan Paid -# Calc -LoanCalc=Bank Loans Calculator -PurchaseFinanceInfo=Purchase & Financing Information -SalePriceOfAsset=Sale Price of Asset -PercentageDown=Percentage Down -LengthOfMortgage=Duration of loan -AnnualInterestRate=Annual Interest Rate -ExplainCalculations=Explain Calculations -ShowMeCalculationsAndAmortization=Show me the calculations and amortization -MortgagePaymentInformation=Mortgage Payment Information -DownPayment=Down Payment -DownPaymentDesc=The down payment = The price of the home multiplied by the percentage down divided by 100 (for 5% down becomes 5/100 or 0.05) -InterestRateDesc=The interest rate = The annual interest percentage divided by 100 -MonthlyFactorDesc=The monthly factor = The result of the following formula -MonthlyInterestRateDesc=The monthly interest rate = The annual interest rate divided by 12 (for the 12 months in a year) -MonthTermDesc=The month term of the loan in months = The number of years you've taken the loan out for times 12 -MonthlyPaymentDesc=The montly payment is figured out using the following formula -AmortizationPaymentDesc=The amortization breaks down how much of your monthly payment goes towards the bank's interest, and how much goes into paying off the principal of your loan. -AmountFinanced=Amount Financed -AmortizationMonthlyPaymentOverYears=Amortization For Monthly Payment: %s over %s years -Totalsforyear=Totals for year -MonthlyPayment=Monthly Payment -LoanCalcDesc=This mortgage calculator can be used to figure out monthly payments of a loaning, based on the amount borrowed, the term of the loan desired and the interest rate.
This calculator includes also PMI (Private Mortgage Insurance) for loans where less than 20%% is put as a down payment. Also taken into consideration are the town property taxes, and their effect on the total monthly mortgage payment.
-GoToInterest=%s will go towards INTEREST -GoToPrincipal=%s will go towards PRINCIPAL -YouWillSpend=You will spend %s in year %s ListLoanAssociatedProject=List of loan associated with the project AddLoan=Create loan +FinancialCommitment=Financial commitment +InterestAmount=Interest +CapitalRemain=Capital remain +DueDate=Date # Admin ConfigLoan=Configuration of the module loan LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default diff --git a/htdocs/loan/createschedule.php b/htdocs/loan/createschedule.php index 6988839fa51..921402c240a 100644 --- a/htdocs/loan/createschedule.php +++ b/htdocs/loan/createschedule.php @@ -152,7 +152,7 @@ Print ''.$langs->trans("DueDate").''; Print ''.$langs->trans("Date").''; Print ''.$langs->trans("Amount").''; Print ''.$langs->trans("InterestAmount").''; -Print ''.$langs->trans("Remain"); +Print ''.$langs->trans("CapitalRemain"); print ' ('.price2num($object->capital).')'; print ''; print ''; From c41a9291f11deb59cdf53bc9a9cb63f4ce044730 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 20 May 2018 07:46:02 +0200 Subject: [PATCH 10/72] Fix some problems & presentation --- htdocs/langs/en_US/loan.lang | 4 +- htdocs/loan/card.php | 10 ++-- htdocs/loan/class/loan.class.php | 2 +- htdocs/loan/createschedule.php | 2 +- htdocs/loan/index.php | 89 +++++++++++++++++--------------- htdocs/loan/payment/card.php | 40 +++++++------- 6 files changed, 76 insertions(+), 71 deletions(-) diff --git a/htdocs/langs/en_US/loan.lang b/htdocs/langs/en_US/loan.lang index 3c54bde8c35..534dee08867 100644 --- a/htdocs/langs/en_US/loan.lang +++ b/htdocs/langs/en_US/loan.lang @@ -10,6 +10,7 @@ LoanCapital=Capital Insurance=Insurance Interest=Interest Nbterms=Number of terms +Term=Term LoanAccountancyCapitalCode=Accounting account capital LoanAccountancyInsuranceCode=Accounting account insurance LoanAccountancyInterestCode=Accounting account interest @@ -22,12 +23,9 @@ AddLoan=Create loan FinancialCommitment=Financial commitment InterestAmount=Interest CapitalRemain=Capital remain -DueDate=Date # Admin ConfigLoan=Configuration of the module loan LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default LOAN_ACCOUNTING_ACCOUNT_INTEREST=Accounting account interest by default LOAN_ACCOUNTING_ACCOUNT_INSURANCE=Accounting account insurance by default -FinancialCommitment=Financial commitment CreateCalcSchedule=Edit financial commitment -InterestAmount=Interest amount diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 62b294f7108..12cb0bfefd4 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -697,8 +697,8 @@ if ($id > 0) print ''.$langs->trans("Type").''; print ''.$langs->trans("Insurance").''; print ''.$langs->trans("Interest").''; - print ''.$langs->trans("LoanCapital").''; - print ''; + print ''.$langs->trans("LoanCapital").''; + print ''; while ($i < $num) { @@ -708,9 +708,9 @@ if ($id > 0) print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; print "".$objp->paiement_type.' '.$objp->num_payment."\n"; - print ''.price($objp->amount_insurance, 0, $langs, 0, 0, -1, $conf->currency)."\n"; - print ''.price($objp->amount_interest, 0, $langs, 0, 0, -1, $conf->currency)."\n"; - print ''.price($objp->amount_capital, 0, $langs, 0, 0, -1, $conf->currency)."\n"; + print ''.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; print ""; $total_capital += $objp->amount_capital; $i++; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 02832c0ecf5..7843694585f 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -344,7 +344,7 @@ class Loan extends CommonObject $this->error=$this->db->lasterror(); return -1; } - } + } /** * Return label of loan status (unpaid, paid) diff --git a/htdocs/loan/createschedule.php b/htdocs/loan/createschedule.php index 921402c240a..0983fb15a05 100644 --- a/htdocs/loan/createschedule.php +++ b/htdocs/loan/createschedule.php @@ -148,7 +148,7 @@ print ''; print ''; print ''; -Print ''.$langs->trans("DueDate").''; +Print ''.$langs->trans("Term").''; Print ''.$langs->trans("Date").''; Print ''.$langs->trans("Amount").''; Print ''.$langs->trans("InterestAmount").''; diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index bf5b6590c33..c48e9b50ac1 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -19,9 +19,9 @@ */ /** - * \file htdocs/loan/index.php - * \ingroup loan - * \brief Page to list all loans + * \file htdocs/loan/index.php + * \ingroup loan + * \brief Page to list all loans */ require '../main.inc.php'; @@ -54,7 +54,7 @@ $optioncss = GETPOST('optioncss','alpha'); // Purge search criteria if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { - $search_ref=""; + $search_ref=""; $search_label=""; $search_amount=""; } @@ -68,7 +68,7 @@ $loan_static = new Loan($db); llxHeader(); -$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend,"; +$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.paid,"; $sql.= " SUM(pl.amount_capital) as alreadypayed"; $sql.= " FROM ".MAIN_DB_PREFIX."loan as l LEFT JOIN ".MAIN_DB_PREFIX."payment_loan AS pl"; $sql.= " ON l.rowid = pl.fk_loan"; @@ -77,8 +77,8 @@ if ($search_amount) $sql.= natural_search("l.capital", $search_amount, 1); if ($search_ref) $sql.= " AND l.rowid = ".$db->escape($search_ref); if ($search_label) $sql.= natural_search("l.label", $search_label); if ($filtre) { - $filtre=str_replace(":","=",$filtre); - $sql .= " AND ".$filtre; + $filtre=str_replace(":","=",$filtre); + $sql .= " AND ".$filtre; } $sql.= " GROUP BY l.rowid, l.label, l.capital, l.datestart, l.dateend"; $sql.= $db->order($sortfield,$sortorder); @@ -86,13 +86,13 @@ $sql.= $db->order($sortfield,$sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); - if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 - { - $page = 0; - $offset = 0; - } + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -105,35 +105,35 @@ if ($resql) $i = 0; $var=true; - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); - if ($search_ref) $param.="&search_ref=".urlencode($search_ref); - if ($search_label) $param.="&search_label=".urlencode($search_user); - if ($search_amount) $param.="&search_amount=".urlencode($search_amount_ht); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($search_ref) $param.="&search_ref=".urlencode($search_ref); + if ($search_label) $param.="&search_label=".urlencode($search_user); + if ($search_amount) $param.="&search_amount=".urlencode($search_amount_ht); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - $newcardbutton=''; - if ($user->rights->loan->write) - { - $newcardbutton=''.$langs->trans('NewLoan'); - $newcardbutton.= ''; - $newcardbutton.= ''; - } + $newcardbutton=''; + if ($user->rights->loan->write) + { + $newcardbutton=''.$langs->trans('NewLoan'); + $newcardbutton.= ''; + $newcardbutton.= ''; + } - print '
'."\n"; - if ($optioncss != '') print ''; + print ''."\n"; + if ($optioncss != '') print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit); - print '
'; - print ''."\n"; + print '
'; + print '
'."\n"; // Filters lines print ''; @@ -141,6 +141,7 @@ if ($resql) print ''; print ''; print ''; + print ''; print ''; print '\n"; @@ -160,9 +162,9 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $loan_static->id = $obj->rowid; - $loan_static->ref = $obj->rowid; - $loan_static->label = $obj->label; + $loan_static->id = $obj->rowid; + $loan_static->ref = $obj->rowid; + $loan_static->label = $obj->label; $var = !$var; print ''; @@ -179,23 +181,26 @@ if ($resql) // Date start print ''; + // Date end + print ''; + print ''; print ''; - print "\n"; + print "\n"; $i++; } - print "
  '; print ''; @@ -153,6 +154,7 @@ if ($resql) print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"l.label","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre("LoanCapital",$_SERVER["PHP_SELF"],"l.capital","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("DateStart",$_SERVER["PHP_SELF"],"l.datestart","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"l.dateend","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"l.paid","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "
'.dol_print_date($db->jdate($obj->datestart), 'day').''.dol_print_date($db->jdate($obj->dateend), 'day').''.$loan_static->LibStatut($obj->paid,5,$obj->alreadypayed).'
"; - print '
'; - print "
\n"; - $db->free($resql); + print ""; + print '
'; + print "\n"; + $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } llxFooter(); diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index f7b687caed9..2f6fbe8f202 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/loan/payment/card.php - * \ingroup loan - * \brief Payment's card of loan + * \file htdocs/loan/payment/card.php + * \ingroup loan + * \brief Payment's card of loan */ require '../../main.inc.php'; @@ -56,14 +56,14 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del $result = $payment->delete($user); if ($result > 0) { - $db->commit(); - header("Location: ".DOL_URL_ROOT."/loan/index.php"); - exit; + $db->commit(); + header("Location: ".DOL_URL_ROOT."/loan/index.php"); + exit; } else { setEventMessages($payment->error, $payment->errors, 'errors'); - $db->rollback(); + $db->rollback(); } } @@ -170,18 +170,18 @@ print ''.$langs->trans('NotePublic').''.nl2br($payment->note_pu // Bank account if (! empty($conf->banque->enabled)) { - if ($payment->bank_account) - { - $bankline=new AccountLine($db); - $bankline->fetch($payment->bank_line); + if ($payment->bank_account) + { + $bankline=new AccountLine($db); + $bankline->fetch($payment->bank_line); - print ''; - print ''.$langs->trans('BankTransactionLine').''; + print ''; + print ''.$langs->trans('BankTransactionLine').''; print ''; print $bankline->getNomUrl(1,0,'showall'); - print ''; - print ''; - } + print ''; + print ''; + } } print ''; @@ -210,7 +210,7 @@ if ($resql) print ''; print ''.$langs->trans('Loan').''; print ''.$langs->trans('Label').''; - print ''.$langs->trans('ExpectedToPay').''; + // print ''.$langs->trans('ExpectedToPay').''; print ''.$langs->trans('Status').''; print ''.$langs->trans('PayedByThisPayment').''; print "\n"; @@ -230,11 +230,13 @@ if ($resql) // Label print ''.$objp->label.''; // Expected to pay - print ''.price($objp->capital).''; + // print ''.price($objp->capital).''; // Status print ''.$loan->getLibStatut(4,$objp->amount_capital).''; // Amount payed - print ''.price($objp->amount_capital).''; + $amount_payed = $objp->amount_capital + $objp->amount_insurance + $objp->amount_interest; + + print ''.price($amount_payed).''; print "\n"; if ($objp->paid == 1) // If at least one invoice is paid, disable delete { From 3fd55585b7113c220da0feb4658092d31b5c41ae Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 20 May 2018 08:00:42 +0200 Subject: [PATCH 11/72] Salaries : Move to LoadLangs --- htdocs/compta/salaries/card.php | 18 ++++++------------ htdocs/compta/salaries/document.php | 6 +----- htdocs/compta/salaries/info.php | 6 +----- htdocs/compta/salaries/stats/index.php | 3 +-- 4 files changed, 9 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 4f28e2c76c9..a525e876f81 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -1,8 +1,8 @@ * Copyright (C) 2014 Laurent Destailleur - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Charlie BENKE + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Charlie BENKE * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,9 +19,9 @@ */ /** - * \file htdocs/compta/salaries/card.php - * \ingroup salaries - * \brief Page of salaries payments + * \file htdocs/compta/salaries/card.php + * \ingroup salaries + * \brief Page of salaries payments */ require '../../main.inc.php'; @@ -30,13 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; - -$langs->load("compta"); -$langs->load("banks"); -$langs->load("bills"); -$langs->load("users"); -$langs->load("salaries"); -$langs->load('hrm'); +$langs->loadLangs(array("compta","banks","bills","users","salaries","hrm")); $id=GETPOST("id",'int'); $action=GETPOST('action','aZ09'); diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php index 00bc6185ffd..f866042cda0 100644 --- a/htdocs/compta/salaries/document.php +++ b/htdocs/compta/salaries/document.php @@ -35,11 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; -$langs->load("other"); -$langs->load("users"); -$langs->load("salaries"); -$langs->load('hrm'); -$langs->load("companies"); +$langs->loadLangs(array("compta","bills","users","salaries","hrm")); $id = GETPOST('id','int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/compta/salaries/info.php b/htdocs/compta/salaries/info.php index ddb79845748..ab5bcdcb558 100644 --- a/htdocs/compta/salaries/info.php +++ b/htdocs/compta/salaries/info.php @@ -28,11 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("users"); -$langs->load("salaries"); -$langs->load('hrm'); +$langs->loadLangs(array("compta","bills","users","salaries","hrm")); $id=GETPOST('id','int'); $action=GETPOST('action','aZ09'); diff --git a/htdocs/compta/salaries/stats/index.php b/htdocs/compta/salaries/stats/index.php index dabe988909f..ad9425e76c4 100644 --- a/htdocs/compta/salaries/stats/index.php +++ b/htdocs/compta/salaries/stats/index.php @@ -26,8 +26,7 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/salariesstats.class.php'; -$langs->load("salaries"); -$langs->load("companies"); +$langs->loadLangs(array("salaries","companies")); $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); From 4d3ce7a3d64f22f17c11513b289d9e4a930a3ef1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 20 May 2018 14:08:47 +0200 Subject: [PATCH 12/72] Fix buttons --- htdocs/loan/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 12cb0bfefd4..42c8cc57a4a 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -768,7 +768,7 @@ if ($id > 0) print '
'; // Edit - if ($user->rights->loan->write) + if ($object->paid == 0 && $user->rights->loan->write) { print ''.$langs->trans('CreateCalcSchedule').''; @@ -788,7 +788,7 @@ if ($id > 0) } // Delete - if ($user->rights->loan->delete) + if ($object->paid == 0 && $user->rights->loan->delete) { print ''.$langs->trans("Delete").''; } From 8e397b772f87bf123ded6523d49f0611a22cbbdd Mon Sep 17 00:00:00 2001 From: Sean Wang Date: Mon, 21 May 2018 14:19:41 +0800 Subject: [PATCH 13/72] Fix sql error --- htdocs/accountancy/class/accountingaccount.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 3f5c11691ad..3544f98d418 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -202,9 +202,9 @@ class AccountingAccount extends CommonObject $sql .= ", " . (empty($this->pcg_type) ? 'NULL' : "'" . $this->db->escape($this->pcg_type) . "'"); $sql .= ", " . (empty($this->pcg_subtype) ? 'NULL' : "'" . $this->db->escape($this->pcg_subtype) . "'"); $sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'"); - $sql .= ", " . (empty($this->account_parent) ? 'NULL' : "'" . $this->db->escape($this->account_parent) . "'"); + $sql .= ", " . (empty($this->account_parent) ? '0' : "'" . $this->db->escape($this->account_parent) . "'"); $sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'"); - $sql .= ", " . (empty($this->account_category) ? '0' : $this->db->escape($this->account_category)); + $sql .= ", " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category)); $sql .= ", " . $user->id; $sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active)); $sql .= ")"; From 22cdbffb0affc3ff7608bd4a0b4d78f4c1c7bdef Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 21 May 2018 10:58:16 +0200 Subject: [PATCH 14/72] new : add adv targt emailing amdin with main feature level 1 --- htdocs/admin/mailing.php | 10 +++++++++- htdocs/comm/mailing/advtargetemailing.php | 1 + htdocs/comm/mailing/cibles.php | 13 ++++++++++--- .../modules/mailings/advthirdparties.modules.php | 2 +- htdocs/langs/en_US/mails.lang | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 3aa3b3364c0..1cbb177f3e5 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -60,7 +60,7 @@ if ($action == 'setvalue') // Create temporary encryption key if nedded $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - + if (! $error) { $db->commit(); @@ -128,6 +128,7 @@ print $langs->trans("MailingDelay").''; print ''; print ''; + // Constant to add salt into the unsubscribe and check read tag. // It is also used as a security key parameter. @@ -137,6 +138,13 @@ print ''; +if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >=1) { + print ''; + print $langs->trans("MailAdvTargetRecipients").''; + print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR'); + print ''; +} + print ''; print '
'; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index cfafdaa725b..d39feb3784d 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -237,6 +237,7 @@ if ($action == 'add') { if (! empty($template_id)) { $query_temlate_id = '&template_id=' . $template_id; } + setEventMessages($langs->trans("XTargetsAdded",$result), null, 'mesgs'); header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id . $query_temlate_id); exit(); } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 676c9c3e98e..ccbca0fd419 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -561,7 +561,7 @@ if ($object->fetch($id) >= 0) include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $objectstatic=new Adherent($db); $objectstatic->fetch($obj->source_id); - print $objectstatic->getNomUrl(2); + print $objectstatic->getNomUrl(1); } else if ($obj->source_type == 'user') { @@ -569,14 +569,21 @@ if ($object->fetch($id) >= 0) $objectstatic=new User($db); $objectstatic->fetch($obj->source_id); $objectstatic->id=$obj->source_id; - print $objectstatic->getNomUrl(2); + print $objectstatic->getNomUrl(1); } else if ($obj->source_type == 'thirdparty') { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $objectstatic=new Societe($db); $objectstatic->fetch($obj->source_id); - print $objectstatic->getNomUrl(2); + print $objectstatic->getNomUrl(1); + } + else if ($obj->source_type == 'contact') + { + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $objectstatic=new Contact($db); + $objectstatic->fetch($obj->source_id); + print $objectstatic->getNomUrl(1); } else { diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 38636396da5..78aab1a5bd7 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -293,7 +293,7 @@ class mailing_advthirdparties extends MailingTargets } elseif ($type=='contact') { $contactstatic=new Contact($this->db); $contactstatic->fetch($id); - return $contactstatic->getNomUrl(0, '', 0, '', -1, 0); + return $contactstatic->getNomUrl(0, '', 0, '', -1, 1); } } diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index b155e2e4208..1bee044c6f3 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -166,4 +166,4 @@ InGoingEmailSetup=Incoming email setup OutGoingEmailSetupForEmailing=Outgoing email setup (for mass emailing) DefaultOutgoingEmailSetup=Default outgoing email setup Information=Information - +ContactsWithThirdpartyFilter=Contact avec filtre client From dd946dd1970179e7bacedd27f21b8406e77b7667 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 21 May 2018 11:03:48 +0200 Subject: [PATCH 15/72] add ressource --- htdocs/core/lib/project.lib.php | 21 ++++++++++++++++++++- htdocs/projet/tasks.php | 6 ++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 3c1ea553a66..99e9055c6a3 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -332,7 +332,7 @@ function project_admin_prepare_head() */ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc='') { - global $user, $bc, $langs, $conf; + global $user, $bc, $langs, $conf, $db; global $projectstatic, $taskstatic; $lastprojectid=0; @@ -531,6 +531,24 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } print ''; + // Ressources + print ''; + foreach(array('internal','external') as $source) + { + $tab = $lines[$i]->liste_contact(-1,$source); + $num=count($tab); + if (!empty($num)){ + foreach ($tab as $contacttask){ + //var_dump($contacttask); + if ($source == 'internal') $c = new User($db); + else $c = new Contact($db); + $c->fetch($contacttask['id']); + print $c->getNomUrl(1) . ' (' . $contacttask['libelle'] . ')' . '
'; + } + } + } + print ''; + // Tick to drag and drop if ($addordertick) { @@ -579,6 +597,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned,2).' %'; print ''; print ''; + print ''; if ($addordertick) print ''; print ''; } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 0205f2b5e33..922bfafcbf6 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -660,6 +660,8 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; + print ''; + // Action column print ''; $searchpicto=$form->showFilterButtons(); @@ -677,7 +679,7 @@ else if ($id > 0 || ! empty($ref)) print_liste_field_titre("TimeSpent", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); print_liste_field_titre("ProgressCalculated", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); print_liste_field_titre("ProgressDeclared", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); - //print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center" width="80"',$sortfield,$sortorder,'maxwidthsearch '); + print_liste_field_titre("TaskRessourceLinks",$_SERVER["PHP_SELF"],'','','',$sortfield,$sortorder,''); print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="center" width="80"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -689,7 +691,7 @@ else if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans("NoTasks").''; + print ''.$langs->trans("NoTasks").''; } print ""; From c9222adf6d0cc70bd562324d3f1486c9472bb3d9 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Mon, 21 May 2018 16:22:06 +0200 Subject: [PATCH 16/72] FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods --- htdocs/expedition/class/expedition.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index bccfba4446d..0c4232fabee 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -481,7 +481,7 @@ class Expedition extends CommonObject // Check parameters if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; - $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut"; + $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet"; $sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery"; $sql.= ", e.fk_shipping_method, e.tracking_number"; @@ -513,6 +513,7 @@ class Expedition extends CommonObject $this->ref_ext = $obj->ref_ext; $this->ref_int = $obj->ref_int; $this->statut = $obj->fk_statut; + $this->fk_project = $obj->fk_projet; $this->user_author_id = $obj->fk_user_author; $this->date_creation = $this->db->jdate($obj->date_creation); $this->date = $this->db->jdate($obj->date_expedition); // TODO deprecated @@ -1052,6 +1053,7 @@ class Expedition extends CommonObject $sql.= " fk_shipping_method=".((isset($this->shipping_method_id) && $this->shipping_method_id > 0)?$this->shipping_method_id:"null").","; $sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").","; $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; + $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; $sql.= " height=".(($this->trueHeight != '')?$this->trueHeight:"null").","; $sql.= " width=".(($this->trueWidth != '')?$this->trueWidth:"null").","; $sql.= " size_units=".(isset($this->size_units)?$this->size_units:"null").","; From 227539d647cd70a447c645b4080d06f5dbc35e3e Mon Sep 17 00:00:00 2001 From: bgenere Date: Mon, 21 May 2018 16:55:35 +0200 Subject: [PATCH 17/72] FIX : showOptionals function is now consistent with template Extrafield_view.tpl.php for date and datetime fields The jdate function is not called when not needed. --- htdocs/core/class/commonobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c6442c730f0..b74bc8a4e96 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6080,7 +6080,12 @@ abstract class CommonObject // Convert date into timestamp format (value in memory must be a timestamp) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('date','datetime'))) { - $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]); + $datenotinstring = $this->array_options['options_' . $key]; + if (! is_numeric($this->array_options['options_' . $key])) // For backward compatibility + { + $datenotinstring = $db->jdate($datenotinstring); + } + $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$datenotinstring; } // Convert float submited string into real php numeric (value in memory must be a php numeric) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('price','double'))) From 1f43882bb70fa1b021a990fd6012b322e9b14255 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Tue, 22 May 2018 01:09:52 +0100 Subject: [PATCH 18/72] Add liste_modeles to warehouse module --- htdocs/core/class/html.formfile.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index dbdb7edf760..c3460989d82 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -478,6 +478,24 @@ class FormFile $modellist=ModelePDFProductBatch::liste_modeles($this->db); } } + elseif ($modulepart == 'stock') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.class.php'; + $modellist=ModelePDFStock::liste_modeles($this->db); + } + } + elseif ($modulepart == 'mouvement') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.class.php'; + $modellist=ModelePDFMouvement::liste_modeles($this->db); + } + } elseif ($modulepart == 'export') { if (is_array($genallowed)) $modellist=$genallowed; From 63e056064ebd6d3a7d1fbe84241f0c43fca100ed Mon Sep 17 00:00:00 2001 From: dtix <39430068+dtix@users.noreply.github.com> Date: Tue, 22 May 2018 11:22:04 +0300 Subject: [PATCH 19/72] Create llx_accounting_account_ro.sql --- .../mysql/data/llx_accounting_account_ro.sql | 642 ++++++++++++++++++ 1 file changed, 642 insertions(+) create mode 100644 htdocs/install/mysql/data/llx_accounting_account_ro.sql diff --git a/htdocs/install/mysql/data/llx_accounting_account_ro.sql b/htdocs/install/mysql/data/llx_accounting_account_ro.sql new file mode 100644 index 00000000000..2d22e78591d --- /dev/null +++ b/htdocs/install/mysql/data/llx_accounting_account_ro.sql @@ -0,0 +1,642 @@ +-- Copyright (C) 2018 +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l''install et tous les sigles '--' sont supprimés. +-- + +-- Created 20180518 + +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1,'RO-BASE','CAPIT','XXXXXX','1','0','Conturi de capitaluri, provizioane, împrumuturi şi datorii asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (10,'RO-BASE','CAPIT','XXXXXX','10','1','Capital şi rezerve',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1010,'RO-BASE','CAPIT','XXXXXX','101','10','Capital',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1011,'RO-BASE','CAPIT','XXXXXX','1011','1010','Capital subscris nevărsat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1012,'RO-BASE','CAPIT','CAPITAL','1012','1010','Capital subscris vărsat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1015,'RO-BASE','CAPIT','XXXXXX','1015','1010','Patrimoniul regiei (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1016,'RO-BASE','CAPIT','XXXXXX','1016','1010','Patrimoniul public (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1017,'RO-BASE','CAPIT','XXXXXX','1017','1010','Patrimoniul privat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1018,'RO-BASE','CAPIT','XXXXXX','1018','1010','Patrimoniul institutelor naţionale de cercetare-dezvoltare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1030,'RO-BASE','CAPIT','XXXXXX','103','10','Alte elemente de capitaluri proprii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1031,'RO-BASE','CAPIT','XXXXXX','1031','1030','Beneficii acordate angajaţilor sub forma instrumentelor de capitaluri proprii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1033,'RO-BASE','CAPIT','XXXXXX','1033','1030','Diferenţe de curs valutar în relaţie cu investiţia netă într-o entitate străină (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1038,'RO-BASE','CAPIT','XXXXXX','1038','1030','Diferenţe din modificarea valorii juste a activelor financiare disponibile în vederea vânzării şi alte elemente de capitaluri proprii (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1040,'RO-BASE','CAPIT','XXXXXX','104','10','Prime de capital',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1041,'RO-BASE','CAPIT','XXXXXX','1041','1040','Prime de emisiune (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1042,'RO-BASE','CAPIT','XXXXXX','1042','1040','Prime de fuziune/divizare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1043,'RO-BASE','CAPIT','XXXXXX','1043','1040','Prime de aport (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1044,'RO-BASE','CAPIT','XXXXXX','1044','1040','Prime de conversie a obligaţiunilor în acţiuni (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1050,'RO-BASE','CAPIT','XXXXXX','105','10','Rezerve din reevaluare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1060,'RO-BASE','CAPIT','XXXXXX','106','10','Rezerve',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1061,'RO-BASE','CAPIT','XXXXXX','1061','1060','Rezerve legale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1063,'RO-BASE','CAPIT','XXXXXX','1063','1060','Rezerve statutare sau contractuale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1068,'RO-BASE','CAPIT','XXXXXX','1068','1060','Alte rezerve (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1070,'RO-BASE','CAPIT','XXXXXX','107','10','Diferenţe de curs valutar din conversie (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1080,'RO-BASE','CAPIT','XXXXXX','108','10','Interese care nu controlează',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1081,'RO-BASE','CAPIT','XXXXXX','1081','1080','Interese care nu controlează - rezultatul exerciţiului financiar (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1082,'RO-BASE','CAPIT','XXXXXX','1082','1080','Interese care nu controlează - alte capitaluri proprii (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1090,'RO-BASE','CAPIT','XXXXXX','109','10','Acţiuni proprii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1091,'RO-BASE','CAPIT','XXXXXX','1091','1090','Acţiuni proprii deţinute pe termen scurt (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1092,'RO-BASE','CAPIT','XXXXXX','1092','1090','Acţiuni proprii deţinute pe termen lung (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1095,'RO-BASE','CAPIT','XXXXXX','1095','1090','Acţiuni proprii reprezentând titluri deţinute de societatea absorbită la societatea absorbantă (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (11,'RO-BASE','CAPIT','XXXXXX','11','1','Rezultatul reportat',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1170,'RO-BASE','CAPIT','XXXXXX','117','11','Rezultatul reportat',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1171,'RO-BASE','CAPIT','XXXXXX','1171','1170','Rezultatul reportat reprezentând profitul nerepartizat sau pierderea neacoperită (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1172,'RO-BASE','CAPIT','XXXXXX','1172','1170','Rezultatul reportat provenit din adoptarea pentru prima dată a IAS, mai puţin IAS 29(A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1173,'RO-BASE','CAPIT','XXXXXX','1173','1170','Rezultatul reportat provenit din modificările politicilor contabile (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1174,'RO-BASE','CAPIT','XXXXXX','1174','1170','Rezultatul reportat provenit din corectarea erorilor contabile (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1175,'RO-BASE','CAPIT','XXXXXX','1175','1170','Rezultatul reportat reprezentând surplusul realizat din rezerve din reevaluare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1176,'RO-BASE','CAPIT','XXXXXX','1176','1170','Rezultatul reportat provenit din trecerea la aplicarea reglementărilor contabile conforme cu directivele europene (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (12,'RO-BASE','CAPIT','XXXXXX','12','1','Rezultatul exerciţiului financiar',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1210,'RO-BASE','CAPIT','XXXXXX','121','12','Profit sau pierdere (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1290,'RO-BASE','CAPIT','XXXXXX','129','12','Repartizarea profitului (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (14,'RO-BASE','CAPIT','XXXXXX','14','1','Câştiguri sau pierderi legate de emiterea, răscumpărarea, vânzarea, cedarea cu titlu gratuit sau anularea instrumentelor de capitaluri proprii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1410,'RO-BASE','CAPIT','XXXXXX','141','14','Câştiguri legate de vânzarea sau anularea instrumentelor de capitaluri proprii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1411,'RO-BASE','CAPIT','XXXXXX','1411','1410','Câştiguri legate de vânzarea instrumentelor de capitaluri proprii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1412,'RO-BASE','CAPIT','XXXXXX','1412','1410','Câştiguri legate de anularea instrumentelor de capitaluri proprii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1490,'RO-BASE','CAPIT','XXXXXX','149','14','Pierderi legate de emiterea, răscumpărarea, vânzarea, cedarea cu titlu gratuit sau anularea instrumentelor de capitaluri proprii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1491,'RO-BASE','CAPIT','XXXXXX','1491','1490','Pierderi rezultate din vânzarea instrumentelor de capitaluri proprii (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1495,'RO-BASE','CAPIT','XXXXXX','1495','1490','Pierderi rezultate din reorganizări, care sunt determinate de anularea titlurilor deţinute (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1498,'RO-BASE','CAPIT','XXXXXX','1498','1490','Alte pierderi legate de instrumentele de capitaluri proprii (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15,'RO-BASE','CAPIT','XXXXXX','15','1','Provizioane',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1510,'RO-BASE','CAPIT','XXXXXX','151','15','Provizioane',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1511,'RO-BASE','CAPIT','XXXXXX','1511','1510','Provizioane pentru litigii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1512,'RO-BASE','CAPIT','XXXXXX','1512','1510','Provizioane pentru garanţii acordate clienţilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1513,'RO-BASE','CAPIT','XXXXXX','1513','1510','Provizioane pentru dezafectare imobilizări corporale şi alte acţiuni similare legate de acestea (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1514,'RO-BASE','CAPIT','XXXXXX','1514','1510','Provizioane pentru restructurare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1515,'RO-BASE','CAPIT','XXXXXX','1515','1510','Provizioane pentru pensii şi obligaţii similare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1516,'RO-BASE','CAPIT','XXXXXX','1516','1510','Provizioane pentru impozite (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1517,'RO-BASE','CAPIT','XXXXXX','1517','1510','Provizioane pentru terminarea contractului de muncă (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1518,'RO-BASE','CAPIT','XXXXXX','1518','1510','Alte provizioane (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (16,'RO-BASE','CAPIT','XXXXXX','16','1','Împrumuturi şi datorii asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1610,'RO-BASE','CAPIT','XXXXXX','161','16','Împrumuturi din emisiuni de obligaţiuni',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1614,'RO-BASE','CAPIT','XXXXXX','1614','1610','Împrumuturi externe din emisiuni de obligaţiuni garantate de stat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1615,'RO-BASE','CAPIT','XXXXXX','1615','1610','Împrumuturi externe din emisiuni de obligaţiuni garantate de bănci (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1617,'RO-BASE','CAPIT','XXXXXX','1617','1610','Împrumuturi interne din emisiuni de obligaţiuni garantate de stat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1618,'RO-BASE','CAPIT','XXXXXX','1618','1610','Alte împrumuturi din emisiuni de obligaţiuni (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1620,'RO-BASE','CAPIT','XXXXXX','162','16','Credite bancare pe termen lung',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1621,'RO-BASE','CAPIT','XXXXXX','1621','1620','Credite bancare pe termen lung (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1622,'RO-BASE','CAPIT','XXXXXX','1622','1620','Credite bancare pe termen lung nerambursate la scadenţă (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1623,'RO-BASE','CAPIT','XXXXXX','1623','1620','Credite externe guvernamentale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1624,'RO-BASE','CAPIT','XXXXXX','1624','1620','Credite bancare externe garantate de stat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1625,'RO-BASE','CAPIT','XXXXXX','1625','1620','Credite bancare externe garantate de bănci (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1626,'RO-BASE','CAPIT','XXXXXX','1626','1620','Credite de la trezoreria statului (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1627,'RO-BASE','CAPIT','XXXXXX','1627','1620','Credite bancare interne garantate de stat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1660,'RO-BASE','CAPIT','XXXXXX','166','16','Datorii care privesc imobilizările financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1661,'RO-BASE','CAPIT','XXXXXX','1661','1660','Datorii faţă de entităţile afiliate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1663,'RO-BASE','CAPIT','XXXXXX','1663','1660','Datorii faţă de entităţile asociate şi entităţile controlate în comun (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1670,'RO-BASE','CAPIT','XXXXXX','167','16','Alte împrumuturi şi datorii asimilate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1680,'RO-BASE','CAPIT','XXXXXX','168','16','Dobânzi aferente împrumuturilor şi datoriilor asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1681,'RO-BASE','CAPIT','XXXXXX','1681','1680','Dobânzi aferente împrumuturilor din emisiuni de obligaţiuni (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1682,'RO-BASE','CAPIT','XXXXXX','1682','1680','Dobânzi aferente creditelor bancare pe termen lung (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1685,'RO-BASE','CAPIT','XXXXXX','1685','1680','Dobânzi aferente datoriilor faţă de entităţile afiliate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1686,'RO-BASE','CAPIT','XXXXXX','1686','1680','Dobânzi aferente datoriilor faţă de entităţile asociate şi entităţile controlate în comun (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1687,'RO-BASE','CAPIT','XXXXXX','1687','1680','Dobânzi aferente altor împrumuturi şi datorii asimilate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1690,'RO-BASE','CAPIT','XXXXXX','169','16','Prime privind rambursarea obligaţiunilor şi a altor datorii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1691,'RO-BASE','CAPIT','XXXXXX','1691','1690','Prime privind rambursarea obligaţiunilor (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1692,'RO-BASE','CAPIT','XXXXXX','1692','1690','Prime privind rambursarea altor datorii (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2,'RO-BASE','IMMO','XXXXXX','2','0','Conturi de imobilizări',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (20,'RO-BASE','IMMO','XXXXXX','20','2','IMOBILIZĂRI NECORPORALE',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2010,'RO-BASE','IMMO','XXXXXX','201','20','Cheltuieli de constituire (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2030,'RO-BASE','IMMO','XXXXXX','203','20','Cheltuieli de dezvoltare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2050,'RO-BASE','IMMO','XXXXXX','205','20','Concesiuni, brevete, licenţe, mărci comerciale, drepturi şi active similare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2060,'RO-BASE','IMMO','XXXXXX','206','20','Active necorporale de explorare şi evaluare a resurselor minerale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2070,'RO-BASE','IMMO','XXXXXX','207','20','Fond comercial',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2071,'RO-BASE','IMMO','XXXXXX','2071','2070','Fond comercial pozitiv (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2075,'RO-BASE','IMMO','XXXXXX','2075','2070','Fond comercial negativ (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2080,'RO-BASE','IMMO','XXXXXX','208','20','Alte imobilizări necorporale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (21,'RO-BASE','IMMO','XXXXXX','21','2','Imobilizări corporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2110,'RO-BASE','IMMO','XXXXXX','211','21','Terenuri şi amenajări de terenuri (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2111,'RO-BASE','IMMO','XXXXXX','2111','2110','Terenuri',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2112,'RO-BASE','IMMO','XXXXXX','2112','2110','Amenajări de terenuri',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2120,'RO-BASE','IMMO','XXXXXX','212','21','Construcţii (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2130,'RO-BASE','IMMO','XXXXXX','213','21','Instalaţii tehnice şi mijloace de transport',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2131,'RO-BASE','IMMO','XXXXXX','2131','2130','Echipamente tehnologice (maşini, utilaje şi instalaţii de lucru) (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2132,'RO-BASE','IMMO','XXXXXX','2132','2130','Aparate şi instalaţii de măsurare, control şi reglare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2133,'RO-BASE','IMMO','XXXXXX','2133','2130','Mijloace de transport (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2140,'RO-BASE','IMMO','XXXXXX','214','21','Mobilier, aparatură birotică, echipamente de protecţie a valorilor umane şi materiale şi alte active corporale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2150,'RO-BASE','IMMO','XXXXXX','215','21','Investiţii imobiliare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2160,'RO-BASE','IMMO','XXXXXX','216','21','Active corporale de explorare şi evaluare a resurselor minerale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2170,'RO-BASE','IMMO','XXXXXX','217','21','Active biologice productive (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (22,'RO-BASE','IMMO','XXXXXX','22','2','Imobilizări corporale în curs de aprovizionare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2230,'RO-BASE','IMMO','XXXXXX','223','22','Instalaţii tehnice şi mijloace de transport în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2240,'RO-BASE','IMMO','XXXXXX','224','22','Mobilier, aparatură birotică, echipamente de protecţie a valorilor umane şi materiale şi alte active corporale în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2270,'RO-BASE','IMMO','XXXXXX','227','22','Active biologice productive în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (23,'RO-BASE','IMMO','XXXXXX','23','2','Imobilizări în curs',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2310,'RO-BASE','IMMO','XXXXXX','231','23','Imobilizări corporale în curs de execuţie (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2350,'RO-BASE','IMMO','XXXXXX','235','23','Investiţii imobiliare în curs de execuţie (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (26,'RO-BASE','IMMO','XXXXXX','26','2','Imobilizări financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2610,'RO-BASE','IMMO','XXXXXX','261','26','Acţiuni deţinute la entităţile afiliate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2620,'RO-BASE','IMMO','XXXXXX','262','26','Acţiuni deţinute la entităţi asociate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2630,'RO-BASE','IMMO','XXXXXX','263','26','Acţiuni deţinute la entităţi controlate în comun (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2640,'RO-BASE','IMMO','XXXXXX','264','26','Titluri puse în echivalenţă (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2650,'RO-BASE','IMMO','XXXXXX','265','26','Alte titluri imobilizate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2660,'RO-BASE','IMMO','XXXXXX','266','26','Certificate verzi amânate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2670,'RO-BASE','IMMO','XXXXXX','267','26','Creanţe imobilizate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2671,'RO-BASE','IMMO','XXXXXX','2671','2670','Sume de încasat de la entităţile afiliate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2672,'RO-BASE','IMMO','XXXXXX','2672','2670','Dobânda aferentă sumelor de încasat de la entităţile afiliate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2673,'RO-BASE','IMMO','XXXXXX','2673','2670','Creanţe faţă de entităţile asociate şi entităţile controlate în comun (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2674,'RO-BASE','IMMO','XXXXXX','2674','2670','Dobânda aferentă creanţelor faţă de entităţile asociate şi entităţile controlate în comun (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2675,'RO-BASE','IMMO','XXXXXX','2675','2670','Împrumuturi acordate pe termen lung (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2676,'RO-BASE','IMMO','XXXXXX','2676','2670','Dobânda aferentă împrumuturilor acordate pe termen lung (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2677,'RO-BASE','IMMO','XXXXXX','2677','2670','Obligaţiuni achiziţionate cu ocazia emisiunilor efectuate de terţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2678,'RO-BASE','IMMO','XXXXXX','2678','2670','Alte creanţe imobilizate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2679,'RO-BASE','IMMO','XXXXXX','2679','2670','Dobânzi aferente altor creanţe imobilizate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2690,'RO-BASE','IMMO','XXXXXX','269','26','Vărsăminte de efectuat pentru imobilizări financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2691,'RO-BASE','IMMO','XXXXXX','2691','2690','Vărsăminte de efectuat privind acţiunile deţinute la entităţile afiliate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2692,'RO-BASE','IMMO','XXXXXX','2692','2690','Vărsăminte de efectuat privind acţiunile deţinute la entităţi asociate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2693,'RO-BASE','IMMO','XXXXXX','2693','2690','Vărsăminte de efectuat privind acţiunile deţinute la entităţi controlate în comun (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2695,'RO-BASE','IMMO','XXXXXX','2695','2690','Vărsăminte de efectuat pentru alte imobilizări financiare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (28,'RO-BASE','IMMO','XXXXXX','28','2','Amortizări privind imobilizările',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2800,'RO-BASE','IMMO','XXXXXX','280','28','Amortizări privind imobilizările necorporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2801,'RO-BASE','IMMO','XXXXXX','2801','2800','Amortizarea cheltuielilor de constituire (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2803,'RO-BASE','IMMO','XXXXXX','2803','2800','Amortizarea cheltuielilor de dezvoltare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2805,'RO-BASE','IMMO','XXXXXX','2805','2800','Amortizarea concesiunilor, brevetelor, licenţelor, mărcilor comerciale, drepturilor şi activelor similare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2806,'RO-BASE','IMMO','XXXXXX','2806','2800','Amortizarea activelor necorporale de explorare şi evaluare a resurselor minerale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2807,'RO-BASE','IMMO','XXXXXX','2807','2800','Amortizarea fondului comercial (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2808,'RO-BASE','IMMO','XXXXXX','2808','2800','Amortizarea altor imobilizări necorporale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2810,'RO-BASE','IMMO','ALLOCATION','281','28','Amortizări privind imobilizările corporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2811,'RO-BASE','IMMO','XXXXXX','2811','2810','Amortizarea amenajărilor de terenuri (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2812,'RO-BASE','IMMO','XXXXXX','2812','2810','Amortizarea construcţiilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2813,'RO-BASE','IMMO','XXXXXX','2813','2810','Amortizarea instalaţiilor şi mijloacelor de transport (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2814,'RO-BASE','IMMO','XXXXXX','2814','2810','Amortizarea altor imobilizări corporale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2815,'RO-BASE','IMMO','XXXXXX','2815','2810','Amortizarea investiţiilor imobiliare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2816,'RO-BASE','IMMO','XXXXXX','2816','2810','Amortizarea activelor corporale de explorare şi evaluare a resurselor minerale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2817,'RO-BASE','IMMO','XXXXXX','2817','2810','Amortizarea activelor biologice productive (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (29,'RO-BASE','IMMO','XXXXXX','29','2','Ajustări pentru deprecierea sau pierderea de valoare a imobilizărilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2900,'RO-BASE','IMMO','XXXXXX','290','29','Ajustări pentru deprecierea imobilizărilor necorporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2903,'RO-BASE','IMMO','XXXXXX','2903','2900','Ajustări pentru deprecierea cheltuielilor de dezvoltare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2905,'RO-BASE','IMMO','XXXXXX','2905','2900','Ajustări pentru deprecierea concesiunilor, brevetelor, licenţelor, mărcilor comerciale, drepturilor şi activelor similare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2906,'RO-BASE','IMMO','XXXXXX','2906','2900','Ajustări pentru deprecierea activelor necorporale de explorare şi evaluare a resurselor minerale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2908,'RO-BASE','IMMO','XXXXXX','2908','2900','Ajustări pentru deprecierea altor imobilizări necorporale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2910,'RO-BASE','IMMO','XXXXXX','291','29','Ajustări pentru deprecierea imobilizărilor corporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2911,'RO-BASE','IMMO','XXXXXX','2911','2910','Ajustări pentru deprecierea terenurilor şi amenajărilor de terenuri (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2912,'RO-BASE','IMMO','XXXXXX','2912','2910','Ajustări pentru deprecierea construcţiilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2913,'RO-BASE','IMMO','XXXXXX','2913','2910','Ajustări pentru deprecierea instalaţiilor şi mijloacelor de transport (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2914,'RO-BASE','IMMO','XXXXXX','2914','2910','Ajustări pentru deprecierea altor imobilizări corporale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2915,'RO-BASE','IMMO','XXXXXX','2915','2910','Ajustări pentru deprecierea investiţiilor imobiliare (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2916,'RO-BASE','IMMO','XXXXXX','2916','2910','Ajustări pentru deprecierea activelor corporale de explorare şi evaluare a resurselor minerale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2917,'RO-BASE','IMMO','XXXXXX','2917','2910','Ajustări pentru deprecierea activelor biologice productive (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2930,'RO-BASE','IMMO','XXXXXX','293','29','Ajustări pentru deprecierea imobilizărilor în curs de execuţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2931,'RO-BASE','IMMO','XXXXXX','2931','2930','Ajustări pentru deprecierea imobilizărilor corporale în curs de execuţie (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2935,'RO-BASE','IMMO','XXXXXX','2935','2930','Ajustări pentru deprecierea investiţiilor imobiliare în curs de execuţie (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2960,'RO-BASE','IMMO','XXXXXX','296','29','Ajustări pentru pierderea de valoare a imobilizărilor financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2961,'RO-BASE','IMMO','XXXXXX','2961','2960','Ajustări pentru pierderea de valoare a acţiunilor deţinute la entităţile afiliate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2962,'RO-BASE','IMMO','XXXXXX','2962','2960','Ajustări pentru pierderea de valoare a acţiunilor deţinute la entităţi asociate şi entităţi controlate în comun (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2963,'RO-BASE','IMMO','XXXXXX','2963','2960','Ajustări pentru pierderea de valoare a altor titluri imobilizate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2964,'RO-BASE','IMMO','XXXXXX','2964','2960','Ajustări pentru pierderea de valoare a sumelor de încasat de la entităţile afiliate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2965,'RO-BASE','IMMO','XXXXXX','2965','2960','Ajustări pentru pierderea de valoare a creanţelor faţă de entităţile asociate şi entităţile controlate în comun (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2966,'RO-BASE','IMMO','XXXXXX','2966','2960','Ajustări pentru pierderea de valoare a împrumuturilor acordate pe termen lung (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (2968,'RO-BASE','IMMO','XXXXXX','2968','2960','Ajustări pentru pierderea de valoare a altor creanţe imobilizate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3,'RO-BASE','STOCK','XXXXXX','3','0','Conturi de stocuri şi producţie în curs de execuţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (30,'RO-BASE','STOCK','XXXXXX','30','3','Stocuri de materii prime şi materiale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3010,'RO-BASE','STOCK','XXXXXX','301','30','Materii prime (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3020,'RO-BASE','STOCK','XXXXXX','302','30','Materiale consumabile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3021,'RO-BASE','STOCK','XXXXXX','3021','3020','Materiale auxiliare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3022,'RO-BASE','STOCK','XXXXXX','3022','3020','Combustibili (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3023,'RO-BASE','STOCK','XXXXXX','3023','3020','Materiale pentru ambalat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3024,'RO-BASE','STOCK','XXXXXX','3024','3020','Piese de schimb (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3025,'RO-BASE','STOCK','XXXXXX','3025','3020','Seminţe şi materiale de plantat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3026,'RO-BASE','STOCK','XXXXXX','3026','3020','Furaje (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3028,'RO-BASE','STOCK','XXXXXX','3028','3020','Alte materiale consumabile (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3030,'RO-BASE','STOCK','XXXXXX','303','30','Materiale de natura obiectelor de inventar (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3080,'RO-BASE','STOCK','XXXXXX','308','30','Diferenţe de preţ la materii prime şi materiale (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (32,'RO-BASE','STOCK','XXXXXX','32','3','Stocuri în curs de aprovizionare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3210,'RO-BASE','STOCK','XXXXXX','321','32','Materii prime în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3220,'RO-BASE','STOCK','XXXXXX','322','32','Materiale consumabile în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3230,'RO-BASE','STOCK','XXXXXX','323','32','Materiale de natura obiectelor de inventar în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3260,'RO-BASE','STOCK','XXXXXX','326','32','Active biologice de natura stocurilor în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3270,'RO-BASE','STOCK','XXXXXX','327','32','Mărfuri în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3280,'RO-BASE','STOCK','XXXXXX','328','32','Ambalaje în curs de aprovizionare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (33,'RO-BASE','STOCK','XXXXXX','33','3','Producţie în curs de execuţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3310,'RO-BASE','STOCK','XXXXXX','331','33','Produse în curs de execuţie (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3320,'RO-BASE','STOCK','XXXXXX','332','33','Servicii în curs de execuţie (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (34,'RO-BASE','STOCK','XXXXXX','34','3','PRODUSE',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3410,'RO-BASE','STOCK','XXXXXX','341','34','Semifabricate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3450,'RO-BASE','STOCK','XXXXXX','345','34','Produse finite (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3460,'RO-BASE','STOCK','XXXXXX','346','34','Produse reziduale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3470,'RO-BASE','STOCK','XXXXXX','347','34','Produse agricole (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3480,'RO-BASE','STOCK','XXXXXX','348','34','Diferenţe de preţ la produse (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (35,'RO-BASE','STOCK','XXXXXX','35','3','STOCURI AFLATE LA TERŢI',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3510,'RO-BASE','STOCK','XXXXXX','351','35','Materii şi materiale aflate la terţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3540,'RO-BASE','STOCK','XXXXXX','354','35','Produse aflate la terţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3560,'RO-BASE','STOCK','XXXXXX','356','35','Active biologice de natura stocurilor aflate la terţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3570,'RO-BASE','STOCK','XXXXXX','357','35','Mărfuri aflate la terţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3580,'RO-BASE','STOCK','XXXXXX','358','35','Ambalaje aflate la terţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (36,'RO-BASE','STOCK','XXXXXX','36','3','Active biologice de natura stocurilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3610,'RO-BASE','STOCK','XXXXXX','361','36','Active biologice de natura stocurilor (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3680,'RO-BASE','STOCK','XXXXXX','368','36','Diferenţe de preţ la active biologice de natura stocurilor (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (37,'RO-BASE','STOCK','XXXXXX','37','3','MĂRFURI',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3710,'RO-BASE','STOCK','XXXXXX','371','37','Mărfuri (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3780,'RO-BASE','STOCK','XXXXXX','378','37','Diferenţe de preţ la mărfuri (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (38,'RO-BASE','STOCK','XXXXXX','38','3','Ambalaje',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3810,'RO-BASE','STOCK','XXXXXX','381','38','Ambalaje (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3880,'RO-BASE','STOCK','XXXXXX','388','38','Diferenţe de preţ la ambalaje (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (39,'RO-BASE','STOCK','XXXXXX','39','3','Ajustări pentru deprecierea stocurilor şi producţiei în curs de execuţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3910,'RO-BASE','STOCK','XXXXXX','391','39','Ajustări pentru deprecierea materiilor prime (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3920,'RO-BASE','STOCK','XXXXXX','392','39','Ajustări pentru deprecierea materialelor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3921,'RO-BASE','STOCK','XXXXXX','3921','3920','Ajustări pentru deprecierea materialelor consumabile (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3922,'RO-BASE','STOCK','XXXXXX','3922','3920','Ajustări pentru deprecierea materialelor de natura obiectelor de inventar (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3930,'RO-BASE','STOCK','XXXXXX','393','39','Ajustări pentru deprecierea producţiei în curs de execuţie (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3940,'RO-BASE','STOCK','XXXXXX','394','39','Ajustări pentru deprecierea produselor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3941,'RO-BASE','STOCK','XXXXXX','3941','3940','Ajustări pentru deprecierea semifabricatelor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3945,'RO-BASE','STOCK','XXXXXX','3945','3940','Ajustări pentru deprecierea produselor finite (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3946,'RO-BASE','STOCK','XXXXXX','3946','3940','Ajustări pentru deprecierea produselor reziduale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3947,'RO-BASE','STOCK','XXXXXX','3947','3940','Ajustări pentru deprecierea produselor agricole (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3950,'RO-BASE','STOCK','XXXXXX','395','39','Ajustări pentru deprecierea stocurilor aflate la terţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3951,'RO-BASE','STOCK','XXXXXX','3951','3950','Ajustări pentru deprecierea materiilor şi materialelor aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3952,'RO-BASE','STOCK','XXXXXX','3952','3950','Ajustări pentru deprecierea semifabricatelor aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3953,'RO-BASE','STOCK','XXXXXX','3953','3950','Ajustări pentru deprecierea produselor finite aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3954,'RO-BASE','STOCK','XXXXXX','3954','3950','Ajustări pentru deprecierea produselor reziduale aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3955,'RO-BASE','STOCK','XXXXXX','3955','3950','Ajustări pentru deprecierea produselor agricole aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3956,'RO-BASE','STOCK','XXXXXX','3956','3950','Ajustări pentru deprecierea activelor biologice de natura stocurilor aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3957,'RO-BASE','STOCK','XXXXXX','3957','3950','Ajustări pentru deprecierea mărfurilor aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3958,'RO-BASE','STOCK','XXXXXX','3958','3950','Ajustări pentru deprecierea ambalajelor aflate la terţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3960,'RO-BASE','STOCK','XXXXXX','396','39','Ajustări pentru deprecierea activelor biologice de natura stocurilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3970,'RO-BASE','STOCK','XXXXXX','397','39','Ajustări pentru deprecierea mărfurilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (3980,'RO-BASE','STOCK','XXXXXX','398','39','Ajustări pentru deprecierea ambalajelor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4,'RO-BASE','THIRDPARTY','XXXXXX','4','0','Conturi de terţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (40,'RO-BASE','THIRDPARTY','XXXXXX','40','4','Furnizori şi conturi asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4010,'RO-BASE','THIRDPARTY','SUPPLIER','401','40','Furnizori (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4030,'RO-BASE','THIRDPARTY','XXXXXX','403','40','Efecte de plătit (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4040,'RO-BASE','THIRDPARTY','XXXXXX','404','40','Furnizori de imobilizări (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4050,'RO-BASE','THIRDPARTY','XXXXXX','405','40','Efecte de plătit pentru imobilizări (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4080,'RO-BASE','THIRDPARTY','XXXXXX','408','40','Furnizori - facturi nesosite (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4090,'RO-BASE','THIRDPARTY','XXXXXX','409','40','Furnizori - debitori',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4091,'RO-BASE','THIRDPARTY','XXXXXX','4091','4090','Furnizori - debitori pentru cumpărări de bunuri de natura stocurilor (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4092,'RO-BASE','THIRDPARTY','XXXXXX','4092','4090','Furnizori - debitori pentru prestări de servicii (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4093,'RO-BASE','THIRDPARTY','XXXXXX','4093','4090','Avansuri acordate pentru imobilizări corporale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4094,'RO-BASE','THIRDPARTY','XXXXXX','4094','4090','Avansuri acordate pentru imobilizări necorporale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (41,'RO-BASE','THIRDPARTY','XXXXXX','41','4','Clienţi şi conturi asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4110,'RO-BASE','THIRDPARTY','CUSTOMER','411','41','Clienţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4111,'RO-BASE','THIRDPARTY','XXXXXX','4111','4110','Clienţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4118,'RO-BASE','THIRDPARTY','XXXXXX','4118','4110','Clienţi incerţi sau în litigiu (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4130,'RO-BASE','THIRDPARTY','XXXXXX','413','41','Efecte de primit de la clienţi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4180,'RO-BASE','THIRDPARTY','XXXXXX','418','41','Clienţi - facturi de întocmit (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4190,'RO-BASE','THIRDPARTY','XXXXXX','419','41','Clienţi - creditori (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (42,'RO-BASE','THIRDPARTY','XXXXXX','42','4','Personal şi conturi asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4210,'RO-BASE','THIRDPARTY','XXXXXX','421','42','Personal - salarii datorate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4230,'RO-BASE','THIRDPARTY','XXXXXX','423','42','Personal - ajutoare materiale datorate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4240,'RO-BASE','THIRDPARTY','XXXXXX','424','42','Prime reprezentând participarea personalului la profit*16) (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4250,'RO-BASE','THIRDPARTY','XXXXXX','425','42','Avansuri acordate personalului (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260,'RO-BASE','THIRDPARTY','XXXXXX','426','42','Drepturi de personal neridicate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270,'RO-BASE','THIRDPARTY','XXXXXX','427','42','Reţineri din salarii datorate terţilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280,'RO-BASE','THIRDPARTY','XXXXXX','428','42','Alte datorii şi creanţe în legătură cu personalul',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281,'RO-BASE','THIRDPARTY','XXXXXX','4281','4280','Alte datorii în legătură cu personalul (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282,'RO-BASE','THIRDPARTY','XXXXXX','4282','4280','Alte creanţe în legătură cu personalul (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (43,'RO-BASE','THIRDPARTY','XXXXXX','43','4','Asigurări sociale, protecţia socială şi conturi asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310,'RO-BASE','THIRDPARTY','XXXXXX','431','43','Asigurări sociale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311,'RO-BASE','THIRDPARTY','XXXXXX','4311','4310','Contribuţia unităţii la asigurările sociale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312,'RO-BASE','THIRDPARTY','XXXXXX','4312','4310','Contribuţia personalului la asigurările sociale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313,'RO-BASE','THIRDPARTY','XXXXXX','4313','4310','Contribuţia angajatorului pentru asigurările sociale de sănătate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314,'RO-BASE','THIRDPARTY','XXXXXX','4314','4310','Contribuţia angajaţilor pentru asigurările sociale de sănătate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315,'RO-BASE','THIRDPARTY','XXXXXX','4315','4310','Contribuţia de asigurări sociale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316,'RO-BASE','THIRDPARTY','XXXXXX','4316','4310','Contribuţia de asigurări sociale de sănătate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318,'RO-BASE','THIRDPARTY','XXXXXX','4318','4310','Alte contribuţii pentru asigurările sociale de sănătate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360,'RO-BASE','THIRDPARTY','XXXXXX','436','43','Contribuția asiguratorie pentru muncă        ',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370,'RO-BASE','THIRDPARTY','XXXXXX','437','43','Ajutor de şomaj',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371,'RO-BASE','THIRDPARTY','XXXXXX','4371','4370','Contribuţia unităţii la fondul de şomaj (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372,'RO-BASE','THIRDPARTY','XXXXXX','4372','4370','Contribuţia personalului la fondul de şomaj (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380,'RO-BASE','THIRDPARTY','XXXXXX','438','43','Alte datorii şi creanţe sociale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381,'RO-BASE','THIRDPARTY','XXXXXX','4381','4380','Alte datorii sociale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382,'RO-BASE','THIRDPARTY','XXXXXX','4382','4380','Alte creanţe sociale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (44,'RO-BASE','THIRDPARTY','XXXXXX','44','4','Bugetul statului, fonduri speciale şi conturi asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410,'RO-BASE','THIRDPARTY','XXXXXX','441','44','Impozitul pe profit/venit',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411,'RO-BASE','THIRDPARTY','XXXXXX','4411','4410','Impozitul pe profit (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418,'RO-BASE','THIRDPARTY','XXXXXX','4418','4410','Impozitul pe venit*17) (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420,'RO-BASE','THIRDPARTY','XXXXXX','442','44','Taxa pe valoarea adăugată',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423,'RO-BASE','THIRDPARTY','XXXXXX','4423','4420','TVA de plată (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424,'RO-BASE','THIRDPARTY','XXXXXX','4424','4420','TVA de recuperat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426,'RO-BASE','THIRDPARTY','XXXXXX','4426','4420','TVA deductibilă (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427,'RO-BASE','THIRDPARTY','XXXXXX','4427','4420','TVA colectată (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428,'RO-BASE','THIRDPARTY','XXXXXX','4428','4420','TVA neexigibilă (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440,'RO-BASE','THIRDPARTY','XXXXXX','444','44','Impozitul pe venituri de natura salariilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450,'RO-BASE','THIRDPARTY','XXXXXX','445','44','Subvenţii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451,'RO-BASE','THIRDPARTY','XXXXXX','4451','4450','Subvenţii guvernamentale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452,'RO-BASE','THIRDPARTY','XXXXXX','4452','4450','Împrumuturi nerambursabile cu caracter de subvenţii (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458,'RO-BASE','THIRDPARTY','XXXXXX','4458','4450','Alte sume primite cu caracter de subvenţii (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460,'RO-BASE','THIRDPARTY','XXXXXX','446','44','Alte impozite, taxe şi vărsăminte asimilate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470,'RO-BASE','THIRDPARTY','XXXXXX','447','44','Fonduri speciale - taxe şi vărsăminte asimilate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480,'RO-BASE','THIRDPARTY','XXXXXX','448','44','Alte datorii şi creanţe cu bugetul statului',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481,'RO-BASE','THIRDPARTY','XXXXXX','4481','4480','Alte datorii faţă de bugetul statului (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482,'RO-BASE','THIRDPARTY','XXXXXX','4482','4480','Alte creanţe privind bugetul statului (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (45,'RO-BASE','THIRDPARTY','XXXXXX','45','4','Grup şi acţionari/asociaţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510,'RO-BASE','THIRDPARTY','XXXXXX','451','45','Decontări între entităţile afiliate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511,'RO-BASE','THIRDPARTY','XXXXXX','4511','4510','Decontări între entităţile afiliate (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518,'RO-BASE','THIRDPARTY','XXXXXX','4518','4510','Dobânzi aferente decontărilor între entităţile afiliate (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530,'RO-BASE','THIRDPARTY','XXXXXX','453','45','Decontări cu entităţile asociate şi entităţile controlate în comun',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531,'RO-BASE','THIRDPARTY','XXXXXX','4531','4530','Decontări cu entităţile asociate şi entităţile controlate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538,'RO-BASE','THIRDPARTY','XXXXXX','4538','4530','Dobânzi aferente decontărilor cu entităţile asociate şi entităţile controlate în comun (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550,'RO-BASE','THIRDPARTY','XXXXXX','455','45','Sume datorate acţionarilor/asociaţilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551,'RO-BASE','THIRDPARTY','XXXXXX','4551','4550','Acţionari/Asociaţi - conturi curente (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558,'RO-BASE','THIRDPARTY','XXXXXX','4558','4550','Acţionari/Asociaţi - dobânzi la conturi curente (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560,'RO-BASE','THIRDPARTY','XXXXXX','456','45','Decontări cu acţionarii/asociaţii privind capitalul (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570,'RO-BASE','THIRDPARTY','XXXXXX','457','45','Dividende de plată (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580,'RO-BASE','THIRDPARTY','XXXXXX','458','45','Decontări din operaţiuni în participaţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581,'RO-BASE','THIRDPARTY','XXXXXX','4581','4580','Decontări din operaţiuni în participaţie - pasiv (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582,'RO-BASE','THIRDPARTY','XXXXXX','4582','4580','Decontări din operaţiuni în participaţie - activ (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (46,'RO-BASE','THIRDPARTY','XXXXXX','46','4','Debitori şi creditori diverşi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610,'RO-BASE','THIRDPARTY','XXXXXX','461','46','Debitori diverşi (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620,'RO-BASE','THIRDPARTY','XXXXXX','462','46','Creditori diverşi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660,'RO-BASE','THIRDPARTY','XXXXXX','466','46','Decontări din operaţiuni de fiducie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661,'RO-BASE','THIRDPARTY','XXXXXX','4661','4660','Datorii din operaţiuni de fiducie (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662,'RO-BASE','THIRDPARTY','XXXXXX','4662','4660','Creanţe din operaţiuni de fiducie (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (47,'RO-BASE','THIRDPARTY','XXXXXX','47','4','Conturi de subvenţii, regularizare şi asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710,'RO-BASE','THIRDPARTY','XXXXXX','471','47','Cheltuieli înregistrate în avans (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720,'RO-BASE','THIRDPARTY','XXXXXX','472','47','Venituri înregistrate în avans (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730,'RO-BASE','THIRDPARTY','XXXXXX','473','47','Decontări din operaţiuni în curs de clarificare (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750,'RO-BASE','THIRDPARTY','XXXXXX','475','47','Subvenţii pentru investiţii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751,'RO-BASE','THIRDPARTY','XXXXXX','4751','4750','Subvenţii guvernamentale pentru investiţii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752,'RO-BASE','THIRDPARTY','XXXXXX','4752','4750','Împrumuturi nerambursabile cu caracter de subvenţii pentru investiţii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753,'RO-BASE','THIRDPARTY','XXXXXX','4753','4750','Donaţii pentru investiţii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4754,'RO-BASE','THIRDPARTY','XXXXXX','4754','4750','Plusuri de inventar de natura imobilizărilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758,'RO-BASE','THIRDPARTY','XXXXXX','4758','4750','Alte sume primite cu caracter de subvenţii pentru investiţii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780,'RO-BASE','THIRDPARTY','XXXXXX','478','47','Venituri în avans aferente activelor primite prin transfer de la clienţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (48,'RO-BASE','THIRDPARTY','XXXXXX','48','4','Decontări în cadrul unităţii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4810,'RO-BASE','THIRDPARTY','XXXXXX','481','48','Decontări între unitate şi subunităţi (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4820,'RO-BASE','THIRDPARTY','XXXXXX','482','48','Decontări între subunităţi (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (49,'RO-BASE','THIRDPARTY','XXXXXX','49','4','Ajustări pentru deprecierea creanţelor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4910,'RO-BASE','THIRDPARTY','XXXXXX','491','49','Ajustări pentru deprecierea creanţelor - clienţi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4950,'RO-BASE','THIRDPARTY','XXXXXX','495','49','Ajustări pentru deprecierea creanţelor - decontări în cadrul grupului şi cu acţionarii/asociaţii (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4960,'RO-BASE','THIRDPARTY','XXXXXX','496','49','Ajustări pentru deprecierea creanţelor - debitori diverşi (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5,'RO-BASE','FINAN','XXXXXX','5','0','Conturi de trezorerie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (50,'RO-BASE','FINAN','XXXXXX','50','5','Investiţii pe termen scurt',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5010,'RO-BASE','FINAN','XXXXXX','501','50','Acţiuni deţinute la entităţile afiliate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5050,'RO-BASE','FINAN','XXXXXX','505','50','Obligaţiuni emise şi răscumpărate (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5060,'RO-BASE','FINAN','XXXXXX','506','50','Obligaţiuni (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5070,'RO-BASE','FINAN','XXXXXX','507','50','Certificate verzi primite (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5080,'RO-BASE','FINAN','XXXXXX','508','50','Alte investiţii pe termen scurt şi creanţe asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5081,'RO-BASE','FINAN','XXXXXX','5081','5080','Alte titluri de plasament (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5088,'RO-BASE','FINAN','XXXXXX','5088','5080','Dobânzi la obligaţiuni şi titluri de plasament (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5090,'RO-BASE','FINAN','XXXXXX','509','50','Vărsăminte de efectuat pentru investiţiile pe termen scurt',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5091,'RO-BASE','FINAN','XXXXXX','5091','5090','Vărsăminte de efectuat pentru acţiunile deţinute la entităţile afiliate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5092,'RO-BASE','FINAN','XXXXXX','5092','5090','Vărsăminte de efectuat pentru alte investiţii pe termen scurt (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (51,'RO-BASE','FINAN','XXXXXX','51','5','Conturi la bănci',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5110,'RO-BASE','FINAN','XXXXXX','511','51','Valori de încasat',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5112,'RO-BASE','FINAN','XXXXXX','5112','5110','Cecuri de încasat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5113,'RO-BASE','FINAN','XXXXXX','5113','5110','Efecte de încasat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5114,'RO-BASE','FINAN','XXXXXX','5114','5110','Efecte remise spre scontare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5120,'RO-BASE','FINAN','XXXXXX','512','51','Conturi curente la bănci',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5121,'RO-BASE','FINAN','BANK','5121','5120','Conturi la bănci în lei (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5124,'RO-BASE','FINAN','XXXXXX','5124','5120','Conturi la bănci în valută (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5125,'RO-BASE','FINAN','XXXXXX','5125','5120','Sume în curs de decontare (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5126,'RO-BASE','FINAN','XXXXXX','5126','5120','Conturi la bănci în lei - TVA defalcat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5127,'RO-BASE','FINAN','XXXXXX','5127','5120','Conturi la bănci în valută - TVA defalcat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5180,'RO-BASE','FINAN','XXXXXX','518','51','Dobânzi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5186,'RO-BASE','FINAN','XXXXXX','5186','5180','Dobânzi de plătit (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5187,'RO-BASE','FINAN','XXXXXX','5187','5180','Dobânzi de încasat (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5190,'RO-BASE','FINAN','XXXXXX','519','51','Credite bancare pe termen scurt',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5191,'RO-BASE','FINAN','XXXXXX','5191','5190','Credite bancare pe termen scurt (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5192,'RO-BASE','FINAN','XXXXXX','5192','5190','Credite bancare pe termen scurt nerambursate la scadenţă (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5193,'RO-BASE','FINAN','XXXXXX','5193','5190','Credite externe guvernamentale (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5194,'RO-BASE','FINAN','XXXXXX','5194','5190','Credite externe garantate de stat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5195,'RO-BASE','FINAN','XXXXXX','5195','5190','Credite externe garantate de bănci (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5196,'RO-BASE','FINAN','XXXXXX','5196','5190','Credite de la Trezoreria Statului (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5197,'RO-BASE','FINAN','XXXXXX','5197','5190','Credite interne garantate de stat (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5198,'RO-BASE','FINAN','XXXXXX','5198','5190','Dobânzi aferente creditelor bancare pe termen scurt (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (53,'RO-BASE','FINAN','XXXXXX','53','5','Casa',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5310,'RO-BASE','FINAN','CASH','531','53','Casa',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5311,'RO-BASE','FINAN','XXXXXX','5311','5310','Casa în lei (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5314,'RO-BASE','FINAN','XXXXXX','5314','5310','Casa în valută (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5320,'RO-BASE','FINAN','XXXXXX','532','53','Alte valori',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5321,'RO-BASE','FINAN','XXXXXX','5321','5320','Timbre fiscale şi poştale (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5322,'RO-BASE','FINAN','XXXXXX','5322','5320','Bilete de tratament şi odihnă (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5323,'RO-BASE','FINAN','XXXXXX','5323','5320','Tichete şi bilete de călătorie (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5328,'RO-BASE','FINAN','XXXXXX','5328','5320','Alte valori (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (54,'RO-BASE','FINAN','XXXXXX','54','5','Acreditive',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5410,'RO-BASE','FINAN','XXXXXX','541','54','Acreditive',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5411,'RO-BASE','FINAN','XXXXXX','5411','5410','Acreditive în lei (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5414,'RO-BASE','FINAN','XXXXXX','5414','5410','Acreditive în valută (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5420,'RO-BASE','FINAN','XXXXXX','542','54','Avansuri de trezorerie*18) (A)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (58,'RO-BASE','FINAN','XXXXXX','58','5','Viramente interne',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5810,'RO-BASE','FINAN','XXXXXX','581','58','Viramente interne (A/P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (59,'RO-BASE','FINAN','XXXXXX','59','5','Ajustări pentru pierderea de valoare a conturilor de trezorerie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5910,'RO-BASE','FINAN','XXXXXX','591','59','Ajustări pentru pierderea de valoare a acţiunilor deţinute la entităţile afiliate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5950,'RO-BASE','FINAN','XXXXXX','595','59','Ajustări pentru pierderea de valoare a obligaţiunilor emise şi răscumpărate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5960,'RO-BASE','FINAN','XXXXXX','596','59','Ajustări pentru pierderea de valoare a obligaţiunilor (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5980,'RO-BASE','FINAN','XXXXXX','598','59','Ajustări pentru pierderea de valoare a altor investiţii pe termen scurt şi creanţe asimilate (P)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6,'RO-BASE','EXPENSE','XXXXXX','6','0','Conturi de cheltuieli',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (60,'RO-BASE','EXPENSE','XXXXXX','60','6','Cheltuieli privind stocurile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6010,'RO-BASE','EXPENSE','XXXXXX','601','60','Cheltuieli cu materiile prime',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6020,'RO-BASE','EXPENSE','XXXXXX','602','60','Cheltuieli cu materialele consumabile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6021,'RO-BASE','EXPENSE','XXXXXX','6021','6020','Cheltuieli cu materialele auxiliare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6022,'RO-BASE','EXPENSE','XXXXXX','6022','6020','Cheltuieli privind combustibilii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6023,'RO-BASE','EXPENSE','XXXXXX','6023','6020','Cheltuieli privind materialele pentru ambalat',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6024,'RO-BASE','EXPENSE','XXXXXX','6024','6020','Cheltuieli privind piesele de schimb',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6025,'RO-BASE','EXPENSE','XXXXXX','6025','6020','Cheltuieli privind seminţele şi materialele de plantat',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6026,'RO-BASE','EXPENSE','XXXXXX','6026','6020','Cheltuieli privind furajele',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6028,'RO-BASE','EXPENSE','XXXXXX','6028','6020','Cheltuieli privind alte materiale consumabile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6030,'RO-BASE','EXPENSE','XXXXXX','603','60','Cheltuieli privind materialele de natura obiectelor de inventar',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6040,'RO-BASE','EXPENSE','XXXXXX','604','60','Cheltuieli privind materialele nestocate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6050,'RO-BASE','EXPENSE','XXXXXX','605','60','Cheltuieli privind energia şi apa',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6060,'RO-BASE','EXPENSE','XXXXXX','606','60','Cheltuieli privind activele biologice de natura stocurilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6070,'RO-BASE','EXPENSE','PRODUCT','607','60','Cheltuieli privind mărfurile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6080,'RO-BASE','EXPENSE','XXXXXX','608','60','Cheltuieli privind ambalajele',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6090,'RO-BASE','EXPENSE','XXXXXX','609','60','Reduceri comerciale primite',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (61,'RO-BASE','EXPENSE','XXXXXX','61','6','Cheltuieli cu serviciile executate de terţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6110,'RO-BASE','EXPENSE','SERVICE','611','61','Cheltuieli cu întreţinerea şi reparaţiile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6120,'RO-BASE','EXPENSE','XXXXXX','612','61','Cheltuieli cu redevenţele, locaţiile de gestiune şi chiriile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6130,'RO-BASE','EXPENSE','XXXXXX','613','61','Cheltuieli cu primele de asigurare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6140,'RO-BASE','EXPENSE','XXXXXX','614','61','Cheltuieli cu studiile şi cercetările',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6150,'RO-BASE','EXPENSE','XXXXXX','615','61','Cheltuieli cu pregătirea personalului',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (62,'RO-BASE','EXPENSE','XXXXXX','62','6','Cheltuieli cu alte servicii executate de terţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6210,'RO-BASE','EXPENSE','XXXXXX','621','62','Cheltuieli cu colaboratorii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6220,'RO-BASE','EXPENSE','XXXXXX','622','62','Cheltuieli privind comisioanele şi onorariile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6230,'RO-BASE','EXPENSE','XXXXXX','623','62','Cheltuieli de protocol, reclamă şi publicitate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6240,'RO-BASE','EXPENSE','XXXXXX','624','62','Cheltuieli cu transportul de bunuri şi personal',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6250,'RO-BASE','EXPENSE','XXXXXX','625','62','Cheltuieli cu deplasări, detaşări şi transferări',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6260,'RO-BASE','EXPENSE','XXXXXX','626','62','Cheltuieli poştale şi taxe de telecomunicaţii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6270,'RO-BASE','EXPENSE','XXXXXX','627','62','Cheltuieli cu serviciile bancare şi asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6280,'RO-BASE','EXPENSE','XXXXXX','628','62','Alte cheltuieli cu serviciile executate de terţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (63,'RO-BASE','EXPENSE','XXXXXX','63','6','Cheltuieli cu alte impozite, taxe şi vărsăminte asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6350,'RO-BASE','EXPENSE','XXXXXX','635','63','Cheltuieli cu alte impozite, taxe şi vărsăminte asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (64,'RO-BASE','EXPENSE','XXXXXX','64','6','Cheltuieli cu personalul',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6410,'RO-BASE','EXPENSE','XXXXXX','641','64','Cheltuieli cu salariile personalului',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6420,'RO-BASE','EXPENSE','XXXXXX','642','64','Cheltuieli cu avantajele în natură şi tichetele acordate salariaţilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6421,'RO-BASE','EXPENSE','XXXXXX','6421','6420','Cheltuieli cu avantajele în natură acordate salariaţilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6422,'RO-BASE','EXPENSE','XXXXXX','6422','6420','Cheltuieli cu tichetele acordate salariaţilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6430,'RO-BASE','EXPENSE','XXXXXX','643','64','Cheltuieli cu remunerarea în instrumente de capitaluri proprii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6440,'RO-BASE','EXPENSE','XXXXXX','644','64','Cheltuieli cu primele reprezentând participarea personalului la profit',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6450,'RO-BASE','EXPENSE','SOCIAL','645','64','Cheltuieli privind asigurările şi protecţia socială',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6451,'RO-BASE','EXPENSE','XXXXXX','6451','6450','Cheltuieli privind contribuţia unităţii la asigurările sociale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6452,'RO-BASE','EXPENSE','XXXXXX','6452','6450','Cheltuieli privind contribuţia unităţii pentru ajutorul de şomaj',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6453,'RO-BASE','EXPENSE','XXXXXX','6453','6450','Cheltuieli privind contribuţia angajatorului pentru asigurările sociale de sănătate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6455,'RO-BASE','EXPENSE','XXXXXX','6455','6450','Cheltuieli privind contribuţia unităţii la asigurările de viaţă',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6456,'RO-BASE','EXPENSE','XXXXXX','6456','6450','Cheltuieli privind contribuţia unităţii la fondurile de pensii facultative',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6457,'RO-BASE','EXPENSE','XXXXXX','6457','6450','Cheltuieli privind contribuţia unităţii la primele de asigurare voluntară de sănătate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6458,'RO-BASE','EXPENSE','XXXXXX','6458','6450','Alte cheltuieli privind asigurările şi protecţia socială',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6460,'RO-BASE','EXPENSE','XXXXXX','646','64','Cheltuieli privind contribuția asiguratorie pentru muncă',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (65,'RO-BASE','EXPENSE','XXXXXX','65','6','Alte cheltuieli de exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6510,'RO-BASE','EXPENSE','XXXXXX','651','65','Cheltuieli din operaţiuni de fiducie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6511,'RO-BASE','EXPENSE','XXXXXX','6511','6510','Cheltuieli ocazionate de constituirea fiduciei',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6512,'RO-BASE','EXPENSE','XXXXXX','6512','6510','Cheltuieli din derularea operaţiunilor de fiducie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6513,'RO-BASE','EXPENSE','XXXXXX','6513','6510','Cheltuieli din lichidarea operaţiunilor de fiducie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6520,'RO-BASE','EXPENSE','XXXXXX','652','65','Cheltuieli cu protecţia mediului înconjurător',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6540,'RO-BASE','EXPENSE','XXXXXX','654','65','Pierderi din creanţe şi debitori diverşi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6550,'RO-BASE','EXPENSE','XXXXXX','655','65','Cheltuieli din reevaluarea imobilizărilor corporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6580,'RO-BASE','EXPENSE','XXXXXX','658','65','Alte cheltuieli de exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6581,'RO-BASE','EXPENSE','XXXXXX','6581','6580','Despăgubiri, amenzi şi penalităţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6582,'RO-BASE','EXPENSE','XXXXXX','6582','6580','Donaţii acordate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6583,'RO-BASE','EXPENSE','XXXXXX','6583','6580','Cheltuieli privind activele cedate şi alte operaţiuni de capital',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6584,'RO-BASE','EXPENSE','XXXXXX','6584','6580','Cheltuieli cu sumele sau bunurile acordate ca sponsorizări  ',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6586,'RO-BASE','EXPENSE','XXXXXX','6586','6580','Cheltuieli reprezentând transferuri şi contribuţii datorate în baza unor acte normative speciale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6587,'RO-BASE','EXPENSE','XXXXXX','6587','6580','Cheltuieli privind calamităţile şi alte evenimente similare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6588,'RO-BASE','EXPENSE','XXXXXX','6588','6580','Alte cheltuieli de exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (66,'RO-BASE','EXPENSE','XXXXXX','66','6','Cheltuieli financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6630,'RO-BASE','EXPENSE','XXXXXX','663','66','Pierderi din creanţe legate de participaţii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6640,'RO-BASE','EXPENSE','XXXXXX','664','66','Cheltuieli privind investiţiile financiare cedate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6641,'RO-BASE','EXPENSE','XXXXXX','6641','6640','Cheltuieli privind imobilizările financiare cedate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6642,'RO-BASE','EXPENSE','XXXXXX','6642','6640','Pierderi din investiţiile pe termen scurt cedate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6650,'RO-BASE','EXPENSE','XXXXXX','665','66','Cheltuieli din diferenţe de curs valutar',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6651,'RO-BASE','EXPENSE','XXXXXX','6651','6650','Diferenţe nefavorabile de curs valutar legate de elementele monetare exprimate în valută',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6652,'RO-BASE','EXPENSE','XXXXXX','6652','6650','Diferenţe nefavorabile de curs valutar din evaluarea elementelor monetare care fac parte din investiţia netă într-o entitate străină',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6660,'RO-BASE','EXPENSE','XXXXXX','666','66','Cheltuieli privind dobânzile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6670,'RO-BASE','EXPENSE','XXXXXX','667','66','Cheltuieli privind sconturile acordate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6680,'RO-BASE','EXPENSE','XXXXXX','668','66','Alte cheltuieli financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (68,'RO-BASE','EXPENSE','XXXXXX','68','6','Cheltuieli cu amortizările, provizioanele şi ajustările pentru depreciere sau pierdere de valoare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6810,'RO-BASE','EXPENSE','XXXXXX','681','68','Cheltuieli de exploatare privind amortizările, provizioanele şi ajustările pentru depreciere',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6811,'RO-BASE','EXPENSE','XXXXXX','6811','6810','Cheltuieli de exploatare privind amortizarea imobilizărilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6812,'RO-BASE','EXPENSE','XXXXXX','6812','6810','Cheltuieli de exploatare privind provizioanele',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6813,'RO-BASE','EXPENSE','XXXXXX','6813','6810','Cheltuieli de exploatare privind ajustările pentru deprecierea imobilizărilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6814,'RO-BASE','EXPENSE','XXXXXX','6814','6810','Cheltuieli de exploatare privind ajustările pentru deprecierea activelor circulante',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6817,'RO-BASE','EXPENSE','XXXXXX','6817','6810','Cheltuieli de exploatare privind ajustările pentru deprecierea fondului comercial',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6860,'RO-BASE','EXPENSE','XXXXXX','686','68','Cheltuieli financiare privind amortizările, provizioanele şi ajustările pentru pierdere de valoare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6861,'RO-BASE','EXPENSE','XXXXXX','6861','6860','Cheltuieli privind actualizarea provizioanelor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6863,'RO-BASE','EXPENSE','XXXXXX','6863','6860','Cheltuieli financiare privind ajustările pentru pierderea de valoare a imobilizărilor financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6864,'RO-BASE','EXPENSE','XXXXXX','6864','6860','Cheltuieli financiare privind ajustările pentru pierderea de valoare a activelor circulante',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6865,'RO-BASE','EXPENSE','XXXXXX','6865','6860','Cheltuieli financiare privind amortizarea diferenţelor aferente titlurilor de stat',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6868,'RO-BASE','EXPENSE','XXXXXX','6868','6860','Cheltuieli financiare privind amortizarea primelor de rambursare a obligaţiunilor şi a altor datorii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (69,'RO-BASE','EXPENSE','XXXXXX','69','6','Cheltuieli cu impozitul pe profit şi alte impozite',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6910,'RO-BASE','EXPENSE','XXXXXX','691','69','Cheltuieli cu impozitul pe profit',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (6980,'RO-BASE','EXPENSE','XXXXXX','698','69','Cheltuieli cu impozitul pe venit şi cu alte impozite care nu apar în elementele de mai sus',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7,'RO-BASE','INCOME','XXXXXX','7','0','Conturi de venituri',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (70,'RO-BASE','INCOME','XXXXXX','70','7','Cifra de afaceri netă',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7010,'RO-BASE','INCOME','PRODUCT','701','70','Venituri din vânzarea produselor finite, produselor agricole şi a activelor biologice de natura stocurilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7015,'RO-BASE','INCOME','XXXXXX','7015','7010','Venituri din vânzarea produselor finite',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7017,'RO-BASE','INCOME','XXXXXX','7017','7010','Venituri din vânzarea produselor agricole',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7018,'RO-BASE','INCOME','XXXXXX','7018','7010','Venituri din vânzarea activelor biologice de natura stocurilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7020,'RO-BASE','INCOME','XXXXXX','702','70','Venituri din vânzarea semifabricatelor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7030,'RO-BASE','INCOME','XXXXXX','703','70','Venituri din vânzarea produselor reziduale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7040,'RO-BASE','INCOME','SERVICE','704','70','Venituri din servicii prestate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7050,'RO-BASE','INCOME','XXXXXX','705','70','Venituri din studii şi cercetări',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7060,'RO-BASE','INCOME','XXXXXX','706','70','Venituri din redevenţe, locaţii de gestiune şi chirii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7070,'RO-BASE','INCOME','PRODUCT','707','70','Venituri din vânzarea mărfurilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7080,'RO-BASE','INCOME','XXXXXX','708','70','Venituri din activităţi diverse',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7090,'RO-BASE','INCOME','XXXXXX','709','70','Reduceri comerciale acordate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (71,'RO-BASE','INCOME','XXXXXX','71','7','Venituri aferente costului producţiei în curs de execuţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7110,'RO-BASE','INCOME','XXXXXX','711','71','Venituri aferente costurilor stocurilor de produse',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7120,'RO-BASE','INCOME','XXXXXX','712','71','Venituri aferente costurilor serviciilor în curs de execuţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (72,'RO-BASE','INCOME','XXXXXX','72','7','Venituri din producţia de imobilizări',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7210,'RO-BASE','INCOME','XXXXXX','721','72','Venituri din producţia de imobilizări necorporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7220,'RO-BASE','INCOME','XXXXXX','722','72','Venituri din producţia de imobilizări corporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7250,'RO-BASE','INCOME','XXXXXX','725','72','Venituri din producţia de investiţii imobiliare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (74,'RO-BASE','INCOME','XXXXXX','74','7','Venituri din subvenţii de exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7410,'RO-BASE','INCOME','XXXXXX','741','74','Venituri din subvenţii de exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7411,'RO-BASE','INCOME','XXXXXX','7411','7410','Venituri din subvenţii de exploatare aferente cifrei de afaceri',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7412,'RO-BASE','INCOME','XXXXXX','7412','7410','Venituri din subvenţii de exploatare pentru materii prime şi materiale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7413,'RO-BASE','INCOME','XXXXXX','7413','7410','Venituri din subvenţii de exploatare pentru alte cheltuieli externe',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7414,'RO-BASE','INCOME','XXXXXX','7414','7410','Venituri din subvenţii de exploatare pentru plata personalului',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7415,'RO-BASE','INCOME','XXXXXX','7415','7410','Venituri din subvenţii de exploatare pentru asigurări şi protecţie socială',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7416,'RO-BASE','INCOME','XXXXXX','7416','7410','Venituri din subvenţii de exploatare pentru alte cheltuieli de exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7417,'RO-BASE','INCOME','XXXXXX','7417','7410','Venituri din subvenţii de exploatare în caz de calamităţi şi alte evenimente similare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7418,'RO-BASE','INCOME','XXXXXX','7418','7410','Venituri din subvenţii de exploatare pentru dobânda datorată',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7419,'RO-BASE','INCOME','XXXXXX','7419','7410','Venituri din subvenţii de exploatare aferente altor venituri',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (75,'RO-BASE','INCOME','XXXXXX','75','7','Alte venituri din exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7510,'RO-BASE','INCOME','XXXXXX','751','75','Venituri din operaţiuni de fiducie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7511,'RO-BASE','INCOME','XXXXXX','7511','7510','Venituri ocazionate de constituirea fiduciei',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7512,'RO-BASE','INCOME','XXXXXX','7512','7510','Venituri din derularea operaţiunilor de fiducie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7513,'RO-BASE','INCOME','XXXXXX','7513','7510','Venituri din lichidarea operaţiunilor de fiducie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7540,'RO-BASE','INCOME','XXXXXX','754','75','Venituri din creanţe reactivate şi debitori diverşi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7550,'RO-BASE','INCOME','XXXXXX','755','75','Venituri din reevaluarea imobilizărilor corporale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7580,'RO-BASE','INCOME','XXXXXX','758','75','Alte venituri din exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7581,'RO-BASE','INCOME','XXXXXX','7581','7580','Venituri din despăgubiri, amenzi şi penalităţi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7582,'RO-BASE','INCOME','XXXXXX','7582','7580','Venituri din donaţii primite',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7583,'RO-BASE','INCOME','XXXXXX','7583','7580','Venituri din vânzarea activelor şi alte operaţiuni de capital',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7584,'RO-BASE','INCOME','XXXXXX','7584','7580','Venituri din subvenţii pentru investiţii',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7586,'RO-BASE','INCOME','XXXXXX','7586','7580','Venituri reprezentând transferuri cuvenite în baza unor acte normative speciale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7588,'RO-BASE','INCOME','XXXXXX','7588','7580','Alte venituri din exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (76,'RO-BASE','INCOME','XXXXXX','76','7','Venituri financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7610,'RO-BASE','INCOME','XXXXXX','761','76','Venituri din imobilizări financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7611,'RO-BASE','INCOME','XXXXXX','7611','7610','Venituri din acţiuni deţinute la entităţile afiliate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7612,'RO-BASE','INCOME','XXXXXX','7612','7610','Venituri din acţiuni deţinute la entităţi asociate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7613,'RO-BASE','INCOME','XXXXXX','7613','7610','Venituri din acţiuni deţinute la entităţi controlate în comun',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7615,'RO-BASE','INCOME','XXXXXX','7615','7610','Venituri din alte imobilizări financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7620,'RO-BASE','INCOME','XXXXXX','762','76','Venituri din investiţii financiare pe termen scurt',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7640,'RO-BASE','INCOME','XXXXXX','764','76','Venituri din investiţii financiare cedate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7641,'RO-BASE','INCOME','XXXXXX','7641','7640','Venituri din imobilizări financiare cedate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7642,'RO-BASE','INCOME','XXXXXX','7642','7640','Câştiguri din investiţii pe termen scurt cedate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7650,'RO-BASE','INCOME','XXXXXX','765','76','Venituri din diferenţe de curs valutar',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7651,'RO-BASE','INCOME','XXXXXX','7651','7650','Diferenţe favorabile de curs valutar legate de elementele monetare exprimate în valută',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7652,'RO-BASE','INCOME','XXXXXX','7652','7650','Diferenţe favorabile de curs valutar din evaluarea elementelor monetare care fac parte din investiţia netă într-o entitate străină',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7660,'RO-BASE','INCOME','XXXXXX','766','76','Venituri din dobânzi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7670,'RO-BASE','INCOME','XXXXXX','767','76','Venituri din sconturi obţinute',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7680,'RO-BASE','INCOME','XXXXXX','768','76','Alte venituri financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (78,'RO-BASE','INCOME','XXXXXX','78','7','Venituri din provizioane, amortizări şi ajustări pentru depreciere sau pierdere de valoare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7810,'RO-BASE','INCOME','XXXXXX','781','78','Venituri din provizioane şi ajustări pentru depreciere privind activitatea de exploatare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7812,'RO-BASE','INCOME','XXXXXX','7812','7810','Venituri din provizioane',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7813,'RO-BASE','INCOME','XXXXXX','7813','7810','Venituri din ajustări pentru deprecierea imobilizărilor',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7814,'RO-BASE','INCOME','XXXXXX','7814','7810','Venituri din ajustări pentru deprecierea activelor circulante',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7815,'RO-BASE','INCOME','XXXXXX','7815','7810','Venituri din fondul comercial negativ',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7860,'RO-BASE','INCOME','XXXXXX','786','78','Venituri financiare din amortizări şi ajustări pentru pierdere de valoare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7863,'RO-BASE','INCOME','XXXXXX','7863','7860','Venituri financiare din ajustări pentru pierderea de valoare a imobilizărilor financiare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7864,'RO-BASE','INCOME','XXXXXX','7864','7860','Venituri financiare din ajustări pentru pierderea de valoare a activelor circulante',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7865,'RO-BASE','INCOME','XXXXXX','7865','7860','Venituri financiare din amortizarea diferenţelor aferente titlurilor de stat',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8,'RO-BASE','OTHER','XXXXXX','8','0','Conturi speciale',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (80,'RO-BASE','OTHER','XXXXXX','80','8','Conturi în afara bilanţului',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8010,'RO-BASE','OTHER','XXXXXX','801','80','Angajamente acordate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8011,'RO-BASE','OTHER','XXXXXX','8011','8010','Giruri şi garanţii acordate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8018,'RO-BASE','OTHER','XXXXXX','8018','8010','Alte angajamente acordate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8020,'RO-BASE','OTHER','XXXXXX','802','80','Angajamente primite',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8021,'RO-BASE','OTHER','XXXXXX','8021','8020','Giruri şi garanţii primite',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8028,'RO-BASE','OTHER','XXXXXX','8028','8020','Alte angajamente primite',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8030,'RO-BASE','OTHER','XXXXXX','803','80','Alte conturi în afara bilanţului',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8031,'RO-BASE','OTHER','XXXXXX','8031','8030','Imobilizări corporale primite cu chirie sau în baza altor contracte similare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8032,'RO-BASE','OTHER','XXXXXX','8032','8030','Valori materiale primite spre prelucrare sau reparare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8033,'RO-BASE','OTHER','XXXXXX','8033','8030','Valori materiale primite în păstrare sau custodie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8034,'RO-BASE','OTHER','XXXXXX','8034','8030','Debitori scoşi din activ, urmăriţi în continuare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8035,'RO-BASE','OTHER','XXXXXX','8035','8030','Stocuri de natura obiectelor de inventar date în folosinţă',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8036,'RO-BASE','OTHER','XXXXXX','8036','8030','Redevenţe, locaţii de gestiune, chirii şi alte datorii asimilate',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8037,'RO-BASE','OTHER','XXXXXX','8037','8030','Efecte scontate neajunse la scadenţă',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8038,'RO-BASE','OTHER','XXXXXX','8038','8030','Bunuri primite în administrare, concesiune şi cu chirie şi alte bunuri similare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8039,'RO-BASE','OTHER','XXXXXX','8039','8030','Alte valori în afara bilanţului',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8040,'RO-BASE','OTHER','XXXXXX','804','80','Certificate verzi',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8050,'RO-BASE','OTHER','XXXXXX','805','80','Dobânzi aferente contractelor de leasing şi altor contracte asimilate, neajunse la scadenţă',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8051,'RO-BASE','OTHER','XXXXXX','8051','8050','Dobânzi de plătit',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8052,'RO-BASE','OTHER','XXXXXX','8052','8050','Dobânzi de încasat*24)',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8060,'RO-BASE','OTHER','XXXXXX','806','80','Certificate de emisii de gaze cu efect de seră',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8070,'RO-BASE','OTHER','XXXXXX','807','80','Active contingente',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8080,'RO-BASE','OTHER','XXXXXX','808','80','Datorii contingente',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8090,'RO-BASE','OTHER','XXXXXX','809','80','Creanţe preluate prin cesionare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (89,'RO-BASE','OTHER','XXXXXX','89','8','Bilanţ',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8910,'RO-BASE','OTHER','XXXXXX','891','89','Bilanţ de deschidere',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (8920,'RO-BASE','OTHER','XXXXXX','892','89','Bilanţ de închidere',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9,'RO-BASE','MANAGEMENT','XXXXXX','9','0','Conturi de gestiune',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (90,'RO-BASE','MANAGEMENT','XXXXXX','90','9','Decontări interne',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9010,'RO-BASE','MANAGEMENT','XXXXXX','901','90','Decontări interne privind cheltuielile',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9020,'RO-BASE','MANAGEMENT','XXXXXX','902','90','Decontări interne privind producţia obţinută',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9030,'RO-BASE','MANAGEMENT','XXXXXX','903','90','Decontări interne privind diferenţele de preţ',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (92,'RO-BASE','MANAGEMENT','XXXXXX','92','9','Conturi de calculaţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9210,'RO-BASE','MANAGEMENT','XXXXXX','921','92','Cheltuielile activităţii de bază',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9220,'RO-BASE','MANAGEMENT','XXXXXX','922','92','Cheltuielile activităţilor auxiliare',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9230,'RO-BASE','MANAGEMENT','XXXXXX','923','92','Cheltuieli indirecte de producţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9240,'RO-BASE','MANAGEMENT','XXXXXX','924','92','Cheltuieli generale de administraţie',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9250,'RO-BASE','MANAGEMENT','XXXXXX','925','92','Cheltuieli de desfacere',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (93,'RO-BASE','MANAGEMENT','XXXXXX','93','9','Costul producţiei',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9310,'RO-BASE','MANAGEMENT','XXXXXX','931','93','Costul producţiei obţinute',1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9330,'RO-BASE','MANAGEMENT','XXXXXX','933','93','Costul producţiei în curs de execuţie',1); + + From cca1d2694386e09d1958b7546c195369acf1d5cd Mon Sep 17 00:00:00 2001 From: dtix <39430068+dtix@users.noreply.github.com> Date: Tue, 22 May 2018 11:23:59 +0300 Subject: [PATCH 20/72] Romanian chart of account added --- htdocs/install/mysql/data/llx_accounting_abc.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index e80de82b6ad..4365c83098e 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -119,3 +119,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account TG SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1); +-- Description of chart of account RO RO-BASE +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 188, 'RO-BASE', 'Plan de conturi romanesc', 1); + From be21405d219d04cd286c653f7490b9d1d1a89a1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 May 2018 19:24:56 +0200 Subject: [PATCH 21/72] Fix missing error message --- htdocs/societe/card.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 204eff383d5..d0aa719e08c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -296,7 +296,7 @@ if (empty($reshook)) if (! $error) { $result = $object->insertExtraFields(); - if ($result < 0) + if ($result < 0) { $error++; $errors = $object->errors; @@ -524,8 +524,8 @@ if (empty($reshook)) $error=$object->error; $errors=$object->errors; } } - - + + // Customer categories association $custcats = GETPOST( 'custcats', 'array' ); $object->setCategories($custcats, 'customer'); @@ -533,7 +533,7 @@ if (empty($reshook)) // Supplier categories association $suppcats = GETPOST('suppcats', 'array'); $object->setCategories($suppcats, 'supplier'); - + // Logo/Photo save $dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/"; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); @@ -638,10 +638,13 @@ if (empty($reshook)) $result = $object->update($socid, $user, 1, $object->oldcopy->codeclient_modifiable(), $object->oldcopy->codefournisseur_modifiable(), 'update', 0); if ($result <= 0) { - $error = $object->error; $errors = $object->errors; + $error++; + $errors = $object->errors; + setEventMessages($object->error, $object->errors, 'errors'); } + // Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined) - if(!empty($user->rights->categorie->lire)){ + if(!empty($user->rights->categorie->lire)){ // Customer categories association $categories = GETPOST( 'custcats', 'array' ); $object->setCategories($categories, 'customer'); @@ -718,6 +721,7 @@ if (empty($reshook)) { $error++; $object->error .= $object->db->lasterror(); + setEventMessages($object->error, $object->errors, 'errors'); } } From 2a579b707a83a5566020f4eeb5b572e8eedebaa4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 May 2018 19:43:28 +0200 Subject: [PATCH 22/72] FIX javascript showempty error FIX Contact tab not visible when using canvas --- htdocs/core/class/html.formcompany.class.php | 3 +- htdocs/societe/contact.php | 67 ++++++++------------ 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index fbf77080de2..63babef655e 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -599,7 +599,8 @@ class FormCompany var method = obj.method; var url = obj.url; var htmlname = obj.htmlname; - console.log("Run runJsCodeForEvent-'.$htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname); + var showempty = obj.showempty; + console.log("Run runJsCodeForEvent-'.$htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname); $.getJSON(url, { action: method, diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index d57f61045c0..fb56c8b3dcb 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -102,7 +102,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($cancel) + if ($cancel) { $action=''; if (! empty($backtopage)) @@ -139,51 +139,40 @@ llxHeader('',$title,$help_url); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) + +if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels); +//if ($res < 0) { dol_print_error($db); exit; } + + +$head = societe_prepare_head($object); + +dol_fiche_head($head, 'contact', $langs->trans("ThirdParty"), 0, 'company'); + +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); + +dol_fiche_end(); + +print '
'; + +if ($action != 'presend') { - // ----------------------------------------- - // When used with CANVAS - // ----------------------------------------- - $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates - $objcanvas->display_canvas($action); // Show template -} -else -{ - - if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels); - //if ($res < 0) { dol_print_error($db); exit; } - - - $head = societe_prepare_head($object); - - dol_fiche_head($head, 'contact', $langs->trans("ThirdParty"), 0, 'company'); - - $linkback = ''.$langs->trans("BackToList").''; - - dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); - - dol_fiche_end(); - - print '
'; - - if ($action != 'presend') + // Contacts list + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - // Contacts list - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) - { - $result=show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } - - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) - { - $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } + $result=show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); } + // Addresses list + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) + { + $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } } + // End of page llxFooter(); $db->close(); From f074daae4800882a53acbc726673b352c0b9ca4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 May 2018 20:17:31 +0200 Subject: [PATCH 23/72] Fix option MAIN_MAIL_ENABLED_USER_DEST_SELECT --- htdocs/core/actions_sendmails.inc.php | 23 ++++++++++++----------- htdocs/core/class/html.formmail.class.php | 6 +++--- htdocs/langs/en_US/mails.lang | 4 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f751711288c..8c81c0efc6a 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -146,9 +146,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $sendtocc=''; $sendtobcc=''; $sendtoid = array(); - if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { - $sendtouserid=array(); - } + $sendtouserid=array(); + $sendtoccuserid=array(); // Define $sendto $receiver=$_POST['receiver']; @@ -179,18 +178,20 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO } } } - if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { + if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) + { $receiveruser=$_POST['receiveruser']; if (is_array($receiveruser) && count($receiveruser)>0) { $fuserdest = new User($db); foreach($receiveruser as $key=>$val) { - $tmparray[] = $fuserdest->user_get_property($key,'email'); - $sendtouserid[] = $key; + $tmparray[] = $fuserdest->user_get_property($val,'email'); + $sendtouserid[] = $val; } } } + $sendto=implode(',',$tmparray); // Define $sendtocc @@ -222,15 +223,15 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO } } if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { - $receiveruser=$_POST['receiveccruser']; + $receiverccuser=$_POST['receiverccuser']; - if (is_array($receiveruser) && count($receiveruser)>0) + if (is_array($receiverccuser) && count($receiverccuser)>0) { $fuserdest = new User($db); - foreach($receiveruser as $key=>$val) + foreach($receiverccuser as $key=>$val) { - $tmparray[] = $fuserdest->user_get_property($key,'email'); - $sendtouserid[] = $key; + $tmparray[] = $fuserdest->user_get_property($val,'email'); + $sendtoccuserid[] = $val; } } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 555ad503693..5beae12a4fb 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -632,7 +632,7 @@ class FormMail extends Form if (! empty($this->withtouser) && is_array($this->withtouser) && !empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { $out.= ''; - $out.= $langs->trans("MailToSalaries"); + $out.= $langs->trans("MailToUsers"); $out.= ''; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time @@ -698,7 +698,7 @@ class FormMail extends Form if (! empty($this->withtoccuser) && is_array($this->withtoccuser) && !empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { $out.= ''; - $out.= $langs->trans("MailToCCSalaries"); + $out.= $langs->trans("MailToCCUsers"); $out.= ''; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time @@ -1112,7 +1112,7 @@ class FormMail extends Form elseif ($type_template=='thirdparty') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentThirdparty"); } elseif ($type_template=='user') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentUser"); } elseif (!empty($type_template)) { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContent".ucfirst($type_template)); } - + $ret->label = 'default'; $ret->lang = $outputlangs->defaultlang; $ret->topic = ''; diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index b155e2e4208..e80dd03b623 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -11,9 +11,9 @@ MailFrom=Sender MailErrorsTo=Errors to MailReply=Reply to MailTo=Receiver(s) -MailToSalaries=To salarie(s) +MailToUsers=To user(s) MailCC=Copy to -MailToCCSalaries=Copy to salarie(s) +MailToCCUsers=Copy to users(s) MailCCC=Cached copy to MailTopic=EMail topic MailText=Message From d072c2eb5db9344889e0112f27260b7e56645586 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 May 2018 23:09:27 +0200 Subject: [PATCH 24/72] Fix turnover invoiced by vat rate and country. Use fiscal month start. --- htdocs/compta/stats/byratecountry.php | 101 ++++++++++++++++++-------- 1 file changed, 72 insertions(+), 29 deletions(-) diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index b2186633413..33649dd51e0 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -1,9 +1,5 @@ - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2006-2007, 2015 Yannick Warnier - * Copyright (C) 2014 Ferran Marcet +/* Copyright (C) 2018 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,8 +16,7 @@ */ /** - * \file htdocs/compta/tva/quadri_detail.php - * \ingroup tax + * \file htdocs/compta/stats/byratecountry.php * \brief VAT by rate */ @@ -240,15 +235,20 @@ print ''; print ''; print ''; print ''; -for($i = 1; $i <= 12; $i ++) { - print ''; +$i=0; +while($i < 12) +{ + $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); + if ($j > 12) $j -= 12; + print ''; + $i++; } print ''; $sql = "SELECT fd.tva_tx AS vatrate,"; $sql .= " fd.product_type AS product_type,"; $sql .= " cc.label AS country,"; -for($i = 1; $i <= 12; $i ++) { +for ($i = 1; $i <= 12; $i ++) { $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; } $sql .= " SUM(fd.total_ht) as total"; @@ -271,31 +271,56 @@ dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - - while ( $row = $db->fetch_row($resql)) { - print ''; - if ($row[1] == 0) { + $totalpermonth = array(); + while ( $obj = $db->fetch_object($resql)) { + print ''; + if ($obj->product_type == 0) { print ''; } else { print ''; } - print ''; - - for($i = 3; $i <= 14; $i ++) { - print ''; + print ''; + for($i = 0; $i < 12; $i++) { + $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); + if ($j > 12) $j -= 12; + $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT); + print ''; + $totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj; } - print ''; + print ''; + $totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total; print ''; } $db->free($resql); + + // Total + print ''; + print ''; + print ''; + for($i = 0; $i < 12; $i++) { + $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); + if ($j > 12) $j -= 12; + $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT); + print ''; + } + print ''; + print ''; + } else { print $db->lasterror(); // Show last sql error } + + print ''; print ''; print ''; -for($i = 1; $i <= 12; $i ++) { - print ''; +$i=0; +while($i < 12) +{ + $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); + if ($j > 12) $j -= 12; + print ''; + $i++; } print ''; @@ -326,22 +351,40 @@ dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG); $resql2 = $db->query($sql2); if ($resql2) { $num = $db->num_rows($resql2); - - while ( $row = $db->fetch_row($resql2)) { - print ''; - if ($row[1] == 0) { + $totalpermonth = array(); + while ( $obj = $db->fetch_object($resql2)) { + print ''; + if ($obj->product_type == 0) { print ''; } else { print ''; } - print ''; - for($i = 3; $i <= 14; $i ++) { - print ''; + print ''; + for($i = 0; $i < 12; $i++) { + $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); + if ($j > 12) $j -= 12; + $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT); + print ''; + $totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj; } - print ''; + print ''; + $totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total; print ''; } $db->free($resql2); + + // Total + print ''; + print ''; + print ''; + for($i = 0; $i < 12; $i++) { + $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); + if ($j > 12) $j -= 12; + $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT); + print ''; + } + print ''; + print ''; } else { print $db->lasterror(); // Show last sql error } From a1c799507a5058640952bc6473746e05bc4346e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 May 2018 08:16:24 +0200 Subject: [PATCH 25/72] Fix $contactobject not always defined --- htdocs/compta/facture/card.php | 156 +++++++++--------- .../doc/doc_generic_order_odt.modules.php | 2 +- .../doc/doc_generic_contract_odt.modules.php | 2 +- .../doc/doc_generic_invoice_odt.modules.php | 2 +- .../doc/doc_generic_product_odt.modules.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 2 +- .../doc/doc_generic_proposal_odt.modules.php | 2 +- .../doc/doc_generic_stock_odt.modules.php | 2 +- 8 files changed, 85 insertions(+), 85 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ff3e7f3c407..476319fcdea 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -943,13 +943,13 @@ if (empty($reshook)) if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { $fk_parent_line = 0; } - - - - + + + + if($facture_source->type == Facture::TYPE_SITUATION) { - + if(!empty($facture_source->tab_previous_situation_invoice)) { // search the last invoice in cycle @@ -962,40 +962,40 @@ if (empty($reshook)) $searchPreviousInvoice=false; // find, exit; break; } - else + else { - $lineIndex--; // go to previous invoice in cycle + $lineIndex--; // go to previous invoice in cycle } } - - + + $maxPrevSituationPercent = 0; foreach($facture_source->tab_previous_situation_invoice[$lineIndex]->lines as $prevLine) { if($prevLine->id == $line->fk_prev_id) { $maxPrevSituationPercent = max($maxPrevSituationPercent,$prevLine->situation_percent); - + //$line->subprice = $line->subprice - $prevLine->subprice; $line->total_ht = $line->total_ht - $prevLine->total_ht; $line->total_tva = $line->total_tva - $prevLine->total_tva; $line->total_ttc = $line->total_ttc - $prevLine->total_ttc; $line->total_localtax1 = $line->total_localtax1 - $prevLine->total_localtax1; $line->total_localtax2 = $line->total_localtax2 - $prevLine->total_localtax2; - + $line->multicurrency_subprice = $line->multicurrency_subprice - $prevLine->multicurrency_subprice; $line->multicurrency_total_ht = $line->multicurrency_total_ht - $prevLine->multicurrency_total_ht; $line->multicurrency_total_tva = $line->multicurrency_total_tva - $prevLine->multicurrency_total_tva; $line->multicurrency_total_ttc = $line->multicurrency_total_ttc - $prevLine->multicurrency_total_ttc; - - + + } } - + // prorata $line->situation_percent = $maxPrevSituationPercent - $line->situation_percent; - - + + } } @@ -1524,7 +1524,7 @@ if (empty($reshook)) $line->origin = $object->origin; $line->origin_id = $line->id; $line->fetch_optionals($line->id); - + // Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée if ($line->fk_remise_except) { @@ -2201,12 +2201,12 @@ if (empty($reshook)) header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); // Pour reaffichage de la fiche en cours d'edition exit(); } - - // Outing situation invoice from cycle + + // Outing situation invoice from cycle elseif ($action == 'confirm_situationout' && $confirm == 'yes' && $user->rights->facture->creer) { $object->fetch($id,'', '','', true); - + if ($object->statut == Facture::STATUS_VALIDATED && $object->type == Facture::TYPE_SITUATION && $user->rights->facture->creer @@ -2214,20 +2214,20 @@ if (empty($reshook)) && $object->is_last_in_cycle() && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) - ) + ) { $outingError = 0; $newCycle = $object->newCycle(); // we need to keep the "situation behavior" so we place it on a new situation cycle if($newCycle > 1) { - // Search credit notes + // Search credit notes $lastCycle = $object->situation_cycle_ref; $lastSituationCounter = $object->situation_counter; $linkedCreditNotesList = array(); - + if (count($object->tab_next_situation_invoice) > 0) { foreach ($object->tab_next_situation_invoice as $next_invoice) { - if($next_invoice->type == Facture::TYPE_CREDIT_NOTE + if($next_invoice->type == Facture::TYPE_CREDIT_NOTE && $next_invoice->situation_counter == $object->situation_counter && $next_invoice->fk_facture_source == $object->id ) @@ -2236,7 +2236,7 @@ if (empty($reshook)) } } } - + $object->situation_cycle_ref = $newCycle; $object->situation_counter = 1; $object->situation_final = 0; @@ -2251,18 +2251,18 @@ if (empty($reshook)) $sql.= ' , situation_final=0'; $sql.= ' , situation_counter='.$object->situation_counter; $sql.= ' WHERE rowid IN ('.implode(',',$linkedCreditNotesList).')'; - + $resql=$db->query($sql); if (!$resql) $errors++; - + // Change each progression persent on each lines foreach($object->lines as $line) { - + // no traitement for special product if ($line->product_type == 9 ) continue; - - + + if(!empty($object->tab_previous_situation_invoice)) { // search the last invoice in cycle @@ -2280,8 +2280,8 @@ if (empty($reshook)) $lineIndex--; // go to previous invoice in cycle } } - - + + $maxPrevSituationPercent = 0; foreach($object->tab_previous_situation_invoice[$lineIndex]->lines as $prevLine) { @@ -2290,19 +2290,19 @@ if (empty($reshook)) $maxPrevSituationPercent = max($maxPrevSituationPercent,$prevLine->situation_percent); } } - - + + $line->situation_percent = $line->situation_percent - $maxPrevSituationPercent; - + if($line->update()<0) $errors++; - + } } } - + if (!$errors) { - setEventMessages($langs->trans('Updated')); + setEventMessages($langs->trans('Updated'), '', 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); } else @@ -2310,7 +2310,7 @@ if (empty($reshook)) setEventMessages($langs->trans('ErrorOutingSituationInvoiceCreditNote'), array(), 'errors'); } } - else + else { setEventMessages($langs->trans('ErrorOutingSituationInvoiceOnUpdate'), array(), 'errors'); } @@ -2331,7 +2331,7 @@ if (empty($reshook)) $fromElement = GETPOST('fromelement'); $fromElementid = GETPOST('fromelementid'); $importLines = GETPOST('line_checkbox'); - + if(!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) { if($fromElement == 'commande') @@ -2383,27 +2383,27 @@ if (empty($reshook)) $fk_prev_id = ''; $fk_unit = $originLine->fk_unit; $pu_ht_devise = $originLine->multicurrency_subprice; - + $res = $object->addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $ventil, $info_bits, $fk_remise_except, $price_base_type, $pu_ttc, $type, $rang, $special_code, $origin, $origin_id, $fk_parent_line, $fk_fournprice, $pa_ht, $label, $array_options, $situation_percent, $fk_prev_id, $fk_unit,$pu_ht_devise); - + if($res > 0){ $importCount++; }else{ $error++; } } - else{ - $error++; + else{ + $error++; } } - + if($error) { setEventMessage($langs->trans('ErrorsOnXLines',$error), 'errors'); } } } - + // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; @@ -3357,7 +3357,7 @@ else if ($id > 0 || ! empty($ref)) $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', 'no', 1); } } - + // Confirmation to remove invoice from cycle if ($action == 'situationout') { $text = $langs->trans('ConfirmRemoveSituationFromCycle', $object->ref); @@ -3857,10 +3857,10 @@ else if ($id > 0 || ! empty($ref)) print ""; print ''; - - - + + + // Incoterms if (!empty($conf->incoterm->enabled)) @@ -4022,10 +4022,10 @@ else if ($id > 0 || ! empty($ref)) // List of previous situation invoices if (($object->situation_cycle_ref > 0) && ! empty($conf->global->INVOICE_USE_SITUATION)) { - + print '
' . $langs->trans("TurnoverbyVatrate") . '' . $langs->trans("ProductOrService") . '' . $langs->trans("Country") . '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("TotalHT") . '
' . vatrate($row[0]) . '
' . vatrate($obj->vatrate) . ''. $langs->trans("Product") . ''. $langs->trans("Service") . '' .$row[2] . '' . price($row[$i]) . '' .$obj->country . '' . price($obj->$monthj) . '' . price($row[15]) . '' . price($obj->total) . '
' . price($totalpermonth[$j]) . '' . price($totalpermonth['total']) . '
' . $langs->trans("PurchasebyVatrate") . '' . $langs->trans("ProductOrService") . '' . $langs->trans("Country") . '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("TotalHT") . '
' . vatrate($row[0]) . '
' . vatrate($obj->vatrate) . ''. $langs->trans("Product") . ''. $langs->trans("Service") . '' . $row[2] . '' . price($row[$i]) . '' . $obj->country . '' . price($obj->$monthj) . '' . price($row[15]) . '' . price($obj->total) . '
' . price($totalpermonth[$j]) . '' . price($totalpermonth['total']) . '
'; - - + + print ''; print ''; print ''; @@ -4035,14 +4035,14 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - - + + $total_prev_ht = $total_prev_ttc = 0; $total_global_ht = $total_global_ttc = 0; - + if (count($object->tab_previous_situation_invoice) > 0) { // List of previous invoices - + $current_situation_counter = array(); foreach ($object->tab_previous_situation_invoice as $prev_invoice) { $totalpaye = $prev_invoice->getSommePaiement(); @@ -4060,8 +4060,8 @@ else if ($id > 0 || ! empty($ref)) print ''; } } - - + + $total_global_ht += $total_prev_ht ; $total_global_ttc += $total_prev_ttc ; $total_global_ht += $object->total_ht; @@ -4076,8 +4076,8 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - - + + print ''; print ''; print ''; print ''; print ''; - - + + if (count($object->tab_next_situation_invoice) > 0) { // List of next invoices /*print ''; @@ -4109,14 +4109,14 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print '';*/ - + $total_next_ht = $total_next_ttc = 0; - + foreach ($object->tab_next_situation_invoice as $next_invoice) { $totalpaye = $next_invoice->getSommePaiement(); $total_next_ht += $next_invoice->total_ht; $total_next_ttc += $next_invoice->total_ttc; - + print ''; print ''; print ''; @@ -4126,12 +4126,12 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + } - + $total_global_ht += $total_next_ht; $total_global_ttc += $total_next_ttc; - + print ''; print ''; if (! empty($conf->banque->enabled)) print ''; @@ -4140,7 +4140,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; } - + print '
' . $langs->trans('ListOfSituationInvoices') . '' . $langs->trans('AmountTTC') . ' 
' . price($object->total_ttc) . '' . $object->getLibStatut(3, $object->getSommePaiement()) . '
' . $langs->trans('CurrentSituationTotal') . ''; @@ -4096,8 +4096,8 @@ else if ($id > 0 || ! empty($ref)) print '' . price($total_global_ttc) . ' 
' . $langs->trans('AmountTTC') . ' 
' . $next_invoice->getNomUrl(1) . '' . price($next_invoice->total_ttc) . '' . $next_invoice->getLibStatut(3, $totalpaye) . '
 
'; } @@ -4712,9 +4712,9 @@ else if ($id > 0 || ! empty($ref)) print ''; } else { print '
' . $langs->trans("CreateCreditNote") . '
'; - } + } } - + // remove situation from cycle if ($object->statut == Facture::STATUS_VALIDATED && $object->type == Facture::TYPE_SITUATION @@ -4730,12 +4730,12 @@ else if ($id > 0 || ! empty($ref)) { print ''; } - else + else { print ''; } } - + // Create next situation invoice if ($user->rights->facture->creer && ($object->type == 5) && ($object->statut == 1 || $object->statut == 2)) { if ($object->is_last_in_cycle() && $object->situation_final != 1) { @@ -4804,16 +4804,16 @@ else if ($id > 0 || ! empty($ref)) // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice')); - + $compatibleImportElementsList = false; - if($user->rights->facture->creer - && $object->statut == Facture::STATUS_DRAFT + if($user->rights->facture->creer + && $object->statut == Facture::STATUS_DRAFT && ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) ) { $compatibleImportElementsList = array('commande','propal'); // import from linked elements } $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem,$compatibleImportElementsList); - + // Show online payment link $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 8178af40c37..a7268ee0ea3 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -364,7 +364,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in order as contact_xxx tags $array_thirdparty_contact = array(); - if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); + if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 98b644c8cce..99eb9feb2ea 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -304,7 +304,7 @@ class doc_generic_contract_odt extends ModelePDFContract $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in contract as contact_xxx tags $array_thirdparty_contact = array(); - if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); + if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); $substitutionarray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); complete_substitutions_array($substitutionarray, $outputlangs, $object); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 6d9d5172a7f..79741886119 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -372,7 +372,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in invoice as contact_xxx tags $array_thirdparty_contact = array(); - if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); + if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 6c5fa8652f9..f63d62149eb 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -381,7 +381,7 @@ class doc_generic_product_odt extends ModelePDFProduct $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in product as contact_xxx tags $array_thirdparty_contact = array(); - if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); + if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 5c0d025252e..35cbed4acf4 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -579,7 +579,7 @@ class doc_generic_project_odt extends ModelePDFProjects $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in project as contact_xxx tags $array_project_contact = array(); - if ($usecontact) $array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); + if ($usecontact && is_object($contactobject)) $array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_project_contact); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 0b71e9e862f..589d2d006c2 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -395,7 +395,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in proposal as contact_xxx tags $array_thirdparty_contact = array(); - if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); + if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 0cadf3362d4..d7ceffaaf72 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -381,7 +381,7 @@ class doc_generic_stock_odt extends ModelePDFStock $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in stock as contact_xxx tags $array_thirdparty_contact = array(); - if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); + if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); From f58e0d3bcfb5be14fa34d8da3d67480bfd017144 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 May 2018 08:24:20 +0200 Subject: [PATCH 26/72] Fix scrutinizer errors --- .../class/fournisseur.commande.class.php | 3 ++- .../fourn/class/fournisseur.facture.class.php | 3 ++- .../class/supplier_proposal.class.php | 19 +++++++++++-------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index de09e800ede..7f74c02a115 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -573,9 +573,10 @@ class CommandeFournisseur extends CommonOrder */ function LibStatut($statut,$mode=0,$billed=0) { + global $conf, $langs; + if (empty($this->statuts) || empty($this->statutshort)) { - global $conf, $langs; $langs->load('orders'); $this->statuts[0] = 'StatusOrderDraft'; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 6b4c45eafad..b10be70dd40 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1521,8 +1521,9 @@ class FactureFournisseur extends CommonInvoice { $product_type = $prod->type; $label = $prod->label; + $fk_prod_fourn_price = 0; - // We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok. + // We use 'none' instead of $ref_supplier, because $ref_supplier may not exists anymore. So we will take the first supplier price ok. // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. $result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc if ($result > 0) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 31a89ab332e..4b012e31c2d 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -72,7 +72,8 @@ class SupplierProposal extends CommonObject * @see user_author_id */ var $author; - var $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande + var $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande + var $ref_supplier; //Reference saisie lors de l'ajout d'une ligne à la demande var $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (processed/billed) var $date; // Date of proposal var $date_livraison; @@ -350,7 +351,7 @@ class SupplierProposal extends CommonObject * @param int $pa_ht Buying price without tax * @param string $label ??? * @param array $array_option extrafields array - * @param string $ref_fourn Supplier price reference + * @param string $ref_supplier Supplier price reference * @param int $fk_unit Id of the unit to use. * @param string $origin 'order', 'supplier_proposal', ... * @param int $origin_id Id of origin line @@ -359,7 +360,7 @@ class SupplierProposal extends CommonObject * * @see add_product */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$array_option=0, $ref_fourn='', $fk_unit='', $origin='', $origin_id=0, $pu_ht_devise=0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$array_option=0, $ref_supplier='', $fk_unit='', $origin='', $origin_id=0, $pu_ht_devise=0) { global $mysoc, $conf; @@ -409,6 +410,7 @@ class SupplierProposal extends CommonObject { $product_type = $prod->type; $label = $prod->label; + $fk_prod_fourn_price = $fk_fournprice; // We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok. // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. @@ -532,7 +534,7 @@ class SupplierProposal extends CommonObject $this->line->fk_unit=$fk_unit; $this->line->origin=$origin; $this->line->origin_id=$origin_id; - $this->line->ref_fourn = $this->db->escape($ref_fourn); + $this->line->ref_fourn = $this->db->escape($ref_supplier); // infos marge if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) { @@ -616,11 +618,11 @@ class SupplierProposal extends CommonObject * @param string $label ??? * @param int $type 0/1=Product/service * @param array $array_option extrafields array - * @param string $ref_fourn Supplier price reference + * @param string $ref_supplier Supplier price reference * @param int $fk_unit Id of the unit to use. * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $array_option=0, $ref_fourn='', $fk_unit='') + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $array_option=0, $ref_supplier='', $fk_unit='') { global $conf,$user,$langs, $mysoc; @@ -706,7 +708,7 @@ class SupplierProposal extends CommonObject $this->line->special_code = $special_code; $this->line->fk_parent_line = $fk_parent_line; $this->line->skip_update_total = $skip_update_total; - $this->line->ref_fourn = $ref_fourn; + $this->line->ref_fourn = $ref_supplier; $this->line->fk_unit = $fk_unit; // infos marge @@ -2730,7 +2732,8 @@ class SupplierProposalLine extends CommonObjectLine var $skip_update_total; // Skip update price total for special lines - var $ref_fourn; + var $ref_fourn; + var $ref_supplier; // Multicurrency var $fk_multicurrency; From 734ecbc9b5051aff233f73cdc8910e94a791dc6b Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Wed, 23 May 2018 09:47:29 +0200 Subject: [PATCH 27/72] FIX : Fetch shipping will now fetch project id --- htdocs/expedition/class/expedition.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index bccfba4446d..fa16f7f6ae5 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -487,7 +487,7 @@ class Expedition extends CommonObject $sql.= ", e.fk_shipping_method, e.tracking_number"; $sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= ", e.note_private, e.note_public"; - $sql.= ', e.fk_incoterms, e.location_incoterms'; + $sql.= ', e.fk_incoterms, e.location_incoterms, e.fk_projet'; $sql.= ', i.libelle as libelle_incoterms'; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'"; @@ -526,6 +526,7 @@ class Expedition extends CommonObject $this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility $this->origin_id = $obj->origin_id; $this->billed = ($obj->fk_statut==2?1:0); + $this->fk_project = $obj->fk_projet; $this->trueWeight = $obj->weight; $this->weight_units = $obj->weight_units; From 4bfd8b55398e46435122f738caa74ff5bb2f2cc5 Mon Sep 17 00:00:00 2001 From: All3kcis Date: Wed, 23 May 2018 10:38:24 +0200 Subject: [PATCH 28/72] Add oldcopy on productlot::update() --- htdocs/product/stock/class/productlot.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 6167a967199..8370e8ce080 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -300,6 +300,13 @@ class Productlot extends CommonObject // Check parameters // Put here code to add a control on parameters values + + if (empty($this->oldcopy)) + { + $org=new self($this->db); + $org->fetch($this->id); + $this->oldcopy=$org; + } // Update request $sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET'; From 111f3a964954ae7d42f72a98a966687074e7b50c Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 23 May 2018 11:11:33 +0200 Subject: [PATCH 29/72] FIX: pdf: overlap when linked elements and incoterms/public note displayed + port PR #8155 into supplier docs & contracts --- .../commande/doc/pdf_einstein.modules.php | 20 +++------- .../contract/doc/pdf_strato.modules.php | 13 ++----- .../modules/facture/doc/pdf_crabe.modules.php | 20 +++------- .../modules/propale/doc/pdf_azur.modules.php | 20 +++------- .../pdf/pdf_canelle.modules.php | 37 +++++++++---------- .../pdf/pdf_muscadet.modules.php | 35 +++++++++--------- .../doc/pdf_aurore.modules.php | 30 +++++++-------- 7 files changed, 68 insertions(+), 107 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9fecdc277b5..334b9f0c12f 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -301,18 +301,14 @@ class pdf_einstein extends ModelePDFCommandes $tab_top = 90+$top_shift; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); - $tab_height = 130-$top_shift; - $tab_height_newpage = 150; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift; // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -323,8 +319,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6; - $height_incoterms += 4; + $tab_top = $nexY+6+$height_incoterms; } } @@ -343,10 +338,10 @@ class pdf_einstein extends ModelePDFCommandes } if ($notetoshow) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -354,12 +349,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 77904beac0b..59c04c29413 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -214,16 +214,14 @@ class pdf_strato extends ModelePDFContract $tab_top = 90; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; // Affiche notes if (! empty($object->note_public)) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -231,12 +229,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 88a47095b8c..1e4c4840d24 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -338,18 +338,14 @@ class pdf_crabe extends ModelePDFFactures $tab_top = 90+$top_shift; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); - $tab_height = 130-$top_shift; - $tab_height_newpage = 150; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift; // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -360,8 +356,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6; - $height_incoterms += 4; + $tab_top = $nexY+6+$height_incoterms; } } @@ -380,10 +375,10 @@ class pdf_crabe extends ModelePDFFactures } if ($notetoshow) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -391,12 +386,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 03d0db86d8f..4048a19b1fd 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -337,18 +337,14 @@ class pdf_azur extends ModelePDFPropales $tab_top = 90+$top_shift; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); - $tab_height = 130-$top_shift; - $tab_height_newpage = 150; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift; // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -359,8 +355,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6; - $height_incoterms += 4; + $tab_top = $nexY+6+$height_incoterms; } } @@ -387,10 +382,10 @@ class pdf_azur extends ModelePDFPropales } if ($notetoshow) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -398,12 +393,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 11951e90207..c84c76e0ad7 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -260,24 +260,21 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90+$top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -288,18 +285,17 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6; - $height_incoterms += 4; + $tab_top = $nexY+6+$height_incoterms; } } // Affiche notes if (! empty($object->note_public)) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -307,12 +303,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; @@ -1080,8 +1071,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $posy+=1; $pdf->SetTextColor(0,0,60); + $top_shift = 0; // Show list of linked objects + $current_y = $pdf->getY(); $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) + { + $top_shift = $pdf->getY() - $current_y; + } if ($showaddress) { @@ -1098,7 +1095,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender - $posy=42; + $posy=42+$top_shift; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; @@ -1150,7 +1147,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Show recipient $widthrecbox=100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; + $posy=42+$top_shift; $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; @@ -1173,6 +1170,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } + + return $top_shift; } /** diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index b70a299fa03..f3a102307ec 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -272,24 +272,21 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90+$top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -300,18 +297,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6; - $height_incoterms += 4; + $tab_top = $nexY+6+$height_incoterms; } } // Affiche notes if (! empty($object->note_public)) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -319,13 +315,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; $tab_top = $nexY+6; } - else - { - $height_note=0; - } $iniY = $tab_top + 7; $curY = $tab_top + 7; @@ -1130,8 +1121,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $posy+=1; $pdf->SetTextColor(0,0,60); + $top_shift = 0; // Show list of linked objects + $current_y = $pdf->getY(); $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) + { + $top_shift = $pdf->getY() - $current_y; + } if ($showaddress) { @@ -1148,7 +1145,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender - $posy=42; + $posy=42+$top_shift; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; @@ -1200,7 +1197,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Show recipient $widthrecbox=100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; + $posy=42+$top_shift; $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; @@ -1223,6 +1220,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } + + return $top_shift; } /** diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index a6457dd7a2e..60a0b4808cc 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -289,15 +289,13 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90+$top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); // Affiche notes $notetoshow=empty($object->note_public)?'':$object->note_public; @@ -314,10 +312,10 @@ class pdf_aurore extends ModelePDFSupplierProposal } if ($notetoshow) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -325,12 +323,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; @@ -1300,8 +1293,14 @@ class pdf_aurore extends ModelePDFSupplierProposal $posy+=2; + $top_shift = 0; // Show list of linked objects + $current_y = $pdf->getY(); $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) + { + $top_shift = $pdf->getY() - $current_y; + } if ($showaddress) { @@ -1319,7 +1318,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender - $posy=42; + $posy=42+$top_shift; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; @@ -1373,7 +1372,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Show recipient $widthrecbox=100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; + $posy=42+$top_shift; $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; @@ -1396,6 +1395,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } $pdf->SetTextColor(0,0,0); + return $top_shift; } /** From be78c379858c14a3310ce6481a88fe6ed3df52db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 May 2018 11:37:12 +0200 Subject: [PATCH 30/72] Fix typo --- test/phpunit/WebservicesThirdpartyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index f974622e013..90698407527 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -203,7 +203,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase $parameters = array('authentication'=>$authentication, 'thirdparty'=>$body); print __METHOD__." call method ".$WS_METHOD."\n"; try { - $result = $this->soapclient->call($WS_METHOD,$parameters,$thid->ns,''); + $result = $this->soapclient->call($WS_METHOD,$parameters,$this->ns,''); } catch(SoapFault $exception) { echo $exception; $result=0; From efbb053e54fffa154a7ed515a54ee12c946b4d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 23 May 2018 17:05:08 +0200 Subject: [PATCH 31/72] PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES --- htdocs/comm/card.php | 2 +- htdocs/comm/propal/card.php | 23 ++++++++- htdocs/commande/card.php | 26 ++++++++-- htdocs/compta/facture/card.php | 25 +++++++++- htdocs/core/class/html.form.class.php | 9 ++-- htdocs/product/admin/product.php | 6 +-- htdocs/product/class/product.class.php | 68 +++++++++++++++++++++++++- htdocs/product/price.php | 41 ++++++++-------- 8 files changed, 164 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index eee4d529751..f74f9d777e8 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -436,7 +436,7 @@ if ($object->id > 0) // Multiprice level - if (! empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; print ''."\n"; */ $rowspan = 4; -if (! empty($conf->global->PRODUIT_MULTIPRICES)) $rowspan++; +if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $rowspan++; if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) $rowspan++; if (! empty($conf->global->MAIN_MULTILANGS)) $rowspan++; @@ -553,7 +553,7 @@ $current_rule = 'PRODUCT_PRICE_UNIQ'; if (!empty($conf->global->PRODUIT_MULTIPRICES)) $current_rule='PRODUIT_MULTIPRICES'; if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY'; if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES'; -if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) && (!empty($conf->global->PRODUIT_MULTIPRICES))) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'; +if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'; print $form->selectarray("princingrule",$select_pricing_rules,$current_rule); if ( empty($conf->multicompany->enabled)) { @@ -566,7 +566,7 @@ print ''; // multiprix nombre de prix a proposer -if (! empty($conf->global->PRODUIT_MULTIPRICES)) +if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2f36fd59035..291182ba475 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1665,7 +1665,7 @@ class Product extends CommonObject // If multiprices are enabled, then we check if the current product is subject to price autogeneration // Price will be modified ONLY when the first one is the one that is being modified - if (!empty($conf->global->PRODUIT_MULTIPRICES) && !$ignore_autogen && $this->price_autogen && ($level == 1)) + if ((!empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !$ignore_autogen && $this->price_autogen && ($level == 1)) { return $this->generateMultiprices($user, $newprice, $newpricebase, $newvat, $newnpr, $newpbq); } @@ -2088,7 +2088,71 @@ class Product extends CommonObject } else if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // prices per customer and quantity { - // Not yet implemented + for ($i=1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) + { + $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; + $sql.= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; + $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; + $sql.= " WHERE entity IN (".getEntity('productprice').")"; + $sql.= " AND price_level=".$i; + $sql.= " AND fk_product = ".$this->id; + $sql.= " ORDER BY date_price DESC, rowid DESC"; + $sql.= " LIMIT 1"; + $resql = $this->db->query($sql); + if ($resql) + { + $result = $this->db->fetch_array($resql); + + $this->multiprices[$i]=$result["price"]; + $this->multiprices_ttc[$i]=$result["price_ttc"]; + $this->multiprices_min[$i]=$result["price_min"]; + $this->multiprices_min_ttc[$i]=$result["price_min_ttc"]; + $this->multiprices_base_type[$i]=$result["price_base_type"]; + // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on + $this->multiprices_tva_tx[$i]=$result["tva_tx"]; // TODO Add ' ('.$result['default_vat_code'].')' + $this->multiprices_recuperableonly[$i]=$result["recuperableonly"]; + + // Price by quantity + $this->prices_by_qty[$i]=$result["price_by_qty"]; + $this->prices_by_qty_id[$i]=$result["rowid"]; + // Récuperation de la liste des prix selon qty si flag positionné + if ($this->prices_by_qty[$i] == 1) + { + $sql = "SELECT rowid, price, unitprice, quantity, remise_percent, remise, price_base_type"; + $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; + $sql.= " WHERE fk_product_price = ".$this->prices_by_qty_id[$i]; + $sql.= " ORDER BY quantity ASC"; + $resultat=array(); + $resql = $this->db->query($sql); + if ($resql) + { + $ii=0; + while ($result= $this->db->fetch_array($resql)) { + $resultat[$ii]=array(); + $resultat[$ii]["rowid"]=$result["rowid"]; + $resultat[$ii]["price"]= $result["price"]; + $resultat[$ii]["unitprice"]= $result["unitprice"]; + $resultat[$ii]["quantity"]= $result["quantity"]; + $resultat[$ii]["remise_percent"]= $result["remise_percent"]; + $resultat[$ii]["remise"]= $result["remise"]; // deprecated + $resultat[$ii]["price_base_type"]= $result["price_base_type"]; + $ii++; + } + $this->prices_by_qty_list[$i]=$resultat; + } + else + { + dol_print_error($this->db); + return -1; + } + } + } + else + { + dol_print_error($this->db); + return -1; + } + } } if (!empty($conf->dynamicprices->enabled) && !empty($this->fk_price_expression) && empty($ignore_expression)) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 61b6316ca01..672eede5552 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -72,7 +72,7 @@ if ($id > 0 || ! empty($ref)) } // Clean param -if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) $conf->global->PRODUIT_MULTIPRICES_LIMIT = 5; +if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) $conf->global->PRODUIT_MULTIPRICES_LIMIT = 5; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productpricecard','globalcard')); @@ -202,7 +202,7 @@ if (empty($reshook)) } // Multiprices - if (! $error && ! empty($conf->global->PRODUIT_MULTIPRICES)) { + if (! $error && (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { $newprice = GETPOST('price', 'array'); $newprice_min = GETPOST('price_min', 'array'); @@ -717,7 +717,7 @@ print '
'; print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 004b32a83fc..a2f4dcd1f5d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -848,7 +848,28 @@ if (empty($reshook)) // If price per quantity and customer elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - // TODO Same than PRODUIT_CUSTOMER_PRICES_BY_QTY but using $object->thirdparty->price_level + if ($prod->prices_by_qty[$object->thirdparty->price_level]) // yes, this product has some prices per quantity + { + // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. + $pqp = GETPOST('pbq','int'); + + // Search price into product_price_by_qty from $prod->id + foreach($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) + { + if ($priceforthequantityarray['rowid'] != $pqp) continue; + // We found the price + if ($priceforthequantityarray['price_base_type'] == 'HT') + { + $pu_ht = $priceforthequantityarray['unitprice']; + } + else + { + $pu_ttc = $priceforthequantityarray['unitprice']; + } + // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. + break; + } + } } $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 76a290a79cd..075f174e355 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -797,7 +797,27 @@ if (empty($reshook)) // If price per quantity and customer elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - // TODO Same than PRODUIT_CUSTOMER_PRICES_BY_QTY but using $object->thirdparty->price_level + if ($prod->prices_by_qty[$object->thirdparty->price_level]) // yes, this product has some prices per quantity + { + // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. + $pqp = GETPOST('pbq','int'); + // Search price into product_price_by_qty from $prod->id + foreach($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) + { + if ($priceforthequantityarray['rowid'] != $pqp) continue; + // We found the price + if ($priceforthequantityarray['price_base_type'] == 'HT') + { + $pu_ht = $priceforthequantityarray['unitprice']; + } + else + { + $pu_ttc = $priceforthequantityarray['unitprice']; + } + // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. + break; + } + } } $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); @@ -1018,8 +1038,8 @@ if (empty($reshook)) $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) - $price_min = $product->multiprices_min [$object->thirdparty->price_level]; + if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && ! empty($object->thirdparty->price_level)) + $price_min = $product->multiprices_min[$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dbce9c2e76d..a9769c04442 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1729,7 +1729,28 @@ if (empty($reshook)) // If price per quantity and customer elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - // TODO Same than PRODUIT_CUSTOMER_PRICES_BY_QTY but using $object->thirdparty->price_level + if ($prod->prices_by_qty[$object->thirdparty->price_level]) // yes, this product has some prices per quantity + { + // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. + $pqp = GETPOST('pbq','int'); + + // Search price into product_price_by_qty from $prod->id + foreach($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) + { + if ($priceforthequantityarray['rowid'] != $pqp) continue; + // We found the price + if ($priceforthequantityarray['price_base_type'] == 'HT') + { + $pu_ht = $priceforthequantityarray['unitprice']; + } + else + { + $pu_ttc = $priceforthequantityarray['unitprice']; + } + // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. + break; + } + } } $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); @@ -1978,7 +1999,7 @@ if (empty($reshook)) $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) + if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && ! empty($object->thirdparty->price_level)) $price_min = $product->multiprices_min [$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c02ada175fd..dddb5201f06 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1942,7 +1942,7 @@ class Form $selectFields.= ", label_translated"; } // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { $sql.= ", (SELECT pp.rowid FROM ".MAIN_DB_PREFIX."product_price as pp WHERE pp.fk_product = p.rowid"; if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $sql.= " AND price_level=".$price_level; @@ -2063,7 +2063,7 @@ class Form $optJson = array(); $objp = $this->db->fetch_object($result); - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) + if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; @@ -2212,7 +2212,8 @@ class Form $found=0; // Multiprice - if (empty($hidepriceinlabel) && $price_level >= 1 && $conf->global->PRODUIT_MULTIPRICES) // If we need a particular price level (from 1 to 6) + // If we need a particular price level (from 1 to 6) + if (empty($hidepriceinlabel) && $price_level >= 1 && (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { $sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; @@ -2253,7 +2254,7 @@ class Form } // Price by quantity - if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1 && ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) + if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1 && (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { $found = 1; $outqty=$objp->quantity; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 3ff76dd1f82..63f10296212 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -541,7 +541,7 @@ print ' 
'; // Price per customer segment/level -if (! empty($conf->global->PRODUIT_MULTIPRICES)) +if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { // Price and min price are variable (depends on level of company). if (! empty($socid)) @@ -880,10 +880,11 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) // TODO Fix the form included into a tr instead of a td + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // TODO Fix the form included into a tr instead of a td { print '
' . $langs->trans("PriceByQuantity") . ' ' . $i; - print ''; + if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); + print ''; if ($object->prices_by_qty[$i] == 1) { print ''; @@ -935,9 +936,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; // id in product_price print ''; print ''; - print ''; - // print ''; - print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -991,7 +992,7 @@ else print ''; // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) // TODO Fix the form inside tr instead of td + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // TODO Fix the form inside tr instead of td { print ''; print ''; - if (! empty($conf->global->PRODUIT_MULTIPRICES)) { + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; } - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; } print ''; print $conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) print ''; print ''; print ''; if (! empty($conf->dynamicprices->enabled)) { @@ -1502,11 +1503,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ print ""; // Price level - if (! empty($conf->global->PRODUIT_MULTIPRICES)) { + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print '"; } // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { $type = ($objp->price_by_qty == 1) ? 'PriceByQuantity' : 'Standard'; print '"; @@ -1518,7 +1519,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ } print ""; - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; print ''; - $var = true; if ($num > 0) { $i = 0; @@ -411,7 +406,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande print ''; print ''; - $var = true; if ($num > 0) { $i = 0; @@ -528,7 +522,6 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) print ''; $i++; - } $db->free($resql); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 8db5308bf3f..7bdb6220493 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -88,8 +88,6 @@ if ($resql) $i = 0; if ($num > 0 ) { - $var=true; - print '
 ' . $object->price_base_type . '  % ' . $object->price_base_type . '  %
' . $langs->trans("PriceByQuantity"); if ($object->prices_by_qty[0] == 0) { @@ -1108,7 +1109,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ { print "\n" . '
' . "\n"; - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; @@ -1122,7 +1123,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ } } - if (! empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; @@ -1177,7 +1178,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print load_fiche_titre($langs->trans("NewPrice"), ''); - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''."\n"; print '
'; @@ -1322,7 +1323,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) //dol_fiche_head('', '', '', -1); - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($conf->global->PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL)) { + if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && ! empty($conf->global->PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL)) { print $langs->trans('UseMultipriceRules'). ' price_autogen ? 'checked' : '').'>

'; } @@ -1468,16 +1469,16 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ print '
' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceLevel") . '' . $langs->trans("Type") . '' . $langs->trans("PriceBase") . '' . $langs->trans("DefaultTaxRate") . '' . $langs->trans("DefaultTaxRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '" . dol_print_date($db->jdate($objp->dp), "dayhour") . "' . $objp->price_level . "' . $langs->trans($type) . "'; @@ -1586,7 +1587,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ if ($user->rights->produit->supprimer) { $candelete=0; - if (! empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if (empty($notfirstlineforlevel[$objp->price_level])) $notfirstlineforlevel[$objp->price_level]=1; else $candelete=1; From 1b69c2357f0080d2447d6295af8a591c742716be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 23 May 2018 17:16:58 +0200 Subject: [PATCH 32/72] typo --- htdocs/modulebuilder/template/admin/about.php | 2 +- htdocs/modulebuilder/template/admin/setup.php | 2 +- htdocs/modulebuilder/template/css/mymodule.css.php | 2 +- htdocs/modulebuilder/template/js/mymodule.js.php | 2 +- htdocs/modulebuilder/template/mymoduleindex.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/modulebuilder/template/myobject_document.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/modulebuilder/template/myobject_note.php | 2 +- htdocs/modulebuilder/template/scripts/myobject.php | 2 +- htdocs/website/websiteaccount_card.php | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php index c34574791c1..b72917daff0 100644 --- a/htdocs/modulebuilder/template/admin/about.php +++ b/htdocs/modulebuilder/template/admin/about.php @@ -26,7 +26,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 58a572a42ac..ba12425d4f4 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -26,7 +26,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index cd9a4b6035b..5787fa4f64c 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -36,7 +36,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/js/mymodule.js.php b/htdocs/modulebuilder/template/js/mymodule.js.php index b9ca46e652e..07f44756615 100644 --- a/htdocs/modulebuilder/template/js/mymodule.js.php +++ b/htdocs/modulebuilder/template/js/mymodule.js.php @@ -39,7 +39,7 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 8073d31fd60..0b9eb9bf7ee 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -28,7 +28,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 3fafc181c5a..38f462a93c7 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -26,7 +26,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 48a039e4edf..5e7612053c6 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -46,7 +46,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 905f16d8780..124fa031487 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -26,7 +26,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 8d4cf6439a4..eeeda4e3021 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -44,7 +44,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index 3cb6a5791b3..4ee7e9fb861 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -26,7 +26,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); diff --git a/htdocs/modulebuilder/template/scripts/myobject.php b/htdocs/modulebuilder/template/scripts/myobject.php index c2be67451cb..0aad12e2e35 100755 --- a/htdocs/modulebuilder/template/scripts/myobject.php +++ b/htdocs/modulebuilder/template/scripts/myobject.php @@ -44,7 +44,7 @@ define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to // Load Dolibarr environment $res=0; -// Try master.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try master.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/master.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/master.inc.php"); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 15ced283957..3f684952f87 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -25,7 +25,7 @@ $res=0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); From d1d8494666011a68165701121005e6da73e4bc8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 May 2018 17:48:18 +0200 Subject: [PATCH 33/72] FIX Missing extrafields in export --- htdocs/core/modules/modProduct.class.php | 9 +++++---- htdocs/core/modules/modStock.class.php | 3 ++- htdocs/exports/export.php | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index e747f05b3f6..5cd66208ec9 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -162,8 +162,10 @@ class modProduct extends DolibarrModules if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue')); if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode')); - if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.unitprice'=>'BuyingPrice','pf.quantity'=>'QtyMin','pf.remise_percent'=>'DiscountQtyMin')); if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice')); + $keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.quantity'=>'QtyMin','pf.remise_percent'=>'DiscountQtyMin','pf.unitprice'=>'BuyingPrice')); if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories')); if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote')); if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; @@ -177,10 +179,8 @@ class modProduct extends DolibarrModules if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array("group_concat(cat.label)"=>'category')); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product')); if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product')); - if (! empty($conf->fournisseur->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('s.nom'=>'company','pf.ref_fourn'=>'product','pf.unitprice'=>'product')); + if (! empty($conf->fournisseur->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('s.nom'=>'product_supplier_ref','pf.ref_fourn'=>'product_supplier_ref','pf.unitprice'=>'product_supplier_ref','pf.quantity'=>'product_supplier_ref','pf.remise_percent'=>'product_supplier_ref')); if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('l.lang'=>'translation', 'l.label'=>'translation','l.description'=>'translation','l.note'=>'translation')); - $keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra'; - include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_dependencies_array[$r]=array('category'=>'p.rowid'); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p'; @@ -221,6 +221,7 @@ class modProduct extends DolibarrModules if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) { + // Exports virtual products $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="AssociatedProducts"; // Translation key (used only if key ExportDataset_xxx_z not found) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index daeb948fe4a..654801007a2 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -173,11 +173,12 @@ class modStock extends DolibarrModules $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.ref'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','p.pmp'=>'product','p.cost_price'=>'product','ps.reel'=>'stock'); $this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. + $keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e'; $this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid'; $this->export_sql_end[$r] .=' AND e.entity IN ('.getEntity('stock').')'; - if ($conf->productbatch->enabled) { $langs->load("productbatch"); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index a21dcdce7a6..ec11f9c1771 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -63,7 +63,8 @@ $entitytoicon = array( 'product' => 'product', 'virtualproduct'=>'product', 'subproduct' => 'product', - 'warehouse' => 'stock', + 'product_supplier_ref' => 'product', + 'warehouse' => 'stock', 'batch' => 'stock', 'stockbatch' => 'stock', 'category' => 'category', @@ -98,7 +99,8 @@ $entitytolang = array( 'product' => 'Product', 'virtualproduct' => 'AssociatedProducts', 'subproduct' => 'SubProduct', - 'service' => 'Service', + 'product_supplier_ref' => 'SupplierPrices', + 'service' => 'Service', 'stock' => 'Stock', 'movement' => 'StockMovement', 'batch' => 'Batch', From 3a06918b167996a79334a9c2fa76f62dd65a0874 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 May 2018 18:00:27 +0200 Subject: [PATCH 34/72] FIX Missing extrafields in export of stock or products --- htdocs/core/modules/modStock.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 654801007a2..1c0393b3653 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -168,19 +168,22 @@ class modStock extends DolibarrModules $this->export_code[$r]=$this->rights_class; $this->export_label[$r]="WarehousesAndProducts"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("stock","lire")); - $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.ref'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','p.pmp'=>'PMPValue','p.cost_price'=>'CostPrice','ps.reel'=>'Stock'); + $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.ref'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','p.pmp'=>'PMPValue','p.cost_price'=>'CostPrice'); $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','p.pmp'=>'Numeric','p.cost_price'=>'Numeric','ps.reel'=>'Numeric'); $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.ref'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','p.pmp'=>'product','p.cost_price'=>'product','ps.reel'=>'stock'); $this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. $keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('ps.reel'=>'Stock')); + $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e'; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON extra.fk_object = p.rowid, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e'; $this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid'; $this->export_sql_end[$r] .=' AND e.entity IN ('.getEntity('stock').')'; if ($conf->productbatch->enabled) { + // Export of stock including lot number $langs->load("productbatch"); // This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch @@ -205,6 +208,7 @@ class modStock extends DolibarrModules $this->export_sql_end[$r] .=' AND e.entity IN ('.getEntity('stock').')'; } + // Export of stock movement $r++; $this->export_code[$r]=$this->rights_class.'_movement'; $this->export_label[$r]="StockMovements"; // Translation key (used only if key ExportDataset_xxx_z not found) From 4967c678b8eb3386bc2cd4fe07907e4dab6a2f08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 May 2018 18:05:19 +0200 Subject: [PATCH 35/72] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ed2c27fc004..9f8d8a129ce 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1505,7 +1505,7 @@ OSCommerceTestOk=Connection to server '%s' on database '%s' with user '%s' succe OSCommerceTestKo1=Connection to server '%s' succeed but database '%s' could not be reached. OSCommerceTestKo2=Connection to server '%s' with user '%s' failed. ##### Stock ##### -StockSetup=Warehouse module setup +StockSetup=Stock module setup IfYouUsePointOfSaleCheckModule=If you use a Point of Sale module (POS module provided by default or another external module), this setup may be ignored by your Point Of Sale module. Most point of sales modules are designed to create immediatly an invoice and decrease stock by default whatever are options here. So, if you need or not to have a stock decrease when registering a sell from your Point Of Sale, check also your POS module set up. ##### Menu ##### MenuDeleted=Menu deleted From 3f24f5ef78d3d6bb2c3270eabd5b612911ec8dcd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 May 2018 18:19:59 +0200 Subject: [PATCH 36/72] Fix css --- htdocs/holiday/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index c5ea7c868e0..8521beac4f1 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Laurent Destailleur + * Copyright (C) 2013-2018 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -410,14 +410,14 @@ print ''; -print ''; // Create date print ''; @@ -487,13 +487,13 @@ print ''; // Start date print ''; // End date print ''; From eb224e43a5d67d3656f547da822704e802a04b4d Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 24 May 2018 10:41:24 +0200 Subject: [PATCH 37/72] FIX missing filters during ordering --- htdocs/comm/propal/list.php | 1 + htdocs/commande/list.php | 7 +++++++ htdocs/compta/facture/list.php | 3 +++ htdocs/expedition/list.php | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 480ad7f4fda..72491e90e3e 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -384,6 +384,7 @@ if ($resql) if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($socid > 0) $param.='&socid='.urlencode($socid); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_product_category != '') $param.='&search_product_category='.$search_product_category; // Add $param from extra fields foreach ($search_array_options as $key => $val) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 86a5f463840..6284e53aa5c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -627,6 +627,13 @@ if ($resql) if ($show_files) $param.='&show_files=' .$show_files; if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($billed != '') $param.='&billed='.$billed; + if ($search_town != '')$param .= '&search_town='.$search_town; + if ($search_zip != '')$param .= '&search_zip='.$search_zip; + if ($search_state != '')$param .= '&search_state='.$search_state; + if ($search_country != '')$param .= '&search_country='.$search_country; + if ($search_type_thirdparty != '')$param .= '&search_type_thirdparty='.$search_type_thirdparty; + if ($search_product_category != '')$param .= '&search_product_category='.$search_product_category; + // Add $param from extra fields foreach ($search_array_options as $key => $val) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d7f9384399f..994f1d93569 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -563,6 +563,9 @@ if ($resql) if ($show_files) $param.='&show_files=' .$show_files; if ($option) $param.="&option=".$option; if ($optioncss != '') $param.='&optioncss='.$optioncss; + if ($search_town)$param .= '&search_town='.urlencode($search_town); + if ($search_zip)$param .= '&search_zip='.urlencode($search_zip); + // Add $param from extra fields foreach ($search_array_options as $key => $val) { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 1a712b66650..819d4337788 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -51,6 +51,7 @@ $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); $search_billed=GETPOST("search_billed",'int'); $sall = GETPOST('sall', 'alphanohtml'); $optioncss = GETPOST('optioncss','alpha'); +$search_ref_customer=GETPOST("search_ref_customer"); $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); @@ -141,6 +142,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_billed=''; $viewstatut=''; $search_array_options=array(); + $search_ref_customer=''; } if (empty($reshook)) @@ -267,6 +269,10 @@ if ($resql) if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv; if ($search_company) $param.= "&search_company=".$search_company; if ($optioncss != '') $param.='&optioncss='.$optioncss; + if ($search_town)$param .= '&search_town='.urlencode($search_town); + if ($search_zip)$param .= '&search_zip='.urlencode($search_zip); + if ($search_ref_customer)$param .= '&search_ref_customer='.$search_ref_customer; + if ($viewstatut != '')$param .= '&viewstatut='.$viewstatut; // Add $param from extra fields foreach ($search_array_options as $key => $val) { From 11b63325bf695d45486257bf936b4ebc83e207ae Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 24 May 2018 10:48:03 +0200 Subject: [PATCH 38/72] clean and update code --- htdocs/comm/index.php | 11 ++--------- htdocs/comm/prospect/index.php | 11 ++--------- htdocs/commande/customer.php | 8 ++------ htdocs/commande/orderstoinvoice.php | 7 +++---- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index eab813653d6..c818659683f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -37,8 +37,8 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn if (! $user->rights->societe->lire) accessforbidden(); -$langs->load("commercial"); -$langs->load("propal"); +// Load traductions files requiredby by page +$langs->loadLangs(array("commercial", "propal")); $action=GETPOST('action', 'alpha'); $bid=GETPOST('bid', 'int'); @@ -161,7 +161,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; print ''; - $var=true; if ($num > 0) { $i = 0; @@ -243,7 +242,6 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos print ''; print ''; - $var=true; if ($num > 0) { $i = 0; @@ -274,13 +272,11 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos } if ($total>0) { - print '"; } } else { - print ''; } print "
'; +print ''; print ''; print ''; -print ''; -$formother->select_year($search_year_create,'search_year_create',1, $min_year, 0); +print ''; +$formother->select_year($search_year_create, 'search_year_create', 1, $min_year, 0); print ' '; -print ''; +print ''; $formother->select_year($search_year_start,'search_year_start',1, $min_year, $max_year); print ''; -print ''; +print ''; $formother->select_year($search_year_end,'search_year_end',1, $min_year, $max_year); print '
'.$langs->trans("ProposalsDraft").($num?' '.$num.'':'').'
'.$langs->trans("SupplierProposalsDraft").($num?' '.$num.'':'').'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoProposal").'

"; @@ -323,7 +319,6 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print '
'.$langs->trans("DraftOrders").($num?' '.$num.'':'').'
'.$langs->trans("DraftSuppliersOrders").($num?' '.$num.'':'').'
'; print ''; print ''; @@ -126,8 +124,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $resql=$db->query($sql); if ($resql) { - $var=true; - $total=0; $num = $db->num_rows($resql); $i = 0; @@ -197,8 +193,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $i = 0; if ($num > 0) { - $var=true; - print '
'.$langs->trans("ProspectsByStatus").'
'; print ''; @@ -223,7 +217,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $i++; $total += $obj->price; } - if ($total>0) { + if ($total>0) + { print '"; } print "
'.$langs->trans("ProposalsOpened").'
'.$langs->trans("Total")."".price($total)."

"; @@ -255,8 +250,6 @@ if ($resql) $i = 0; if ($num > 0 ) { - $var=true; - print ''; print ''; diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 2d97b06238b..7a2d0be27b2 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -42,8 +42,8 @@ if ($user->societe_id > 0) if (! $user->rights->facture->creer) accessforbidden(); -$langs->load("companies"); -$langs->load("orders"); +// Load traductions files requiredby by page +$langs->loadLangs(array("companies", "orders")); $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -155,14 +155,10 @@ if ($resql) print "\n"; - $var=true; - while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - - print ''; print ''; } @@ -822,7 +782,7 @@ if ($resql) { // Product Ref print ''; } if (! empty($arrayfields['p.label']['checked'])) @@ -835,7 +795,7 @@ if ($resql) // Batch if (! empty($arrayfields['m.batch']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['pl.eatby']['checked'])) { @@ -914,10 +874,10 @@ if ($resql) print ''; } - + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - + // Fields from hook $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook @@ -957,7 +917,7 @@ if ($resql) if (! empty($arrayfields['origin']['checked'])) print_liste_field_titre($arrayfields['origin']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($arrayfields['m.value']['label'],$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['m.price']['checked'])) print_liste_field_titre($arrayfields['m.price']['label'],$_SERVER["PHP_SELF"], "m.price","",$param,'align="right"',$sortfield,$sortorder); - + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -1096,7 +1056,7 @@ if ($resql) { // Price print ''; } // Action column @@ -1156,10 +1116,12 @@ else dol_print_error($db); } + + /* * Documents generes */ - +/* Area for doc and last events of warehouse are stored on the main card of warehouse $modulepart='mouvement'; if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) @@ -1174,16 +1136,14 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) if(!empty($search_inventorycode)) $objectref.="_".$id."_".$search_inventorycode; if($search_type_mouvement) $objectref.="_".$search_type_mouvement; $relativepath = $comref . '/' . $objectref . '.pdf'; - $filedir = $conf->stock->dir_output . '/mouvement/' . $objectref; - + $filedir = $conf->stock->dir_output . '/movement/' . $objectref; + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id."&search_inventorycode=".$search_inventorycode."&search_type_mouvement=$search_type_mouvement"; $genallowed=$usercanread; $delallowed=$usercancreate; - + $genallowed=$user->rights->stock->mouvement->lire; $delallowed=$user->rights->stock->mouvement->creer; - - $var=true; print $formfile->showdocuments($modulepart,$objectref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); $somethingshown=$formfile->numoffiles; @@ -1203,6 +1163,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) print ''; } +*/ llxFooter(); From 1b237a75b9411b270664b874a7650d8d6947fa29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Thu, 24 May 2018 13:31:23 +0200 Subject: [PATCH 44/72] Update card.php --- htdocs/comm/action/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b89263bae01..eba1d77a03f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -417,6 +417,7 @@ if ($action == 'update') $object->location = GETPOST('location'); $object->socid = GETPOST("socid"); $socpeopleassigned = GETPOST("socpeopleassigned",'array'); + $object->socpeopleassigned = array(); foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid); $object->contactid = GETPOST("contactid",'int'); $object->fk_project = GETPOST("projectid",'int'); From 3adfce35e2338ebafbbae5df7257e433decc6f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Thu, 24 May 2018 13:32:13 +0200 Subject: [PATCH 45/72] Update card.php --- htdocs/comm/action/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 03152fce97b..a09214d7d26 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -413,6 +413,7 @@ if ($action == 'update') $object->location = GETPOST('location'); $object->socid = GETPOST("socid"); $socpeopleassigned = GETPOST("socpeopleassigned",'array'); + $object->socpeopleassigned = array(); foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid); $object->contactid = GETPOST("contactid",'int'); $object->fk_project = GETPOST("projectid",'int'); From 7d2d8186799c855c81d0fd2175290bd3d8baab84 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 24 May 2018 20:25:06 +0200 Subject: [PATCH 46/72] Fix link --- htdocs/loan/class/paymentloan.class.php | 222 ++++++++++++------------ 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 022cf050f11..595aead109e 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify @@ -17,16 +17,16 @@ */ /** - * \file htdocs/loan/class/paymentloan.class.php - * \ingroup facture - * \brief File of class to manage payment of loans + * \file htdocs/loan/class/paymentloan.class.php + * \ingroup loan + * \brief File of class to manage payment of loans */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -/** \class PaymentLoan - * \brief Class to manage payments of loans +/** \class PaymentLoan + * \brief Class to manage payments of loans */ class PaymentLoan extends CommonObject { @@ -37,8 +37,8 @@ class PaymentLoan extends CommonObject var $datec=''; var $tms=''; var $datep=''; - var $amounts=array(); // Array of amounts - var $amount_capital; // Total amount of payment + var $amounts=array(); // Array of amounts + var $amount_capital; // Total amount of payment var $amount_insurance; var $amount_interest; var $fk_typepayment; @@ -65,8 +65,8 @@ class PaymentLoan extends CommonObject /** * Create payment of loan into database. - * Use this->amounts to have list of lines for the payment - * + * Use this->amounts to have list of lines for the payment + * * @param User $user User making payment * @return int <0 if KO, id of payment if OK */ @@ -76,9 +76,9 @@ class PaymentLoan extends CommonObject $error=0; - $now=dol_now(); + $now=dol_now(); - // Validate parameters + // Validate parameters if (! $this->datepaid) { $this->error='ErrorBadValueForParameter'; @@ -98,11 +98,11 @@ class PaymentLoan extends CommonObject if (isset($this->fk_user_creat)) $this->fk_user_creat = trim($this->fk_user_creat); if (isset($this->fk_user_modif)) $this->fk_user_modif = trim($this->fk_user_modif); - $totalamount = $this->amount_capital + $this->amount_insurance + $this->amount_interest; - $totalamount = price2num($totalamount); + $totalamount = $this->amount_capital + $this->amount_insurance + $this->amount_interest; + $totalamount = price2num($totalamount); - // Check parameters - if ($totalamount == 0) return -1; // Negative amounts are accepted for reject prelevement but not null + // Check parameters + if ($totalamount == 0) return -1; // Negative amounts are accepted for reject prelevement but not null $this->db->begin(); @@ -127,7 +127,7 @@ class PaymentLoan extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error=$this->db->lasterror(); $error++; } @@ -135,9 +135,9 @@ class PaymentLoan extends CommonObject if ($totalamount != 0 && ! $error) { - $this->amount_capital=$totalamount; - $this->total=$totalamount; // deprecated - $this->db->commit(); + $this->amount_capital=$totalamount; + $this->total=$totalamount; // deprecated + $this->db->commit(); return $this->id; } else @@ -168,8 +168,8 @@ class PaymentLoan extends CommonObject $sql.= " t.amount_interest,"; $sql.= " t.fk_typepayment,"; $sql.= " t.num_payment,"; - $sql.= " t.note_private,"; - $sql.= " t.note_public,"; + $sql.= " t.note_private,"; + $sql.= " t.note_public,"; $sql.= " t.fk_bank,"; $sql.= " t.fk_user_creat,"; $sql.= " t.fk_user_modif,"; @@ -327,15 +327,15 @@ class PaymentLoan extends CommonObject $this->db->begin(); - if (! $error) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; - $sql.= " WHERE type='payment_loan' AND url_id=".$this->id; + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; + $sql.= " WHERE type='payment_loan' AND url_id=".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - } + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + } if (! $error) { @@ -381,95 +381,95 @@ class PaymentLoan extends CommonObject } } - /** - * Add record into bank for payment with links between this bank record and invoices of payment. - * All payment properties must have been set first like after a call to create(). - * - * @param User $user Object of user making payment - * @param int $fk_loan Id of fk_loan to do link with this payment - * @param string $mode 'payment_loan' - * @param string $label Label to use in bank record - * @param int $accountid Id of bank account to do link with - * @param string $emetteur_nom Name of transmitter - * @param string $emetteur_banque Name of bank - * @return int <0 if KO, >0 if OK - */ - function addPaymentToBank($user, $fk_loan, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) - { - global $conf; + /** + * Add record into bank for payment with links between this bank record and invoices of payment. + * All payment properties must have been set first like after a call to create(). + * + * @param User $user Object of user making payment + * @param int $fk_loan Id of fk_loan to do link with this payment + * @param string $mode 'payment_loan' + * @param string $label Label to use in bank record + * @param int $accountid Id of bank account to do link with + * @param string $emetteur_nom Name of transmitter + * @param string $emetteur_banque Name of bank + * @return int <0 if KO, >0 if OK + */ + function addPaymentToBank($user, $fk_loan, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) + { + global $conf; - $error=0; + $error=0; - if (! empty($conf->banque->enabled)) - { - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + if (! empty($conf->banque->enabled)) + { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $acc = new Account($this->db); - $acc->fetch($accountid); + $acc = new Account($this->db); + $acc->fetch($accountid); - $total=$this->total; - if ($mode == 'payment_loan') $total=-$total; + $total=$this->total; + if ($mode == 'payment_loan') $total=-$total; - // Insert payment into llx_bank - $bank_line_id = $acc->addline( - $this->datepaid, - $this->paymenttype, // Payment mode id or code ("CHQ or VIR for example") - $label, - $total, - $this->num_payment, - '', - $user, - $emetteur_nom, - $emetteur_banque - ); + // Insert payment into llx_bank + $bank_line_id = $acc->addline( + $this->datepaid, + $this->paymenttype, // Payment mode id or code ("CHQ or VIR for example") + $label, + $total, + $this->num_payment, + '', + $user, + $emetteur_nom, + $emetteur_banque + ); - // Update fk_bank into llx_paiement. - // We know the payment who generated the account write - if ($bank_line_id > 0) - { - $result=$this->update_fk_bank($bank_line_id); - if ($result <= 0) - { - $error++; - dol_print_error($this->db); - } + // Update fk_bank into llx_paiement. + // We know the payment who generated the account write + if ($bank_line_id > 0) + { + $result=$this->update_fk_bank($bank_line_id); + if ($result <= 0) + { + $error++; + dol_print_error($this->db); + } - // Add link 'payment_loan' in bank_url between payment and bank transaction - $url=''; - if ($mode == 'payment_loan') $url=DOL_URL_ROOT.'/loan/payment/card.php?id='; - if ($url) - { - $result=$acc->add_url_line($bank_line_id, $this->id, $url, '(payment)', $mode); - if ($result <= 0) - { - $error++; - dol_print_error($this->db); - } - } + // Add link 'payment_loan' in bank_url between payment and bank transaction + $url=''; + if ($mode == 'payment_loan') $url=DOL_URL_ROOT.'/loan/payment/card.php?id='; + if ($url) + { + $result=$acc->add_url_line($bank_line_id, $this->id, $url, '(payment)', $mode); + if ($result <= 0) + { + $error++; + dol_print_error($this->db); + } + } - // Add link 'loan' in bank_url between invoice and bank transaction (for each invoice concerned by payment) - if ($mode == 'payment_loan') - { - $result=$acc->add_url_line($bank_line_id, $fk_loan, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan'); - if ($result <= 0) dol_print_error($this->db); - } - } - else - { - $this->error=$acc->error; - $error++; - } - } + // Add link 'loan' in bank_url between invoice and bank transaction (for each invoice concerned by payment) + if ($mode == 'payment_loan') + { + $result=$acc->add_url_line($bank_line_id, $fk_loan, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan'); + if ($result <= 0) dol_print_error($this->db); + } + } + else + { + $this->error=$acc->error; + $error++; + } + } - if (! $error) - { - return 1; - } - else - { - return -1; - } - } + if (! $error) + { + return 1; + } + else + { + return -1; + } + } /** @@ -512,7 +512,7 @@ class PaymentLoan extends CommonObject if (!empty($this->id)) { - $link = ''; + $link = ''; $linkend=''; if ($withpicto) $result.=($link.img_object($langs->trans("ShowPayment").': '.$this->ref,'payment').$linkend.' '); From d1e1d64b42d66c59a97a6fda966f8dcf914304af Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 24 May 2018 20:26:38 +0200 Subject: [PATCH 47/72] Add some information in bank_journal --- htdocs/accountancy/journal/bankjournal.php | 58 ++++++++++++++++------ 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index be299471708..3bb98e42727 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1,12 +1,12 @@ - * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Olivier Geffroy +/* Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2007-2010 Jean Heimburger + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2017 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -24,9 +24,9 @@ */ /** - * \file htdocs/accountancy/journal/bankjournal.php - * \ingroup Advanced accountancy - * \brief Page with bank journal + * \file htdocs/accountancy/journal/bankjournal.php + * \ingroup Advanced accountancy + * \brief Page with bank journal */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; @@ -53,8 +53,10 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT . '/loan/class/loan.class.php'; +require_once DOL_DOCUMENT_ROOT . '/loan/class/paymentloan.class.php'; -$langs->loadLangs(array("companies","other","compta","banks",'bills','donations',"accountancy","trips","salaries","hrm")); +$langs->loadLangs(array("companies","other","compta","banks","bills","donations","loan","accountancy","trips","salaries","hrm")); // Multi journal $id_journal = GETPOST('id_journal', 'int'); @@ -143,6 +145,7 @@ $paymentvatstatic = new TVA($db); $paymentsalstatic = new PaymentSalary($db); $paymentexpensereportstatic = new PaymentExpenseReport($db); $paymentvariousstatic = new PaymentVarious($db); +$paymentloanstatic = new PaymentLoan($db); // Get code of finance journal $accountingjournalstatic = new AccountingJournal($db); @@ -254,7 +257,7 @@ if ($result) { // Now loop on each link of record in bank. foreach ($links as $key => $val) { - if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'payment_salary', 'payment_various'))) + if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'payment_loan', 'payment_salary', 'payment_various'))) { // So we excluded 'company' and 'user' here. We want only payment lines @@ -358,6 +361,13 @@ if ($result) { $paymentvariousstatic->fetch($paymentvariousstatic->id); $account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word $tabtp[$obj->rowid][$account_various] += $obj->amount; + } else if ($links[$key]['type'] == 'payment_loan') { + $paymentloanstatic->id = $links[$key]['url_id']; + $paymentloanstatic->ref = $links[$key]['url_id']; + $paymentloanstatic->fk_loan = $links[$key]['url_id']; + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentloanstatic->getNomUrl(2); + $tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id; + //$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount; } else if ($links[$key]['type'] == 'banktransfert') { $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer"); $tabtp[$obj->rowid][$account_transfer] += $obj->amount; @@ -548,6 +558,11 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = ''; + } else if ($tabtype[$key] == 'payment_loan') { + $bookkeeping->subledger_account = ''; + $bookkeeping->subledger_label = ''; + $bookkeeping->numero_compte = $k; + $bookkeeping->label_compte = ''; } else if ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; @@ -713,8 +728,8 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $langs->trans("LedgerAccount") . '"' . $sep; print '"' . $langs->trans("SubledgerAccount") . '"' . $sep; print '"' . $langs->trans("Label"). '"' . $sep; - print '"' . $langs->trans("Amount") . '"' . $sep; - print '"' . $langs->trans("Amount") . '"' . $sep; + print '"' . $langs->trans("Debit") . '"' . $sep; + print '"' . $langs->trans("Credit") . '"' . $sep; print '"' . $langs->trans("Journal") . '"' . $sep; print '"' . $langs->trans("Note") . '"' . $sep; print "\n"; @@ -822,6 +837,7 @@ if (empty($action) || $action == 'view') { $expensereportstatic = new ExpenseReport($db); $vatstatic = new Tva($db); $donationstatic = new Don($db); + $loanstatic = new Loan($db); $salarystatic = new PaymentSalary($db); $variousstatic = new PaymentVarious($db); @@ -893,7 +909,7 @@ if (empty($action) || $action == 'view') { print '
'; $i = 0; - print '
'; + print '
'; print "
'.$langs->trans("ProspectToContact").'
'; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 5542218b18b..1f0b950ad0f 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -39,9 +39,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -$langs->load('orders'); -$langs->load('deliveries'); -$langs->load('companies'); +// Load traductions files requiredby by page +$langs->loadLangs(array("orders", "deliveries", "companies")); if (! $user->rights->facture->creer) accessforbidden(); @@ -655,7 +654,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print ''; print '
'; - $var=true; + $generic_commande = new Commande($db); while ($i < $num) From 436a1001b32e639c3d1dd4aed084ca70530c30fc Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 24 May 2018 10:56:01 +0200 Subject: [PATCH 39/72] fix : avoid Notice: Undefined property: stdClass::$MAIN_FEATURES_LEVEL on upgrade.php page where global is not yet defined --- htdocs/core/class/translate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 3602ae427bd..66722d51732 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -577,7 +577,7 @@ class Translate //$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label'); } - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); + if (property_exists($conf->global, 'MAIN_FEATURES_LEVEL') && $conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); return $newstr; } From de447d88d75e782e6e0d06a79dbfd0a08a96c9fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 May 2018 11:51:32 +0200 Subject: [PATCH 40/72] Fix translation --- htdocs/langs/en_US/productbatch.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 6acd1c9245c..f0eafc807cf 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -16,7 +16,7 @@ printEatby=Eat-by: %s printSellby=Sell-by: %s printQty=Qty: %d AddDispatchBatchLine=Add a line for Shelf Life dispatching -WhenProductBatchModuleOnOptionAreForced=When module Lot/Serial is on, automatic increase/decrease stock mode is forced to shipping validate and manual dispatching for reception and can't be edited. Other options can be defined as you want. +WhenProductBatchModuleOnOptionAreForced=When module Lot/Serial is on, automatic stock decrease is forced to 'Decrease real stocks on shipping validation' and automatic increase mode is forced to 'Increase real stocks on manual dispatching into warehouses' and can't be edited. Other options can be defined as you want. ProductDoesNotUseBatchSerial=This product does not use lot/serial number ProductLotSetup=Setup of module lot/serial ShowCurrentStockOfLot=Show current stock for couple product/lot From 0623ff7667707802c66ff2e127c6e484a41605d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 24 May 2018 11:56:19 +0200 Subject: [PATCH 41/72] fix logic --- htdocs/product/price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 1f62ff95aec..ad73b57d76f 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1123,7 +1123,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ } } - if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; From e51aa68284a6e58f89e8c5d50abe8e830fe4ac8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 May 2018 12:16:04 +0200 Subject: [PATCH 42/72] Fix link to warehouses for events --- htdocs/comm/action/list.php | 1 + htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/lib/functions2.lib.php | 25 ++++++++++++++++----- htdocs/core/modules/stock/modules_stock.php | 11 +++------ htdocs/product/card.php | 2 -- htdocs/product/stock/card.php | 17 +++++++++----- htdocs/product/stock/productlot_card.php | 2 -- htdocs/projet/tasks/task.php | 2 -- htdocs/user/card.php | 2 +- 9 files changed, 37 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index cca1f59bf8e..c9a0f1f9d49 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -631,6 +631,7 @@ if ($resql) // Linked object if (! empty($arrayfields['a.fk_element']['checked'])) { print '
'; + //var_dump($obj->fkelement.' '.$obj->elementtype); if ($obj->fk_element > 0 && ! empty($obj->elementtype)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print dolGetElementUrl($obj->fk_element,$obj->elementtype,1); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index dbdb7edf760..78ef6c2f1c3 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -601,7 +601,7 @@ class FormFile $modellist=call_user_func($class.'::liste_modeles',$this->db); } else - { + { dol_print_error($this->db,'Bad value for modulepart'); return -1; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 0b8d42f3a9e..c95deeef81f 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1830,6 +1830,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') $module='projet'; $subelement='task'; } + if ($objecttype == 'stock') { + $classpath = 'product/stock/class'; + $module='stock'; + $subelement='stock'; + } //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; @@ -1840,22 +1845,30 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') $classpath = 'fourn/class'; $module='fournisseur'; } - if ($objecttype == 'order_supplier') { + elseif ($objecttype == 'order_supplier') { $classfile = 'fournisseur.commande'; $classname='CommandeFournisseur'; $classpath = 'fourn/class'; $module='fournisseur'; } - + elseif ($objecttype == 'stock') { + $classpath = 'product/stock/class'; + $classfile='entrepot'; + $classname='Entrepot'; + } if (! empty($conf->$module->enabled)) { $res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); if ($res) { - $object = new $classname($db); - $res=$object->fetch($objectid); - if ($res > 0) $ret=$object->getNomUrl($withpicto,$option); - unset($object); + if (class_exists($classname)) + { + $object = new $classname($db); + $res=$object->fetch($objectid); + if ($res > 0) $ret=$object->getNomUrl($withpicto,$option); + unset($object); + } + else dol_syslog("Class with classname ".$classname." is unknown even after the include", LOG_ERR); } } return $ret; diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php index f1c72601b97..16c33b94e07 100644 --- a/htdocs/core/modules/stock/modules_stock.php +++ b/htdocs/core/modules/stock/modules_stock.php @@ -1,9 +1,5 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2016 Charlie Benke +/* Copyright (C) 2018 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,10 +19,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; /** - * \class ModeleStock - * \brief Parent class for stock models of doc generators + * Parent class for stock models of doc generators */ -abstract class ModeleStock extends CommonDocGenerator +abstract class ModelePDFStock extends CommonDocGenerator { var $error=''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index a0ab4508d9c..addc827700e 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2165,8 +2165,6 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') $genallowed=$usercanread; $delallowed=$usercancreate; - $var=true; - print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); $somethingshown=$formfile->numoffiles; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index eca9086c48a..2bd0a10bc51 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -117,7 +117,7 @@ if ($action == 'add' && $user->rights->stock->creer) // Delete warehouse if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->stock->supprimer) { - $object->fetch($_REQUEST["id"]); + $object->fetch(GETPOST('id','int')); $result=$object->delete($user); if ($result > 0) { @@ -169,9 +169,17 @@ if ($cancel == $langs->trans("Cancel")) $action = ''; } + +// Actions to build doc +$upload_dir = $conf->stock->dir_output; +$permissioncreate = $user->rights->stock->creer; +include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + + /* * Build document */ +/* if ($action == 'builddoc') // En get ou en post { if ($id > 0 || $ref) @@ -185,7 +193,7 @@ if ($action == 'builddoc') // En get ou en post } } - // Save last template used to generate document + // Save last template used to generate document if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); // Define output language @@ -218,7 +226,7 @@ elseif ($action == 'remove_file') if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } - +*/ /* * View @@ -728,8 +736,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed=$usercanread; $delallowed=$usercancreate; - - $var=true; + $modulepart = 'stock'; print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); $somethingshown=$formfile->numoffiles; diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 757d01868b5..90ca3a73cc9 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -418,8 +418,6 @@ if (empty($action)) $genallowed=$usercanread; $delallowed=$usercancreate; - $var=true; - print $formfile->showdocuments('product_batch',dol_sanitizeFileName($object->ref),$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); $somethingshown=$formfile->numoffiles; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 735b5a81195..9f1a486fcaa 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -612,8 +612,6 @@ if ($id > 0 || ! empty($ref)) $genallowed=($user->rights->projet->lire); $delallowed=($user->rights->projet->creer); - $var=true; - print $formfile->showdocuments('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); print '
'; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 48dc1049706..ddab0daed0c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2455,7 +2455,7 @@ else print '
'; /* * Documents generes - */ + */ $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->user->dir_output . "/" . dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; From 23e2bb20d95c6c796842c267d7a2c80978c0c56b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 May 2018 12:32:04 +0200 Subject: [PATCH 43/72] Look and feel v8 --- .../stock/doc/pdf_stdmouvement.modules.php | 112 +++++++++--------- htdocs/product/stock/card.php | 108 +++++------------ htdocs/product/stock/mouvement.php | 83 ++++--------- 3 files changed, 108 insertions(+), 195 deletions(-) diff --git a/htdocs/core/modules/stock/doc/pdf_stdmouvement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmouvement.modules.php index 16d979d60ee..0ea7947005a 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmouvement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmouvement.modules.php @@ -115,14 +115,14 @@ class pdf_stdmouvement extends ModelePDFMouvement // Recupere emetteur $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined - + // Define position of columns $this->wref = 15; $this->posxidref = $this->marge_gauche; $this->posxdatemouv = $this->marge_gauche+8;; $this->posxdesc=37; $this->posxlabel=50; - $this->posxtva=80; + $this->posxtva=80; $this->posxqty=105; $this->posxup=119; $this->posxunit=136; @@ -175,7 +175,7 @@ class pdf_stdmouvement extends ModelePDFMouvement $outputlangs->load("stocks"); $outputlangs->load("orders"); $outputlangs->load("deliveries"); - + /** * TODO: get from object */ @@ -308,7 +308,7 @@ class pdf_stdmouvement extends ModelePDFMouvement if ($conf->stock->dir_output) { - + if ($resql) { $product = new Product($db); @@ -340,11 +340,11 @@ class pdf_stdmouvement extends ModelePDFMouvement if ($id) $texte.=' ('.$langs->trans("ForThisWarehouse").')'; } } - + // Definition of $dir and $file if ($object->specimen) { - $dir = $conf->stock->dir_output . "/mouvement"; + $dir = $conf->stock->dir_output . "/movement"; $file = $dir . "/SPECIMEN.pdf"; } else @@ -352,14 +352,14 @@ class pdf_stdmouvement extends ModelePDFMouvement $objectref = dol_sanitizeFileName($object->ref); if(!empty($search_inventorycode)) $objectref.="_".$id."_".$search_inventorycode; if($search_type_mouvement) $objectref.="_".$search_type_mouvement; - $dir = $conf->stock->dir_output . "/mouvement/" . $objectref; + $dir = $conf->stock->dir_output . "/movement/" . $objectref; $file = $dir . "/" . $objectref . ".pdf"; } - + $stockFournisseur = new ProductFournisseur($this->db); $supplierprices = $stockFournisseur->list_product_fournisseur_price($object->id); $object->supplierprices = $supplierprices; - + $productstatic=new Product($db); if (! file_exists($dir)) @@ -439,14 +439,14 @@ class pdf_stdmouvement extends ModelePDFMouvement /* Affichage de la liste des produits du MouvementStock */ /* */ /* ************************************************************************** */ - - $nexY+=5; + + $nexY+=5; $nexY = $pdf->GetY(); $nexY+=10; $totalunit=0; $totalvalue=$totalvaluesell=0; - + //dol_syslog('List products', LOG_DEBUG); $resql = $db->query($sql); if ($resql) @@ -474,7 +474,7 @@ class pdf_stdmouvement extends ModelePDFMouvement if ($objtp->label != '') $objp->produit = $objtp->label; } } - + $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0,0,0); @@ -482,7 +482,7 @@ class pdf_stdmouvement extends ModelePDFMouvement $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore=$pdf->getPage(); - + // Description of product line $curX = $this->posxdesc-1; @@ -535,7 +535,7 @@ class pdf_stdmouvement extends ModelePDFMouvement } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut - + // $objp = $db->fetch_object($resql); $userstatic->id=$objp->fk_user_author; @@ -565,8 +565,8 @@ class pdf_stdmouvement extends ModelePDFMouvement $origin = $movement->get_origin($objp->fk_origin, $objp->origintype); } else { $origin = ''; - } - + } + // Id movement. $pdf->SetXY($this->posxidref, $curY); $pdf->MultiCell($this->posxdesc-$this->posxidref-0.8, 3, $objp->mid, 0, 'L'); @@ -585,8 +585,8 @@ class pdf_stdmouvement extends ModelePDFMouvement // Lot/serie $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->posxup-$this->posxqty-0.8, 3, $productlot->batch, 0, 'R'); - + $pdf->MultiCell($this->posxup-$this->posxqty-0.8, 3, $productlot->batch, 0, 'R'); + // Inv. code $pdf->SetXY($this->posxup, $curY); $pdf->MultiCell($this->posxunit-$this->posxup-0.8, 3, $objp->inventorycode, 0, 'R'); @@ -595,7 +595,7 @@ class pdf_stdmouvement extends ModelePDFMouvement $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount-$this->posxunit-0.8, 3, $objp->label, 0, 'R'); $totalvalue+=price2num($objp->ppmp*$objp->value,'MT'); - + // Origin $pricemin=$objp->price; $pdf->SetXY($this->posxdiscount, $curY); @@ -608,9 +608,9 @@ class pdf_stdmouvement extends ModelePDFMouvement $pdf->SetXY($this->postotalht, $curY); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $objp->qty, 0, 'R', 0); - + $totalvaluesell+=price2num($pricemin*$objp->value,'MT'); - + $nexY+=3.5; // Passe espace entre les lignes // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) @@ -623,7 +623,7 @@ class pdf_stdmouvement extends ModelePDFMouvement } $nexY+=2; // Passe espace entre les lignes - + // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) { @@ -668,9 +668,9 @@ class pdf_stdmouvement extends ModelePDFMouvement */ $nexY = $pdf->GetY(); $nexY+=5; - $curY = $nexY; + $curY = $nexY; - $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); + $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); $pdf->line($this->marge_gauche, $curY-1, $this->page_largeur-$this->marge_droite, $curY-1); $pdf->SetLineStyle(array('dash'=>0)); @@ -680,11 +680,11 @@ class pdf_stdmouvement extends ModelePDFMouvement // Total $pdf->SetXY($this->posxidref, $curY); $pdf->MultiCell($this->posxdesc-$this->posxidref, 3, $langs->trans("Total"), 0, 'L'); - + // Total Qty $pdf->SetXY($this->postotalht, $curY); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $totalunit, 0, 'R', 0); - + } else { @@ -720,8 +720,8 @@ class pdf_stdmouvement extends ModelePDFMouvement $curY = $tab_top + 7; $nexY = $tab_top + 7; - $tab_top = $tab_top_newpage+21; - + $tab_top = $tab_top_newpage+21; + // Show square if ($pagenb == 1) { @@ -733,7 +733,7 @@ class pdf_stdmouvement extends ModelePDFMouvement $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos @@ -820,14 +820,14 @@ class pdf_stdmouvement extends ModelePDFMouvement // Output Rect //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param - + $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); - $pdf->SetDrawColor(220,26,26); + $pdf->SetDrawColor(220,26,26); $pdf->line($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite, $tab_top); $pdf->SetLineStyle(array('dash'=>0)); $pdf->SetDrawColor(128,128,128); $pdf->SetTextColor(0,0,120); - + //Ref mouv if (empty($hidetop)) { @@ -835,7 +835,7 @@ class pdf_stdmouvement extends ModelePDFMouvement $pdf->SetXY($this->posxidref, $tab_top+1); $pdf->MultiCell($this->posxdatemouv-$this->posxdatemouv-0.8,3, $outputlangs->transnoentities("Ref"),'','L'); } - + //Date mouv //$pdf->line($this->posxlabel-1, $tab_top, $this->posxlabel-1, $tab_top + $tab_height); if (empty($hidetop)) @@ -847,7 +847,7 @@ class pdf_stdmouvement extends ModelePDFMouvement //Ref Product //$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); if (empty($hidetop)) - { + { $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell($this->posxlabel-$this->posxdesc,2, $outputlangs->transnoentities("Ref. Product"),'','C'); } @@ -862,7 +862,7 @@ class pdf_stdmouvement extends ModelePDFMouvement //Lot/serie Product //$pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height); - if (empty($hidetop)) + if (empty($hidetop)) { $pdf->SetXY($this->posxqty, $tab_top + 1); $pdf->MultiCell($this->posxup - $this->posxqty, 2, $outputlangs->transnoentities("Lot/Série"), '','C'); @@ -877,34 +877,34 @@ class pdf_stdmouvement extends ModelePDFMouvement } //Label mouvement - //$pdf->line($this->posxunit, $tab_top, $this->posxunit, $tab_top + $tab_height); + //$pdf->line($this->posxunit, $tab_top, $this->posxunit, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxunit, $tab_top+1); $pdf->MultiCell($this->posxdiscount-$this->posxunit,2, $outputlangs->transnoentities("Label Mouvement"),'','C'); } - + //Origin - //$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); + //$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxdiscount+2, $tab_top+1); $pdf->MultiCell($this->postotalht-$this->posxdiscount-0.8,2, $outputlangs->transnoentities("Origin"),'','C'); } - + //Qty - //$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); + //$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->postotalht+2, $tab_top+1); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht,2, $outputlangs->transnoentities("Qty"),'','C'); } - - $pdf->SetDrawColor(220,26,26); + + $pdf->SetDrawColor(220,26,26); $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); - $pdf->line($this->marge_gauche, $tab_top+11, $this->page_largeur-$this->marge_droite, $tab_top+11); + $pdf->line($this->marge_gauche, $tab_top+11, $this->page_largeur-$this->marge_droite, $tab_top+11); $pdf->SetLineStyle(array('dash'=>0)); - + } /** @@ -990,22 +990,22 @@ class pdf_stdmouvement extends ModelePDFMouvement $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("LocationSummary").' :', '', 'R'); - + $posy+=4; $pdf->SetXY($posx-50,$posy); $pdf->MultiCell(150, 3, $object->lieu, '', 'R'); - - + + // Parent MouvementStock $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ParentWarehouse").' :', '', 'R'); - + $posy+=4; $pdf->SetXY($posx-50,$posy); $e = new MouvementStock($db); - if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) + if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) { $pdf->MultiCell(150, 3, $e->libelle, '', 'R'); } @@ -1013,14 +1013,14 @@ class pdf_stdmouvement extends ModelePDFMouvement { $pdf->MultiCell(150, 3, $outputlangs->transnoentities("None"), '', 'R'); } - + // Description $nexY = $pdf->GetY(); $nexY+=5; $pdf->SetXY($posx,$posy); $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("Description").' : '.nl2br($object->description), 0, 1); $nexY = $pdf->GetY(); - + $calcproductsunique=$object->nb_different_products(); $calcproducts=$object->nb_products(); @@ -1032,12 +1032,12 @@ class pdf_stdmouvement extends ModelePDFMouvement $valtoshow=price2num($calcproducts['nb'], 'MS'); $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("NumberOfProducts").' : '.(empty($valtoshow)?'0':$valtoshow), 0, 1); $nexY = $pdf->GetY(); - + // Value $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("EstimatedStockValueShort").' : '. price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency), 0, 1); $nexY = $pdf->GetY(); - - + + // Last movement $sql = "SELECT max(m.datem) as datem"; $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; @@ -1065,7 +1065,7 @@ class pdf_stdmouvement extends ModelePDFMouvement $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("LastMovement").' : '.$toWrite, 0, 1); $nexY = $pdf->GetY(); - + /*if ($object->ref_client) { $posy+=5; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 2bd0a10bc51..3765bafff16 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -61,6 +61,7 @@ $hookmanager->initHooks(array('warehousecard','globalcard')); $object = new Entrepot($db); + /* * Actions */ @@ -176,58 +177,6 @@ $permissioncreate = $user->rights->stock->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; -/* - * Build document - */ -/* -if ($action == 'builddoc') // En get ou en post -{ - if ($id > 0 || $ref) - { - $object = new Entrepot($db); - $result = $object->fetch($id, $ref); - if ($result <= 0) - { - print 'No record found'; - exit; - } - } - - // Save last template used to generate document - if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); - - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - $result= $object->generateDocument($object->modelpdf, $outputlangs); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } -} - -// Delete file in doc form -elseif ($action == 'remove_file') -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $upload_dir = $conf->stock->dir_output ; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); -} -*/ - /* * View */ @@ -721,40 +670,43 @@ else * Documents generes */ -$modulepart='stock'; - -if ($action != 'create' && $action != 'edit' && $action != 'delete') +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print '
'; - print '
'; - print ''; // ancre + $modulepart='stock'; - // Documents - $objectref = dol_sanitizeFileName($object->ref); - $relativepath = $comref . '/' . $objectref . '.pdf'; - $filedir = $conf->stock->dir_output . '/' . $objectref; - $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed=$usercanread; - $delallowed=$usercancreate; - $modulepart = 'stock'; + if ($action != 'create' && $action != 'edit' && $action != 'delete') + { + print '
'; + print '
'; + print ''; // ancre - print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); - $somethingshown=$formfile->numoffiles; + // Documents + $objectref = dol_sanitizeFileName($object->ref); + $relativepath = $comref . '/' . $objectref . '.pdf'; + $filedir = $conf->stock->dir_output . '/' . $objectref; + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed=$usercanread; + $delallowed=$usercancreate; + $modulepart = 'stock'; - print '
'; + print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); + $somethingshown=$formfile->numoffiles; - $MAXEVENT = 10; + print '
'; - $morehtmlright = ''; - $morehtmlright.= $langs->trans("SeeAll"); - $morehtmlright.= ''; + $MAXEVENT = 10; - // List of actions on element - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; - $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'stock', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product + $morehtmlright = ''; + $morehtmlright.= $langs->trans("SeeAll"); + $morehtmlright.= ''; - print '
'; + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'stock', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product + + print '
'; + } } diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index edabf9184da..0b37a2269cd 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -95,7 +95,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search $arrayfields=array( 'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1), - 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1), + 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'), 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1), 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(! empty($conf->productbatch->enabled))), 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))), @@ -403,52 +403,12 @@ if ($action == "transfert_stock" && ! $cancel) /* * Build document */ -if ($action == 'builddoc') // En get ou en post -{ - if ($id > 0 || $ref) - { - $object = new MouvementStock($db); - $result = $object->fetch($id, $ref); - if ($result <= 0) - { - print 'No record found'; - exit; - } - } - - // Save last template used to generate document - if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); - - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - $result= $object->generateDocument($object->modelpdf, $outputlangs); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } -} - -// Delete file in doc form -elseif ($action == 'remove_file') -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $upload_dir = $conf->stock->dir_output."/mouvement" ; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); -} +/* The builddoc action for object of a movement must be on the movement card +// Actions to build doc +$upload_dir = $conf->stock->dir_output; +$permissioncreate = $user->rights->stock->creer; +include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; +*/ if (empty($reshook) && $action != 'remove_file') { @@ -809,12 +769,12 @@ if ($resql) } if (! empty($arrayfields['m.datem']['checked'])) { - print '
'; + print ''; print ''; if (empty($conf->productbatch->enabled)) print ' '; //else print '
'; $syear = $year?$year:-1; - print ''; + print ''; //print $formother->selectyear($syear,'year',1, 20, 5); print '
'; - print ''; + print ''; print ''; - print price($objp->price); + if ($objp->price != 0) print price($objp->price); print '
"; print ""; print ""; @@ -1119,6 +1135,9 @@ function getSourceDocRef($val, $typerecord) if ($ref == '(ExpenseReportPayment)') { $ref = $langs->trans('Employee'); } + if ($ref == '(LoanPayment)') { + $ref = $langs->trans('Loan'); + } if ($ref == '(payment_salary)') { $ref = $langs->trans('Employee'); } @@ -1173,6 +1192,13 @@ function getSourceDocRef($val, $typerecord) $sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"]; $ref = $langs->trans("Donation"); } + elseif ($typerecord == 'payment_loan') + { + $sqlmid = 'SELECT l.rowid as ref'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_loan as l"; + $sqlmid .= " WHERE l.rowid=" . $val["paymentloanid"]; + $ref = $langs->trans("LoanPayment"); + } elseif ($typerecord == 'payment_various') { $sqlmid = 'SELECT v.rowid as ref'; From 46a251a2b3fd5055b37be5eb542cce1f2eb08912 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 24 May 2018 21:13:48 +0200 Subject: [PATCH 48/72] FIX : Replace feature level 2 by a constant on accountancy journal --- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 6d8c67aff3f..fee6ae6c595 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -384,7 +384,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM if ($objp->nature == 9) $nature="hasnew"; // To enable when page exists - if ($conf->global->MAIN_FEATURES_LEVEL < 2) + if (! empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL)) { if ($nature == 'various' || $nature == 'hasnew' || $nature == 'inventory') $nature=''; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2b54e444ca8..2fa2b8a7822 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1062,14 +1062,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($objp->nature == 9) $nature="hasnew"; // To enable when page exists - if ($conf->global->MAIN_FEATURES_LEVEL < 2) + if (! empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL)) { if ($nature == 'various' || $nature == 'hasnew' || $nature == 'inventory') $nature=''; } if ($nature) { - $langs->load('accountancy'); + $langs->load('accountancy'); $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $langs->trans($objp->label), 2, $user->rights->accounting->comptarapport->lire); } $i++; From 9f2f8ca7e09ff812acbf039dd1fafba1f1faa828 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 09:31:16 +0200 Subject: [PATCH 49/72] Fix scrutinizer --- .../doc/doc_generic_order_odt.modules.php | 1 + .../doc/doc_generic_contract_odt.modules.php | 1 + .../doc/doc_generic_invoice_odt.modules.php | 1 + .../doc/doc_generic_product_odt.modules.php | 1 + .../doc/doc_generic_project_odt.modules.php | 1 + .../doc/doc_generic_proposal_odt.modules.php | 1 + .../doc/doc_generic_stock_odt.modules.php | 1 + ...s_stock.class.php => modules_movement.php} | 47 ++----------------- htdocs/core/modules/stock/modules_stock.php | 1 + 9 files changed, 13 insertions(+), 42 deletions(-) rename htdocs/core/modules/stock/{modules_stock.class.php => modules_movement.php} (51%) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index a7268ee0ea3..4c8b4ba2dc5 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -285,6 +285,7 @@ class doc_generic_order_odt extends ModelePDFCommandes } // Recipient name + $contactobject=null; if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 99eb9feb2ea..cd96e880d27 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -276,6 +276,7 @@ class doc_generic_contract_odt extends ModelePDFContract } // Recipient name + $contactobject=null; if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 79741886119..21c25913543 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -286,6 +286,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures } // Recipient name + $contactobject=null; if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index f63d62149eb..c447639cfe1 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -302,6 +302,7 @@ class doc_generic_product_odt extends ModelePDFProduct } // Recipient name + $contactobject=null; if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 35cbed4acf4..c804d6b1af8 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -526,6 +526,7 @@ class doc_generic_project_odt extends ModelePDFProjects } // Recipient name + $contactobject=null; if (! empty($usecontact)) { // if we have a PROJECTLEADER contact and we dont use it as recipient we store the contact object for later use diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 589d2d006c2..24477a67cc5 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -316,6 +316,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales } // Recipient name + $contactobject=null; if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index d7ceffaaf72..4b4a902cb96 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -302,6 +302,7 @@ class doc_generic_stock_odt extends ModelePDFStock } // Recipient name + $contactobject=null; if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact diff --git a/htdocs/core/modules/stock/modules_stock.class.php b/htdocs/core/modules/stock/modules_movement.php similarity index 51% rename from htdocs/core/modules/stock/modules_stock.class.php rename to htdocs/core/modules/stock/modules_movement.php index 283ae75b6a3..806f500dab7 100644 --- a/htdocs/core/modules/stock/modules_stock.class.php +++ b/htdocs/core/modules/stock/modules_movement.php @@ -1,8 +1,5 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2018 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,53 +16,19 @@ * or see http://www.gnu.org/ */ - /** - * \class ModeleStock - * \brief Parent class for warehouse generators - */ - -/** - * \file htdocs/core/modules/stock/modules_stock.php + * \file htdocs/core/modules/stock/modules_movement.php * \ingroup stock - * \brief File with parent class for generating warehouse to PDF and File of class to manage warehouse mouvement + * \brief File with parent class for generating warehouse to PDF and File of class to manage warehouse movement */ - require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; - -/** - * Parent class to manage warehouse document templates - */ -abstract class ModelePDFStock extends CommonDocGenerator -{ - var $error=''; - - - /** - * Return list of active generation modules - * - * @param DoliDB $db Database handler - * @param integer $maxfilenamelength Max length of value to show - * @return array List of templates - */ - static function liste_modeles($db,$maxfilenamelength=0) - { - global $conf; - - $type='stock'; - $liste=array(); - - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste=getListOfModels($db,$type,$maxfilenamelength); - return $liste; - } -} +require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; /** * Parent class to manage warehouse mouvement document templates */ -abstract class ModelePDFMouvement extends CommonDocGenerator +abstract class ModelePDFMovement extends CommonDocGenerator { var $error=''; diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php index 16c33b94e07..a0740b50f54 100644 --- a/htdocs/core/modules/stock/modules_stock.php +++ b/htdocs/core/modules/stock/modules_stock.php @@ -25,6 +25,7 @@ abstract class ModelePDFStock extends CommonDocGenerator { var $error=''; + /** * Return list of active generation modules * From b9fbf13eba3f9eb48869b5007cc646849617badf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 09:36:49 +0200 Subject: [PATCH 50/72] Fix look and feel v8 --- ..._stdmouvement.modules.php => pdf_stdmovement.modules.php} | 5 +++-- htdocs/product/stock/mouvement.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) rename htdocs/core/modules/stock/doc/{pdf_stdmouvement.modules.php => pdf_stdmovement.modules.php} (99%) diff --git a/htdocs/core/modules/stock/doc/pdf_stdmouvement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php similarity index 99% rename from htdocs/core/modules/stock/doc/pdf_stdmouvement.modules.php rename to htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 0ea7947005a..a1ba9b141ec 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmouvement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/core/modules/stock/doc/pdf_standard.modules.php + * \file htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php * \ingroup societe - * \brief File of class to build PDF documents for stocks/services + * \brief File of class to build PDF documents for stocks movements */ require_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.class.php'; @@ -446,6 +446,7 @@ class pdf_stdmouvement extends ModelePDFMouvement $totalunit=0; $totalvalue=$totalvaluesell=0; + $arrayofuniqueproduct = array(); //dol_syslog('List products', LOG_DEBUG); $resql = $db->query($sql); diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 0b37a2269cd..f21c509f188 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -839,7 +839,7 @@ if ($resql) if (! empty($arrayfields['m.type_mouvement']['checked'])) { // Type of movement - print ''; - // Ressources - print ''; } - print ''; // Tick to drag and drop if ($addordertick) @@ -597,7 +600,11 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned,2).' %'; print ''; print ''; - print ''; + // Contacts of task + if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) + { + print ''; + } if ($addordertick) print ''; print ''; } From e7cfad0e6073c496b652ada0b4dfe582ea7ef3f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 10:52:24 +0200 Subject: [PATCH 52/72] Update tasks.php --- htdocs/projet/tasks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 922bfafcbf6..9a3bcb6f6e3 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -297,7 +297,7 @@ if ($id > 0 || ! empty($ref)) { $object->fetch($id, $ref); $object->fetch_thirdparty(); - $res=$object->fetch_optionals($object->id,$extralabels_projet); + $res=$object->fetch_optionals(); // To verify role of users From 034752dc0b250b131522f997eb5cffed6c93f0b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 10:54:17 +0200 Subject: [PATCH 53/72] Update tasks.php --- htdocs/projet/tasks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 9a3bcb6f6e3..e0f9ecea1e6 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -660,7 +660,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; - print ''; + if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print ''; // Action column print '\n"; From 0a581e48d47cb8c0a5aa565006beae35a753b4a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 11:04:04 +0200 Subject: [PATCH 54/72] Update card.php --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9d5cc64c2a4..06330de7682 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -186,7 +186,7 @@ if (empty($reshook)) $qualified_for_stock_change = $object->hasProductsOrServices(1); } - if($object->is_erasable()) { + if ($object->is_erasable()) { $result = $object->delete($user, 0, $idwarehouse); if ($result > 0) { From ac0570f6b2ec59f420284b93804e965e73f52a3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 11:07:11 +0200 Subject: [PATCH 55/72] Update translate.class.php --- htdocs/core/class/translate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 66722d51732..bdcae2e33ea 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -577,7 +577,7 @@ class Translate //$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label'); } - if (property_exists($conf->global, 'MAIN_FEATURES_LEVEL') && $conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); + if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); return $newstr; } From 3d97fa36d11c90e3ae127085b9a4fda2689f4459 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 11:08:05 +0200 Subject: [PATCH 56/72] CSS --- htdocs/projet/tasks.php | 14 +++++++------- htdocs/theme/eldy/style.css.php | 3 ++- htdocs/theme/md/style.css.php | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index e0f9ecea1e6..09c012787a8 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -625,22 +625,22 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a8798901a21..2b0d7f662f9 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -286,7 +286,8 @@ input.select2-input { .liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create], .liste_titre input[name=search_month_lim], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], .liste_titre input[name=search_month_create], .liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when], -.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end] +.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], +.liste_titre input[name=search_dtstartday], .liste_titre input[name=search_dtendday], .liste_titre input[name=search_dtstartmonth], .liste_titre input[name=search_dtendmonth] { margin-right: 4px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2188a5bff9c..e32db0aea91 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -291,6 +291,7 @@ textarea.cke_source:focus .liste_titre input[name=search_month_lim], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], .liste_titre input[name=search_month_create], .liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when], .liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end] +.liste_titre input[name=search_dtstartday], .liste_titre input[name=search_dtendday], .liste_titre input[name=search_dtstartmonth], .liste_titre input[name=search_dtendmonth] { margin-right: 4px; } From a3bea8d29857284b4a6b54326903eedb4ffa6619 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 11:17:01 +0200 Subject: [PATCH 57/72] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b74bc8a4e96..fef4856a46e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6083,7 +6083,7 @@ abstract class CommonObject $datenotinstring = $this->array_options['options_' . $key]; if (! is_numeric($this->array_options['options_' . $key])) // For backward compatibility { - $datenotinstring = $db->jdate($datenotinstring); + $datenotinstring = $this->db->jdate($datenotinstring); } $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$datenotinstring; } From 3d71ce82978091b6b837652a25d51ccd690799d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 11:19:38 +0200 Subject: [PATCH 58/72] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c3460989d82..dc02f956a3d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -483,17 +483,17 @@ class FormFile if (is_array($genallowed)) $modellist=$genallowed; else { - include_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.php'; $modellist=ModelePDFStock::liste_modeles($this->db); } } - elseif ($modulepart == 'mouvement') + elseif ($modulepart == 'movement') { if (is_array($genallowed)) $modellist=$genallowed; else { - include_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_stock.class.php'; - $modellist=ModelePDFMouvement::liste_modeles($this->db); + include_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_movement.php'; + $modellist=ModelePDFMovement::liste_modeles($this->db); } } elseif ($modulepart == 'export') From 0e6aa3def3562a0da00852b220efaa15725b4df8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 11:26:50 +0200 Subject: [PATCH 59/72] Fix duplicate deprecated file --- .../modules/product/modules_product.class.php | 11 ++-- .../core/modules/product/modules_product.php | 52 ------------------- htdocs/product/card.php | 2 +- 3 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 htdocs/core/modules/product/modules_product.php diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index d7138af84a8..83fc444f258 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -21,18 +21,13 @@ /** - * \class ModeleProductCode - * \brief Parent class for product code generators - */ - -/** - * \file htdocs/core/modules/contract/modules_contract.php + * \file htdocs/core/modules/product/modules_product.class.php * \ingroup contract - * \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering + * \brief File with parent class for generating products to PDF and File of class to manage product numbering */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; - + /** * Parent class to manage intervention document templates */ diff --git a/htdocs/core/modules/product/modules_product.php b/htdocs/core/modules/product/modules_product.php deleted file mode 100644 index afe07e39503..00000000000 --- a/htdocs/core/modules/product/modules_product.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2016 Charlie Benke - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; - -/** - * \class ModeleProduct - * \brief Parent class for product models of doc generators - */ -abstract class ModeleProduct extends CommonDocGenerator -{ - var $error=''; - - /** - * Return list of active generation modules - * - * @param DoliDB $db Database handler - * @param integer $maxfilenamelength Max length of value to show - * @return array List of templates - */ - static function liste_modeles($db,$maxfilenamelength=0) - { - global $conf; - - $type='product'; - $liste=array(); - - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste=getListOfModels($db,$type,$maxfilenamelength); - - return $liste; - } -} diff --git a/htdocs/product/card.php b/htdocs/product/card.php index addc827700e..84ba11bf624 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; From bcbe28d80246b0b4d130a1efb11079c378365c06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 12:48:33 +0200 Subject: [PATCH 60/72] Code comment --- htdocs/core/class/commonobject.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ca7b8d7e1ba..dc57d6b9d2e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1578,11 +1578,11 @@ abstract class CommonObject /** - * Return list of id of contacts of project + * Return list of id of contacts of object * * @param string $source Source of contact: external (llx_socpeople) or internal (llx_user) or thirdparty (llx_societe) * @return array Array of id of contacts (if source=external or internal) - * Array of id of third parties with at least one contact on project (if source=thirdparty) + * Array of id of third parties with at least one contact on object (if source=thirdparty) */ function getListContactId($source='external') { @@ -3659,7 +3659,7 @@ abstract class CommonObject if (empty($reshook)) { print "\n"; - + print ''; if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ''; @@ -3742,7 +3742,7 @@ abstract class CommonObject $var = true; $i = 0; - + print "\n"; foreach ($this->lines as $line) { @@ -3771,7 +3771,7 @@ abstract class CommonObject $i++; } - print "\n"; + print "\n"; } /** From ba6193cff7c93905f355f8d99f05119d3a4e00ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 14:57:30 +0200 Subject: [PATCH 61/72] Add indonesia provinces --- .../install/mysql/data/llx_10_c_regions.sql | 4 ++ .../mysql/data/llx_20_c_departements.sql | 40 +++++++++++++++++- .../install/mysql/migration/7.0.0-8.0.0.sql | 41 +++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index f997971d26d..f6229dda906 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -240,6 +240,10 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) va -- Regions India (id country=117) insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 117, 11701, '', 0, 'India', 1); +-- Regions Indonesia (id country=118) +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 118, 11801, '', 0, 'Indonesia', 1); + + -- Regions Maroc - Moroco (id country=12) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1201, '', 0, 'Tanger-Tétouan', 1); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1202, '', 0, 'Gharb-Chrarda-Beni Hssen', 1); diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index f82f817f5c5..541aba8a30d 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -1108,6 +1108,42 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('UP', 11701, NULL, 0, 'UP', 'Uttar Pradesh', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('WB', 11701, NULL, 0, 'WB', 'West Bengal', 1); +-- Provinces Indonesia (id country=118) +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BA', 11801, NULL, 0, 'BA', 'Bali', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BB', 11801, NULL, 0, 'BB', 'Bangka Belitung', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BT', 11801, NULL, 0, 'BT', 'Banten', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BE', 11801, NULL, 0, 'BA', 'Bengkulu', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('YO', 11801, NULL, 0, 'YO', 'DI Yogyakarta', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JK', 11801, NULL, 0, 'JK', 'DKI Jakarta', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GO', 11801, NULL, 0, 'GO', 'Gorontalo', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JA', 11801, NULL, 0, 'JA', 'Jambi', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JB', 11801, NULL, 0, 'JB', 'Jawa Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JT', 11801, NULL, 0, 'JT', 'Jawa Tengah', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JI', 11801, NULL, 0, 'JI', 'Jawa Timur', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KB', 11801, NULL, 0, 'KB', 'Kalimantan Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KS', 11801, NULL, 0, 'KS', 'Kalimantan Selatan', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KT', 11801, NULL, 0, 'KT', 'Kalimantan Tengah', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KI', 11801, NULL, 0, 'KI', 'Kalimantan Timur', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KU', 11801, NULL, 0, 'KU', 'Kalimantan Utara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KR', 11801, NULL, 0, 'KR', 'Kepulauan Riau', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LA', 11801, NULL, 0, 'LA', 'Lampung', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MA', 11801, NULL, 0, 'MA', 'Maluku', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MU', 11801, NULL, 0, 'MU', 'Maluku Utara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AC', 11801, NULL, 0, 'AC', 'Nanggroe Aceh Darussalam', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('NB', 11801, NULL, 0, 'NB', 'Nusa Tenggara Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('NT', 11801, NULL, 0, 'NT', 'Nusa Tenggara Timur', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA', 11801, NULL, 0, 'PA', 'Papua', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PB', 11801, NULL, 0, 'PB', 'Papua Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RI', 11801, NULL, 0, 'RI', 'Riau', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SR', 11801, NULL, 0, 'SR', 'Sulawesi Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SN', 11801, NULL, 0, 'SN', 'Sulawesi Selatan', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ST', 11801, NULL, 0, 'ST', 'Sulawesi Tengah', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SG', 11801, NULL, 0, 'SG', 'Sulawesi Tenggara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SA', 11801, NULL, 0, 'SA', 'Sulawesi Utara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SB', 11801, NULL, 0, 'SB', 'Sumatera Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SS', 11801, NULL, 0, 'SS', 'Sumatera Selatan', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SU', 11801, NULL, 0, 'SU', 'Sumatera Utara ', 1); + -- Provinces Mexique (id country=154) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DIF', 15401, '', 0, 'DIF', 'Distrito Federal', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AGS', 15401, '', 0, 'AGS', 'Aguascalientes', 1); @@ -1143,7 +1179,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ZAC', 15401, '', 0, 'ZAC', 'Zacatecas', 1); --- Provinces Colombie (id country=70) +-- Provinces Colombia (id country=70) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ANT', 7001, '', 0, 'ANT', 'Antioquia', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BOL', 7001, '', 0, 'BOL', 'Bolívar', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BOY', 7001, '', 0, 'BOY', 'Boyacá', 1); @@ -1284,7 +1320,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0011', 14003, '', 0, '', 'Luxembourg', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0012', 14003, '', 0, '', 'Mersch', 1); --- Provinces Perú (id country=181) +-- Provinces Peru (id country=181) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('0101', 18101, '', 0, '', 'Chachapoyas', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('0102', 18101, '', 0, '', 'Bagua', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('0103', 18101, '', 0, '', 'Bongará', 1); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index bf5f0400b9a..fe9ff500ae7 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -472,3 +472,44 @@ UPDATE llx_c_email_templates SET lang = '' WHERE lang IS NULL; ALTER TABLE llx_entrepot ADD COLUMN model_pdf VARCHAR(255) AFTER fk_user_author; ALTER TABLE llx_stock_mouvement ADD COLUMN model_pdf VARCHAR(255) AFTER origintype; + + + + +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 118, 11801, '', 0, 'Indonesia', 1); + +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BA', 11801, NULL, 0, 'BA', 'Bali', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BB', 11801, NULL, 0, 'BB', 'Bangka Belitung', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BT', 11801, NULL, 0, 'BT', 'Banten', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BE', 11801, NULL, 0, 'BA', 'Bengkulu', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('YO', 11801, NULL, 0, 'YO', 'DI Yogyakarta', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JK', 11801, NULL, 0, 'JK', 'DKI Jakarta', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GO', 11801, NULL, 0, 'GO', 'Gorontalo', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JA', 11801, NULL, 0, 'JA', 'Jambi', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JB', 11801, NULL, 0, 'JB', 'Jawa Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JT', 11801, NULL, 0, 'JT', 'Jawa Tengah', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JI', 11801, NULL, 0, 'JI', 'Jawa Timur', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KB', 11801, NULL, 0, 'KB', 'Kalimantan Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KS', 11801, NULL, 0, 'KS', 'Kalimantan Selatan', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KT', 11801, NULL, 0, 'KT', 'Kalimantan Tengah', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KI', 11801, NULL, 0, 'KI', 'Kalimantan Timur', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KU', 11801, NULL, 0, 'KU', 'Kalimantan Utara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KR', 11801, NULL, 0, 'KR', 'Kepulauan Riau', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LA', 11801, NULL, 0, 'LA', 'Lampung', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MA', 11801, NULL, 0, 'MA', 'Maluku', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MU', 11801, NULL, 0, 'MU', 'Maluku Utara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AC', 11801, NULL, 0, 'AC', 'Nanggroe Aceh Darussalam', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('NB', 11801, NULL, 0, 'NB', 'Nusa Tenggara Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('NT', 11801, NULL, 0, 'NT', 'Nusa Tenggara Timur', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA', 11801, NULL, 0, 'PA', 'Papua', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PB', 11801, NULL, 0, 'PB', 'Papua Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RI', 11801, NULL, 0, 'RI', 'Riau', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SR', 11801, NULL, 0, 'SR', 'Sulawesi Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SN', 11801, NULL, 0, 'SN', 'Sulawesi Selatan', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ST', 11801, NULL, 0, 'ST', 'Sulawesi Tengah', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SG', 11801, NULL, 0, 'SG', 'Sulawesi Tenggara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SA', 11801, NULL, 0, 'SA', 'Sulawesi Utara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SB', 11801, NULL, 0, 'SB', 'Sumatera Barat', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SS', 11801, NULL, 0, 'SS', 'Sumatera Selatan', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SU', 11801, NULL, 0, 'SU', 'Sumatera Utara ', 1); + From 10281169e6e78b209da6a34239d227539ffdbe71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 15:43:08 +0200 Subject: [PATCH 62/72] Empty page first --- htdocs/core/class/html.formwebsite.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 86e0f48c65f..fc863c4d069 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -174,7 +174,7 @@ class FormWebsite $langs->load("admin"); - $arrayofsamples=array('corporatehome'=>'CorporateHomePage', 'empty'=>'EmptyPage'); + $arrayofsamples=array('empty'=>'EmptyPage', 'corporatehome'=>'CorporateHomePage'); $out = ''; $out .= ''; print ''; + + // Print nav arrows + $pagepreviousid=0; + $pagenextid=0; + $sql = 'SELECT MAX(rowid) as pagepreviousid FROM '.MAIN_DB_PREFIX.'website_page WHERE rowid < '.$pageid.' AND fk_website = '.$object->id; + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) + { + $pagepreviousid = $obj->pagepreviousid; + } + } + else dol_print_error($db); + $sql = 'SELECT MIN(rowid) as pagenextid FROM '.MAIN_DB_PREFIX.'website_page WHERE rowid > '.$pageid.' AND fk_website = '.$object->id; + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) + { + $pagenextid = $obj->pagenextid; + } + } + else dol_print_error($db); + if ($pagepreviousid) print ''.img_previous($langs->trans("PreviousContainer")).''; + else print ''.img_previous($langs->trans("PreviousContainer")).''; + if ($pagenextid) print ''.img_next($langs->trans("NextContainer")).''; + else print ''.img_next($langs->trans("NextContainer")).''; + $websitepage = new WebSitePage($db); if ($pageid > 0 && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone')) { From d41b395a6dcdc43e35240494369d54f8fd28343b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 17:52:24 +0200 Subject: [PATCH 66/72] Fix edition of type of container --- htdocs/website/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 68eb2b8e8bb..0636cc098a8 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1905,6 +1905,7 @@ if ($action == 'editcss') print '
'; } + if ($action == 'createsite') { print '
'; @@ -1977,6 +1978,7 @@ if ($action == 'createsite') print '
'; } + if ($action == 'editmeta' || $action == 'createcontainer') { print '
'; @@ -2082,7 +2084,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print '
'; if ($action == 'createcontainer') @@ -2090,7 +2092,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; } From c78b1f11542a8a2b6846cca7f44d8f3201fd59ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 17:59:58 +0200 Subject: [PATCH 67/72] Fix navigation into page containers --- htdocs/website/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0636cc098a8..14edad66b08 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1561,9 +1561,10 @@ if (count($object->records) > 0) } } else dol_print_error($db); - if ($pagepreviousid) print ''.img_previous($langs->trans("PreviousContainer")).''; + + if ($pagepreviousid) print ''.img_previous($langs->trans("PreviousContainer")).''; else print ''.img_previous($langs->trans("PreviousContainer")).''; - if ($pagenextid) print ''.img_next($langs->trans("NextContainer")).''; + if ($pagenextid) print ''.img_next($langs->trans("NextContainer")).''; else print ''.img_next($langs->trans("NextContainer")).''; $websitepage = new WebSitePage($db); From b44717e7067ffa11da9ab0d4d7f50660d426d3a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 18:06:13 +0200 Subject: [PATCH 68/72] Fix navifation --- htdocs/website/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 14edad66b08..2538841dcd0 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1562,9 +1562,9 @@ if (count($object->records) > 0) } else dol_print_error($db); - if ($pagepreviousid) print ''.img_previous($langs->trans("PreviousContainer")).''; + if ($pagepreviousid) print ''.img_previous($langs->trans("PreviousContainer")).''; else print ''.img_previous($langs->trans("PreviousContainer")).''; - if ($pagenextid) print ''.img_next($langs->trans("NextContainer")).''; + if ($pagenextid) print ''.img_next($langs->trans("NextContainer")).''; else print ''.img_next($langs->trans("NextContainer")).''; $websitepage = new WebSitePage($db); From 894f16c5eeb44faa5936df1ec4dd0da50720b1e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 18:11:24 +0200 Subject: [PATCH 69/72] Fix navifation --- htdocs/website/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2538841dcd0..8db219b65e2 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -49,7 +49,7 @@ $website=GETPOST('website', 'alpha'); $page=GETPOST('page', 'alpha'); $pageid=GETPOST('pageid', 'int'); $pageref=GETPOST('pageref', 'aZ09'); -$action=GETPOST('action','alpha'); +$action=GETPOST('action','aZ09'); $confirm=GETPOST('confirm','alpha'); $cancel=GETPOST('cancel','alpha'); @@ -1562,9 +1562,9 @@ if (count($object->records) > 0) } else dol_print_error($db); - if ($pagepreviousid) print ''.img_previous($langs->trans("PreviousContainer")).''; + if ($pagepreviousid) print ''.img_previous($langs->trans("PreviousContainer")).''; else print ''.img_previous($langs->trans("PreviousContainer")).''; - if ($pagenextid) print ''.img_next($langs->trans("NextContainer")).''; + if ($pagenextid) print ''.img_next($langs->trans("NextContainer")).''; else print ''.img_next($langs->trans("NextContainer")).''; $websitepage = new WebSitePage($db); From 3f489ee3c61bda5ba1aa7332c273f59add8e8977 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 May 2018 17:58:32 +0200 Subject: [PATCH 70/72] Fix look and feel v7 for popup on ref of social contributions payments --- htdocs/compta/facture/class/facture.class.php | 2 +- .../sociales/class/chargesociales.class.php | 55 ++++++++++++++++--- htdocs/compta/sociales/index.php | 18 +++--- 3 files changed, 56 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 53d8bb981ce..85b596ce49c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1152,7 +1152,7 @@ class Facture extends CommonInvoice { global $langs, $conf, $user, $form; - if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips $result=''; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index f16d18c8143..65e6085a650 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -464,21 +464,58 @@ class ChargeSociales extends CommonObject /** * Return a link to the object card (with optionaly the picto) * - * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) - * @param int $maxlen Max length of label - * @param int $notooltip 1=Disable tooltip - * @return string String with link + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param int $maxlen Max length of label + * @param int $notooltip 1=Disable tooltip + * @param int $short 1=Return just URL + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with link */ - function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0) + function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0, $short=0, $save_lastsearch_value=-1) { - global $langs; + global $langs, $conf, $user, $form; + + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips $result=''; - if (empty($this->ref)) $this->ref=$this->lib; - $label = $langs->trans("ShowSocialContribution").': '.$this->ref; + $url = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$this->id; - $linkstart = ''; + if ($short) return $url; + + if ($option !== 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + + + if (empty($this->ref)) $this->ref=$this->lib; + + $label = ''.$langs->trans("ShowSocialContribution").''; + if (! empty($this->ref)) + $label .= '
'.$langs->trans('Ref') . ': ' . $this->ref; + if (! empty($this->lib)) + $label .= '
'.$langs->trans('Label') . ': ' . $this->lib; + if (! empty($this->type_libelle)) + $label .= '
'.$langs->trans('Type') . ': ' . $this->type_libelle; + + $linkclose=''; + if (empty($notooltip) && $user->rights->facture->lire) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowSocialContribution"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip"'; + } + + $linkstart='
'; $linkend=''; $result .= $linkstart; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index d38ae348c90..8721e133c84 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -28,9 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; -$langs->load("compta"); -$langs->load("banks"); -$langs->load("bills"); +$langs->loadLangs(array("compta","banks","bills")); // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; @@ -189,10 +187,10 @@ if ($resql) print '
'; // Ref print ''; // Label - print ''; + print ''; // Type print ''; // Amount print ''; print ''; // Status @@ -233,13 +231,15 @@ if ($resql) { $obj = $db->fetch_object($resql); + $chargesociale_static->id=$obj->id; + $chargesociale_static->ref=$obj->id; + $chargesociale_static->lib=$obj->libelle; + $chargesociale_static->type_libelle=$obj->type_lib; + print ''; // Ref print ''; From f3f252e88bad2698e88d99661ca916d457b094d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 May 2018 19:31:03 +0200 Subject: [PATCH 71/72] Fix duplicate record before creating primary key --- htdocs/compta/facture/card.php | 2 +- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3ff67cac02d..2a5c53d8ef7 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4197,7 +4197,7 @@ else if ($id > 0 || ! empty($ref)) $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND pf.fk_paiement = p.rowid'; $sql .= ' AND p.entity IN (' . getEntity('facture').')'; $sql .= ' ORDER BY p.datep, p.tms'; - +print $sql; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 5e0990165ba..4d432f674b5 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -142,10 +142,17 @@ ALTER TABLE llx_expensereport_det ADD COLUMN docnumber varchar(128) after fk_exp ALTER TABLE llx_website_page ADD COLUMN aliasalt varchar(255) after pageurl; --- Add missing keys and primary key DELETE FROM llx_c_paiement WHERE code = '' or code = '-' or id = 0; + +-- Remove duplicate record with same primary key in llx_c_paiement +DROP TABLE llx_c_paiement_temp; +CREATE TABLE llx_c_paiement_temp AS SELECT * FROM llx_c_paiement; +DELETE FROM llx_c_paiement WHERE entity > 1 AND id IN (SELECT cp2.id FROM llx_c_paiement_temp as cp2 WHERE cp2.entity = 1); + +-- Add missing keys and primary key ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement; ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement_code(entity, code); + -- VMYSQL4.3 ALTER TABLE llx_c_paiement CHANGE COLUMN id id INTEGER AUTO_INCREMENT PRIMARY KEY; -- VPGSQL8.2 CREATE SEQUENCE llx_c_paiement_id_seq OWNED BY llx_c_paiement.id; -- VPGSQL8.2 ALTER TABLE llx_c_paiement ADD PRIMARY KEY (id); From 5da89e1cadc519c403bfda58704230ed1d62b1dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 May 2018 19:33:46 +0200 Subject: [PATCH 72/72] Remove log --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 2a5c53d8ef7..3ff67cac02d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4197,7 +4197,7 @@ else if ($id > 0 || ! empty($ref)) $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND pf.fk_paiement = p.rowid'; $sql .= ' AND p.entity IN (' . getEntity('facture').')'; $sql .= ' ORDER BY p.datep, p.tms'; -print $sql; + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result);
'; + print ''; //print ''; print ''; - foreach(array('internal','external') as $source) + // Contacts of task + if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) { - $tab = $lines[$i]->liste_contact(-1,$source); - $num=count($tab); - if (!empty($num)){ - foreach ($tab as $contacttask){ - //var_dump($contacttask); - if ($source == 'internal') $c = new User($db); - else $c = new Contact($db); - $c->fetch($contacttask['id']); - print $c->getNomUrl(1) . ' (' . $contacttask['libelle'] . ')' . '
'; + print '
'; + foreach(array('internal','external') as $source) + { + $tab = $lines[$i]->liste_contact(-1,$source); + $num=count($tab); + if (!empty($num)){ + foreach ($tab as $contacttask){ + //var_dump($contacttask); + if ($source == 'internal') $c = new User($db); + else $c = new Contact($db); + $c->fetch($contacttask['id']); + print $c->getNomUrl(1) . ' (' . $contacttask['libelle'] . ')' . '
'; + } } } + print '
'; @@ -679,7 +679,7 @@ else if ($id > 0 || ! empty($ref)) print_liste_field_titre("TimeSpent", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); print_liste_field_titre("ProgressCalculated", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); print_liste_field_titre("ProgressDeclared", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); - print_liste_field_titre("TaskRessourceLinks",$_SERVER["PHP_SELF"],'','','',$sortfield,$sortorder,''); + if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print_liste_field_titre("TaskRessourceLinks",$_SERVER["PHP_SELF"],'','','',$sortfield,$sortorder,''); print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="center" width="80"',$sortfield,$sortorder,'maxwidthsearch '); print "
'; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; $formother->select_year($search_dtstartyear?$search_dtstartyear:-1,'search_dtstartyear',1, 20, 5); print ''; - print ''; - print ''; + print ''; + print ''; $formother->select_year($search_dtendyear?$search_dtendyear:-1,'search_dtendyear',1, 20, 5); print '
 
'; print $langs->trans('WEBSITE_TYPE_CONTAINER'); print ''; - print $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER')?GETPOST('WEBSITE_TYPE_CONTAINER'):'page')); + print $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER','alpha')?GETPOST('WEBSITE_TYPE_CONTAINER','alpha'):$type_container)); print '
'; print $langs->trans('WEBSITE_PAGE_EXAMPLE'); print ''; - print $formwebsite->selectSampleOfContainer('sample', (GETPOST('sample')?GETPOST('sample'):'corporatehomepage')); + print $formwebsite->selectSampleOfContainer('sample', (GETPOST('sample','alpha')?GETPOST('sample','alpha'):'corporatehomepage')); print '
'; - print ''; + print ''; print ''; $formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone'); @@ -201,7 +199,7 @@ if ($resql) print ' '; - print ''; + print ''; print ' 
'; - $chargesociale_static->id=$obj->id; - $chargesociale_static->lib=$obj->id; - $chargesociale_static->ref=$obj->id; print $chargesociale_static->getNomUrl(1,'20'); print '