Merge remote-tracking branch 'upstream/develop' into free_email

This commit is contained in:
Frédéric FRANCE 2020-05-08 21:29:12 +02:00
commit bd7a2d23a0
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
29 changed files with 265 additions and 98 deletions

View File

@ -5,11 +5,12 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017 André Schild <a.schild@aarboard.ch>
* Copyright (C) 2020 Guillaume Alexandre <guillaume@tag-info.fr>
*
* 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
@ -52,6 +53,7 @@ class AccountancyExport
public static $EXPORT_TYPE_SAGE50_SWISS = 45;
public static $EXPORT_TYPE_CHARLEMAGNE = 50;
public static $EXPORT_TYPE_QUADRATUS = 60;
public static $EXPORT_TYPE_WINFIC = 70;
public static $EXPORT_TYPE_OPENCONCERTO = 100;
public static $EXPORT_TYPE_LDCOMPTA = 110;
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
@ -105,6 +107,7 @@ class AccountancyExport
self::$EXPORT_TYPE_BOB50 => $langs->trans('Modelcsv_bob50'),
self::$EXPORT_TYPE_CIEL => $langs->trans('Modelcsv_ciel'),
self::$EXPORT_TYPE_QUADRATUS => $langs->trans('Modelcsv_quadratus'),
self::$EXPORT_TYPE_WINFIC => $langs->trans('Modelcsv_winfic'),
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
@ -136,6 +139,7 @@ class AccountancyExport
self::$EXPORT_TYPE_BOB50 => 'bob50',
self::$EXPORT_TYPE_CIEL => 'ciel',
self::$EXPORT_TYPE_QUADRATUS => 'quadratus',
self::$EXPORT_TYPE_WINFIC => 'winfic',
self::$EXPORT_TYPE_EBP => 'ebp',
self::$EXPORT_TYPE_COGILOG => 'cogilog',
self::$EXPORT_TYPE_AGIRIS => 'agiris',
@ -184,6 +188,10 @@ class AccountancyExport
'label' => $langs->trans('Modelcsv_quadratus'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_WINFIC => array(
'label' => $langs->trans('Modelcsv_winfic'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_EBP => array(
'label' => $langs->trans('Modelcsv_ebp'),
),
@ -246,7 +254,7 @@ class AccountancyExport
$filename = 'general_ledger-'.$this->getFormatCode($formatexportset);
$type_export = 'general_ledger';
global $db; // The tpl file use $db
global $db; // The tpl file use $db
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
@ -269,6 +277,9 @@ class AccountancyExport
case self::$EXPORT_TYPE_QUADRATUS :
$this->exportQuadratus($TData);
break;
case self::$EXPORT_TYPE_WINFIC :
$this->exportWinfic($TData);
break;
case self::$EXPORT_TYPE_EBP :
$this->exportEbp($TData);
break;
@ -548,6 +559,85 @@ class AccountancyExport
}
}
/**
* Export format : WinFic - eWinfic - WinSis Compta
*
*
* @param array $TData data
* @return void
*/
public function exportWinfic(&$TData)
{
global $conf;
$end_line = "\r\n";
//We should use dol_now function not time however this is wrong date to transfert in accounting
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
foreach ($TData as $data) {
$code_compta = $data->numero_compte;
if (!empty($data->subledger_account))
$code_compta = $data->subledger_account;
$Tab = array();
//$Tab['type_ligne'] = 'M';
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
//$Tab['date_ecriture'] = $date_ecriture;
$Tab['date_operation'] = dol_print_date($data->doc_date, '%d%m%Y');
$Tab['folio'] = ' 1';
$Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT);
$Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0');
if($data->sens == 'D'){
$Tab['montant_debit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT);
$Tab['montant_crebit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
}
else{
$Tab['montant_debit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
$Tab['montant_crebit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT);
}
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30);
$Tab['lettrage'] = str_repeat(' ', 2);
$Tab['code_piece'] = str_repeat(' ', 5);
$Tab['code_stat'] = str_repeat(' ', 4);
if (!empty($data->date_echeance))
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y');
else
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
$Tab['monnaie'] = '1';
$Tab['filler'] = ' ';
$Tab['ind_compteur'] = ' ';
$Tab['quantite'] = '0,000000000';
$Tab['code_pointage'] = str_repeat(' ', 2);
$Tab['end_line'] = $end_line;
print implode('|', $Tab);
}
}
/**
* Export format : EBP
@ -930,7 +1020,7 @@ class AccountancyExport
}
/**
* Export format : LD Compta version 9 & higher
* Export format : LD Compta version 9
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf
*
* @param array $objectLines data

View File

@ -365,9 +365,9 @@ if ($mode == 'overwrite')
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
print ' &nbsp; ';
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
}
print '</td>';
@ -531,8 +531,8 @@ if ($mode == 'searchkey')
{
$obj = $db->fetch_object($result);
}
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=edit">'.img_edit().'</a>';
print '&nbsp;&nbsp;';
print '<a class="editfielda reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=edit">'.img_edit().'</a>';
print ' ';
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=delete">'.img_delete().'</a>';
print '&nbsp;&nbsp;';
$htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
@ -541,7 +541,7 @@ if ($mode == 'searchkey')
elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
{
//print $key.'-'.$val;
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&amp;langcode='.$langcode.'&amp;transkey='.$key.'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&amp;langcode='.$langcode.'&amp;transkey='.$key.'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
}
if (!empty($conf->global->MAIN_FEATURES_LEVEL))

View File

@ -1004,6 +1004,7 @@ class BOM extends CommonObject
/**
* BOM costs calculation based on cost_price or pmp of each BOM line
*
* @return void
*/
public function calculateCosts()
@ -1022,7 +1023,9 @@ class BOM extends CommonObject
}
$this->total_cost = price2num($this->total_cost, 'MT');
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
if ($this->qty) {
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
}
}
}

View File

@ -405,7 +405,6 @@ class ActionComm extends CommonObject
$this->userassigned[$tmpid] = array('id'=>$tmpid, 'transparency'=>$this->transparency);
}
$userownerid = $this->userownerid;
$userdoneid = $this->userdoneid;
@ -484,7 +483,7 @@ class ActionComm extends CommonObject
$sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", ";
$sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated
$sql .= (isset($this->type_id) ? $this->type_id : "null").",";
$sql .= ($code ? ("'".$code."'") : "null").", ";
$sql .= ($code ? ("'".$this->db->escape($code)."'") : "null").", ";
$sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", ";
$sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", ";
$sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", ";

View File

@ -242,7 +242,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$sql = "SELECT";
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
$sql .= " a.id, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= " a.fk_contact, a.note, a.percent as percent,";
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
@ -385,14 +385,8 @@ if ($resql)
print '<input type="hidden" name="type" value="'.$type.'">';
$nav = '';
//if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
//if ($resourceid) $nav.='<input type="hidden" name="resourceid" value="'.$resourceid.'">';
if ($filter) $nav .= '<input type="hidden" name="search_filter" value="'.$filter.'">';
//if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
//if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
if ($showbirthday) $nav .= '<input type="hidden" name="search_showbirthday" value="1">';
//if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
//if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
print $nav;
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
@ -548,6 +542,7 @@ if ($resql)
$actionstatic->id = $obj->id;
$actionstatic->ref = $obj->id;
$actionstatic->code = $obj->code;
$actionstatic->type_code = $obj->type_code;
$actionstatic->type_label = $obj->type_label;
$actionstatic->type_picto = $obj->type_picto;
@ -583,21 +578,31 @@ if ($resql)
if (!empty($arrayfields['c.libelle']['checked']))
{
print '<td class="nowraponall">';
$actioncomm = $actionstatic;
// TODO Code common with code into showactions
$imgpicto = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto);
else {
if ($actionstatic->type_code == 'AC_RDV') print img_picto('', 'object_group', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_TEL') print img_picto('', 'object_phoning', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_EMAIL') print img_picto('', 'object_email', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_INT') print img_picto('', 'object_intervention', '', false, 0, 0, '', '').' ';
elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) print img_picto('', 'object_other', '', false, 0, 0, '', '').' ';
}
if ($actioncomm->type_picto) {
$imgpicto = img_picto('', $actioncomm->type_picto);
}
else {
if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_other', '', false, 0, 0, '', 'paddingright').' ';
}
}
print $imgpicto;
$labeltype = $obj->type_code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype = 'AC_OTH';
if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
$labeltype = $langs->trans("Message");
} elseif (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
print dol_trunc($labeltype, 28);
print '</td>';
}
@ -620,7 +625,7 @@ if ($resql)
$formatToUse = $obj->fulldayevent ? 'day' : 'dayhour';
// Start date
if (!empty($arrayfields['a.datep']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->dp), $formatToUse);
$late = 0;
if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1;
@ -633,7 +638,7 @@ if ($resql)
// End date
if (!empty($arrayfields['a.datep2']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->dp2), $formatToUse);
print '</td>';
}

View File

@ -1177,6 +1177,30 @@ class Facture extends CommonInvoice
{
unset($object->lines[$i]);
unset($object->products[$i]); // Tant que products encore utilise
}
// Bloc to update dates of service (month by month only if previously filled at 1d near start or end of month)
// If it's a service with start and end dates
if (!empty($line->date_start) && !empty($line->date_end) ) {
// Get the dates
$start = dol_getdate($line->date_start);
$end = dol_getdate($line->date_end);
// Get the first and last day of the month
$first = dol_get_first_day($start['year'], $start['mon']);
$last = dol_get_first_day($end['year'], $end['mon']);
// Get diff betweend start/end of month and previously filled
$diffFirst = num_between_day($first, dol_mktime($start['hours'], $start['minutes'], $start['seconds'], $start['mon'], $start['mday'], $start['year'], 'user'));
$diffLast = num_between_day(dol_mktime($end['hours'], $end['minutes'], $end['seconds'], $end['mon'], $end['mday'], $end['year'], 'user'), $last);
// If there is <= 1d (or 2?) of start/or/end of month
if ($diffFirst <= 2 && $diffLast <= 2) {
$nextMonth = dol_get_next_month($end['mon'], $end['year']);
$newFirst = dol_get_first_day($nextMonth['year'], $nextMonth['month']);
$newLast = dol_get_last_day($nextMonth['year'], $nextMonth['month']);
$object->lines[$i]->date_start = $newFirst;
$object->lines[$i]->date_end = $newLast;
}
}
}

View File

@ -2227,13 +2227,12 @@ else
$MAXEVENT = 10;
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'contract', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlright);
$somethingshown = $formactions->showactions($object, 'contract', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter);
print '</div></div></div>';
}

View File

@ -165,13 +165,12 @@ class FormActions
* @param string $morecss More css on table
* @param int $max Max number of record
* @param string $moreparambacktopage More param for the backtopage
* @param string $morehtmlright More html text on right of title line
* @param string $morehtmlcenter More html text on center of title line
* @return int <0 if KO, >=0 if OK
*/
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlright = '')
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '')
{
global $langs, $conf, $user;
global $bc;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
@ -208,8 +207,9 @@ class FormActions
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
}
print '<!-- formactions->showactions -->'."\n";
print load_fiche_titre($title, $newcardbutton, '', 0, 0, '', $morehtmlright);
print load_fiche_titre($title, $newcardbutton, '', 0, 0, '', $morehtmlcenter);
$page = 0; $param = '';
@ -230,29 +230,29 @@ class FormActions
$cacheusers = array();
$cursorevent = 0;
foreach ($listofactions as $action)
foreach ($listofactions as $actioncomm)
{
if ($max && $cursorevent >= $max) break;
$ref = $action->getNomUrl(1, -1);
$label = $action->getNomUrl(0, 38);
$ref = $actioncomm->getNomUrl(1, -1);
$label = $actioncomm->getNomUrl(0, 38);
print '<tr class="oddeven">';
// Ref
print '<td class="nowraponall">'.$ref.'</td>';
// Onwer
print '<td class="tdoverflowmax150">';
if (!empty($action->userownerid))
if (!empty($actioncomm->userownerid))
{
if (is_object($cacheusers[$action->userownerid]))
if (is_object($cacheusers[$actioncomm->userownerid]))
{
$tmpuser = $cacheusers[$action->userownerid];
$tmpuser = $cacheusers[$actioncomm->userownerid];
}
else
{
$tmpuser = new User($this->db);
$tmpuser->fetch($action->userownerid);
$cacheusers[$action->userownerid] = $tmpuser;
$tmpuser->fetch($actioncomm->userownerid);
$cacheusers[$actioncomm->userownerid] = $tmpuser;
}
if ($tmpuser->id > 0)
{
@ -260,41 +260,50 @@ class FormActions
}
}
print '</td>';
// Type
print '<td>';
// TODO Code common with code into comm/action/list.php
$imgpicto = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($action->type_picto) $imgpicto = img_picto('', $action->type_picto);
if ($actioncomm->type_picto) {
$imgpicto = img_picto('', $actioncomm->type_picto);
}
else {
if ($action->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif (!preg_match('/_AUTO/', $action->type_code)) $imgpicto = img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
}
}
print $imgpicto;
print $action->type_short ? $action->type_short : $action->type;
if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
print $langs->trans("Message");
} else {
print $actioncomm->type_short ? $actioncomm->type_short : $actioncomm->type;
}
print '</td>';
// Label
print '<td>'.$label.'</td>';
// Date
print '<td class="center">'.dol_print_date($action->datep, 'dayhour', 'tzuserrel');
if ($action->datef)
print '<td class="center">'.dol_print_date($actioncomm->datep, 'dayhour', 'tzuserrel');
if ($actioncomm->datef)
{
$tmpa = dol_getdate($action->datep);
$tmpb = dol_getdate($action->datef);
$tmpa = dol_getdate($actioncomm->datep);
$tmpb = dol_getdate($actioncomm->datef);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year'])
{
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef, 'hour', 'tzuserrel');
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel');
}
else print '-'.dol_print_date($action->datef, 'dayhour', 'tzuserrel');
else print '-'.dol_print_date($actioncomm->datef, 'dayhour', 'tzuserrel');
}
print '</td>';
print '<td class="right">';
print $action->getLibStatut(3);
print $actioncomm->getLibStatut(3);
print '</td>';
print '</tr>';

View File

@ -27,7 +27,7 @@
/**
* Show filter form in agenda view
*
* @param Object $form Form object
* @param Form $form Form object
* @param int $canedit Can edit filter fields
* @param int $status Status
* @param int $year Year
@ -123,7 +123,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print $langs->trans("ThirdParty").' &nbsp; ';
print '</td><td class="nowrap" style="padding-bottom: 2px;">';
print img_picto('', 'company');
print $form->select_company($socid, 'search_socid', '', 'SelectThirdParty', 0, 0, null, 0);
print $form->select_company($socid, 'search_socid', '', '&nbsp;', 0, 0, null, 0);
print '</td></tr>';
}

View File

@ -3155,7 +3155,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'intervention', 'label', 'language', 'list', 'listlight', 'lot',
'map-marker-alt', 'money-bill-alt', 'mrp', 'note',
'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label',
@ -3190,7 +3190,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$arrayconvpictotofa = array(
'account'=>'university', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'address'=> 'address-book',
'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billd'=>'file-medical', 'bom'=>'cubes',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
@ -3263,7 +3263,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$arrayconvpictotomorcess = array(
'action'=>'bg-infobox-action', 'account'=>'bg-infobox-bank_account', 'accountancy'=>'bg-infobox-bank_account',
'bank_account'=>'bg-infobox-bank_account', 'bill'=>'bg-infobox-commande', 'billa'=>'bg-infobox-commande', 'billd'=>'bg-infobox-commande',
'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4',
'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', 'conversation'=>'bg-infobox-contrat',
'donation'=>'bg-infobox-commande', 'dollyrevert'=>'flip', 'ecm'=>'bg-infobox-action',
'hrm'=>'bg-infobox-adherent', 'group'=>'bg-infobox-adherent', 'intervention'=>'bg-infobox-contrat',
'multicurrency'=>'bg-infobox-bank_account',

View File

@ -709,7 +709,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out .= $histo[$key]['id'];
$out .= '</a> ';
} else {
$out .= $actionstatic->getNomUrl(1, -1).' ';
$out .= $actionstatic->getNomUrl(1, -1, 'valignmiddle').' ';
}
//if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id)

View File

@ -33,11 +33,6 @@ if (!is_object($website))
$website = new Website($db);
$website->fetch(0, $websitekey);
}
// Define $weblangs
if (!is_object($weblangs))
{
$weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice
}
// Define $websitepage if we have $websitepagefile defined
if (!$pageid && !empty($websitepagefile))
{
@ -48,10 +43,17 @@ if (!is_object($websitepage))
{
$websitepage = new WebsitePage($db);
}
// Define $weblangs
if (!is_object($weblangs))
{
$weblangs = new Translate('', $conf);
}
if ($pageid > 0)
{
$websitepage->fetch($pageid);
$weblangs->setDefaultLang($websitepage->lang ? $websitepage->lang : 'auto');
if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other')))
{
$weblangs->load("website");

View File

@ -582,3 +582,14 @@ create table llx_commande_fournisseur_dispatch_extrafields
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
create table llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object);

View File

@ -54,6 +54,15 @@ create table llx_c_shipment_package_type
entity integer DEFAULT 1 NOT NULL -- Multi company id
)ENGINE=innodb;
create table llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object);
-- For v12
@ -275,4 +284,4 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL;
ALTER TABLE llx_menu MODIFY COLUMN module varchar(255);
UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG';

View File

@ -314,12 +314,13 @@ Modelcsv_quadratus=Export for Quadratus QuadraCompta
Modelcsv_ebp=Export for EBP
Modelcsv_cogilog=Export for Cogilog
Modelcsv_agiris=Export for Agiris
Modelcsv_LDCompta=Export for LD Compta (v9 & higher) (Test)
Modelcsv_LDCompta=Export for LD Compta (v9) (Test)
Modelcsv_LDCompta10=Export for LD Compta (v10 & higher)
Modelcsv_openconcerto=Export for OpenConcerto (Test)
Modelcsv_configurable=Export CSV Configurable
Modelcsv_FEC=Export FEC
Modelcsv_Sage50_Swiss=Export for Sage 50 Switzerland
Modelcsv_winfic=Export Winfic - eWinfic - WinSis Compta
ChartofaccountsId=Chart of accounts Id
## Tools - Init accounting account on product / service

View File

@ -95,7 +95,7 @@ PrintMethod=Print method
ReceiptPrinterMethodDescription=Powerful method with a lot of parameters. Full customizable with templates. Cannot print from the cloud.
ByTerminal=By terminal
TakeposNumpadUsePaymentIcon=Use payment icon on numpad
CashDeskRefNumberingModules=Numbering module for cash desk
CashDeskRefNumberingModules=Numbering module for POS sales
CashDeskGenericMaskCodes6 = <br><b>{TN}</b> tag is used to add the terminal number
TakeposGroupSameProduct=Group same products lines
StartAParallelSale=Start a new parallel sale

View File

@ -426,6 +426,7 @@ Modules=Modules/Applications
Option=Option
List=List
FullList=Full list
FullConversation=Full conversation
Statistics=Statistics
OtherStatistics=Other statistics
Status=Status

View File

@ -370,7 +370,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
// Message list
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticket');
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation');
$object->viewTicketMessages(false, true, $object->dao);
}
else

View File

@ -2826,7 +2826,7 @@ else
$MAXEVENT = 10;
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -85,7 +85,7 @@ print '<input type="hidden" name="action" value="set">';
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print '<td class="titlefieldcreate">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") {
@ -157,7 +157,7 @@ if ($conf->global->TAKEPOS_AUTO_ORDER)
print '<td>';
print "<a target='_blank' href='".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."'>".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."</a>";
print '<td>';
print "<img src='".DOL_DOCUMENT_ROOT."/takepos/genimg/qr.php?id=".dol_encode($row['rowid'])."' height='42' width='42'>";
print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?id=".dol_encode($row['rowid'])."' height='42' width='42'>";
print '</td></tr>';
}

View File

@ -274,7 +274,7 @@ if (!empty($conf->service->enabled))
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
print '<td colspan="2">';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
print "</td></tr>\n";

View File

@ -29,5 +29,5 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php';
$key = GETPOST('key');
$module = new modtcpdfbarcode($db);
$module = new modTcpdfbarcode($db);
$result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y');

View File

@ -31,14 +31,14 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
require '../main.inc.php'; // Load $user and permissions
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
if ($_SESSION["publicterminal"]){
// Decode place if is a order from customer phone
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
// Decode place if it is an order from customer phone
$key = GETPOST('key');
$place=dol_decode($key);
}
@ -53,7 +53,7 @@ if ($setterminal > 0)
$langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter"));
if ($_SESSION["publicterminal"]) {
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
$_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers
}
elseif (empty($user->rights->takepos->run)) {

View File

@ -24,6 +24,10 @@
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
require '../../main.inc.php';
$_SESSION["basiclayout"] = 1;
$_SESSION["publicterminal"] = true; // Is a public customer
require '../phone.php';
define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1);
include '../phone.php';

View File

@ -154,7 +154,7 @@ a.timeline-btn:hover
border-radius: 50%;
text-align: center;
left: 18px;
top: 0;
top: 5px;
}
.timeline > .time-label > span {
font-weight: 600;

View File

@ -143,6 +143,7 @@ if (empty($reshook)) {
$action = 'view';
}
// Action to add an action (not a message)
if (GETPOST('add', 'alpha') && $user->rights->ticket->write) {
$error = 0;
@ -381,6 +382,7 @@ if (empty($reshook)) {
$action = 'view';
}
// Action to add an action (not a message)
if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $user->rights->ticket->read) {
$ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0));
@ -1218,7 +1220,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage';
// add a message
if ($action == 'presend' || $action == 'presend_addmessage') {
if ($action == 'presend' || $action == 'presend_addmessage')
{
$action = 'add_message'; // action to use to post the message
$modelmail = 'ticket_send';
@ -1293,8 +1296,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print '</div>';
}
// Show messages on card
if (empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) {
// Show messages on card (Note: this is a duplicate of the view Events/Agenda but on the main tab)
if (! empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
$param = '&id='.$object->id;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
@ -1337,16 +1340,23 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print showDirectPublicLink($object).'<br>';
print '</div>';
if (!empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) {
if (empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
print '<div class="fichehalfright"><div class="ficheaddleft">';
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/ticket/messaging.php?id='.$object->id);
$morehtmlcenter .= ' ';
$morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1);
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter);
print '</div></div>';
}
print '</div>';
}
}

View File

@ -272,6 +272,7 @@ class ActionsTicket
print $langs->trans('User');
print '</td>';
}
print '</tr>';
foreach ($this->dao->cache_msgs_ticket as $id => $arraymsgs) {
if (!$arraymsgs['private']
@ -280,7 +281,7 @@ class ActionsTicket
//print '<tr>';
print '<tr class="oddeven">';
print '<td><strong>';
print dol_print_date($arraymsgs['datec'], 'dayhour');
print img_picto('', 'object_action', 'class="paddingright"').dol_print_date($arraymsgs['datec'], 'dayhour');
print '<strong></td>';
if ($show_user) {
print '<td>';
@ -379,8 +380,7 @@ class ActionsTicket
global $langs;
print '<div class="div-table-responsive-no-min margintoponly">';
print '<div class="tagtable centpercent">';
print '<div class="tagtr">';
print '<div class="centpercent right">';
// Exclude status which requires specific method
$exclude_status = array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED);
// Exclude actual status
@ -391,7 +391,7 @@ class ActionsTicket
foreach ($object->statuts_short as $status => $status_label) {
if (!in_array($status, $exclude_status)) {
print '<div class="tagtd center">';
print '<div class="inline-block center marginbottomonly">';
if ($status == 1)
{
@ -402,13 +402,13 @@ class ActionsTicket
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&new_status='.$status;
}
print '<a class="butAction buttonticket" href="'.$urlforbutton.'">';
print '<a class="butAction buttonticket marginbottomonly" href="'.$urlforbutton.'">';
print img_picto($langs->trans($object->statuts_short[$status]), 'statut'.$status.'.png@ticket').' '.$langs->trans($object->statuts_short[$status]);
print '</a>';
print '</div>';
}
}
print '</div></div></div><br>';
print '</div></div><br>';
}
/**

View File

@ -1559,7 +1559,7 @@ class Ticket extends CommonObject
// Insert entry into agenda with code 'TICKET_MSG'
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db);
$actioncomm->type_code = 'AC_OTH_AUTO';
$actioncomm->type_code = 'AC_OTH';
$actioncomm->code = 'TICKET_MSG';
if ($this->private) {
$actioncomm->code = 'TICKET_MSG_PRIVATE';