Merge branch 'develop' of github.com:OPEN-DSI/dolibarr into new-takepos-freezone-vat-rate

This commit is contained in:
VESSILLER 2020-03-17 09:57:21 +01:00
commit 0e171e81e6
38 changed files with 226 additions and 83 deletions

View File

@ -8,7 +8,10 @@ For Users:
NEW: Module MO (Manufacturing Order) is available as stable module.
For Developers or integrators:
* A new way to navigate between pages in list is available. To use it, you must
- replace $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
- remove input field in form '<input type="hidden" name="page" value="'.$page.'">';'
- add parameter $pagenavastextinput to value 1 when calling print_barre_liste
WARNING:

View File

@ -305,6 +305,7 @@ switch ($action)
$payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
$payment->paiementid=$invoice->mode_reglement_id;
$payment->num_paiement='';
$payment->num_payment='';
$paiement_id = $payment->create($user);
if ($paiement_id > 0)

View File

@ -2251,10 +2251,10 @@ class Facture extends CommonInvoice
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1
* ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0
* Tag the invoice as paid completely (if close_code is filled) => this->fk_statut=2, this->paye=1
* or partialy (if close_code filled) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0
*
* @param User $user Objet utilisateur qui modifie
* @param User $user Object user that modify
* @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple)
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple)
* @return int <0 if KO, >0 if OK

View File

@ -115,7 +115,7 @@ if (GETPOST("orphelins", "alpha"))
{
// Payments not linked to an invoice. Should not happend. For debug only.
$sql = "SELECT p.rowid, p.ref, p.datep as dp, p.amount,";
$sql.= " p.statut, p.num_paiement,";
$sql.= " p.statut, p.num_paiement as num_payment,";
$sql.= " c.code as paiement_code";
// Add fields from hooks
$parameters=array();
@ -133,7 +133,7 @@ if (GETPOST("orphelins", "alpha"))
else
{
$sql = "SELECT DISTINCT p.rowid, p.ref, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives
$sql.= " p.statut, p.num_paiement,";
$sql.= " p.statut, p.num_paiement as num_payment,";
$sql.= " c.code as paiement_code,";
$sql.= " ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal,";
$sql.= " s.rowid as socid, s.nom as name, s.email";
@ -323,7 +323,7 @@ if ($resql)
if (!$i) $totalarray['nbfield']++;
// Payment number
print '<td>'.$objp->num_paiement.'</td>';
print '<td>'.$objp->num_payment.'</td>';
if (!$i) $totalarray['nbfield']++;
// Account

View File

@ -64,7 +64,7 @@ if (! $sortfield) $sortfield="p.rowid";
llxHeader();
$sql = "SELECT p.rowid, p.datep as dp, p.amount, p.statut";
$sql.=", c.libelle as paiement_type, p.num_paiement";
$sql.=", c.libelle as paiement_type, p.num_paiement as num_payment";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id";
if ($socid)
{
@ -119,7 +119,7 @@ if ($resql)
print '<tr class="oddeven">';
print '<td><a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"), "payment").' '.$objp->rowid.'</a></td>';
print '<td width="80" align="center">'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
print "<td>$objp->paiement_type $objp->num_payment</td>\n";
print '<td class="right">'.price($objp->amount).'</td>';
print '<td class="center">';

View File

@ -108,9 +108,10 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$paiement->chid = $chid;
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Tableau de montant
$paiement->paiementtype = $_POST["paiementtype"];
$paiement->num_paiement = $_POST["num_paiement"];
$paiement->note = $_POST["note"];
$paiement->paiementtype = GETPOST("paiementtype", 'alphanohtml');
$paiement->num_payment = GETPOST("num_payment", 'alphanohtml');
$paiement->note = GETPOST("note", 'none');
$paiement->note_private = GETPOST("note", 'none');
if (!$error)
{
@ -243,7 +244,7 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</td>';
print '<td><input name="num_paiement" type="text" value="'.GETPOST('num_paiement').'"></td></tr>'."\n";
print '<td><input name="num_payment" type="text" value="'.GETPOST('num_payment', 'alphanohtml').'"></td></tr>'."\n";
print '<tr>';
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';

View File

@ -484,7 +484,7 @@ class BonPrelevement extends CommonObject
$paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice
$paiement->paiementid = 3; //
$paiement->num_payment = $this->ref; // Set ref of direct debit note
$paiement->num_paiement = $this->ref; // For bacward compatibility
$paiement->num_paiement = $this->ref; // For backward compatibility
$paiement->id_prelevement = $this->id;
$paiement_id = $paiement->create($user);

View File

@ -154,6 +154,7 @@ class RejetPrelevement
$pai->datepaye = $date_rejet;
$pai->paiementid = 3; // type of payment: withdrawal
$pai->num_paiement = $fac->ref;
$pai->num_payment = $fac->ref;
if ($pai->create($this->user) < 0) // we call with no_commit
{

View File

@ -603,7 +603,7 @@ if ($id > 0)
/*
* Payments
*/
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
$sql = "SELECT p.rowid, p.num_paiement as num_payment, datep as dp, p.amount,";
$sql .= " c.code as type_code,c.libelle as paiement_type,";
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.currency_code as bacurrency_code, ba.fk_accountancy_journal';
$sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
@ -647,7 +647,7 @@ if ($id > 0)
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_paiement."</td>\n";
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (!empty($conf->banque->enabled))
{
$bankaccountstatic->id = $objp->baid;

View File

@ -69,8 +69,17 @@ class PaymentSocialContribution extends CommonObject
*/
public $fk_typepaiement;
/**
* @var string
* @deprecated
*/
public $num_paiement;
/**
* @var string
*/
public $num_payment;
/**
* @var int ID
*/
@ -125,7 +134,8 @@ class PaymentSocialContribution extends CommonObject
if (isset($this->fk_charge)) $this->fk_charge = (int) $this->fk_charge;
if (isset($this->amount)) $this->amount = trim($this->amount);
if (isset($this->fk_typepaiement)) $this->fk_typepaiement = (int) $this->fk_typepaiement;
if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement);
if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated
if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
if (isset($this->note)) $this->note = trim($this->note);
if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
@ -149,11 +159,11 @@ class PaymentSocialContribution extends CommonObject
if ($totalamount != 0)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount,";
$sql .= " fk_typepaiement, num_paiement, note, fk_user_creat, fk_bank)";
$sql .= " fk_typepaiement, num_paiement as num_payment, note, fk_user_creat, fk_bank)";
$sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaye)."',";
$sql .= " ".$totalamount.",";
$sql .= " ".$this->paiementtype.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($this->note)."', ".$user->id.",";
$sql .= " ".$this->paiementtype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.",";
$sql .= " 0)";
$resql = $this->db->query($sql);
@ -231,7 +241,7 @@ class PaymentSocialContribution extends CommonObject
$sql.= " t.datep,";
$sql.= " t.amount,";
$sql.= " t.fk_typepaiement,";
$sql.= " t.num_paiement,";
$sql.= " t.num_paiement as num_payment,";
$sql.= " t.note,";
$sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,";
@ -260,7 +270,8 @@ class PaymentSocialContribution extends CommonObject
$this->datep = $this->db->jdate($obj->datep);
$this->amount = $obj->amount;
$this->fk_typepaiement = $obj->fk_typepaiement;
$this->num_paiement = $obj->num_paiement;
$this->num_paiement = $obj->num_payment;
$this->num_payment = $obj->num_payment;
$this->note = $obj->note;
$this->fk_bank = $obj->fk_bank;
$this->fk_user_creat = $obj->fk_user_creat;
@ -301,7 +312,8 @@ class PaymentSocialContribution extends CommonObject
if (isset($this->fk_charge)) $this->fk_charge = (int) $this->fk_charge;
if (isset($this->amount)) $this->amount = trim($this->amount);
if (isset($this->fk_typepaiement)) $this->fk_typepaiement = (int) $this->fk_typepaiement;
if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement);
if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated
if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
if (isset($this->note)) $this->note = trim($this->note);
if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
@ -511,8 +523,9 @@ class PaymentSocialContribution extends CommonObject
$this->datep = '';
$this->amount = '';
$this->fk_typepaiement = '';
$this->num_paiement = '';
$this->note = '';
$this->num_payment = '';
$this->note_private = '';
$this->note_public = '';
$this->fk_bank = '';
$this->fk_user_creat = '';
$this->fk_user_modif = '';

View File

@ -108,7 +108,7 @@ $userid = GETPOST('userid', 'int');
$begin = GETPOST('begin');
if (!$sortorder) $sortorder = "ASC";
if (!$sortfield) $sortfield = "p.lastname";
if (empty($page) || $page < 0) { $page = 0; }
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; }
$offset = $limit * $page;
$titre = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
@ -497,11 +497,11 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
//print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit);
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "contact";

View File

@ -125,7 +125,7 @@ class FormFile
$out .= '<input type="hidden" name="sortorder" value="'.GETPOST('sortorder', 'aZ09').'">';
}
$out .= '<table width="100%" class="nobordernopadding">';
$out .= '<table class="nobordernopadding cenpercent">';
$out .= '<tr>';
if (!empty($options)) $out .= '<td>'.$options.'</td>';
@ -168,7 +168,7 @@ class FormFile
$out .= '<input type="hidden" name="max_file_size" value="'.($maxmin * 1024).'">';
}
$out .= '<input class="flat minwidth400" type="file"';
$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic') ? ' name="userfile"' : ' name="userfile[]" multiple');
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : '');
$out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""');

View File

@ -4361,7 +4361,8 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
if ($cpt == $page)
{
$pagelist .= '<li class="pagination"><input type="text" class="width25 center pageplusone" name="pageplusone" value="'.($page + 1).'"></li>';
if (($cpt + 1) < $nbpages) $pagelist .= '/';
$pagelist .= '/';
//if (($cpt + 1) < $nbpages) $pagelist .= '/';
}
} else {
if ($cpt == $page)
@ -4386,9 +4387,9 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
}
} else {
//var_dump($page.' '.$cpt.' '.$nbpages);
if (($page + 1) < $nbpages) {
//if (($page + 1) < $nbpages) {
$pagelist .= '<li class="pagination"><a href="'.$file.'?page='.($nbpages - 1).$options.'">'.$nbpages.'</a></li>';
}
//}
}
}
else

View File

@ -181,8 +181,7 @@ class pdf_paiement
switch ($this->doc_type) {
case "client":
$sql = "SELECT p.datep as dp, f.ref";
//$sql .= ", c.libelle as paiement_type, p.num_paiement";
$sql.= ", c.code as paiement_code, p.num_paiement";
$sql.= ", c.code as paiement_code, p.num_paiement as num_payment";
$sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
$sql.= ", pf.amount as pf_amount";
if (! empty($conf->banque->enabled))
@ -212,8 +211,7 @@ class pdf_paiement
break;
case "fourn":
$sql = "SELECT p.datep as dp, f.ref as ref";
//$sql .= ", c.libelle as paiement_type, p.num_paiement";
$sql.= ", c.code as paiement_code, p.num_paiement";
$sql.= ", c.code as paiement_code, p.num_paiement as num_payment";
$sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
$sql.= ", pf.amount as pf_amount";
if (! empty($conf->banque->enabled))
@ -257,7 +255,7 @@ class pdf_paiement
$lines[$i][0] = $objp->ref;
$lines[$i][1] = dol_print_date($this->db->jdate($objp->dp), "day", false, $outputlangs, true);
$lines[$i][2] = $langs->transnoentities("PaymentTypeShort".$objp->paiement_code);
$lines[$i][3] = $objp->num_paiement;
$lines[$i][3] = $objp->num_payment;
$lines[$i][4] = price($objp->paiement_amount);
$lines[$i][5] = price($objp->facture_amount);
$lines[$i][6] = price($objp->pf_amount);

View File

@ -2029,7 +2029,8 @@ else
$paymentexpensereportstatic->id = $objp->rowid;
$paymentexpensereportstatic->datepaye = $db->jdate($objp->dp);
$paymentexpensereportstatic->ref = $objp->rowid;
$paymentexpensereportstatic->num_paiement = $objp->num_paiement;
$paymentexpensereportstatic->num_paiement = $objp->num_payment;
$paymentexpensereportstatic->num_payment = $objp->num_payment;
$paymentexpensereportstatic->payment_code = $objp->payment_code;
print '<tr class="oddseven">';

View File

@ -388,7 +388,7 @@ class SupplierInvoices extends DolibarrApi
* @param int $paiementid {@from body} Payment mode Id {@min 1}
* @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no}
* @param int $accountid {@from body} Account Id {@min 1}
* @param string $num_paiement {@from body} Payment number (optional)
* @param string $num_payment {@from body} Payment number (optional)
* @param string $comment {@from body} Note (optional)
* @param string $chqemetteur {@from body} Payment issuer (mandatory if paiementcode = 'CHQ')
* @param string $chqbank {@from body} Issuer bank name (optional)
@ -400,7 +400,7 @@ class SupplierInvoices extends DolibarrApi
* @throws RestException 401
* @throws RestException 404
*/
public function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement = '', $comment = '', $chqemetteur = '', $chqbank = '')
public function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '')
{
global $conf;
@ -455,7 +455,7 @@ class SupplierInvoices extends DolibarrApi
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
$paiement->paiementid = $paiementid;
$paiement->paiementcode = dol_getIdFromCode($this->db, $paiementid, 'c_paiement', 'id', 'code', 1);
$paiement->num_payment = $num_paiement;
$paiement->num_payment = $num_payment;
$paiement->note_public = $comment;
$paiement_id = $paiement->create(DolibarrApiAccess::$user, ($closepaidinvoices=='yes'?1:0)); // This include closing invoices

View File

@ -299,10 +299,12 @@ if (empty($reshook))
$paiement->multicurrency_amounts = $multicurrency_amounts;
$paiement->paiementid = GETPOST('paiementid', 'int');
$paiement->num_payment = GETPOST('num_paiement', 'alpha');
$paiement->num_payment = GETPOST('num_paiement', 'alphanohtml');
$paiement->note_private = GETPOST('comment', 'alpha');
$paiement->num_paiement = $paiement->num_payment; // For bacward compatibility
$paiement->note = $paiement->note_private; // For bacward compatibility
$paiement->num_paiement = $paiement->num_payment; // For backward compatibility
$paiement->num_payment = $paiement->num_payment;
$paiement->note = $paiement->note_private; // For backward compatibility
$paiement->note_private = $paiement->note_private;
if (!$error)
{

View File

@ -16,6 +16,7 @@ AddThisArticle=Add this article
RestartSelling=Go back on sell
SellFinished=Sale complete
PrintTicket=Print ticket
SendTicket=Send ticket
NoProductFound=No article found
ProductFound=product found
NoArticle=No article

View File

@ -86,7 +86,7 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@ -367,7 +367,7 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
//print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);

View File

@ -87,8 +87,8 @@ $diroutputmassaction = $conf->product->dir_output.'/temp/massgeneration/'.$user-
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = (GETPOST("page", 'int') ?GETPOST("page", 'int') : 0);
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@ -536,11 +536,11 @@ if ($resql)
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
//print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
if (empty($arrayfields['p.fk_product_type']['checked'])) print '<input type="hidden" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit);
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "product";

View File

@ -658,6 +658,7 @@ if ($ispaymentok)
}
$paiement->paiementid = $paymentTypeId;
$paiement->num_paiement = '';
$paiement->num_payment = '';
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
$paiement->ext_payment_id = $TRANSACTIONID;
$paiement->ext_payment_site = $service;

View File

@ -111,7 +111,7 @@ $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (!$sortorder) $sortorder = "ASC";
if (!$sortfield) $sortfield = "s.nom";
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -85,10 +85,10 @@ elseif ($action == 'search' && $term != '') {
}
}
$sql = 'SELECT rowid, ref, label, tosell, tobuy FROM '.MAIN_DB_PREFIX.'product as p';
$sql = 'SELECT rowid, ref, label, tosell, tobuy, barcode, price FROM '.MAIN_DB_PREFIX.'product as p';
$sql .= ' WHERE entity IN ('.getEntity('product').')';
if ($filteroncategids) {
$sql.= ' AND rowid IN (SELECT DISTINCT fk_product FROM '.MAIN_DB_PREFIX.'categorie_product WHERE fk_categorie IN ('.$filteroncategids.'))';
$sql.= ' AND EXISTS (SELECT cp.fk_product FROM '.MAIN_DB_PREFIX.'categorie_product as cp WHERE cp.fk_product = p.rowid AND cp.fk_categorie IN ('.$filteroncategids.'))';
}
$sql .= ' AND tosell = 1';
$sql .= natural_search(array('ref', 'label', 'barcode'), $term);
@ -96,8 +96,17 @@ elseif ($action == 'search' && $term != '') {
if ($resql)
{
$rows = array();
while ($row = $db->fetch_object($resql)) {
$rows[] = $row;
while ($obj = $db->fetch_object($resql)) {
$rows[] = array(
'rowid' => $obj->rowid,
'ref' => $obj->ref,
'label' => $obj->label,
'tosell' => $obj->tosell,
'tobuy' => $obj->tobuy,
'barcode' => $obj->barcode,
'price' => $obj->price
//'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency)
);
}
echo json_encode($rows);
}

View File

@ -299,7 +299,7 @@ div.paymentbordline
.row1withhead{
margin: 0 auto;
width: 100%;
height: calc(50% - 50px);
height: calc(45% - 50px);
padding-top: 5px;
}
@ -312,7 +312,7 @@ div.paymentbordline
.row2withhead{
margin: 0 auto;
width: 100%;
height: 50%;
height: 55%;
}
.div1{
@ -501,6 +501,20 @@ div#moreinfo, div#infowarehouse {
padding: 0 8px 0 8px;
}
.productprice {
position: absolute;
top: 5px;
right: 5px;
background: var(--colorbackhmenu1);
color: var(--colortextbackhmenu);
font-size: 2em;
padding: 5px;
border-radius: 2px;
opacity: 0.9;
padding-left: 8px;
padding-right: 8px;
}
@media screen and (min-width: 892px) {
.actionbutton{
@ -574,7 +588,7 @@ div#moreinfo, div#infowarehouse {
}
.row1withhead{
height: calc(50% - 100px);
height: calc(45% - 100px);
}

View File

@ -47,6 +47,15 @@ $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place
$newname = GETPOST('newname', 'alpha');
$mode = GETPOST('mode', 'alpha');
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
/*
* Actions
*/
if ($action == "getTables")
{
$sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables where floor=".$floor;
@ -81,6 +90,11 @@ if ($action == "add")
$db->query("update ".MAIN_DB_PREFIX."takepos_floor_tables set label=rowid where label=''"); // No empty table names
}
/*
* View
*/
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;

View File

@ -45,6 +45,10 @@ $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place
$idline = GETPOST('idline', 'int');
$action = GETPOST('action', 'alpha');
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
// get invoice
$invoice = new Facture($db);
if ($place > 0) {

View File

@ -263,6 +263,8 @@ function LoadProducts(position, issubcat) {
if (currentcat==val.fk_parent) {
$("#prodivdesc"+ishow).show();
$("#prodesc"+ishow).text(val.label);
$("#proprice"+ishow).attr("class", "hidden");
$("#proprice"+ishow).html("");
$("#proimg"+ishow).attr("src","genimg/index.php?query=cat&id="+val.rowid);
$("#prodiv"+ishow).data("rowid",val.rowid);
$("#prodiv"+ishow).data("iscat",1);
@ -281,6 +283,8 @@ function LoadProducts(position, issubcat) {
if (typeof (data[idata]) == "undefined") {
$("#prodivdesc"+ishow).hide();
$("#prodesc"+ishow).text("");
$("#proprice"+ishow).attr("class", "hidden");
$("#proprice"+ishow).html("");
$("#proimg"+ishow).attr("title","");
$("#proimg"+ishow).attr("src","genimg/empty.png");
$("#prodiv"+ishow).data("rowid","");
@ -289,9 +293,17 @@ function LoadProducts(position, issubcat) {
ishow++; //Next product to show after print data product
}
else if ((data[idata]['status']) == "1") { // Only show products with status=1 (for sell)
var titlestring = '<?php echo dol_escape_js($langs->transnoentities('Ref').': '); ?>'+data[idata]['ref'];
<?php
$titlestring = "'".dol_escape_js($langs->transnoentities('Ref').': ')."' + data[idata]['ref']";
$titlestring .= " + ' - ".dol_escape_js($langs->trans("Barcode").': ')."' + data[idata]['barcode']";
?>
var titlestring = <?php echo $titlestring; ?>;
$("#prodivdesc"+ishow).show();
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
if (data[parseInt(idata)]['price_formated']) {
$("#proprice"+ishow).attr("class", "productprice");
$("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']);
}
$("#proimg"+ishow).attr("title", titlestring);
$("#proimg"+ishow).attr("src", "genimg/index.php?query=pro&id="+data[idata]['id']);
$("#prodiv"+ishow).data("rowid", data[idata]['id']);
@ -337,6 +349,8 @@ function MoreProducts(moreorless) {
if (typeof (data[idata]) == "undefined") {
$("#prodivdesc"+ishow).hide();
$("#prodesc"+ishow).text("");
$("#proprice"+ishow).attr("class", "");
$("#proprice"+ishow).html("");
$("#proimg"+ishow).attr("src","genimg/empty.png");
$("#prodiv"+ishow).data("rowid","");
ishow++; //Next product to show after print data product
@ -345,6 +359,10 @@ function MoreProducts(moreorless) {
//Only show products with status=1 (for sell)
$("#prodivdesc"+ishow).show();
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
if (data[parseInt(idata)]['price_formated']) {
$("#proprice"+ishow).attr("class", "productprice");
$("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']);
}
$("#proimg"+ishow).attr("src","genimg/index.php?query=pro&id="+data[idata]['id']);
$("#prodiv"+ishow).data("rowid",data[idata]['id']);
$("#prodiv"+ishow).data("iscat",0);
@ -462,7 +480,7 @@ function New() {
* return {void}
*/
function Search2(keyCodeForEnter) {
console.log("Search2 Call ajax search to replace products");
console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter);
var search = false;
var eventKeyCode = window.event.keyCode;
@ -477,20 +495,37 @@ function Search2(keyCodeForEnter) {
for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) {
if (typeof (data[i]) == "undefined") {
$("#prodesc" + i).text("");
$("#proprice" + i).attr("class", "hidden");
$("#proprice" + i).html("");
$("#proimg" + i).attr("src", "genimg/empty.png");
$("#prodiv" + i).data("rowid", "");
continue;
}
var titlestring = '<?php echo dol_escape_js($langs->transnoentities('Ref').': '); ?>' + data[i]['ref'];
<?php
$titlestring = "'".dol_escape_js($langs->transnoentities('Ref').': ')."' + data[i]['ref']";
$titlestring .= " + ' - ".dol_escape_js($langs->trans("Barcode").': ')."' + data[i]['barcode']";
?>
var titlestring = <?php echo $titlestring; ?>;
$("#prodesc" + i).text(data[i]['label']);
$("#prodivdesc" + i).show();
if (data[i]['price_formated']) {
$("#proprice" + i).attr("class", "productprice");
$("#proprice" + i).html(data[i]['price_formated']);
}
$("#proimg" + i).attr("title", titlestring);
$("#proimg" + i).attr("src", "genimg/index.php?query=pro&id=" + data[i]['rowid']);
$("#prodiv" + i).data("rowid", data[i]['rowid']);
$("#prodiv" + i).data("iscat", 0);
}
}).always(function (data) {
if ($('#search').val().length > 0 && data.length == 1) ClickProduct(0);
// If there is only 1 answer
if ($('#search').val().length > 0 && data.length == 1) {
console.log($('#search').val()+' - '+data[0]['barcode']);
if ($('#search').val() == data[0]['barcode']) {
console.log("There is only 1 answer with barcode matching the search, so we add the product in basket");
ClickProduct(0);
}
}
});
}
}
@ -924,15 +959,16 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
<?php
if ($count == ($MAXPRODUCT - 2)) {
//echo '<img class="imgwrapper" src="img/arrow-prev-top.png" height="100%" id="proimg'.$count.'" />';
echo '<span class="fa fa-chevron-left centerinmiddle" style="font-size: 5em;"></span>';
print '<span class="fa fa-chevron-left centerinmiddle" style="font-size: 5em;"></span>';
}
elseif ($count == ($MAXPRODUCT - 1)) {
//echo '<img class="imgwrapper" src="img/arrow-next-top.png" height="100%" id="proimg'.$count.'" />';
echo '<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
print '<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
}
else
{
echo '<img class="imgwrapper" height="100%" title="" id="proimg'.$count.'">';
print '<div class="" id="proprice'.$count.'"></div>';
print '<img class="imgwrapper" height="100%" title="" id="proimg'.$count.'">';
}
?>
<?php if ($count != ($MAXPRODUCT - 2) && $count != ($MAXPRODUCT - 1)) { ?>

View File

@ -47,6 +47,12 @@ $idproduct = GETPOST('idproduct', 'int');
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant
$placeid = 0; // $placeid is ID of invoice
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
if ($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone')
{
// DIRECT LINK TO THIS PAGE FROM MOBILE AND NO TERMINAL SELECTED
@ -918,14 +924,16 @@ if ($placeid > 0)
if (empty($conf->global->TAKEPOS_SHOW_N_FIRST_LINES)) {
$tooltiptext = '<b>'.$langs->trans("Ref").'</b> : '.$line->product_ref.'<br>';
$tooltiptext .= '<b>'.$langs->trans("Label").'</b> : '.$line->product_label.'<br>';
$tooltiptext .= '<br>';
$tooltiptext .= $line->desc;
$htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : $line->product_ref, $tooltiptext);
if ($line->product_label != $line->desc) {
if ($line->desc) $tooltiptext .= '<br>';
$tooltiptext .= $line->desc;
}
$htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : ($line->product_ref ? $line->product_ref : dolGetFirstLineOfText($line->desc, 1)), $tooltiptext);
} else {
if ($line->product_label) $htmlforlines .= $line->product_label;
if ($line->product_label && $line->desc) $htmlforlines .= '<br>';
if ($line->product_label != $line->desc)
{
if ($line->product_label && $line->desc) $htmlforlines .= '<br>';
$firstline = dolGetFirstLineOfText($line->desc, $conf->global->TAKEPOS_SHOW_N_FIRST_LINES);
if ($firstline != $line->desc)
{

View File

@ -38,6 +38,10 @@ $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place
$invoiceid = GETPOST('invoiceid', 'int');
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
/*
* View

View File

@ -48,6 +48,11 @@ if ($setterminal > 0)
$langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter"));
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
/*
* View
*/

View File

@ -34,6 +34,10 @@ $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place
$facid = GETPOST('facid', 'int');
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
/*
* View

View File

@ -38,6 +38,10 @@ $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place
$invoiceid = GETPOST('invoiceid', 'int');
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
/*
* View

View File

@ -37,6 +37,11 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$invoiceid = GETPOST('facid', 'int');
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
/*
* View
*/

View File

@ -1,5 +1,15 @@
<?php
require '../main.inc.php';
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
require '../main.inc.php';
if (empty($user->rights->takepos->run)) {
access_forbidden();
}
if (isset($_GET['status'])) {
die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));

View File

@ -1165,6 +1165,7 @@ table[summary="list_of_modules"] .fa-cog {
.maxwidth150onsmartphone { max-width: 120px; }
.maxwidth150onsmartphoneimp { max-width: 120px !important; }
.maxwidth200onsmartphone { max-width: 200px; }
.maxwidth250onsmartphone { max-width: 250px; }
.maxwidth300onsmartphone { max-width: 300px; }
.maxwidth400onsmartphone { max-width: 400px; }
.minwidth50imp { min-width: 50px !important; }
@ -1288,7 +1289,7 @@ td.showDragHandle {
.side-nav-vert {
position: sticky;
top: 0px;
z-index: 210;
z-index: 1001;
}
<?php } ?>
@ -4161,6 +4162,7 @@ span[phptag] {
background: #e6e6e6;
display: inline-block;
padding: 4px 0 4px 0;
z-index: 1000;
}
.websitebar .buttonDelete, .websitebar .button {
text-shadow: none;

View File

@ -1245,6 +1245,7 @@ table[summary="list_of_modules"] .fa-cog {
.maxwidth150onsmartphone { max-width: 120px; }
.maxwidth150onsmartphoneimp { max-width: 120px !important; }
.maxwidth200onsmartphone { max-width: 200px; }
.maxwidth250onsmartphone { max-width: 250px; }
.maxwidth300onsmartphone { max-width: 300px; }
.maxwidth400onsmartphone { max-width: 400px; }
.minwidth50imp { min-width: 50px !important; }
@ -1439,7 +1440,7 @@ body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block
.side-nav-vert {
position: sticky;
top: 0px;
z-index: 210;
z-index: 1001;
}
<?php } ?>

View File

@ -97,7 +97,7 @@ $server->wsdl->addComplexType(
'',
array(
'amount' => array('name'=>'amount','type'=>'xsd:double'),
'num_paiement' => array('name'=>'num_paiement','type'=>'xsd:string'),
'num_payment' => array('name'=>'num_payment','type'=>'xsd:string'),
'thirdparty_id' => array('name'=>'thirdparty_id','type'=>'xsd:int'),
'bank_account' => array('name'=>'bank_account','type'=>'xsd:int'),
'payment_mode_id' => array('name'=>'payment_mode_id','type'=>'xsd:int'),
@ -167,14 +167,14 @@ function createPayment($authentication, $payment)
$soc = new Societe($db);
$res = $soc->fetch($payment['thirdparty_id']);
$new_payment = new Paiement($db);
$new_payment->amount = doubleval($payment['amount']);
$new_payment->num_paiement = $payment['num_paiement'];
$new_payment->bank_account = intval($payment['bank_account']);
$new_payment->paiementid = !empty($payment['payment_mode_id']) ? intval($payment['payment_mode_id']) : $soc->mode_reglement_id;
$new_payment->datepaye = $now;
$new_payment->author = $payment['thirdparty_id'];
$new_payment->amounts = array();
$new_payment = new Paiement($db);
$new_payment->amount = doubleval($payment['amount']);
$new_payment->num_payment = $payment['num_payment'];
$new_payment->fk_account = intval($payment['bank_account']);
$new_payment->paiementid = !empty($payment['payment_mode_id']) ? intval($payment['payment_mode_id']) : $soc->mode_reglement_id;
$new_payment->datepaye = $now;
$new_payment->author = $payment['thirdparty_id'];
$new_payment->amounts = array();
if (intval($payment['invoice_id']) > 0) {
$new_payment->amounts[ $payment['invoice_id'] ] = $new_payment->amount;

View File

@ -2074,7 +2074,7 @@ if (!GETPOST('hide_websitemenu'))
// List of website
print '<span class="websiteselection">';
$out = '';
$out .= '<select name="website" class="minwidth100 maxwidth300" id="website">';
$out .= '<select name="website" class="minwidth100 maxwidth300 maxwidth150onsmartphone" id="website">';
if (empty($object->records)) $out .= '<option value="-1">&nbsp;</option>';
// Loop on each sites
$i = 0;
@ -2260,7 +2260,7 @@ if (!GETPOST('hide_websitemenu'))
if ($action != 'addcontainer')
{
print '<span class="websiteselection">'.$formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action).'</span>';
print '<span class="websiteselection">'.$formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone').'</span>';
}
else
{