Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-10-22 17:55:47 +02:00
commit fb7202b7f8
41 changed files with 263 additions and 107 deletions

View File

@ -210,7 +210,7 @@ if ($action == 'create') {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
dol_fiche_head();
print dol_get_fiche_head();
print '<table class="border centpercent">';
@ -272,7 +272,7 @@ if ($action == 'create') {
// Edit mode
if ($action == 'update')
{
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -327,7 +327,7 @@ if ($action == 'create') {
// View mode
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr');
print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr');
dol_banner_tab($object, 'ref', $linkback, 1, 'account_number', 'ref');

View File

@ -102,7 +102,7 @@ print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="display">';
dol_fiche_head();
print dol_get_fiche_head();
print '<table class="border centpercent">';

View File

@ -159,7 +159,7 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
dol_fiche_head();
print dol_get_fiche_head();
print '<table class="border centpercent">';
@ -202,7 +202,7 @@ if ($action == 'create')
$head = fiscalyear_prepare_head($object);
if ($action == 'edit') {
dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -257,7 +257,7 @@ if ($action == 'create')
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete");
}
dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
print '<table class="border centpercent">';

View File

@ -49,7 +49,7 @@ if ($id) {
$head = fiscalyear_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron');
print dol_get_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron');
print '<table width="100%"><tr><td>';
dol_print_object_info($object);

View File

@ -351,7 +351,7 @@ if ($action == 'create')
print '<input type="hidden" name="next_num_mvt" value="'.$next_num_mvt.'">'."\n";
print '<input type="hidden" name="mode" value="_tmp">'."\n";
dol_fiche_head();
print dol_get_fiche_head();
print '<table class="border centpercent">';
@ -415,7 +415,7 @@ if ($action == 'create')
$head[$h][2] = 'transaction';
$h++;
dol_fiche_head($head, 'transaction', '', -1);
print dol_get_fiche_head($head, 'transaction', '', -1);
//dol_banner_tab($object, '', $backlink);

View File

@ -135,7 +135,7 @@ $head = societe_prepare_head($object);
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
dol_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company');
print dol_get_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';

View File

@ -134,7 +134,7 @@ $head = societe_prepare_head($object);
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
dol_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company');
print dol_get_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';

View File

@ -119,7 +119,7 @@ if (!empty($id)) {
print load_fiche_titre($langs->trans('CustomersVentilation'), '', 'title_accountancy');
dol_fiche_head();
print dol_get_fiche_head();
print '<table class="border centpercent">';

View File

@ -121,7 +121,7 @@ if (!empty($id)) {
print load_fiche_titre($langs->trans('ExpenseReportsVentilation'), '', 'title_accountancy');
dol_fiche_head();
print dol_get_fiche_head();
print '<table class="border centpercent">';

View File

@ -121,7 +121,7 @@ if (!empty($id)) {
print load_fiche_titre($langs->trans('SuppliersVentilation'), '', 'title_accountancy');
dol_fiche_head();
print dol_get_fiche_head();
print '<table class="border centpercent">';

View File

@ -118,7 +118,7 @@ if ($object->id > 0) {
if (!empty($conf->notification->enabled)) $langs->load("mails");
$head = member_prepare_head($object);
dol_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user');
print dol_get_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user');
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2020 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
@ -833,7 +833,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<input type="hidden" name="socid" value="'.$socid.'">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
dol_fiche_head('');
print dol_get_fiche_head('');
print '<table class="border centpercent">';
print '<tbody>';
@ -1058,7 +1058,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<input type="hidden" name="statut" value="'.$object->statut.'" />';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
print dol_get_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
print '<table class="border centpercent">';
@ -1268,7 +1268,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
*/
$head = member_prepare_head($object);
dol_fiche_head($head, 'general', $langs->trans("Member"), -1, 'user');
print dol_get_fiche_head($head, 'general', $langs->trans("Member"), -1, 'user');
// Confirm create user
if ($action == 'create_user') {

View File

@ -100,7 +100,7 @@ if ($id > 0) {
$head = member_prepare_head($object);
dol_fiche_head($head, 'document', $langs->trans("Member"), -1, 'user');
print dol_get_fiche_head($head, 'document', $langs->trans("Member"), -1, 'user');
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';

View File

@ -1634,6 +1634,7 @@ class Propal extends CommonObject
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
$sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "null").",";
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").",";

View File

@ -981,6 +981,45 @@ class Invoices extends DolibarrApi
return $this->_cleanObjectDatas($this->invoice);
}
/**
* Get discount from invoice
*
* @param int $id Id of invoice
*
* @url GET {id}/discount
*
* @return mixed
*/
public function getDiscount($id)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
if (!DolibarrApiAccess::$user->rights->facture->lire) {
throw new RestException(401);
}
$result = $this->invoice->fetch($id);
if (!$result) {
throw new RestException(404, 'Invoice not found');
}
if (!DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$discountcheck = new DiscountAbsolute($this->db);
$result = $discountcheck->fetch(0, $this->invoice->id);
if ($result == 0){
throw new RestException(404, 'Discount not found');
}
if ($result < 0){
throw new RestException(500, $discountcheck->error);
}
return parent::_cleanObjectDatas($discountcheck);
}
/**
* Create a discount (credit available) for a credit note or a deposit.
*

View File

@ -206,10 +206,10 @@ $arrayfields = array(
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200),
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>210),
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>220), // Not enabled by default because slow
'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled)?0:1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled)?0:1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($conf->global->DISPLAY_MARGIN_RATES)?0:1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || empty($conf->global->DISPLAY_MARK_RATES)?0:1)),
'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES)?0:1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES)?0:1)),
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))),

View File

@ -81,7 +81,7 @@ if ($id > 0 || !empty($ref))
$totalpaye = $object->getSommePaiement();
dol_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill');
print dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill');
// Invoice content

View File

@ -8,6 +8,7 @@
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -143,8 +144,9 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$sql .= ", s.nom as name";
$sql .= ", s.rowid as socid, s.email";
$sql .= ", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
$sql .= ", cc.rowid as country_id, cc.code as country_code";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT;
$sql .= " AND f.entity IN (".getEntity('invoice').")";
@ -161,6 +163,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, ";
$sql .= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
$sql .= ", cc.rowid as country_id, cc.code as country_code";
// Add Group from hooks
$parameters = array();
@ -207,6 +210,8 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->email = $obj->email;
$companystatic->country_id = $obj->country_id;
$companystatic->country_code = $obj->country_code;
$companystatic->client = 1;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;

View File

@ -5,7 +5,7 @@
* Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -385,7 +385,7 @@ if ($action == 'new')
$sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as transactionid, ";
$sql .= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque,";
$sql .= " p.rowid as paymentid";
$sql .= " p.rowid as paymentid, p.ref as paymentref";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (b.fk_account = ba.rowid)";
@ -411,6 +411,7 @@ if ($action == 'new')
$lines[$obj->bid][$i]["banque"] = $obj->banque;
$lines[$obj->bid][$i]["id"] = $obj->transactionid;
$lines[$obj->bid][$i]["paymentid"] = $obj->paymentid;
$lines[$obj->bid][$i]["paymentref"] = $obj->paymentref;
$i++;
}
@ -482,7 +483,7 @@ if ($action == 'new')
// Link to payment
print '<td class="center">';
$paymentstatic->id = $value["paymentid"];
$paymentstatic->ref = $value["paymentid"];
$paymentstatic->ref = $value["paymentref"];
if ($paymentstatic->id)
{
print $paymentstatic->getNomUrl(1);
@ -616,7 +617,7 @@ if ($action == 'new')
// List of bank checks
$sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,";
$sql .= " b.dateo as date, b.datec as datec, b.banque,";
$sql .= " p.rowid as pid, ba.rowid as bid, p.statut";
$sql .= " p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON (b.fk_account = ba.rowid)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid";
@ -662,9 +663,8 @@ if ($action == 'new')
// Link to payment
print '<td class="center">';
$paymentstatic->id = $objp->pid;
$paymentstatic->ref = $objp->pid;
if ($paymentstatic->id)
{
$paymentstatic->ref = $objp->pref;
if ($paymentstatic->id) {
print $paymentstatic->getNomUrl(1);
} else {
print '&nbsp;';
@ -673,8 +673,7 @@ if ($action == 'new')
// Link to bank transaction
print '<td class="center">';
$accountlinestatic->rowid = $objp->rowid;
if ($accountlinestatic->rowid)
{
if ($accountlinestatic->rowid) {
print $accountlinestatic->getNomUrl(1);
} else {
print '&nbsp;';

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -66,9 +66,9 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact-
if ($file_OK)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
if (GETPOST('deletephoto'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileimg = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/'.$object->photo;
$dirthumbs = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/thumbs';
dol_delete_file($fileimg);
@ -134,7 +134,7 @@ if ($action == 'edit')
* Fiche en mode edition
*/
print '<form name="perso" method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
print '<form name="perso" method="POST" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';

View File

@ -75,6 +75,9 @@ if ($action == 'add' && !empty($permissiontoadd))
$value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup
} elseif ($object->fields[$key]['type'] == 'boolean') {
$value = ((GETPOST($key) == '1' || GETPOST($key) == 'on') ? 1 : 0);
} elseif ($object->fields[$key]['type'] == 'reference') {
$tmparraykey = array_keys($object->param_list);
$value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2');
} else {
$value = GETPOST($key, 'alphanohtml');
}
@ -162,6 +165,8 @@ if ($action == 'update' && !empty($permissiontoadd))
$value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup
} elseif ($object->fields[$key]['type'] == 'boolean') {
$value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0);
} elseif ($object->fields[$key]['type'] == 'reference') {
$value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2');
} else {
$value = GETPOST($key, 'alpha');
}

View File

@ -33,18 +33,24 @@ if ($action == 'print_file' && $user->rights->printing->read) {
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php';
$objectprint = new PrintingDriver($db);
$list = $objectprint->listDrivers($db, 10);
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
if (!empty($list)) {
$errorprint = 0;
$printerfound = 0;
foreach ($list as $driver) {
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
$langs->load($driver);
foreach ($dirmodels as $dir) {
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
break;
}
}
require_once $classfile;
$classname = 'printing_'.$driver;
$printer = new $classname($db);
$langs->load($printer::LANGFILE);
//print '<pre>'.print_r($printer, true).'</pre>';
if (!empty($conf->global->{$printer->active}))
{
if (!empty($conf->global->{$printer->active})) {
$printerfound++;
$subdir = '';

View File

@ -125,7 +125,7 @@ class box_services_contracts extends ModeleBoxes
$contractlinestatic->type = $objp->type;
$contractlinestatic->product_id = $objp->product_id;
$contractlinestatic->product_ref = $objp->product_ref;
$contratlignestatic->product_type = $objp->product_type;
$contractlinestatic->product_type = $objp->product_type;
$contractlinestatic->statut = $objp->contractline_status;

View File

@ -815,7 +815,7 @@ class dolReceiptPrinter extends Printer
}
}
// If is DummyPrintConnector send to log to debugging
if ($this->printer->connector instanceof DummyPrintConnector)
if ($this->printer->connector instanceof DummyPrintConnector || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector")
{
$data = $this->printer->connector->getData();
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") echo base64_encode($data);
@ -868,6 +868,11 @@ class dolReceiptPrinter extends Printer
public function initPrinter($printerid)
{
global $conf;
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector"){
$this->connector = new DummyPrintConnector();
$this->printer = new Printer($this->connector, $this->profile);
return;
}
$error = 0;
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
$sql .= ' FROM '.MAIN_DB_PREFIX.'printer_receipt';

View File

@ -4390,7 +4390,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
// Right
print '<td class="nobordernopadding valignmiddle right">';
print '<input type="hidden" name="pageplusoneold" value="'.($page+1).'">';
print '<input type="hidden" name="pageplusoneold" value="'.((int) $page + 1).'">';
if ($sortfield) $options .= "&sortfield=".urlencode($sortfield);
if ($sortorder) $options .= "&sortorder=".urlencode($sortorder);
// Show navigation bar

View File

@ -1278,6 +1278,9 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
// Description short of product line
$libelleproduitservice = $label;
if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) {
$libelleproduitservice = '<b>' . $libelleproduitservice . '</b>';
}
// Description long of product line
if (!empty($desc) && ($desc != $label))

View File

@ -1656,7 +1656,7 @@ class pdf_crabe extends ModelePDFFactures
if ($object->type == 2) $title = $outputlangs->transnoentities("InvoiceAvoir");
if ($object->type == 3) $title = $outputlangs->transnoentities("InvoiceDeposit");
if ($object->type == 4) $title = $outputlangs->transnoentities("InvoiceProForma");
if ($this->situationinvoice) $title = $outputlangs->transnoentities("InvoiceSituation");
if ($this->situationinvoice) $title = $outputlangs->transnoentities("PDFInvoiceSituation");
$pdf->MultiCell($w, 3, $title, '', 'R');
$pdf->SetFont('', 'B', $default_font_size);

View File

@ -1899,11 +1899,11 @@ class pdf_sponge extends ModelePDFFactures
if ($object->type == 2) $title = $outputlangs->transnoentities("InvoiceAvoir");
if ($object->type == 3) $title = $outputlangs->transnoentities("InvoiceDeposit");
if ($object->type == 4) $title = $outputlangs->transnoentities("InvoiceProForma");
if ($this->situationinvoice) $title = $outputlangs->transnoentities("InvoiceSituation");
if ($this->situationinvoice) $title = $outputlangs->transnoentities("PDFInvoiceSituation");
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
$title .= ' - ';
if ($object->type == 0) {
if ($this->situationinvoice) $title .= $outputlangsbis->transnoentities("InvoiceSituation");
if ($this->situationinvoice) $title .= $outputlangsbis->transnoentities("PDFInvoiceSituation");
$title .= $outputlangsbis->transnoentities("PdfInvoiceTitle");
} elseif ($object->type == 1) $title .= $outputlangsbis->transnoentities("InvoiceReplacement");
elseif ($object->type == 2) $title .= $outputlangsbis->transnoentities("InvoiceAvoir");

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -68,7 +69,7 @@ class mod_mo_advanced extends ModeleNumRefMos
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstBom" value="MRP_MO_ADVANCED_MASK">';
$texte .= '<input type="hidden" name="maskconstMo" value="MRP_MO_ADVANCED_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Mo"), $langs->transnoentities("Mo"));

View File

@ -66,12 +66,17 @@ class PrintingDriver
$type = 'printing';
$list = array();
$moduledir = DOL_DOCUMENT_ROOT."/core/modules/printing/";
$tmpfiles = dol_dir_list($moduledir, 'all', 0, '\modules.php', '', 'name', SORT_ASC, 0);
foreach ($tmpfiles as $record) {
$listoffiles = array();
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
foreach ($dirmodels as $dir) {
$tmpfiles = dol_dir_list(dol_buildpath($dir, 0), 'all', 0, '\modules.php', '', 'name', SORT_ASC, 0);
if (!empty($tmpfiles)) {
$listoffiles = array_merge($listoffiles, $tmpfiles);
}
}
foreach ($listoffiles as $record) {
$list[$record['fullname']] = str_replace('.modules.php', '', $record['name']);
}
}
return $list;
}

View File

@ -35,16 +35,39 @@ use OAuth\OAuth2\Service\Google;
*/
class printing_printgcp extends PrintingDriver
{
/**
* @var string module name
*/
public $name = 'printgcp';
/**
* @var string module description
*/
public $desc = 'PrintGCPDesc';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'printer';
/**
* @var string module description
*/
public $active = 'PRINTING_PRINTGCP';
/**
* @var array module parameters
*/
public $conf = array();
/**
* @var string google id
*/
public $google_id = '';
/**
* @var string google secret
*/
public $google_secret = '';
/**
@ -68,6 +91,7 @@ class printing_printgcp extends PrintingDriver
const PRINTERS_SEARCH_URL = 'https://www.google.com/cloudprint/search';
const PRINTERS_GET_JOBS = 'https://www.google.com/cloudprint/jobs';
const PRINT_URL = 'https://www.google.com/cloudprint/submit';
const LANGFILE = 'printgcp';
/**
* Constructor
@ -280,7 +304,7 @@ class printing_printgcp extends PrintingDriver
$responsedata = json_decode($response, true);
$printers = $responsedata['printers'];
// Check if we have printers?
if (count($printers) == 0) {
if (is_array($printers) && count($printers) == 0) {
// We dont have printers so return blank array
$ret['available'] = array();
} else {

View File

@ -30,19 +30,54 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php';
*/
class printing_printipp extends PrintingDriver
{
/**
* @var string module name
*/
public $name = 'printipp';
/**
* @var string module description
*/
public $desc = 'PrintIPPDesc';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'printer';
/**
* @var string Constant name
*/
public $active = 'PRINTING_PRINTIPP';
/**
* @var array array of setup value
*/
public $conf = array();
/**
* @var string host
*/
public $host;
/**
* @var string port
*/
public $port;
public $userid; /* user login */
/**
* @var string username
*/
public $userid;
/**
* @var string login for printer host
*/
public $user;
/**
* @var string password for printer host
*/
public $password;
/**
@ -60,6 +95,8 @@ class printing_printipp extends PrintingDriver
*/
public $db;
const LANGFILE = 'printipp';
/**
* Constructor
@ -113,7 +150,7 @@ class printing_printipp extends PrintingDriver
$obj = $this->db->fetch_object($result);
if ($obj)
{
dol_syslog("Found a default printer for user ".$user->id." = ".$obj->printer_id);
dol_syslog("Found a default printer for user ".$user->id." = ".$obj->printer_id);
$ipp->setPrinterURI($obj->printer_id);
} else {
if (!empty($conf->global->PRINTIPP_URI_DEFAULT))

View File

@ -531,6 +531,7 @@ TypeContact_invoice_supplier_external_SERVICE=Vendor service contact
InvoiceFirstSituationAsk=First situation invoice
InvoiceFirstSituationDesc=The <b>situation invoices</b> are tied to situations related to a progression, for example the progression of a construction. Each situation is tied to an invoice.
InvoiceSituation=Situation invoice
PDFInvoiceSituation=Situation invoice
InvoiceSituationAsk=Invoice following the situation
InvoiceSituationDesc=Create a new situation following an already existing one
SituationAmount=Situation invoice amount(net)

View File

@ -90,6 +90,8 @@ class modMyModule extends DolibarrModules
'barcode' => 0,
// Set this to 1 if module has its own models directory (core/modules/xxx)
'models' => 0,
// Set this to 1 if module has its own printing directory (core/modules/printing)
'printing' => 0,
// Set this to 1 if module has its own theme directory (theme)
'theme' => 0,
// Set this to relative path of css file if module has its own css file

View File

@ -69,8 +69,7 @@ if ($action == 'setconst' && $user->admin)
if (!$result > 0) $error++;
}
if (!$error)
{
if (!$error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null);
} else {
@ -87,8 +86,7 @@ if ($action == 'setvalue' && $user->admin)
$result = dolibarr_set_const($db, $varname, $value, 'chaine', 0, '', $conf->entity);
if (!$result > 0) $error++;
if (!$error)
{
if (!$error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null);
} else {
@ -131,10 +129,17 @@ if ($mode == 'setup' && $user->admin)
$submit_enabled = 0;
if (!empty($driver)) {
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
foreach ($dirmodels as $dir) {
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
break;
}
}
require_once $classfile;
$classname = 'printing_'.$driver;
$langs->load($driver);
$printer = new $classname($db);
$langs->load($printer::LANGFILE);
$i = 0;
$submit_enabled = 0;
@ -246,22 +251,27 @@ if ($mode == 'config' && $user->admin)
$object = new PrintingDriver($db);
$result = $object->listDrivers($db, 10);
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
foreach ($result as $driver) {
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
foreach ($dirmodels as $dir) {
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
break;
}
}
require_once $classfile;
$classname = 'printing_'.$driver;
$langs->load($driver);
$printer = new $classname($db);
$langs->load($printer::LANGFILE);
//print '<pre>'.print_r($printer, true).'</pre>';
print '<tr class="oddeven">';
print '<td>'.img_picto('', $printer->picto).' '.$langs->trans($printer->desc).'</td>';
print '<td class="center">';
if (!empty($conf->use_javascript_ajax))
{
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff($printer->active);
} else {
if (empty($conf->global->{$printer->conf}))
{
if (empty($conf->global->{$printer->conf})) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&amp;token='.newToken().'&amp;varname='.$printer->active.'&amp;value=1">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&amp;token='.newToken().'&amp;varname='.$printer->active.'&amp;value=0">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
@ -284,12 +294,19 @@ if ($mode == 'test' && $user->admin)
print $langs->trans('PrintTestDesc'.$driver)."<br><br>\n";
print '<table class="noborder centpercent">';
if (!empty($driver))
{
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
if (!empty($driver)) {
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
foreach ($dirmodels as $dir) {
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
break;
}
}
require_once $classfile;
$classname = 'printing_'.$driver;
$langs->load($driver);
$printer = new $classname($db);
$langs->load($printer::LANGFILE);
//print '<pre>'.print_r($printer, true).'</pre>';
if (count($printer->getlistAvailablePrinters())) {
if ($printer->listAvailablePrinters() == 0) {

View File

@ -2627,7 +2627,7 @@ class Product extends CommonObject
}
$sql .= " WHERE c.rowid = cd.fk_commande";
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity('commande').")";
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";
$sql .= " AND cd.fk_product = ".$this->id;
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
@ -2727,7 +2727,7 @@ class Product extends CommonObject
}
$sql .= " WHERE c.rowid = cd.fk_commande";
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sql .= " AND cd.fk_product = ".$this->id;
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
@ -2786,7 +2786,7 @@ class Product extends CommonObject
$sql .= " WHERE e.rowid = ed.fk_expedition";
$sql .= " AND c.rowid = cd.fk_commande";
$sql .= " AND e.fk_soc = s.rowid";
$sql .= " AND e.entity IN (".getEntity('expedition').")";
$sql .= " AND e.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'expedition').")";
$sql .= " AND ed.fk_origin_line = cd.rowid";
$sql .= " AND cd.fk_product = ".$this->id;
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
@ -2863,7 +2863,7 @@ class Product extends CommonObject
}
$sql .= " WHERE cf.rowid = fd.fk_commande";
$sql .= " AND cf.fk_soc = s.rowid";
$sql .= " AND cf.entity IN (".getEntity('supplier_order').")";
$sql .= " AND cf.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sql .= " AND fd.fk_product = ".$this->id;
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
}
@ -2914,7 +2914,7 @@ class Product extends CommonObject
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE m.rowid = mp.fk_mo";
$sql .= " AND m.entity IN (".getEntity('mrp').")";
$sql .= " AND m.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mrp').")";
$sql .= " AND mp.fk_product = ".$this->id;
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
$sql .= " AND m.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;

View File

@ -366,7 +366,7 @@ if ($usevirtualstock)
if (!empty($conf->commande->enabled)) {
$sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1";
$sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity('commande').")";
$sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";
$sqlCommandesCli .= " AND cd1.fk_product = p.rowid";
$sqlCommandesCli .= " AND c1.fk_statut IN (1,2))";
} else {
@ -379,7 +379,7 @@ if ($usevirtualstock)
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,";
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commande as c2,";
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2";
$sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity('expedition').")";
$sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'expedition').")";
$sqlExpeditionsCli .= " AND cd2.fk_commande = c2.rowid";
$sqlExpeditionsCli .= " AND c2.fk_statut IN (1,2)";
$sqlExpeditionsCli .= " AND cd2.fk_product = p.rowid";
@ -393,14 +393,14 @@ if ($usevirtualstock)
$sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,";
$sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3";
$sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande";
$sqlCommandesFourn .= " AND c3.entity IN (".getEntity('supplier_order').")";
$sqlCommandesFourn .= " AND c3.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sqlCommandesFourn .= " AND cd3.fk_product = p.rowid";
$sqlCommandesFourn .= " AND c3.fk_statut IN (3,4))";
$sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,";
$sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4";
$sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity('supplier_order').")";
$sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sqlReceptionFourn .= " AND fd4.fk_product = p.rowid";
$sqlReceptionFourn .= " AND cf4.fk_statut IN (3,4))";
} else {
@ -412,7 +412,7 @@ if ($usevirtualstock)
$sqlProductionToConsume = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlProductionToConsume .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,";
$sqlProductionToConsume .= " ".MAIN_DB_PREFIX."mrp_production as mp5";
$sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")";
$sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mo').")";
$sqlProductionToConsume .= " AND mp5.fk_product = p.rowid";
$sqlProductionToConsume .= " AND mp5.role IN ('toconsume', 'consummed')";
$sqlProductionToConsume .= " AND mm5.status IN (1,2))";
@ -420,7 +420,7 @@ if ($usevirtualstock)
$sqlProductionToProduce = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toproduce'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlProductionToProduce .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,";
$sqlProductionToProduce .= " ".MAIN_DB_PREFIX."mrp_production as mp5";
$sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")";
$sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mo').")";
$sqlProductionToProduce .= " AND mp5.fk_product = p.rowid";
$sqlProductionToProduce .= " AND mp5.role IN ('toproduce', 'produced')";
$sqlProductionToProduce .= " AND mm5.status IN (1,2))";

View File

@ -610,6 +610,10 @@ if (!empty($type))
if ($type == 'f') $label = 'NewSupplier';
}
if ($contextpage = 'poslist' && ( !empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
print get_htmloutput_mesg(img_warning('default') . ' ' . $langs->trans("BecarefullChangeThirdpartyBeforeAddProductToInvoice"), '', 'warning', 1);
}
// Show the new button only when this page is not opend from the Extended POS (pop-up window)
// but allow it too, when a user has the rights to create a new customer
if ($contextpage != 'poslist')

View File

@ -221,32 +221,34 @@ if (!empty($conf->stock->enabled))
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
// Select printer to use with terminal
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
$printer = new dolReceiptPrinter($db);
$printer->listprinters();
$printers = array();
foreach ($printer->listprinters as $key => $value) {
$printers[$value['rowid']] = $value['name'];
}
print '<tr class="oddeven"><td>'.$langs->trans("MainPrinterToUse").'</td>';
print '<td>';
print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1);
print '</td></tr>';
if ($conf->global->TAKEPOS_ORDER_PRINTERS) {
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1</td>';
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
$printer->listprinters();
$printers = array();
foreach ($printer->listprinters as $key => $value) {
$printers[$value['rowid']] = $value['name'];
}
print '<tr class="oddeven"><td>'.$langs->trans("MainPrinterToUse").'</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}), 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}), 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 3</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}), 1);
print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1);
print '</td></tr>';
if ($conf->global->TAKEPOS_ORDER_PRINTERS) {
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}), 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}), 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 3</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}), 1);
print '</td></tr>';
}
}
$printer->listPrintersTemplates();
$templates = array();

View File

@ -144,7 +144,7 @@ if ($action == 'getProducts') {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$printer = new dolReceiptPrinter($db);
// check printer for terminal
if ($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term} > 0 && $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term} > 0) {
if (($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term} > 0 || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") && $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term} > 0) {
$object = new Facture($db);
$object->fetch($id);
$ret = $printer->sendToPrinter($object, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term});

View File

@ -1110,7 +1110,7 @@ if ($placeid > 0)
$moreinfo .= '<br>'.$langs->transcountry("TotalLT2", $mysoc->country_code).': '.price($line->total_localtax2);
$moreinfo .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).': '.price($line->total_ttc);
//$moreinfo .= $langs->trans("TotalHT").': '.$line->total_ht;
if ($line->date_start || $line->date_end) $htmlforlines .= '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
$htmlforlines .= '</td>';
$htmlforlines .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>';
$htmlforlines .= '<td class="right">';