diff --git a/ChangeLog b/ChangeLog index 34ac811e0b0..864f0930fe2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Can filter on status on interventions. +- New: Add help info of field type into dictionary of payment types. - New: Add proposals into referer page of thirdparty. - New: On contact list can set filter on both active and not active (no more exclusive select). - New: Each user can include its own external ics calendar into dolibarr agenda view. @@ -73,6 +75,7 @@ For translators: - New: When a translation is not available we always jump to en_US and only en_US. For developers: +- New: Add a css style "cursorpointer". - New: Select list of users can return user into hierarchy. - New: getBrowserInfo can return type of layout of browser (classic/phone/tablet) - New: Add hook "searchAgendaFrom". @@ -102,12 +105,18 @@ Dolibarr better: ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: - Fix: Can upload files on services. -- Fix: sql errors on updat fichinter -- Fix: debian script syntax error +- Fix: sql errors on updat fichinter. +- Fix: debian script syntax error. - Fix: error "menu param is not inside list" into pos module. -- Fix: Salary payments are not reflected on the reporting sheets -- Fix: Unsubscribe emailing not working -- Fix: Trigger on create category call failed because user is not passed on card +- Fix: Salary payments are not reflected on the reporting sheets. +- Fix: Unsubscribe emailing not working. +- Fix: Trigger on create category call failed because user is not passed on card. +- Fix: list event view lost type event filter. +- Fix: Save also code event. +- Fix: VAT payment - Add control on field date value. +- Fix: Salaries payment - Field date value is now required and add control on it. +- Fix: Iban was used instead of Bic into SEPA file. +- Fix: Must unaccent strings into SEPA file. ***** ChangeLog for 3.6 compared to 3.5.* ***** For users: diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 11c3eb3f80b..d9ebddf2b22 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -387,17 +387,23 @@ if ($id == 11) $langs->load("bills"); $langs->load("interventions"); $elementList = array( - 'commande' => $langs->trans('Order'), + 'proposal' => $langs->trans('Proposal'), + 'order' => $langs->trans('Order'), + 'invoice' => $langs->trans('Bill'), 'invoice_supplier' => $langs->trans('SupplierBill'), 'order_supplier' => $langs->trans('SupplierOrder'), - 'contrat' => $langs->trans('Contract'), + 'intervention' => $langs->trans('InterventionCard'), + 'contract' => $langs->trans('Contract'), 'project' => $langs->trans('Project'), 'project_task' => $langs->trans('Task'), + 'agenda' => $langs->trans('Agenda'), + // old deprecated + 'contrat' => $langs->trans('Contract'), 'propal' => $langs->trans('Proposal'), + 'commande' => $langs->trans('Order'), 'facture' => $langs->trans('Bill'), 'facture_fourn' => $langs->trans('SupplierBill'), - 'fichinter' => $langs->trans('InterventionCard'), - 'agenda' => $langs->trans('Agenda') + 'fichinter' => $langs->trans('InterventionCard') ); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); $sourceList = array( @@ -770,7 +776,10 @@ if ($id) if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3";} if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } - if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } + if ($fieldlist[$field]=='type') { + if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); + else $valuetoshow=$langs->trans("Type"); + } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; } if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 1d2325413f1..29ad7182e5b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -166,7 +166,7 @@ $nowday=$nowarray['mday']; $listofextcals=array(); // Define list of external calendars (global admin setup) -if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0) +if (empty($conf->global->AGENDA_DISABLE_EXT)) { $i=0; while($i < $conf->global->AGENDA_EXT_NB) @@ -184,19 +184,22 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0 } } // Define list of external calendars (user setup) -$i=0; -while($i < $conf->global->AGENDA_EXT_NB) +if (empty($user->conf->AGENDA_DISABLE_EXT)) { - $i++; - $source='AGENDA_EXT_SRC_'.$user->id.'_'.$i; - $name='AGENDA_EXT_NAME_'.$user->id.'_'.$i; - $color='AGENDA_EXT_COLOR_'.$user->id.'_'.$i; - $enabled='AGENDA_EXT_ENABLED_'.$user->id.'_'.$i; - $buggedfile='AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i; - if (! empty($user->conf->$source) && ! empty($user->conf->$name)) + $i=0; + while($i < $conf->global->AGENDA_EXT_NB) { - // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' - $listofextcals[]=array('src'=>$user->conf->$source,'name'=>$user->conf->$name,'color'=>$user->conf->$color,'buggedfile'=>(isset($user->conf->buggedfile)?$user->conf->buggedfile:0)); + $i++; + $source='AGENDA_EXT_SRC_'.$user->id.'_'.$i; + $name='AGENDA_EXT_NAME_'.$user->id.'_'.$i; + $color='AGENDA_EXT_COLOR_'.$user->id.'_'.$i; + $enabled='AGENDA_EXT_ENABLED_'.$user->id.'_'.$i; + $buggedfile='AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i; + if (! empty($user->conf->$source) && ! empty($user->conf->$name)) + { + // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' + $listofextcals[]=array('src'=>$user->conf->$source,'name'=>$user->conf->$name,'color'=>$user->conf->$color,'buggedfile'=>(isset($user->conf->buggedfile)?$user->conf->buggedfile:0)); + } } } @@ -228,18 +231,20 @@ if ($action=='show_week') $prev_month = $prev['prev_month']; $prev_day = $prev['prev_day']; $first_day = $prev['first_day']; + $first_month= $prev['first_month']; + $first_year = $prev['first_year']; $week = $prev['week']; $day = (int) $day; - $next = dol_get_next_week($day, $week, $month, $year); + $next = dol_get_next_week($first_day, $week, $first_month, $first_year); $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow - $firstdaytoshow=dol_mktime(0,0,0,$prev_month,$first_day,$prev_year); - $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); + $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); + $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); @@ -296,7 +301,7 @@ if (empty($action) || $action=='show_month') if ($action=='show_week') { $nav ="".img_previous($langs->trans("Previous"))."\n"; - $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%Y").", ".$langs->trans("Week")." ".$week; + $nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week; $nav.=" \n"; $nav.="".img_next($langs->trans("Next"))."\n"; $nav.="   (".$langs->trans("Today").")"; @@ -338,10 +343,6 @@ $showextcals=$listofextcals; if ($conf->use_javascript_ajax) { $s=''; - //print ''; - - //print $langs->trans("Calendars").': '; - //print ''; $s.='' . "\n"; + if (! empty($conf->use_javascript_ajax)) + { + $s.='
' . $langs->trans("LocalAgenda").'  
'; + if (is_array($showextcals) && count($showextcals) > 0) + { + foreach ($showextcals as $val) + { + $htmlname = dol_string_nospecial($val['name']); + $s.='' . "\n"; + $s.='
' . $val ['name'] . '  
'; + } + } + } + //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; +} + + + +$link=''; print_fiche_titre($s,$link.'     '.$nav, ''); @@ -336,7 +367,7 @@ else if ($type) $sql.= " AND ca.id = ".$type; if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable -if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running +if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) @@ -349,7 +380,7 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) $sql.= ")"; } // Sort on date -$sql.= ' ORDER BY datep'; +$sql.= ' ORDER BY fk_user_action, datep'; //fk_user_action //print $sql; dol_syslog("comm/action/index.php", LOG_DEBUG); @@ -446,6 +477,7 @@ else dol_print_error($db); } + $maxnbofchar=18; $cachethirdparties=array(); $cachecontacts=array(); @@ -459,22 +491,359 @@ if (is_readable($color_file)) if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), array(200,160,180), array(190,190,220)); +$newparam=$param; // newparam is for birthday links +$newparam=preg_replace('/showbirthday=/i','showbirthday_=',$newparam); // To avoid replacement when replace day= is done +$newparam=preg_replace('/action=show_month&?/i','',$newparam); +$newparam=preg_replace('/action=show_week&?/i','',$newparam); +$newparam=preg_replace('/day=[0-9]+&?/i','',$newparam); +$newparam=preg_replace('/month=[0-9]+&?/i','',$newparam); +$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam); +$newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam); +$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter +$newparam.='&viewweek=1'; + +echo '
'; +echo ''; +echo ''; +echo '' ; +echo '
'; -/* TODO Export - print ' - - - +// Table : +echo ''; + +echo ''; +echo ''; +$i=0; +while ($i < 7) +{ + if (($i + 1) < $begin_d || ($i + 1) > $end_d) + { + $i++; + continue; + } + echo '\n"; + $i++; +} +echo "\n"; + +echo ''; +echo ''; +$i=0; +while ($i < 7) +{ + if (($i + 1) < $begin_d || ($i + 1) > $end_d) + { + $i++; + continue; + } + for ($h = $begin_h; $h < $end_h; $h++) + { + echo '"; + } + echo "\n"; + $i++; +} +echo "\n"; + +// Define $usernames +$usernames = array(); //init +/* Use this to have list of users only if users have events +foreach ($eventarray as $daykey => $notused) +{ + $annee = date('Y',$daykey); + $mois = date('m',$daykey); + $jour = date('d',$daykey); + //if ($day==$jour && $month==$mois && $year==$annee) + //{ + //Tout les events à la même date : + foreach ($eventarray[$daykey] as $index => $event) + { + $myuser = new User($db); + $user_id = $event->usertodo->id; + $myuser->fetch($user_id); + $username = $myuser->getFullName($langs); + if (! in_array($username, $usernames)) + { + $usernames[] = $username; + } + } + //} +}*/ +if ($filtert > 0) +{ + var_dump($filtert); + $tmpuser = new User($db); + $tmpuser->fetch($filtert); + $usernames[] = $tmpuser; +} +else if ($usergroup) +{ + $tmpgroup = new UserGroup($db); + $tmpgroup->fetch($usergroup); + $usernames = $tmpgroup->listUsersForGroup(); +} +else +{ + $tmpgroup = new UserGroup($db); + //$tmpgroup->fetch($usergroup); No fetch, we want all users for all groups + $usernames = $tmpgroup->listUsersForGroup(); +} + + +// Loop on each user to show calendar +$sav = $tmpday; +$showheader = true; +foreach ($usernames as $username) +{ + echo ""; + echo ''; + $tmpday = $sav; + + $i = 0; + for ($iter_day = 0; $iter_day < 7; $iter_day++) + { + if (($i + 1) < $begin_d || ($i + 1) > $end_d) + { + $i++; + continue; + } + + // Show days of the current week + $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); + $tmparray = dol_getdate($curtime,'fast'); + $tmpday = $tmparray['mday']; + $tmpmonth = $tmparray['mon']; + $tmpyear = $tmparray['year']; + + $style='cal_current_month'; + if ($iter_day == 6) $style.=' cal_other_month'; + $today=0; + $todayarray=dol_getdate($now,'fast'); + if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; + if ($today) $style='cal_today_peruser'; + + show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader); + + $i++; + } + echo "\n"; + $showheader = false; +} + +echo "
'; + echo $langs->trans("Day".(($i+(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)) % 7)); + print "
"; + if ($i) print dol_print_date(dol_time_plus_duree($firstdaytoshow, $i, 'd'),'day'); + else print dol_print_date($firstdaytoshow,'day'); + echo "
'; + print ''.sprintf("%02d",$h).''; + print "
' . $username->getNomUrl(1). '
\n"; + + +// Add js code to manage click on a box +print ''; + - -'; -*/ llxFooter(); $db->close(); + + + + + +/** + * Show event of a particular day + * + * @param int $day Day + * @param int $month Month + * @param int $year Year + * @param int $monthshown Current month shown in calendar view + * @param string $style Style to use for this day + * @param array &$eventarray Array of events + * @param int $maxprint Nb of actions to show each day on month view (0 means no limit) + * @param int $maxnbofchar Nb of characters to show for event line + * @param string $newparam Parameters on current URL + * @param int $showinfo Add extended information (used by day view) + * @param int $minheight Minimum height for each event. 60px by default. + * @return void + */ +function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false) +{ + global $db; + global $user, $conf, $langs; + global $filter, $filtera, $filtert, $filterd, $status, $actioncode; // Filters used into search form + global $theme_datacolor; + global $cachethirdparties, $cachecontacts, $colorindexused; + global $begin_h, $end_h; + + $cases1 = array(); // Color first half hour + $cases2 = array(); // Color second half hour + + $curtime = dol_mktime(0, 0, 0, $month, $day, $year); + + $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); + $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); + + $nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ... + + foreach ($eventarray as $daykey => $notused) + { + $annee = date('Y',$daykey); + $mois = date('m',$daykey); + $jour = date('d',$daykey); + if ($day==$jour && $month==$mois && $year==$annee) + { + //Tout les events à la même date : + foreach ($eventarray[$daykey] as $index => $event) + { + if ($username->id != $event->usertodo->id) continue; // We discard record if event is from another user than user we want to show + + $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); + + // Define $color and $cssclass of event + $color=-1; $cssclass=''; $colorindex=-1; + if ((! empty($event->author->id) && $event->author->id == $user->id) + || (! empty($event->usertodo->id) && $event->usertodo->id == $user->id) + || (! empty($event->userdone->id) && $event->userdone->id == $user->id)) + { + $nummytasks++; $cssclass='family_mytasks'; + } + else if ($event->type_code == 'ICALEVENT') + { + $numical++; + if (! empty($event->icalname)) { + if (! isset($numicals[dol_string_nospecial($event->icalname)])) { + $numicals[dol_string_nospecial($event->icalname)] = 0; + } + $numicals[dol_string_nospecial($event->icalname)]++; + } + $color=$event->icalcolor; + $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); + } + else if ($event->type_code == 'BIRTHDAY') { + $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); + } + else { $numother++; $cssclass='family_other'; + } + if ($color == -1) // Color was not forced. Set color according to color index. + { + // Define color index if not yet defined + $idusertouse=($event->usertodo->id?$event->usertodo->id:0); + if (isset($colorindexused[$idusertouse])) + { + $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user + } + else + { + $colorindex=$nextindextouse; + $colorindexused[$idusertouse]=$colorindex; + if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color + } + // Define color + $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); + } + //$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; + + // Show rect of event + for ($h = $begin_h; $h < $end_h; $h++) + { + $color = ''; //init + if (empty($event->fulldayevent)) + { + $a = dol_mktime((int) $h,0,0,$month,$day,$year); + $b = dol_mktime((int) $h,30,0,$month,$day,$year); + $c = dol_mktime((int) $h+1,0,0,$month,$day,$year); + + if ($event->date_start_in_calendar < $b && $event->date_end_in_calendar > $a) + { + $cases1[$h][$event->id]++; + } + if ($event->date_start_in_calendar < $c && $event->date_end_in_calendar > $b) + { + $cases2[$h][$event->id]++; + } + } + else + { + $cases1[$h][$event->id]=1; + $cases2[$h][$event->id]=1; + break; + } + } + $i++; + } + + break; + } + } + + for ($h = $begin_h; $h < $end_h; $h++) + { + $style1='';$style2=''; + $string1=' ';$string2=' '; + $title1='';$title2=''; + if (isset($cases1[$h])) + { + if ($cases1[$h] != '') + { + $title = (int) $cases1[$h]; + $title .= 'h'; + if ((int) $cases1[$h] != $cases1[$h]) + $title .= '30'; + else + $title .= '00'; + $string1=' '; + $style1='peruser_busy'; + $url=''; + } + } + if (isset($cases2[$h])) + { + if ($cases2[$h] != '') + { + $title = (int) $cases2[$h]; + $title .= 'h'; + if ((int) $cases2[$h] != $cases2[$h]) $title .= '30'; + else $title .= '00'; + $string2=' '; + $style2='peruser_busy'; + $url=''; + } + } + + + if ($h == $begin_h) echo ''; + else echo ''; + if (count($cases1[$h]) == 1) // 1 seul evenement + { + $ids=array_keys($cases1[$h]); + $id=$ids[0]; + $title1='zzz'; + } + if (count($cases2[$h]) == 1) // 1 seul evenement + { + $ids=array_keys($cases2[$h]); + $id=$ids[0]; + $title2='bbb'; + } + print ''; + print ''; + print '
'; + //var_dump($cases1[$h]); + print $string1; + print ''; + print $string2; + print '
'; + print ''; + } +} diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 35ab381a35f..2cfa97549b1 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -365,7 +365,11 @@ else if ($action == 'add' && $user->rights->propal->creer) { if ($result > 0) { $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject, 'fetch_lines')) $lines = $srcobject->fetch_lines(); + if (empty($lines) && method_exists($srcobject, 'fetch_lines')) + { + $srcobject->fetch_lines(); + $lines = $srcobject->lines; + } $fk_parent_line=0; $num=count($lines); @@ -1283,7 +1287,9 @@ if ($action == 'create') { $objectsrc = new $classname($db); $objectsrc->fetch($originid); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) + { $objectsrc->fetch_lines(); + } $objectsrc->fetch_thirdparty(); $projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); @@ -1951,7 +1957,8 @@ if ($action == 'create') { print ''; } - if ($soc->outstanding_limit) { + if ($soc->outstanding_limit) + { // Outstanding Bill print ''; print $langs->trans('OutstandingBill'); @@ -1962,6 +1969,26 @@ if ($action == 'create') { print ''; } + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL)) + { + // Bank Account + print ''; + print ''; + if ($action != 'editbankaccount' && $user->rights->propal->creer) + print ''; + print '
'; + print $langs->trans('BankAccount'); + print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; + print ''; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print ''; + print ''; + } + // Other attributes (TODO Move this into an include) $res = $object->fetch_optionals($object->id, $extralabels); $parameters = array('colspan' => ' colspan="3"'); @@ -2009,23 +2036,6 @@ if ($action == 'create') { } } - // Bank Account - print ''; - print ''; - if ($action != 'editbankaccount' && $user->rights->propal->creer) - print ''; - print '
'; - print $langs->trans('BankAccount'); - print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; - print ''; - if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print ''; - print ''; - // Amount HT print '' . $langs->trans('AmountHT') . ''; print '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . ''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 1d59311404e..2fda0277bec 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -271,10 +271,12 @@ else if ($action == 'add' && $user->rights->commande->creer) { if ($ret < 0) $error ++; - if (! $error) { + if (! $error) + { $object_id = $object->create($user); - if ($object_id > 0) { + if ($object_id > 0) + { dol_include_once('/' . $element . '/class/' . $subelement . '.class.php'); $classname = ucfirst($subelement); @@ -282,15 +284,20 @@ else if ($action == 'add' && $user->rights->commande->creer) { dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines"); $result = $srcobject->fetch($object->origin_id); - if ($result > 0) { + if ($result > 0) + { $lines = $srcobject->lines; if (empty($lines) && method_exists($srcobject, 'fetch_lines')) - $lines = $srcobject->fetch_lines(); + { + $srcobject->fetch_lines(); + $lines = $srcobject->lines; + } $fk_parent_line = 0; $num = count($lines); - for($i = 0; $i < $num; $i ++) { + for($i = 0; $i < $num; $i ++) + { $label = (! empty($lines [$i]->label) ? $lines [$i]->label : ''); $desc = (! empty($lines [$i]->desc) ? $lines [$i]->desc : $lines [$i]->libelle); $product_type = (! empty($lines [$i]->product_type) ? $lines [$i]->product_type : 0); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 8b16428b23f..814e52884ab 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -100,7 +100,7 @@ if (($action == 'create' || $action == 'add') && !$error) require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - + $langs->load('bills'); $langs->load('products'); $langs->load('main'); @@ -216,13 +216,17 @@ if (($action == 'create' || $action == 'add') && !$error) $result=$objectsrc->fetch($orders_id[$ii]); if ($result > 0) { - if ($closeOrders) + if ($closeOrders) { $objectsrc->classifyBilled(); $objectsrc->setStatut(3); } $lines = $objectsrc->lines; - if (empty($lines) && method_exists($objectsrc,'fetch_lines')) $lines = $objectsrc->fetch_lines(); + if (empty($lines) && method_exists($objectsrc, 'fetch_lines')) + { + $objectsrc->fetch_lines(); + $lines = $objectsrc->lines; + } $fk_parent_line=0; $num=count($lines); for ($i=0;$i<$num;$i++) diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 27acf7eba59..c118186df27 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -240,7 +240,7 @@ if ($action == 'create') print ''; // Ref - print ''; + print ''; print ''; // Label @@ -306,11 +306,15 @@ if ($action == 'create') $doleditor=new DolEditor('account_comment',$account->comment,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); $doleditor->Create(); print ''; + + print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'ref).'" maxlength="12">
'; + + print '
'; + + print ''; // Sold - print ''; - - print ''; + print ''; print ''; print ''; @@ -332,12 +336,12 @@ if ($action == 'create') // Accountancy code if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { - print ''; + print ''; print ''; } else { - print ''; + print ''; print ''; } @@ -506,8 +510,7 @@ else $account->fetch(GETPOST('id','int')); print_fiche_titre($langs->trans("EditFinancialAccount")); - print "
"; - + if ($conf->use_javascript_ajax) { print "\n".'
'.$langs->trans("InitialBankBalance").'...
'.$langs->trans("InitialBankBalance").'
'.$langs->trans("InitialBankBalance").'solde)).'">
'.$langs->trans("Date").'
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'