Merge remote-tracking branch 'Dolibarr/12.0' into 12

This commit is contained in:
Francis Appels 2020-05-29 11:01:07 +02:00
commit 15359afa1c
78 changed files with 698 additions and 328 deletions

View File

@ -2181,7 +2181,7 @@ class Adherent extends CommonObject
if ($mode == 'expired') {
$sql .= " AND a.statut = 1";
$sql .= " AND a.entity IN (".getEntity('adherent').")";
$sql .= " AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND t.subscription = 1)";
$sql .= " AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND t.subscription = '1')";
} elseif ($mode == 'shift') {
$sql .= " AND a.statut = -1";
$sql .= " AND a.entity IN (".getEntity('adherent').")";

View File

@ -166,8 +166,8 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
$varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/';
if ($_FILES[$varforimage]["tmp_name"])
@ -354,7 +354,8 @@ print '</tr>';
// Show bugtrack link
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1);
print ajax_constantonoff("MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
@ -362,7 +363,8 @@ print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelp", $pictohelp).'</td><td>';
print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';

View File

@ -36,24 +36,25 @@ if (!$user->admin) accessforbidden();
$usersignature = $user->signature;
// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html.
if ($action == 'test' || $action == 'send')
{
$usersignature = dol_string_nohtmltag($usersignature);
$usersignature = dol_string_nohtmltag($usersignature, 2);
}
$substitutionarrayfortest = array(
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
'__LOGIN__' => 'RecipientLogin',
'__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
'__ADDRESS__'=> 'RecipientAddress',
'__ZIP__'=> 'RecipientZip',
'__TOWN_'=> 'RecipientTown',
'__COUNTRY__'=> 'RecipientCountry'
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
'__LOGIN__' => 'RecipientLogin',
'__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
'__ADDRESS__'=> 'RecipientAddress',
'__ZIP__'=> 'RecipientZip',
'__TOWN_'=> 'RecipientTown',
'__COUNTRY__'=> 'RecipientCountry'
);
complete_substitutions_array($substitutionarrayfortest, $langs);

View File

@ -543,8 +543,8 @@ if ($mode == 'common' || $mode == 'commonkanban')
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="floatright right">';
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'common' ? '' : ' btnTitleSelected')));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'commonkanban' ? '' : ' btnTitleSelected')));
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="floatright right margintoponly marginrightonly" style="padding-top: 3px">'.$moreinfo.'</div>';
@ -654,7 +654,8 @@ if ($mode == 'common' || $mode == 'commonkanban')
}
$familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label'];
print load_fiche_titre($familytext, '', '');
print load_fiche_titre($familytext, '', '', 0, '', 'modulefamilygroup');
if ($mode == 'commonkanban') {
print '<div class="box-flex-container">';

View File

@ -339,16 +339,20 @@ function getConfigFilePath()
*/
function getTableColumn($name, array $list)
{
global $langs;
$name = strtolower($name);
$html = "<td align='center'>";
if (in_array($name, $list))
{
$html .= '<img src="../../theme/eldy/img/tick.png" alt="Ok">';
if ($name == 'xdebug') $html .= '<img src="../../theme/eldy/img/warning.png" title="'.$langs->trans("ModuleActivated", "xdebug").'">';
else $html .= '<img src="../../theme/eldy/img/tick.png" title="Ok">';
}
else
{
$html .= '<img src="../../theme/eldy/img/warning.png" alt="Warning">';
if ($name == 'xdebug') $html .= yn(0);
else $html .= '<img src="../../theme/eldy/img/warning.png" title="Warning">';
}
$html .= "</td>";

View File

@ -90,7 +90,7 @@ function printDropdownBookmarksList()
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
{
$bookmarkList .= '<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= dol_escape_htmltag($obj->title);
$bookmarkList .= '</a>';
$i++;

View File

@ -1810,11 +1810,13 @@ class AccountLine extends CommonObject
*/
public $fk_account;
public $bank_account_label; // Label of bank account
/**
* @var string Label of bank account
*/
public $bank_account_label;
/**
* Issuer
* @var Societe
* @var string Name of check issuer
*/
public $emetteur;

View File

@ -28,7 +28,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@ -75,9 +75,9 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("NbOfInvoiceToWithdraw").'</td>';
print '<tr class="oddeven"><td>'.$langs->trans("NbOfInvoiceToPayByBankTransfer").'</td>';
print '<td class="right">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/demandes.php?status=0">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/demandes.php?status=0&type=bank-transfer">';
print $bprev->NbFactureAPrelever();
print '</a>';
print '</td></tr>';
@ -100,11 +100,11 @@ $sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql .= " WHERE s.rowid = f.fk_soc";
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
$sql .= " AND f.total_ttc > 0";
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
$sql .= " AND f.fk_statut = ".FactureFournisseur::STATUS_VALIDATED;
}
$sql .= " AND pfd.traite = 0 AND pfd.fk_facture_fourn = f.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
@ -177,9 +177,11 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
/*
* Withdraw receipts
*/
$limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " WHERE p.type = 'bank-transfer'";
$sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit);
@ -198,26 +200,30 @@ if ($result)
print '<th class="right">'.$langs->trans("Status").'</th>';
print '</tr>';
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
if ($num > 0) {
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print '<tr class="oddeven">';
print "<td>";
$bprev->id = $obj->rowid;
$bprev->ref = $obj->ref;
$bprev->statut = $obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec), "dayhour")."</td>\n";
print '<td class="right">'.price($obj->amount)."</td>\n";
print '<td class="right">'.$bprev->getLibStatut(3)."</td>\n";
print "<td>";
$bprev->id = $obj->rowid;
$bprev->ref = $obj->ref;
$bprev->statut = $obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec), "dayhour")."</td>\n";
print '<td class="right">'.price($obj->amount)."</td>\n";
print '<td class="right">'.$bprev->getLibStatut(3)."</td>\n";
print "</tr>\n";
$i++;
print "</tr>\n";
$i++;
}
} else {
print '<tr><td class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table></div><br>";
$db->free($result);
}

View File

@ -38,6 +38,8 @@ $socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
$type = GETPOST('type', 'aZ09');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
@ -57,6 +59,11 @@ $search_amount = GETPOST('search_amount', 'alpha');
$bon = new BonPrelevement($db);
$hookmanager->initHooks(array('withdrawalsreceiptslist'));
$usercancreate = $user->rights->prelevement->bons->creer;
if ($type == 'bank-transfer') {
$usercancreate = $user->rights->paymentbybanktransfer->create;
}
/*
* Actions
@ -78,6 +85,11 @@ llxHeader('', $langs->trans("WithdrawalsReceipts"));
$sql = "SELECT p.rowid, p.ref, p.amount, p.statut, p.datec";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
if ($type == 'bank-transfer') {
$sql .= " AND p.type = 'bank-transfer'";
} else {
$sql .= " AND p.type = 'debit-order'";
}
if ($search_ref) $sql .= natural_search("p.ref", $search_ref);
if ($search_amount) $sql .= natural_search("p.amount", $search_amount, 1);
@ -112,7 +124,7 @@ if ($result)
$selectedfields = '';
$newcardbutton = '';
if ($user->rights->prelevement->bons->creer)
if ($usercancreate)
{
$newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php');
}
@ -127,7 +139,14 @@ if ($result)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
$titlekey = "WithdrawalsReceipts";
$title = $langs->trans("WithdrawalsReceipts");
if ($type == 'bank-transfer') {
$titlekey = "BankTransferReceipts";
$title = $langs->trans("BankTransferReceipts");
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = '';
@ -146,7 +165,7 @@ if ($result)
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($titlekey, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');

View File

@ -45,6 +45,8 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int');
$type = GETPOST('type', 'aZ09');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');

View File

@ -638,8 +638,7 @@ class BonPrelevement extends CommonObject
$arr = array();
/*
* Returns all invoices presented
* within a withdrawal receipt
* Returns all invoices presented within same order
*/
$sql = "SELECT fk_facture";
if ($amounts) $sql .= ", SUM(pl.amount)";
@ -1159,8 +1158,12 @@ class BonPrelevement extends CommonObject
if (!$notrigger)
{
$triggername = 'DIRECT_DEBIT_ORDER_DELETE';
if ($this->type == 'bank-transfer') {
$triggername = 'PAYMENTBYBANKTRANFER_DELETE';
}
// Call trigger
$result = $this->call_trigger('DIRECT_DEBIT_ORDER_DELETE', $user);
$result = $this->call_trigger($triggername, $user);
if ($result < 0) $error++;
// End call triggers
}
@ -1224,7 +1227,12 @@ class BonPrelevement extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("ShowWithdraw").'</u>';
$labeltoshow = 'Withdraw';
if ($this->type == 'bank-transfer') {
$labeltoshow = 'PaymentByBankTransfer';
}
$label = '<u>'.$langs->trans($labeltoshow).'</u>';
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (isset($this->statut)) {
@ -1232,6 +1240,9 @@ class BonPrelevement extends CommonObject
}
$url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;
if ($this->type == 'bank-transfer') {
$url = DOL_URL_ROOT.'/compta/paymentbybanktransfer/card.php?id='.$this->id;
}
if ($option != 'nolink')
{
@ -1272,7 +1283,7 @@ class BonPrelevement extends CommonObject
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
global $action, $hookmanager;
$hookmanager->initHooks(array('myobjectdao'));
$hookmanager->initHooks(array('banktransferdao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $result = $hookmanager->resPrint;

View File

@ -43,6 +43,8 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bill
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
$type = GETPOST('type', 'aZ09');
// Get supervariables
$action = GETPOST('action', 'alpha');
$mode = GETPOST('mode', 'alpha') ?GETPOST('mode', 'alpha') : 'real';
@ -130,7 +132,12 @@ $h++;
dol_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment');
*/
print load_fiche_titre($langs->trans("NewStandingOrder"));
$title = $langs->trans("NewStandingOrder");
if ($type == 'bank-transfer') {
$title = $langs->trans("NewPaymentByBankTransfer");
}
print load_fiche_titre($title);
dol_fiche_head();
@ -144,12 +151,17 @@ if ($nb < 0 || $nb1 < 0 || $nb11 < 0)
}
print '<table class="border centpercent tableforfield">';
print '<tr><td class="titlefield">'.$langs->trans("NbOfInvoiceToWithdraw").'</td>';
$title = $langs->trans("NbOfInvoiceToWithdraw");
if ($type == 'bank-transfer') {
$title = $langs->trans("NbOfInvoiceToPayByBankTransfer");
}
print '<tr><td class="titlefield">'.$title.'</td>';
print '<td>';
print $nb;
print '</td></tr>';
print '<tr><td>'.$langs->trans("AmountToWithdraw").'</td>';
print '<tr><td>'.$langs->trans("AmountTotal").'</td>';
print '<td>';
print price($pricetowithdraw);
print '</td>';
@ -160,7 +172,7 @@ print '</div>';
if ($mesg) print $mesg;
print "<div class=\"tabsAction\">\n";
print '<div class="tabsAction">'."\n";
print '<form action="'.$_SERVER['PHP_SELF'].'?action=create" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -184,7 +196,11 @@ if ($nb) {
}
else
{
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateAll")."</a>\n";
$title = $langs->trans("CreateAll");
if ($type == 'bank-transfer') {
$title = $langs->trans("CreateFileForPaymentByBankTransfer");
}
print '<a class="butActionRefused classfortooltip" href="#">'.$title."</a>\n";
}
}
}
@ -206,7 +222,11 @@ print '<br>';
$sql = "SELECT f.ref, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,";
$sql .= " pfd.date_demande, pfd.amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
if ($type == 'bank-transfer') {
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
} else {
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
}
$sql .= " ".MAIN_DB_PREFIX."societe as s,";
$sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql .= " WHERE s.rowid = f.fk_soc";
@ -217,7 +237,11 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
}
$sql .= " AND f.total_ttc > 0";
$sql .= " AND pfd.traite = 0";
$sql .= " AND pfd.fk_facture = f.rowid";
if ($type == 'bank-transfer') {
$sql .= " AND pfd.fk_facture = f.rowid";
} else {
$sql .= " AND pfd.fk_facture_fourn = f.rowid";
}
if ($socid > 0) $sql .= " AND f.fk_soc = ".$socid;
$nbtotalofrecords = '';
@ -252,7 +276,11 @@ if ($resql)
print '<input type="hidden" name="limit" value="'.$limit.'"/>';
}
print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit);
$title = $langs->trans("InvoiceWaitingWithdraw");
if ($type == 'bank-transfer') {
$title = $langs->trans("InvoiceWaitingPaymentByBankTransfer");
}
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit);
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';

View File

@ -21,12 +21,13 @@
/**
* \file htdocs/compta/prelevement/demandes.php
* \ingroup prelevement
* \brief Page to list withdraw requests
* \brief Page to list bank transfer requests (debit order or payments of vendors)
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@ -43,6 +44,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myo
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$type = GETPOST('type', 'aZ09');
$search_facture = GETPOST('search_facture', 'alpha');
$search_societe = trim(GETPOST('search_societe', 'alpha'));
@ -85,13 +88,20 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
* View
*/
if (!$status)
{
$title = $langs->trans("RequestStandingOrderToTreat");
}
else
{
$title = $langs->trans("RequestStandingOrderTreated");
if ($type != 'bank-transfer') {
if (!$status)
{
$title = $langs->trans("RequestStandingOrderToTreat");
} else {
$title = $langs->trans("RequestStandingOrderTreated");
}
} else {
if (!$status)
{
$title = $langs->trans("RequestPaymentsByBankTransferToTreat");
} else {
$title = $langs->trans("RequestPaymentsByBankTransferTreated");
}
}
llxHeader('', $title);
@ -105,7 +115,11 @@ $sql = "SELECT f.ref, f.rowid, f.total_ttc,";
$sql .= " s.nom as name, s.rowid as socid,";
$sql .= " pfd.date_demande as date_demande,";
$sql .= " pfd.fk_user_demande";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
if ($type != 'bank-transfer') {
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
} else {
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
}
$sql .= " ".MAIN_DB_PREFIX."societe as s,";
$sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -120,7 +134,11 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
}
$sql .= " AND pfd.fk_facture = f.rowid";
if ($type != 'bank-transfer') {
$sql .= " AND pfd.fk_facture = f.rowid";
} else {
$sql .= " AND pfd.fk_facture_fourn = f.rowid";
}
if ($search_facture) $sql .= natural_search("f.ref", $search_facture);
if ($search_societe) $sql .= natural_search("s.nom", $search_societe);
$sql .= $db->order($sortfield, $sortorder);
@ -142,9 +160,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
{
$num = $nbtotalofrecords;
}
else
{
} else {
$sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
@ -160,6 +176,9 @@ else
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
if ($type == 'bank-transfer') {
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php">'.$langs->trans("Back").'</a>';
}
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="searchFormList" name="searchFormList">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -171,6 +190,8 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$param = '';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
print '<table class="liste centpercent">';
@ -195,8 +216,6 @@ print $searchpicto;
print '</td>';
print '</tr>';
$users = array();
$i = 0;
while ($i < min($num, $limit))
{

View File

@ -42,6 +42,8 @@ $prev_id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
$ref = GETPOST('ref', 'alpha');
$type = GETPOST('type', 'aZ09');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');

View File

@ -41,6 +41,8 @@ if ($user->socid > 0) accessforbidden();
$prev_id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$type = GETPOST('type', 'aZ09');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');

View File

@ -39,6 +39,8 @@ if ($user->socid > 0) accessforbidden();
$prev_id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$type = GETPOST('type', 'aZ09');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');

View File

@ -180,6 +180,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " WHERE p.type = 'debit-order'";
$sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit);
@ -198,26 +199,31 @@ if ($result)
print '<th class="right">'.$langs->trans("Status").'</th>';
print '</tr>';
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
if ($num > 0) {
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print '<tr class="oddeven">';
print "<td>";
$bprev->id = $obj->rowid;
$bprev->ref = $obj->ref;
$bprev->statut = $obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec), "dayhour")."</td>\n";
print '<td class="right">'.price($obj->amount)."</td>\n";
print '<td class="right">'.$bprev->getLibStatut(3)."</td>\n";
print "<td>";
$bprev->id = $obj->rowid;
$bprev->ref = $obj->ref;
$bprev->statut = $obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec), "dayhour")."</td>\n";
print '<td class="right">'.price($obj->amount)."</td>\n";
print '<td class="right">'.$bprev->getLibStatut(3)."</td>\n";
print "</tr>\n";
$i++;
print "</tr>\n";
$i++;
}
} else {
print '<tr><td class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table></div><br>";
$db->free($result);
}

View File

@ -43,6 +43,8 @@ $action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
$type = GETPOST('type', 'aZ09');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortorder = GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'alpha');

View File

@ -47,6 +47,8 @@ $socid = GETPOST('socid', 'int');
if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
$type = GETPOST('type', 'aZ09');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');

View File

@ -38,6 +38,8 @@ $socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
$type = GETPOST('type', 'aZ09');
// Get supervariables
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortorder = GETPOST('sortorder', 'alpha');
@ -47,6 +49,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined,
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
/*
* View
*/

View File

@ -36,6 +36,8 @@ $socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
$type = GETPOST('type', 'aZ09');
/*
* View

View File

@ -46,7 +46,7 @@ if (empty($objectclass) || empty($uploaddir))
// For backward compatibility
if (!empty($permtoread) && empty($permissiontoread)) $permissiontoread = $permtoread;
if (!empty($permtocreate) && empty($permissiontoadd)) $permissiontoadd = $permtocreate;
if (!empty($permtodelete) && empty($permissiontodelete)) $permissiontoread = $permtodelete;
if (!empty($permtodelete) && empty($permissiontodelete)) $permissiontodelete = $permtodelete;
// Mass actions. Controls on number of lines checked.

View File

@ -355,7 +355,7 @@ if ($useajax || $action == 'delete')
$section_id = $section;
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$useglobalvars = 1;
$form = new Form($db);
$formquestion['urlfile'] = array('type'=>'hidden', 'value'=>$urlfile, 'name'=>'urlfile'); // We must always put field, even if empty because it is filled by javascript later
$formquestion['section'] = array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); // We must always put field, even if empty because it is filled by javascript later

View File

@ -88,7 +88,12 @@ class DolEditor
// Define some properties
if (in_array($this->tool, array('textarea', 'ckeditor', 'ace')))
{
$this->content = $content;
if ($this->tool == 'ckeditor' && ! dol_textishtml($content)) { // We force content to be into HTML if we are using an advanced editor if content is not HTML.
$this->content = dol_nl2br($content);
}
else {
$this->content = $content;
}
$this->htmlname = $htmlname;
$this->toolbarname = $shorttoolbarname;
$this->toolbarstartexpanded = $toolbarstartexpanded;
@ -125,11 +130,6 @@ class DolEditor
$found = 0;
$out = '';
if ($this->tool == 'fckeditor') // not used anymore
{
$found = 1;
$this->editor->Create();
}
if (in_array($this->tool, array('textarea', 'ckeditor')))
{
$found = 1;

View File

@ -1676,8 +1676,13 @@ class ExtraFields
}
elseif ($type == 'select')
{
if ($langfile && $param['options'][$value]) $value = $langs->trans($param['options'][$value]);
else $value = $param['options'][$value];
$valstr = $param['options'][$value];
if (($pos = strpos($valstr, "|")) !== false)
{
$valstr = substr($valstr, 0, $pos);
}
if ($langfile && $valstr) $value = $langs->trans($valstr);
else $value = $valstr;
}
elseif ($type == 'sellist')
{

View File

@ -3801,7 +3801,8 @@ class Form
$sql = 'SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc';
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture';
$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
$sql .= ' AND situation_counter>=1';
$sql .= ' AND situation_counter >= 1';
$sql .= ' AND type <> 2';
$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
$resql = $this->db->query($sql);
if ($resql && $this->db->num_rows($resql) > 0) {
@ -4207,7 +4208,6 @@ class Form
public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0)
{
global $langs, $conf;
global $useglobalvars;
$more = '<!-- formconfirm -->';
$formconfirm = '';
@ -4355,7 +4355,7 @@ class Form
if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko, $input['name']);
}
}
// Show JQuery confirm box. Note that global var $useglobalvars is used inside this template
// Show JQuery confirm box.
$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
if (!empty($formquestion['text'])) {
$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";

View File

@ -444,11 +444,11 @@ class FormAccounting extends Form
/**
* Return HTML combo list of years existing into book keepping
*
* @param string $selected Preselected value
* @param string $htmlname Name of HTML select object
* @param int $useempty Affiche valeur vide dans liste
* @param string $output_format (html/opton (for option html only)/array (to return options arrays
* @return string/array
* @param string $selected Preselected value
* @param string $htmlname Name of HTML select object
* @param int $useempty Affiche valeur vide dans liste
* @param string $output_format (html/opton (for option html only)/array (to return options arrays
* @return string|array HTML select component or array of select options
*/
public function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html')
{

View File

@ -1277,7 +1277,8 @@ class FormFile
}
else
{
print dol_trunc($file['name'], 200);
$filenametoshow = preg_replace('/\.noexe$/', '', $file['name']);
print dol_trunc($filenametoshow, 200);
print '</a>';
}
// Preview link

View File

@ -307,8 +307,8 @@ class FormMail extends Form
/**
* Get the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
* this->withfile
* this->param: Contains more parameters like email templates info
* this->withfckeditor: 1=We use an advanced editor, so we switch content into HTML
*
* @param string $addfileaction Name of action when posting file attachments
* @param string $removefileaction Name of action when removing file attachments
@ -940,7 +940,7 @@ class FormMail extends Form
$this->substit['__ONLINE_PAYMENT_URL__'] = '';
}
//Add lines substitution key from each line
// Add lines substitution key from each line
$lines = '';
$defaultlines = $arraydefaultmessage->content_lines;
if (isset($defaultlines))
@ -954,14 +954,30 @@ class FormMail extends Form
$defaultmessage = str_replace('\n', "\n", $defaultmessage);
// Deal with format differences between message and signature (text / HTML)
if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']);
} elseif (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
// Deal with format differences between message and some substitution variables (text / HTML)
$atleastonecomponentishtml = 0;
if (strpos($defaultmessage, '__USER_SIGNATURE__') !== false && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$atleastonecomponentishtml++;
}
if (strpos($defaultmessage, '__ONLINE_PAYMENT_TEXT_AND_URL__') !== false && dol_textishtml($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'])) {
$atleastonecomponentishtml++;
}
if (dol_textishtml($defaultmessage)) {
$atleastonecomponentishtml++;
}
if ($atleastonecomponentishtml) {
if (! dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']);
}
if (! dol_textishtml($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'])) {
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = dol_nl2br($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']);
}
if (! dol_textishtml($defaultmessage)) {
$defaultmessage = dol_nl2br($defaultmessage);
}
}
if (isset($_POST["message"]) && !$_POST['modelselected']) $defaultmessage = $_POST["message"];
if (GETPOSTISSET("message") && !$_POST['modelselected']) $defaultmessage = $_POST["message"];
else
{
$defaultmessage = make_substitutions($defaultmessage, $this->substit);
@ -969,6 +985,7 @@ class FormMail extends Form
$defaultmessage = preg_replace("/^(<br>)+/", "", $defaultmessage);
$defaultmessage = preg_replace("/^\n+/", "", $defaultmessage);
}
$out .= '<tr>';
$out .= '<td class="tdtop">';
$out .= $form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody');

View File

@ -882,7 +882,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
{
$rel_filetorenamebefore = preg_replace('/^[\\/]/', '', $rel_filetorenamebefore);
$rel_filetorenameafter = preg_replace('/^[\\/]/', '', $rel_filetorenameafter);
//var_dump($rel_filetorenamebefore.' - '.$rel_filetorenameafter);
//var_dump($rel_filetorenamebefore.' - '.$rel_filetorenameafter);exit;
dol_syslog("Try to rename also entries in database for full relative path before = ".$rel_filetorenamebefore." after = ".$rel_filetorenameafter, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
@ -905,6 +905,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
$resultecm = $ecmfile->update($user);
}
elseif ($resultecm == 0) // If no entry were found for src files, create/update target file
@ -1007,7 +1008,7 @@ function dolCheckVirus($src_file)
* @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
* @param int $nohook Disable all hooks
* @param string $varfiles _FILES var name
* @return int|string >0 if OK, <0 or string if KO
* @return int|string 1 if OK, 2 if OK and .noexe appended, <0 or string if KO
* @see dol_move()
*/
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan = 0, $uploaderrorcode = 0, $nohook = 0, $varfiles = 'addedfile')
@ -1017,6 +1018,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
$reshook = 0;
$file_name = $dest_file;
$successcode = 1;
if (empty($nohook))
{
@ -1067,6 +1069,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
if (isAFileWithExecutableContent($dest_file) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED))
{
$file_name .= '.noexe';
$successcode = 2;
}
// Security:
@ -1121,7 +1124,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
{
if (!empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK));
dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG);
return 1; // Success
return $successcode; // Success
}
else
{
@ -1130,7 +1133,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
}
}
return 1; // Success
return $successcode; // Success
}
/**
@ -1185,8 +1188,6 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
}
else
{
$error = 0;
//print "x".$file." ".$disableglob;exit;
$file_osencoded = dol_osencode($file); // New filename encoded in OS filesystem encoding charset
if (empty($disableglob) && !empty($file_osencoded))
@ -1209,10 +1210,11 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
$rel_filetodelete = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filename);
if (!preg_match('/(\/temp\/|\/thumbs\/|\.meta$)/', $rel_filetodelete)) // If not a tmp file
{
$rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
if (is_object($db) && $indexdatabase) // $db may not be defined when lib is in a context with define('NOREQUIREDB',1)
{
$rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
$rel_filetodelete = preg_replace('/\.noexe$/', '', $rel_filetodelete);
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($db);
@ -1577,6 +1579,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
$destfile = dol_string_nohtmltag($destfile);
$destfull = dol_string_nohtmltag($destfull);
// Move file from temp directory to final directory. A .noexe may also be appended on file name.
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
@ -1613,14 +1616,14 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
// Update index table of files (llx_ecm_files)
if ($donotupdatesession == 1)
{
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0);
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', 0);
if ($result < 0)
{
if ($allowoverwrite) {
// Do not show error message. We can have an error due to DB_ERROR_RECORD_ALREADY_EXISTS
}
else {
setEventMessages('FailedToAddFileIntoDatabaseIndex', '', 'warnings');
setEventMessages('WarningFailedToAddFileIntoDatabaseIndex', '', 'warnings');
}
}
}
@ -1732,7 +1735,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
* See also commonGenerateDocument that also add/update database index when a file is generated.
*
* @param string $dir Directory name (full real path without ending /)
* @param string $file File name
* @param string $file File name (May end with '.noexe')
* @param string $fullpathorig Full path of origin for file (can be '')
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @param int $setsharekey Set also the share key
@ -1748,7 +1751,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
if (!preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir
{
$filename = basename($file);
$filename = basename(preg_replace('/\.noexe$/', '', $file));
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);

View File

@ -1205,7 +1205,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out = "\n".'<!-- dol_get_fiche_head -->';
if ((!empty($title) && $showtitle) || $morehtmlright || !empty($links)) {
$out .= '<div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n";
$out .= '<div class="tabs'.($picto ? '' : ' nopaddingleft').'" data-role="controlgroup" data-type="horizontal">'."\n";
}
// Show right part

View File

@ -37,11 +37,14 @@ function product_prepare_head($object)
global $db, $langs, $conf, $user;
$langs->load("products");
$label = $langs->trans('Product');
if ($object->isService()) $label = $langs->trans('Service');
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id;
$head[$h][1] = $langs->trans("ProductOrService");
$head[$h][1] = $label;
$head[$h][2] = 'card';
$h++;

View File

@ -1433,7 +1433,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire);
$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire);
$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire);
//Achats
$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report", $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire);
$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire);
$newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire);
// Journaux
$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50);
$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51);
@ -1496,8 +1499,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire);
//$newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer);
}
}
@ -1507,12 +1508,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&amp;mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer');
if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") {
$newmenu->add("/compta/paymentbybanktransfer/create.php?mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create);
$newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create);
$newmenu->add("/compta/paymentbybanktransfer/bons.php?mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/paymentbybanktransfer/list.php?mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/paymentbybanktransfer/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/paymentbybanktransfer/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/prelevement/bons.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read);
}
}

View File

@ -2321,24 +2321,24 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
print '</div>
<div class="info-box-content info-box-text-module">
<span class="info-box-title marginbottomonly">'.$this->getName().'</span>
<span class="info-box-title">'.$this->getName().'</span>
<span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>';
/*print '<span class="info-box-icon-version" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
print $this->getVersion(1);
print '</span>'; */
print '<div class="valignmiddle inline-block">';
print '<div class="valignmiddle inline-block info-box-more">';
print '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$this->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
print '</div><br>';
print '<div class="valignmiddle inline-block info-box-actions">';
print '<div class="valignmiddle inline-block">';
print $codeenabledisable;
print '</div>';
print '<div class="valignmiddle inline-block marginleftonly">';
print '<div class="valignmiddle inline-block info-box-setup">';
print $codetoconfig;
print '</div>';
print '<div class="valignmiddle inline-block marginleftonly marginrightonly">';
print $codeenabledisable;
print '</div>';
print '</div>';
print '

View File

@ -1310,7 +1310,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval, 'MT'), 0, $outputlangs), 0, 'R', 1);
}
}

View File

@ -34,7 +34,7 @@ class modExpenseReport extends DolibarrModules
/**
* Constructor. Define names, constants, directories, boxes, permissions
*
* @param Database $db Database handler
* @param DoliDb $db Database handler
*/
public function __construct($db)
{

View File

@ -258,7 +258,6 @@ if ($action == 'presend')
}
}
$custcontact = '';
$contactarr = array();
$contactarr = $tmpobject->liste_contact(-1, 'external');

View File

@ -178,7 +178,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg
print '</td></tr>';
}
else // Show filtree when ajax is disabled (rare)
else // Show file tree when ajax is disabled (rare)
{
print '<tr><td style="padding-left: 20px">';
@ -212,7 +212,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg
<div class="pane-in ecm-in-layout-center">
<div id="ecmfileview" class="ecmfileview">
<?php
// Start right panel
// Start right panel - List of content of a directory
$mode = 'noajax';

View File

@ -26,7 +26,7 @@ class TraceableDB extends DoliDB
*/
protected $startMemory;
/**
* @var Database type
* @var string type
*/
public $type;
/**

View File

@ -138,7 +138,7 @@ class EcmFiles extends CommonObject
$this->entity = trim($this->entity);
}
if (isset($this->filename)) {
$this->filename = trim($this->filename);
$this->filename = preg_replace('/\.noexe$/', '', trim($this->filename));
}
if (isset($this->filepath)) {
$this->filepath = trim($this->filepath);
@ -346,12 +346,13 @@ class EcmFiles extends CommonObject
$sql .= " t.src_object_id";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
$sql .= ' WHERE 1 = 1';
/* Fetching this table depends on filepath+filename, it must not depends on entity
/* Fetching this table depends on filepath+filename, it must not depends on entity because filesystem on disk does not know what is Dolibarr entities
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND entity IN (" . getEntity('ecmfiles') . ")";
}*/
if ($relativepath) {
$sql .= " AND t.filepath = '".$this->db->escape(dirname($relativepath))."' AND t.filename = '".$this->db->escape(basename($relativepath))."'";
$relativepathwithnoexe = preg_replace('/\.noexe$/', '', $relativepath); // We must never have the .noexe into the database
$sql .= " AND t.filepath = '".$this->db->escape(dirname($relativepath))."' AND t.filename = '".$this->db->escape(basename($relativepathwithnoexe))."'";
$sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index
}
elseif (!empty($ref)) { // hash of file path
@ -552,46 +553,47 @@ class EcmFiles extends CommonObject
// Clean parameters
if (isset($this->ref)) {
$this->ref = trim($this->ref);
$this->ref = trim($this->ref);
}
if (isset($this->label)) {
$this->label = trim($this->label);
$this->label = trim($this->label);
}
if (isset($this->share)) {
$this->share = trim($this->share);
$this->share = trim($this->share);
}
if (isset($this->entity)) {
$this->entity = trim($this->entity);
$this->entity = trim($this->entity);
}
if (isset($this->filename)) {
$this->filename = trim($this->filename);
$this->filename = preg_replace('/\.noexe$/', '', trim($this->filename));
}
if (isset($this->filepath)) {
$this->filepath = trim($this->filepath);
$this->filepath = trim($this->filepath);
$this->filepath = preg_replace('/[\\/]+$/', '', $this->filepath); // Remove last /
}
if (isset($this->fullpath_orig)) {
$this->fullpath_orig = trim($this->fullpath_orig);
$this->fullpath_orig = trim($this->fullpath_orig);
}
if (isset($this->description)) {
$this->description = trim($this->description);
$this->description = trim($this->description);
}
if (isset($this->keywords)) {
$this->keywords = trim($this->keywords);
$this->keywords = trim($this->keywords);
}
if (isset($this->cover)) {
$this->cover = trim($this->cover);
$this->cover = trim($this->cover);
}
if (isset($this->gen_or_uploaded)) {
$this->gen_or_uploaded = trim($this->gen_or_uploaded);
$this->gen_or_uploaded = trim($this->gen_or_uploaded);
}
if (isset($this->extraparams)) {
$this->extraparams = trim($this->extraparams);
$this->extraparams = trim($this->extraparams);
}
if (isset($this->fk_user_m)) {
$this->fk_user_m = trim($this->fk_user_m);
$this->fk_user_m = trim($this->fk_user_m);
}
if (isset($this->acl)) {
$this->acl = trim($this->acl);
$this->acl = trim($this->acl);
}
if (isset($this->src_object_type)) {
$this->src_object_type = trim($this->src_object_type);

View File

@ -140,6 +140,12 @@ if ($action == 'update')
$oldfile = $olddir.$oldlabel;
$newfile = $newdir.$newlabel;
$newfileformove = $newfile;
// If old file end with .noexe, new file must also end with .noexe
if (preg_match('/\.noexe$/', $oldfile) && ! preg_match('/\.noexe$/', $newfileformove)) {
$newfileformove .= '.noexe';
}
//var_dump($oldfile);var_dump($newfile);exit;
// Now we update index of file
$db->begin();
@ -147,7 +153,7 @@ if ($action == 'update')
//print $oldfile.' - '.$newfile;
if ($newlabel != $oldlabel)
{
$result = dol_move($oldfile, $newfile); // This include update of database
$result = dol_move($oldfile, $newfileformove); // This include update of database
if (!$result)
{
$langs->load('errors');
@ -191,7 +197,7 @@ if ($action == 'update')
$object->entity = $conf->entity;
$object->filepath = preg_replace('/[\\/]+$/', '', $newdirrelativetodocument);
$object->filename = $newlabel;
$object->label = md5_file(dol_osencode($newfile)); // hash of file content
$object->label = md5_file(dol_osencode($newfileformove)); // hash of file content
$object->fullpath_orig = '';
$object->gen_or_uploaded = 'unknown';
$object->description = ''; // indexed content
@ -209,6 +215,11 @@ if ($action == 'update')
$db->commit();
$urlfile = $newlabel;
// If old file end with .noexe, new file must also end with .noexe
if (preg_match('/\.noexe$/', $newfileformove)) {
$urlfile .= '.noexe';
}
header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'&section='.urlencode($section));
exit;
}
@ -265,9 +276,13 @@ while ($tmpecmdir && $result > 0)
$i++;
}
$urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfile);
$s = img_picto('', 'object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> '.$s.' -> ';
if ($action == 'edit') $s .= '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfile.'">';
else $s .= $urlfile;
if ($action == 'edit') $s .= '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfiletoshow.'">';
else $s .= $urlfiletoshow;
$morehtml = '';
$object->ref = ''; // Force to hide ref
dol_banner_tab($object, '', $morehtml, 0, '', '', $s);
@ -290,10 +305,9 @@ print dol_print_size($totalsize);
print '</td></tr>';
*/
// Hash of file content
print '<tr><td>'.$langs->trans("HashOfFileContent").'</td><td>';
$object = new EcmFiles($db);
//$filenametosearch=basename($filepath);
//$filedirtosearch=basedir($filepath);
$object->fetch(0, '', $filepathtodocument);
if (!empty($object->label))
{

View File

@ -125,7 +125,6 @@ if ($action == 'confirm_deletefile')
if (GETPOST('confirm') == 'yes')
{
// GETPOST('urlfile','alpha') is full relative URL from ecm root dir. Contains path of all sections.
//var_dump(GETPOST('urlfile'));exit;
$upload_dir = $conf->ecm->dir_output.($relativepath ? '/'.$relativepath : '');
$file = $upload_dir."/".GETPOST('urlfile', 'alpha');
@ -133,7 +132,9 @@ if ($action == 'confirm_deletefile')
$ret = dol_delete_file($file); // This include also the delete from file index in database.
if ($ret)
{
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs');
$urlfiletoshow = GETPOST('urlfile', 'alpha');
$urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfiletoshow);
setEventMessages($langs->trans("FileWasRemoved", $urlfiletoshow), null, 'mesgs');
$result = $ecmdir->changeNbOfFiles('-');
}
else

View File

@ -31,7 +31,7 @@
*/
if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (!defined('EURO')) define('EURO', chr(128));

View File

@ -158,7 +158,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
'suppliers' => !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
'services' => !empty($conf->product->enabled) && $user->rights->produit->lire,
'products' => !empty($conf->product->enabled) && $user->rights->produit->lire,
'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire,
'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire,

View File

@ -87,6 +87,9 @@ div.soustitre {
tr.trlineforchoice {
height: 4em;
}
a.button.runupgrade {
padding: 10px;
}
/* Force values for small screen 570 */
@media only screen and (max-width: 570px)

View File

@ -67,11 +67,13 @@ ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafie
ALTER TABLE llx_facture_rec MODIFY COLUMN titre varchar(200) NOT NULL;
-- This var is per entity now, so we remove const if global if exists
delete from llx_const where name = 'PROJECT_HIDE_TASKS' and entity = 0;
delete from llx_const where name in ('PROJECT_HIDE_TASKS', 'MAIN_BUGTRACK_ENABLELINK', 'MAIN_HELP_DISABLELINK') and entity = 0;
-- For v12
ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-order';
-- Delete an old index that is duplicated
-- VMYSQL4.1 DROP INDEX ix_fk_product_stock on llx_product_batch;
-- VPGSQL8.2 DROP INDEX ix_fk_product_stock
@ -295,3 +297,8 @@ ALTER TABLE llx_menu MODIFY COLUMN module varchar(255);
UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG';
ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16) DEFAULT 'UTF-8';
ALTER TABLE llx_adherent_type MODIFY subscription varchar(3) NOT NULL DEFAULT '1';
ALTER TABLE llx_adherent_type MODIFY vote varchar(3) NOT NULL DEFAULT '1';

View File

@ -31,8 +31,8 @@ create table llx_adherent_type
libelle varchar(50) NOT NULL,
morphy varchar(3) NOT NULL,
duration varchar(6) DEFAULT NULL,
subscription varchar(3) NOT NULL DEFAULT 'yes',
vote varchar(3) NOT NULL DEFAULT 'yes',
subscription varchar(3) NOT NULL DEFAULT '1',
vote varchar(3) NOT NULL DEFAULT '1',
note text,
mail_valid text
)ENGINE=innodb;

View File

@ -26,6 +26,7 @@
create table llx_prelevement_bons
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
type varchar(16) DEFAULT 'debit-order', -- 'debit-order' or 'bank-transfer'
ref varchar(12), -- reference
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime, -- date de creation

View File

@ -541,8 +541,8 @@ Module54Name=Contracts/Subscriptions
Module54Desc=Management of contracts (services or recurring subscriptions)
Module55Name=Barcodes
Module55Desc=Barcode management
Module56Name=Payment by bank transfer
Module56Desc=Management of payment by bank transfer orders. It includes generation of SEPA file for European countries.
Module56Name=Payment by credit transfer
Module56Desc=Management of payment by credit transfer orders. It includes generation of SEPA file for European countries.
Module57Name=Bank Direct Debit payments
Module57Desc=Management of Direct Debit payment orders. It includes generation of SEPA file for European countries.
Module58Name=ClickToDial

View File

@ -35,10 +35,10 @@ SwiftValid=BIC/SWIFT valid
SwiftVNotalid=BIC/SWIFT not valid
IbanValid=BAN valid
IbanNotValid=BAN not valid
StandingOrders=Direct Debit orders
StandingOrders=Direct debit orders
StandingOrder=Direct debit order
PaymentByBankTransfers=Payments by bank transfer
PaymentByBankTransfer=Payment by bank transfer
PaymentByBankTransfers=Payments by credit transfer
PaymentByBankTransfer=Payment by credit transfer
AccountStatement=Account statement
AccountStatementShort=Statement
AccountStatements=Account statements

View File

@ -241,10 +241,6 @@ EscompteOffered=Discount offered (payment before term)
EscompteOfferedShort=Discount
SendBillRef=Submission of invoice %s
SendReminderBillRef=Submission of invoice %s (reminder)
StandingOrders=Direct debit orders
StandingOrder=Direct debit order
PaymentByBankTransfers=Payments by bank transfer
PaymentByBankTransfer=Payment by bank transfer
NoDraftBills=No draft invoices
NoOtherDraftBills=No other draft invoices
NoDraftInvoices=No draft invoices

View File

@ -425,7 +425,7 @@ ListSuppliersShort=List of Vendors
ListProspectsShort=List of Prospects
ListCustomersShort=List of Customers
ThirdPartiesArea=Third Parties/Contacts
LastModifiedThirdParties=Last %s modified Third Parties
LastModifiedThirdParties=Latest %s modified Third Parties
UniqueThirdParties=Total of Third Parties
InActivity=Open
ActivityCeased=Closed

View File

@ -263,3 +263,4 @@ WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different re
WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report
WarningProjectClosed=Project is closed. You must re-open it first.
WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were removed after that the receipt including them were generated. So nb of cheques and total of receipt may differ from number and total in list.
WarningFailedToAddFileIntoDatabaseIndex=Warnin, failed to add file entry into ECM database index table

View File

@ -85,8 +85,8 @@ MaxSize=Maximum size
AttachANewFile=Attach a new file/document
LinkedObject=Linked object
NbOfActiveNotifications=Number of notifications (no. of recipient emails)
PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__USER_SIGNATURE__
PredefinedMailTestHtml=__(Hello)__\nThis is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__USER_SIGNATURE__
PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe lines are separated by a carriage return.\n\n__USER_SIGNATURE__
PredefinedMailTestHtml=__(Hello)__<br>This is a <b>test</b> mail sent to __EMAIL__ (the word test must be in bold).<br>The lines are separated by a carriage return.<br><br>__USER_SIGNATURE__
PredefinedMailContentContract=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendInvoice=__(Hello)__\n\nPlease find invoice __REF__ attached \n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to remind you that the invoice __REF__ seems to have not been paid. A copy of the invoice is attached as a reminder.\n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__

View File

@ -43,7 +43,7 @@ ServicesOnSaleOnly=Services for sale only
ServicesOnPurchaseOnly=Services for purchase only
ServicesNotOnSell=Services not for sale and not for purchase
ServicesOnSellAndOnBuy=Services for sale and for purchase
LastModifiedProductsAndServices=Last %s modified products/services
LastModifiedProductsAndServices=Latest %s modified products/services
LastRecordedProducts=Latest %s recorded products
LastRecordedServices=Latest %s recorded services
CardProduct0=Product

View File

@ -4,21 +4,22 @@ SuppliersStandingOrdersArea=Direct credit payment orders area
StandingOrdersPayment=Direct debit payment orders
StandingOrderPayment=Direct debit payment order
NewStandingOrder=New direct debit order
NewPaymentByBankTransfer=New payment by bank transfer
NewPaymentByBankTransfer=New payment by credit transfer
StandingOrderToProcess=To process
PaymentByBankTransferReceipts=Bank transfer orders
PaymentByBankTransferLines=Bank transfer order lines
PaymentByBankTransferReceipts=Credit transfer orders
PaymentByBankTransferLines=Credit transfer order lines
WithdrawalsReceipts=Direct debit orders
WithdrawalReceipt=Direct debit order
LatestBankTransferReceipts=Latest %s bank transfer orders
LatestBankTransferReceipts=Latest %s credit transfer orders
LastWithdrawalReceipts=Latest %s direct debit files
WithdrawalsLines=Direct debit order lines
RequestStandingOrderToTreat=Request for direct debit payment order to process
RequestStandingOrderTreated=Request for direct debit payment order processed
NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines.
NbOfInvoiceToWithdraw=No. of qualified invoice with waiting direct debit order
NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order
NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information
SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by bank transfer
NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by credit transfer
SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer
InvoiceWaitingWithdraw=Invoice waiting for direct debit
AmountToWithdraw=Amount to withdraw
WithdrawsRefused=Direct debit refused

View File

@ -1699,10 +1699,11 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$langs->load('admin');
$appli .= '<br>'.$langs->trans("Database").': '.$db->database_name;
}
$text = '<span href="#" class="aversion"><span class="hideonsmartphone small">'.DOL_VERSION.'</span></span>';
$toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2);
}
$text = '<span href="#" class="aversion"><span class="hideonsmartphone small">'.DOL_VERSION.'</span></span>';
$toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2);
// Logout link
$toprightmenu .= @Form::textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem logout-btn', 2);

View File

@ -2005,9 +2005,7 @@ elseif (!empty($module))
}
dol_fiche_end();
}
else
{
} else { // Edit text file
$fullpathoffile = dol_buildpath($file, 0, 1); // Description - level 2
if ($fullpathoffile)

View File

@ -556,8 +556,6 @@ class MultiCurrency extends CommonObject
*/
public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way = 'dolibarr', $table = 'facture')
{
global $db;
$multicurrency_tx = self::getInvoiceRate($fk_facture, $table);
if ($multicurrency_tx)
@ -592,10 +590,11 @@ class MultiCurrency extends CommonObject
}
/**
* With free account we can't set source then recalcul all rates to force another source
* With free account we can't set source then recalcul all rates to force another source.
* This modify the array &$TRate.
*
* @param stdClass $TRate Object containing all currencies rates
* @return -1 if KO, 0 if nothing, 1 if OK
* @return int -1 if KO, 0 if nothing, 1 if OK
*/
public static function recalculRates(&$TRate)
{

View File

@ -83,14 +83,12 @@ class Opensurveysondage extends CommonObject
public $sujet;
/**
* Allow comments on this poll
* @var bool
* @var int Allow comments on this poll
*/
public $allow_comments;
/**
* Allow users see others vote
* @var bool
* @var int Allow users see others vote
*/
public $allow_spy;

View File

@ -73,9 +73,14 @@ class MouvementStock extends CommonObject
public $fk_origin;
public $origintype;
public $inventorycode;
public $batch;
/**
* @var Object Object set as origin before calling livraison() or reception()
*/
public $origin;
public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1),
@ -378,6 +383,7 @@ class MouvementStock extends CommonObject
if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after
{
// Set $origintype, fk_origin, fk_project
$fk_project = 0;
if (!empty($this->origin)) { // This is set by caller for tracking reason
$origintype = empty($this->origin->origin_type) ? $this->origin->element : $this->origin->origin_type;

View File

@ -133,7 +133,7 @@ class Thirdparties extends DolibarrApi
}
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st";
$sql .= " WHERE t.entity IN ('.getEntity('societe').')";
$sql .= " WHERE t.entity IN (".getEntity('societe').")";
$sql .= " AND t.fk_stcomm = st.id";
if ($mode == 1) $sql .= " AND t.client IN (1, 3)";

View File

@ -4,6 +4,7 @@ html,body {
margin:0;
height:100%;
width:100%;
background-color: #FFF !important;
}
.container{
@ -17,14 +18,14 @@ html,body {
.phonerow1{
margin: 0 auto;
width: 100%;
height: 40%;
height: auto;
min-height: 40%;
}
.phonerow2{
margin: 0 auto;
width: 100%;
height: 40%;
height: auto;
}
.phonebuttonsrow{
@ -90,7 +91,71 @@ button.publicphonebutton {
text-align: center;
overflow: visible; /* removes extra width in IE */
width:33%;
height:90%;
height:50px;
font-weight: bold;
color: #fff;
}
.phoneblue{
color: #fff;
background-color: #428bca;
border-color: #357ebd;
}
.phonegreen{
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
font-size:20px;
text-align:center;
width:20px;
}
.phonetable{
width:130px;
}
.phoneqty{
font-size:24px;
font-weight: bold;
}
.phonered{
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
font-size:20px;
text-align:center;
width:20px;
}
.phoneorange{
color: #fff;
background-color: #f0ad4e;
border-color: #eea236;
}
.total{
width:100% !important;
font-size:24px;
}
.width24{
font-size:24px;
}
.leftcat{
margin-top:15px;
float:left;
width: 50%;
text-align:center;
height:150px;;
overflow:hidden;
margin-bottom:5px;
font-size:18px;
color:#5B5858;
font-weight: bold;
}
@ -107,3 +172,28 @@ button.publicphonebutton2 {
font-weight: bold;
padding: 8px 16px;
}
.div-table-responsive-no-min{
margin-top:20px;
}
.comment {
float: left;
width: 100%;
height: auto;
}
.comment-text-area {
float: left;
width: 80%;
height: auto;
}
.textinput {
float: left;
width: 100%;
min-height: 75px;
outline: none;
resize: none;
border: 1px solid grey;
}

View File

@ -25,7 +25,7 @@ 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'; // Load $user and permissions
$id = GETPOST('id', 'int');
$w = GETPOST('w', 'int');
@ -60,7 +60,7 @@ if ($query == "cat")
{
$filename = $obj['photo'];
}
$file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
$file = DOL_URL_ROOT.'/viewimage.php?cache=1&publictakepos=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
header('Location: '.$file);
exit;
}
@ -72,15 +72,20 @@ elseif ($query == "pro")
$objProd = new Product($db);
$objProd->fetch($id);
$image = $objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1);
$image = $objProd->show_photos('product', $conf->product->multidir_output[$objProd->entity], 'small', 1);
preg_match('@src="([^"]+)"@', $image, $match);
$file = array_pop($match);
if ($file == "") header('Location: ../../public/theme/common/nophoto.png');
else header('Location: '.$file.'&cache=1');
}
else
{
if ($file == "") {
header('Location: ../../public/theme/common/nophoto.png');
} else {
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
header('Location: '.$file.'&cache=1');
} else {
header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
}
}
} else {
// TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded.
// The file

View File

@ -70,10 +70,12 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout ==
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
$arrayofcss = array(
'/takepos/css/pos.css.php',
'/takepos/js/jquery.colorbox-min.js'
);
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="css/pos.css.php">
<link rel="stylesheet" href="css/colorbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>';
}
/**
@ -863,6 +865,9 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT)
print $langs->trans('Place')." <b>".$label."</b> - ";
print $langs->trans('Floor')." <b>".$floor."</b> - ";
}
elseif (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) print $mysoc->name;
elseif ($mobilepage == "cats") print $langs->trans('Category');
elseif ($mobilepage == "products") print $langs->trans('Label');
}
// In phone version only show when is invoice page
if ($mobilepage == "invoice" || $mobilepage == "") {
@ -877,6 +882,7 @@ if ($_SESSION["basiclayout"] != 1)
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
print '<td class="linecolht right nowraponall">'.$langs->trans('TotalTTCShort').'</td>';
}
elseif ($mobilepage == "invoice") print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
print "</tr>\n";
@ -889,12 +895,14 @@ if ($_SESSION["basiclayout"] == 1)
$categories = $categorie->get_full_arbo('product');
$htmlforlines = '';
foreach ($categories as $row) {
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<div class="leftcat';
else $htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
$htmlforlines .= '" onclick="LoadProducts('.$row['id'].');">';
$htmlforlines .= '<td class="left">';
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=cat&query=cat&id='.$row['id'].'"><br>';
else $htmlforlines .= '<td class="left">';
$htmlforlines .= $row['label'];
$htmlforlines .= '</td>';
$htmlforlines .= '</tr>'."\n";
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '</div>'."\n";
else $htmlforlines .= '</td></tr>'."\n";
}
$htmlforlines .= '</table>';
$htmlforlines .= '</table>';
@ -910,12 +918,20 @@ if ($_SESSION["basiclayout"] == 1)
$prods = $object->getObjectsInCateg("product");
$htmlforlines = '';
foreach ($prods as $row) {
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<div class="leftcat';
else $htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
$htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">';
$htmlforlines .= '<td class="left">';
$htmlforlines .= $row->label;
$htmlforlines .= '<div class="right">'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'</div>';
$htmlforlines .= '</tr>'."\n";
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
$htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$row->id.'"><br>';
$htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency);
$htmlforlines .= '</div>'."\n";
}
else {
$htmlforlines .= '<td class="left">';
$htmlforlines .= $row->label;
$htmlforlines .= '<div class="right">'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'</div>';
$htmlforlines .= '</tr>'."\n";
}
}
$htmlforlines .= '</table>';
print $htmlforlines;
@ -991,7 +1007,7 @@ if ($placeid > 0)
}
$htmlforlines .= '" id="'.$line->id.'">';
$htmlforlines .= '<td class="left">';
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x ";
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
//if ($line->product_label) $htmlforlines.= '<b>'.$line->product_label.'</b>';
if (isset($line->product_type))
{
@ -1026,7 +1042,8 @@ if ($placeid > 0)
}
}
if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "<br>(".$line->array_options['options_order_notes'].")";
if ($_SESSION["basiclayout"] != 1)
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '</td><td class="right phonetable"><button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty-1).');" class="publicphonebutton2 phonered">-</button>&nbsp;&nbsp;<button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty+1).');" class="publicphonebutton2 phonegreen">+</button>';
if ($_SESSION["basiclayout"] != 1)
{
$moreinfo = '';
$moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht);

View File

@ -39,10 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
// Decode place if it is an order from customer phone
$key = GETPOST('key');
$place=dol_decode($key);
$place = GETPOSTISSET("key") ? dol_decode(GETPOST('key')) : GETPOST('place', 'aZ09');
} else {
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
}
else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
$action = GETPOST('action', 'alpha');
$setterminal = GETPOST('setterminal', 'int');
$idproduct = GETPOST('idproduct', 'int');
@ -62,28 +62,54 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI
* View
*/
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/takepos/css/phone.css">';
if ($action=="productinfo"){
if ($action == "productinfo") {
$prod = new Product($db);
$prod->fetch($idproduct);
print "<b>".$prod->label."</b><br>";
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/genimg/index.php?query=pro&id='.$idproduct.'">';
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
print "<br><b>".$prod->label."</b><br>";
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$idproduct.'">';
print "<br>".$prod->description;
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
} elseif ($action == "publicpreorder") {
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="TakeposPrintingOrder();">'.$langs->trans('Confirm').'</button>';
print "<br><br>";
print '<div class="comment">
<textarea class="textinput" placeholder="'.$langs->trans('Note').'"></textarea>
</div>';
print '<br>';
} elseif ($action == "publicpayment") {
$langs->loadLangs(array("orders"));
print '<h1>'.$langs->trans('StatusOrderDelivered').'</h1>';
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('Payment').'</button>';
print '<br>';
}
elseif ($action=="editline"){
elseif ($action == "checkplease") {
if (GETPOSTISSET("payment")) {
print '<h1>'.$langs->trans('StatusOrderDelivered').'</h1>';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$printer = new dolReceiptPrinter($db);
$printer->initPrinter($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]});
$printer->printer->feed();
$printer->printer->feed();
$printer->printer->text($langs->trans('IM'));
$printer->printer->feed();
$printer->printer->text($langs->trans('Place').": ".$place);
$printer->printer->feed();
$printer->printer->text($langs->trans('Payment').": ".$langs->trans(GETPOST('payment', 'alpha')));
$printer->printer->feed();
$printer->printer->feed();
$printer->printer->feed();
$printer->printer->feed();
$printer->printer->feed();
$printer->close();
} else {
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease(\'Cash\');">'.$langs->trans('Cash').'</button>';
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease(\'CreditCard\');">'.$langs->trans('CreditCard').'</button>';
print '<br>';
}
} elseif ($action == "editline") {
$placeid = GETPOST('placeid', 'int');
$selectedline = GETPOST('selectedline', 'int');
$invoice = new Facture($db);
@ -95,17 +121,25 @@ elseif ($action=="editline"){
$prod = new Product($db);
$prod->fetch($line->fk_product);
print "<b>".$prod->label."</b><br>";
print '<img class="imgwrapper" width="60%" src="genimg/index.php?query=pro&id='.$line->fk_product.'">';
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$line->fk_product.'">';
print "<br>".$prod->description;
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty-1).');">-</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty+1).');">+</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
print '<button type="button" class="publicphonebutton2 phonered width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty - 1).');">-</button>';
print '<button type="button" class="publicphonebutton2 phonegreen width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty + 1).');">+</button>';
print '<button type="button" class="publicphonebutton2 phoneblue width24" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
}
}
}
else {
} else {
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
$arrayofcss = array('/takepos/css/phone.css');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
?>
<script language="javascript">
<?php
@ -194,6 +228,11 @@ function AddProduct(placeid, productid){
?>
}
function PublicPreOrder(){
$("#phonediv1").load("auto_order.php?action=publicpreorder&place="+place, function() {
});
}
function AddProductConfirm(placeid, productid){
place=placeid;
<?php
@ -209,6 +248,9 @@ function AddProductConfirm(placeid, productid){
}
function SetQty(place, selectedline, qty){
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
?>
if (qty==0){
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() {
});
@ -217,11 +259,26 @@ function SetQty(place, selectedline, qty){
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
});
}
<?php
}
else {
?>
if (qty==0){
$("#phonediv2").load("invoice.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() {
});
}
else{
$("#phonediv2").load("invoice.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
});
}
<?php
}
?>
LoadCats();
}
function SetNote(place, selectedline){
var note = prompt("<?php $langs->trans('Note'); ?>", "Harry Potter");
var note = prompt("<?php $langs->trans('Note'); ?>", "");
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
});
LoadCats();
@ -262,11 +319,13 @@ function LoadPlacesList(){
function TakeposPrintingOrder(){
console.log("TakeposPrintingOrder");
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
echo '$("#phonediv2").load("auto_order.php?action=order&place="+place, function() {
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv2").load("auto_order.php?action=order&mobilepage=order&place="+place, function() {
});';
echo '$("#phonediv1").load("auto_order.php?action=publicpayment&place="+place, function() {
});';
}
else{
else {
echo '$("#phonediv2").load("invoice.php?action=order&place="+place, function() {
});';
}
@ -277,17 +336,21 @@ function Exit(){
window.location.href='../user/logout.php';
}
function CheckPlease(){
console.log("Request the check to the waiter");
$.ajax({
type: "GET",
url: "<?php print dol_buildpath('/takepos/ajax/ajax.php', 1).'?action=thecheck&=place='.$place; ?>",
});
function CheckPlease(payment){
if (payment==undefined){
$("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() {
});
}
else{
console.log("Request the check to the waiter");
$("#phonediv1").load("auto_order.php?action=checkplease&place=<?php echo $place;?>&payment="+payment, function() {
});
}
}
</script>
<body style="overflow: hidden; background-color:#D1D1D1;">
<body style="background-color:#D1D1D1;">
<?php
if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '<div class="dialog-info-takepos-terminal" id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>';
?>
@ -300,19 +363,19 @@ function CheckPlease(){
print '<button type="button" class="phonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="Exit();">'.strtoupper(substr($langs->trans('Logout'), 0, 3)).'</button>';
}
else{
print '<button type="button" class="publicphonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
else {
print '<button type="button" class="publicphonebutton phoneblue" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton phoneorange" onclick="PublicPreOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton phonegreen" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
}
?>
</div>
<div class="row1">
<div id="phonediv1" class="phonediv1"></div>
</div>
<div class="row2">
<div class="phonerow2">
<div id="phonediv2" class="phonediv2"></div>
</div>
<div class="phonerow1">
<div id="phonediv1" class="phonediv1"></div>
</div>
</div>
</body>
<?php

View File

@ -33,4 +33,5 @@ $_SESSION["takeposterminal"] = 1;
define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1);
if (GETPOSTISSET("mobilepage")) require '../invoice.php';
elseif (GETPOSTISSET("genimg")) require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php';
else require '../phone.php';

View File

@ -7,7 +7,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
--btncolorbg: #fbfbfb;
--btncolorborderhover: none;
--btncolorborder: #FFF;
--butactionbg:rgb(225, 235, 225);
--butactionbg:rgb(218, 235, 225);
--butactiondeletebg: rgb(234,228,225);
}

View File

@ -340,7 +340,9 @@ a.top-menu-dropdown-link {
content: "\f0da";
/* color: rgba(0,0,0,0.3); */
}
.dropdown-item.bookmark-item-external::before {
content: "\f35d";
}
.dropdown-item.active, .dropdown-item:hover, .dropdown-item:focus {
color: #<?php echo $colortextbackhmenu; ?> !important;

View File

@ -2651,8 +2651,8 @@ li.expanded > a.fmdirlia.jqft.ecmjqft {
div.tabs {
text-align: <?php print $left; ?>;
padding-top: 10px;
padding-left: 6px !important;
padding-right: 6px !important;
padding-left: 6px;
padding-right: 6px;
clear:both;
height:100%;
}
@ -2870,6 +2870,9 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd
.nopaddingleft {
padding-<?php print $left; ?>: 0px;
}
div.tabs.nopaddingleft {
padding-<?php print $left; ?>: 0px;
}
.nopaddingright {
padding-<?php print $right; ?>: 0px;
}
@ -5122,6 +5125,9 @@ span#select2-taskid-container[title^='--'] {
background-color: rgb(<?php echo $colorbackhmenu1 ?>);
color: #<?php echo $colortextbackhmenu; ?>;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] span {
color: #fff !important;
}
span.select2.select2-container.select2-container--default {
border-left: none;

View File

@ -17,15 +17,21 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
min-height: 90px;
/* background: #fff; */
width: 100%;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: 1px 1px 2px rgba(128, 128, 128, 0.2);
border-radius: 2px;
border: 1px solid #eee;
border: 1px solid #e9e9e9;
margin-bottom: 15px;
}
.info-box.info-box-sm{
min-height: 80px;
margin-bottom: 10px;
}
.info-box-more {
float: right;
top: 6px;
position: absolute;
right: 10px;
}
.info-box small {
font-size: 14px;
@ -74,13 +80,13 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
height: 80px;
width: 80px;
font-size: 25px;
line-height: 100px;
line-height: 92px;
}
.opened-dash-board-wrap .info-box-sm .info-box-icon {
line-height: 80px;
}
.info-box-module .info-box-icon {
height: 107px;
height: 98px;
}
.info-box-icon > img {
max-width: 100%;
@ -152,12 +158,19 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
.info-box-content {
padding: 5px 10px;
margin-left: 90px;
margin-left: 84px;
}
.info-box-sm .info-box-content{
margin-left: 80px;
}
/*.info-box-setup span {
color: var(--colortexttitlenotab2);
}
.tdsetuppicto span {
color: var(--colortexttitlenotab2);
}*/
.info-box-number {
display: block;
font-weight: bold;
@ -175,7 +188,8 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
.info-box-title{
text-transform: uppercase;
font-weight: bold;
padding-bottom: 4px;
margin-bottom: 6px;
/* padding-bottom: 4px; */
}
.info-box-text{
font-size: 0.92em;
@ -373,7 +387,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
max-width: 350px;
}
.info-box-module .info-box-content {
height: 7em;
height: 6.4em;
}
/* Disabled. This break the responsive on smartphone
.box{

View File

@ -3,14 +3,18 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
/* <style type="text/css" > */
/* ICONS INFO BOX */
/*
* Component: Info Box
* -------------------
*/
<?php
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$prefix = '';
if (!empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) $prefix = 'background-';
if (!isset($conf->global->THEME_SATURATE_RATIO)) $conf->global->THEME_SATURATE_RATIO = 0.5;
if (!isset($conf->global->THEME_SATURATE_RATIO)) $conf->global->THEME_SATURATE_RATIO = 0.7;
if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = GETPOST('THEME_SATURATE_RATIO', 'int');
?>
@ -97,12 +101,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
/* box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); */
border-radius: 2px;
margin-bottom: 15px;
border: 1px solid #ddd;
border: 1px solid #e9e9e9;
}
.info-box.info-box-sm{
min-height: 80px;
margin-bottom: 10px;
}
.info-box-more {
float: right;
top: 4px;
position: absolute;
right: 10px;
}
.info-box small {
font-size: 14px;
@ -149,13 +159,13 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
.info-box-sm .info-box-icon {
width: 80px;
font-size: 25px;
line-height: 100px;
line-height: 92px;
}
.opened-dash-board-wrap .info-box-sm .info-box-icon {
line-height: 80px;
}
.info-box-module .info-box-icon {
height: 108px;
height: 98px;
}
.info-box-icon > img {
max-width: 100%;
@ -163,10 +173,6 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
.info-box-module .info-box-icon > img {
max-width: 55%;
}
.info-box-content {
padding: 5px 10px;
margin-left: 90px;
}
.info-box-icon-text{
box-sizing: border-box;
@ -232,7 +238,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
.info-box-content {
padding: 5px 10px;
margin-left: 90px;
margin-left: 84px;
}
.info-box-number {
@ -252,10 +258,10 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
.info-box-title{
text-transform: uppercase;
font-weight: bold;
padding-bottom: 5px;
margin-bottom: 6px;
}
.info-box-text{
font-size: 12px;
font-size: 0.92em;
}
.info-box-text:first-letter{text-transform: uppercase}
a.info-box-text{ text-decoration: none;}
@ -434,5 +440,5 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
max-width: 350px;
}
.info-box-module .info-box-content {
height: 7em;
height: 6.3em;
}

View File

@ -2453,7 +2453,7 @@ class Ticket extends CommonObject
$id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames);
if ($id <= 0) {
$error++;
$this->errors = $object->error;
$this->error = $object->error;
$this->errors = $object->errors;
$action = 'add_message';
}

View File

@ -1669,7 +1669,7 @@ else
$warehousestatic = new Entrepot($db);
$warehousestatic->fetch($object->fk_warehouse);
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print $warehousestatic->getNomUrl();
print $warehousestatic->getNomUrl(1);
print '</td></tr>';
}
@ -2722,7 +2722,7 @@ else
{
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1);
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&amp;backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit').'">'.$langs->trans("AddWarehouse").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&amp;backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddWarehouse").'"></span></a>';
print '</td></tr>';
}

View File

@ -636,7 +636,7 @@ class UserGroup extends CommonObject
* Delete a group
*
* @param User $user User that delete
* @return <0 if KO, > 0 if OK
* @return int <0 if KO, > 0 if OK
*/
public function delete(User $user)
{

View File

@ -542,18 +542,10 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
}
//Final weight impact
$weight_impact = $forced_weightvar;
if ($forced_weightvar === false) {
$weight_impact = 0;
}
$weight_impact = (float) $forced_weightvar; // If false, return 0
//Final price impact
$price_impact = $forced_pricevar;
if ($forced_pricevar === false) {
$price_impact = 0;
}
$price_impact = (float) $forced_pricevar; // If false, return 0
$newcomb = new ProductCombination($db);
$existingCombination = $newcomb->fetchByProductCombination2ValuePairs($product->id, $combinations);

View File

@ -1015,7 +1015,7 @@ function getListOfProductsOrServices($authentication, $filterproduct)
*
* @param array $authentication Array of authentication information
* @param array $id Category id
* @param $lang $lang Force lang
* @param Translate $lang Force lang
* @return array Array result
*/
function getProductsForCategory($authentication, $id, $lang = '')

View File

@ -3592,7 +3592,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
$nbtotalofrecords = count($listofpages['list']);
$num = $nbtotalofrecords = $limit;
$num = $limit;
$permissiontodelete = 0;
// List of mass actions available