Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
d0a8d0aaaa
@ -112,7 +112,7 @@ if ($action == 'validatehistory') {
|
||||
$sql1 = "SELECT erd.rowid, accnt.rowid as suggestedid";
|
||||
$sql1 .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
|
||||
$sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as t ON erd.fk_c_type_fees = t.id";
|
||||
$sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND accnt.entity =".((int) $conf->entity);
|
||||
$sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND accnt.entity =".((int) $conf->entity).",";
|
||||
$sql1 .= " ".MAIN_DB_PREFIX."expensereport as er";
|
||||
$sql1 .= " WHERE erd.fk_expensereport = er.rowid AND er.entity = ".((int) $conf->entity);
|
||||
$sql1 .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
|
||||
|
||||
@ -733,15 +733,15 @@ if ($rowid > 0) {
|
||||
}
|
||||
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="12"></td>';
|
||||
print '<input class="flat maxwidth100" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
|
||||
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>';
|
||||
print '<input class="flat maxwidth100" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'" size="12"></td>';
|
||||
print '<input class="flat maxwidth100" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'"></td>';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
|
||||
@ -997,7 +997,26 @@ class CMailFile
|
||||
$this->dump_mail();
|
||||
}
|
||||
|
||||
$result = $this->smtps->getErrors();
|
||||
if (! $result) {
|
||||
$smtperrorcode = $this->smtps->lastretval; // SMTP error code
|
||||
dol_syslog("CMailFile::sendfile: mail SMTP error code ".$smtperrorcode, LOG_WARNING);
|
||||
|
||||
if ($smtperrorcode == '421') { // Try later
|
||||
// TODO Add a delay and try again
|
||||
/*
|
||||
dol_syslog("CMailFile::sendfile: Try later error, so we wait and we retry");
|
||||
sleep(2);
|
||||
|
||||
$result = $this->smtps->sendMsg();
|
||||
|
||||
if (!empty($conf->global->MAIN_MAIL_DEBUG)) {
|
||||
$this->dump_mail();
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->smtps->getErrors(); // applicative error code (not SMTP error code)
|
||||
if (empty($this->error) && empty($result)) {
|
||||
dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG);
|
||||
$res = true;
|
||||
@ -1268,7 +1287,11 @@ class CMailFile
|
||||
|
||||
if (@is_writeable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir
|
||||
$srcfile = $dolibarr_main_data_root."/dolibarr_mail.log";
|
||||
$destfile = $dolibarr_main_data_root."/dolibarr_mail.err";
|
||||
if (getDolGlobalString('MAIN_MAIL_DEBUG_ERR_WITH_DATE')) {
|
||||
$destfile = $dolibarr_main_data_root."/dolibarr_mail.".dol_print_date(dol_now(), 'dayhourlog', 'gmt').".err";
|
||||
} else {
|
||||
$destfile = $dolibarr_main_data_root."/dolibarr_mail.err";
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
dol_move($srcfile, $destfile, 0, 1, 0, 0);
|
||||
|
||||
@ -228,6 +228,7 @@ class SMTPs
|
||||
|
||||
// @CHANGE LDR
|
||||
public $log = '';
|
||||
public $lastretval = '';
|
||||
private $_errorsTo = '';
|
||||
private $_deliveryReceipt = 0;
|
||||
private $_trackId = '';
|
||||
@ -564,7 +565,7 @@ class SMTPs
|
||||
// Most servers expect a 2nd pass of EHLO after TLS is established to get another time
|
||||
// the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS.
|
||||
if (! $_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) {
|
||||
$this->_setErr(126, '"'.$hosth.'" does not support authenticated connections. Error after sending EHLO '.$hosth);
|
||||
$this->_setErr(126, '"'.$hosth.'" does not support authenticated connections or temporary error. Error after 2nd sending EHLO '.$hosth.' : '.$this->lastretval);
|
||||
return $_retVal;
|
||||
}
|
||||
}
|
||||
@ -614,7 +615,7 @@ class SMTPs
|
||||
$this->_setErr(130, 'Invalid Authentication Credentials.');
|
||||
}
|
||||
} else {
|
||||
$this->_setErr(126, '"'.$host.'" does not support authenticated connections. Error after sending EHLO '.$hosth);
|
||||
$this->_setErr(126, '"'.$host.'" does not support authenticated connections or temporary error. Error after sending EHLO '.$hosth.' : '.$this->lastretval);
|
||||
}
|
||||
|
||||
return $_retVal;
|
||||
@ -670,10 +671,11 @@ class SMTPs
|
||||
}
|
||||
}
|
||||
|
||||
// Send the HELO message to the SMTP server
|
||||
$_retVal = $this->socket_send_str('HELO '.$hosth, '250');
|
||||
}
|
||||
|
||||
// Well, did we get to the server?
|
||||
// Well, did we get the server answer with correct code ?
|
||||
if ($_retVal) {
|
||||
// From this point onward most server response codes should be 250
|
||||
// Specify who the mail is from....
|
||||
@ -716,8 +718,11 @@ class SMTPs
|
||||
|
||||
// Now tell the server we are done and close the socket...
|
||||
fputs($this->socket, 'QUIT');
|
||||
fclose($this->socket);
|
||||
} else {
|
||||
// We got error code into $this->lastretval
|
||||
}
|
||||
|
||||
fclose($this->socket);
|
||||
}
|
||||
|
||||
return $_retVal;
|
||||
@ -1871,7 +1876,9 @@ class SMTPs
|
||||
* using SMTP Extensions
|
||||
*
|
||||
* @param resource $socket Socket handler
|
||||
* @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3"
|
||||
* @param string $response Expected response ('250', ...). Example of response we can get:
|
||||
* "421 4.7.0 Try again later, closing connection. (EHLO) nb21-20020a1709071c9500b0093d0d964affsm869534ejc.73 - gsmtp"
|
||||
* "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3"
|
||||
* @return boolean True or false
|
||||
*/
|
||||
public function server_parse($socket, $response)
|
||||
@ -1898,8 +1905,10 @@ class SMTPs
|
||||
$limit++;
|
||||
}
|
||||
|
||||
$this->lastretval = substr($server_response, 0, 3);
|
||||
|
||||
if (!(substr($server_response, 0, 3) == $response)) {
|
||||
$this->_setErr(120, "Ran into problems sending Mail.\r\nResponse:".$server_response);
|
||||
$this->_setErr(120, "Ran into problems sending Mail.\r\nResponse: ".$server_response);
|
||||
$_retVal = false;
|
||||
}
|
||||
|
||||
@ -1911,9 +1920,9 @@ class SMTPs
|
||||
* Send str
|
||||
*
|
||||
* @param string $_strSend String to send
|
||||
* @param string $_returnCode Return code
|
||||
* @param string $_returnCode Expected return code
|
||||
* @param string $CRLF CRLF
|
||||
* @return boolean|null True or false
|
||||
* @return boolean|null True or false
|
||||
*/
|
||||
public function socket_send_str($_strSend, $_returnCode = null, $CRLF = "\r\n")
|
||||
{
|
||||
@ -1929,6 +1938,8 @@ class SMTPs
|
||||
if ($_returnCode) {
|
||||
return $this->server_parse($this->socket, $_returnCode);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// =============================================================
|
||||
@ -1950,7 +1961,7 @@ class SMTPs
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns errors codes and messages for Class
|
||||
* Returns applicative errors codes and messages for Class (not the SMTP error code)
|
||||
*
|
||||
* @return string $_errMsg Error Message
|
||||
*/
|
||||
|
||||
@ -20,8 +20,8 @@ CREATE TABLE llx_opensurvey_comments (
|
||||
id_sondage CHAR(16) NOT NULL,
|
||||
comment text NOT NULL,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
usercomment text
|
||||
usercomment text,
|
||||
date_creation datetime NOT NULL,
|
||||
ip varchar(250), --ip used to create record (for public submission page)
|
||||
ip varchar(250) --ip used to create record (for public submission page)
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ CREATE TABLE llx_opensurvey_user_studs (
|
||||
nom VARCHAR(64) NOT NULL,
|
||||
id_sondage VARCHAR(16) NOT NULL,
|
||||
reponses VARCHAR(200) NOT NULL, -- Not used for 'F' surveys
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
date_creation datetime NOT NULL,
|
||||
ip varchar(250), --ip used to create record (for public submission page)
|
||||
ip varchar(250) --ip used to create record (for public submission page)
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -212,7 +212,7 @@ AmountOfSubscriptions=Amount collected from contributions
|
||||
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
|
||||
DefaultAmount=Default amount of contribution (used only if no amount is defined at member type level)
|
||||
MinimumAmount=Minimum amount (used only when contribution amount is free)
|
||||
CanEditAmount=Subscription amount is free
|
||||
CanEditAmount=Subscription amount can be defined by the member
|
||||
CanEditAmountDetail=Visitor can choose/edit amount of its contribution regardless of the member type
|
||||
AmountIsLowerToMinimumNotice=sur un dû total de %s
|
||||
MEMBER_NEWFORM_PAYONLINE=After the online registration, switch automatically on the online payment page
|
||||
|
||||
@ -938,6 +938,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Split
|
||||
print '<td></td>';
|
||||
|
||||
// Split All
|
||||
print '<td></td>';
|
||||
|
||||
// Action delete line
|
||||
if ($permissiontodelete) {
|
||||
$href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id);
|
||||
@ -948,12 +955,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Split
|
||||
print '<td></td>';
|
||||
|
||||
// Split All
|
||||
print '<td></td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
// Show detailed of already consumed with js code to collapse
|
||||
@ -1003,6 +1004,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Split
|
||||
print '<td></td>';
|
||||
|
||||
// Split All
|
||||
print '<td></td>';
|
||||
|
||||
// Action delete line
|
||||
if ($permissiontodelete) {
|
||||
$href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line2['rowid']).'&fk_movement='.((int) $line2['fk_stock_movement']);
|
||||
@ -1068,23 +1075,28 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Lot / Batch
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
if ($tmpproduct->status_batch) {
|
||||
$preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : '');
|
||||
print '<input type="text" class="width50" name="batch-'.$line->id.'-'.$i.'" value="'.$preselected.'" list="batch-'.$line->id.'-'.$i.'">';
|
||||
print $formproduct->selectLotDataList('batch-'.$line->id.'-'.$i, 0, $line->fk_product, '', '');
|
||||
|
||||
$type = 'batch';
|
||||
print '<td align="right" class="split">';
|
||||
print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"');
|
||||
print '</td>';
|
||||
print '<td align="right" class="splitall">';
|
||||
if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"');
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Split
|
||||
$type = 'batch';
|
||||
print '<td align="right" class="split">';
|
||||
print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"');
|
||||
print '</td>';
|
||||
|
||||
// Split All
|
||||
print '<td align="right" class="splitall">';
|
||||
if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) {
|
||||
print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Action delete line
|
||||
if ($permissiontodelete) {
|
||||
print '<td></td>';
|
||||
@ -1139,8 +1151,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<table id="tablelinestoproduce" class="noborder noshadow nobottom centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
// Product
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
// Qty
|
||||
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
||||
// Cost price
|
||||
if ($permissiontoupdatecost) {
|
||||
if (empty($bomcostupdated)) {
|
||||
print '<td class="right">'.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).'</td>';
|
||||
@ -1148,16 +1163,59 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<td class="right">'.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).'</td>';
|
||||
}
|
||||
}
|
||||
// Already produced
|
||||
print '<td class="right">'.$langs->trans("QtyAlreadyProduced").'</td>';
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
print $langs->trans("Warehouse");
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Lot
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
print $langs->trans("Batch");
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Split
|
||||
print '<td></td>';
|
||||
|
||||
// Split All
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Action delete
|
||||
if ($permissiontodelete) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
|
||||
if ($action == 'addproduceline') {
|
||||
print '<!-- Add line to produce -->'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
// Product
|
||||
print '<td>';
|
||||
print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 1, array(), 0, '1', 0, 'maxwidth300');
|
||||
print '</td>';
|
||||
// Qty
|
||||
print '<td class="right"><input type="text" name="qtytoadd" value="1" class="width50 right"></td>';
|
||||
// Cost price
|
||||
if ($permissiontoupdatecost) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Action (cost price + already produced)
|
||||
print '<td colspan="2">';
|
||||
print '<input type="submit" class="button buttongen button-add" name="addproducelinebutton" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="canceladdproducelinebutton" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
// Lot - serial
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>';
|
||||
|
||||
// Split
|
||||
print '<td></td>';
|
||||
@ -1165,33 +1223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Split All
|
||||
print '<td></td>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
if ($action == 'addproduceline') {
|
||||
print '<!-- Add line to produce -->'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 1, array(), 0, '1', 0, 'maxwidth300');
|
||||
print '</td>';
|
||||
// Qty
|
||||
print '<td class="right"><input type="text" name="qtytoadd" value="1" class="width50 right"></td>';
|
||||
// Cost price
|
||||
print '<td></td>';
|
||||
|
||||
// Qty already produced
|
||||
print '<td colspan="2">';
|
||||
// Warehouse
|
||||
print '<input type="submit" class="button buttongen button-add" name="addproducelinebutton" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="canceladdproducelinebutton" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
// Lot - serial
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Action
|
||||
// Action delete
|
||||
if ($permissiontodelete) {
|
||||
print '<td></td>';
|
||||
}
|
||||
@ -1229,10 +1261,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyproduced.'">';
|
||||
|
||||
print '<tr>';
|
||||
// Product
|
||||
print '<td>'.$tmpproduct->getNomUrl(1);
|
||||
print '<br><span class="opacitymedium small">'.$tmpproduct->label.'</span>';
|
||||
print '</td>';
|
||||
// Qty
|
||||
print '<td class="right">'.$line->qty.'</td>';
|
||||
// Cost price
|
||||
if ($permissiontoupdatecost) {
|
||||
// Defined $manufacturingcost
|
||||
$manufacturingcost = 0;
|
||||
@ -1260,6 +1295,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
// Already produced
|
||||
print '<td class="right nowraponall">';
|
||||
if ($alreadyproduced) {
|
||||
print '<script>';
|
||||
@ -1284,28 +1320,41 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
print ' '.$alreadyproduced;
|
||||
print '</td>';
|
||||
print '<td>'; // Warehouse
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
// Lot
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>'; // Lot
|
||||
}
|
||||
print '<td></td>';
|
||||
|
||||
if ($permissiontodelete && $line->origin_type == 'free') {
|
||||
$href = $_SERVER["PHP_SELF"];
|
||||
$href .= '?id='.$object->id;
|
||||
$href .= '&action=deleteline';
|
||||
$href .= '&lineid='.$line->id;
|
||||
print '<td class="center">';
|
||||
print '<a class="reposition" href="'.$href.'">';
|
||||
print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), "delete");
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
// Split
|
||||
print '<td></td>';
|
||||
|
||||
// Split All
|
||||
print '<td></td>';
|
||||
}
|
||||
// Delete
|
||||
if ($permissiontodelete) {
|
||||
if ($line->origin_type == 'free') {
|
||||
$href = $_SERVER["PHP_SELF"];
|
||||
$href .= '?id='.$object->id;
|
||||
$href .= '&action=deleteline';
|
||||
$href .= '&lineid='.$line->id;
|
||||
print '<td class="center">';
|
||||
print '<a class="reposition" href="'.$href.'">';
|
||||
print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), "delete");
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td></td>';
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Show detailed of already consumed with js code to collapse
|
||||
foreach ($arrayoflines as $line2) {
|
||||
print '<tr class="expanddetailtoproduce'.$line->id.' hideobject opacitylow">';
|
||||
// Product
|
||||
print '<td>';
|
||||
$tmpstockmovement->id = $line2['fk_stock_movement'];
|
||||
print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?search_ref='.$tmpstockmovement->id.'">'.img_picto($langs->trans("StockMovement"), 'movement', 'class="paddingright"').'</a>';
|
||||
@ -1317,8 +1366,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($permissiontoupdatecost) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Qty already produced
|
||||
// Already produced
|
||||
print '<td class="right">'.$line2['qty'].'</td>';
|
||||
// Warehouse
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($line2['fk_warehouse'] > 0) {
|
||||
$result = $tmpwarehouse->fetch($line2['fk_warehouse']);
|
||||
@ -1327,6 +1377,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
// Lot
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($line2['batch'] != '') {
|
||||
@ -1334,7 +1385,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print $tmpbatch->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
|
||||
// Split
|
||||
print '<td></td>';
|
||||
@ -1342,6 +1392,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Split All
|
||||
print '<td></td>';
|
||||
}
|
||||
// Action delete
|
||||
if ($permissiontodelete) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -1349,12 +1403,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<!-- Enter line to produce -->'."\n";
|
||||
$maxQty = 1;
|
||||
print '<tr data-max-qty="'.$maxQty.'" name="batch_'.$line->id.'_'.$i.'">';
|
||||
// Product
|
||||
print '<td><span class="opacitymedium">'.$langs->trans("ToProduce").'</span></td>';
|
||||
$preselected = (GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i) ? GETPOST('qtytoproduce-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyproduced));
|
||||
if ($action == 'consumeorproduce' && !GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i)) {
|
||||
$preselected = 0;
|
||||
}
|
||||
// Qty
|
||||
print '<td class="right"><input type="text" class="width50 right" id="qtytoproduce-'.$line->id.'-'.$i.'" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
// Cost
|
||||
if ($permissiontoupdatecost) {
|
||||
// Defined $manufacturingcost
|
||||
$manufacturingcost = 0;
|
||||
@ -1383,7 +1440,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<td><input type="hidden" class="width50 right" name="pricetoproduce-'.$line->id.'-'.$i.'" value="'.($manufacturingcost ? $manufacturingcost : '').'"></td>';
|
||||
}
|
||||
}
|
||||
// Already produced
|
||||
print '<td></td>';
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
$preselected = (GETPOSTISSET('idwarehousetoproduce-'.$line->id.'-'.$i) ? GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) : ($object->fk_warehouse > 0 ? $object->fk_warehouse : 'ifone'));
|
||||
@ -1392,6 +1451,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoStockChangeOnServices").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
// Lot
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($tmpproduct->status_batch) {
|
||||
@ -1400,7 +1460,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
print '</td>';
|
||||
// Batch number in same column than the stock movement picto
|
||||
print '<td>';
|
||||
if ($tmpproduct->status_batch) {
|
||||
$type = 'batch';
|
||||
print '<td align="right" class="split">';
|
||||
@ -1410,9 +1469,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<td align="right" class="splitall">';
|
||||
if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" onClick="addDispatchLine('.$line->id.', \'batch\', \'alltoproduce\')"'); //
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td></td>';
|
||||
|
||||
print '<td></td>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Action delete
|
||||
print '<td></td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -2090,7 +2090,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
if (!$object->isService() && isModEnabled('bom')) {
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).'</td><td>';
|
||||
$bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".((int) $object->id);
|
||||
$bomkey = "Bom:bom/class/bom.class.php:0:(t.status:=:1) AND (t.fk_product:=:".((int) $object->id).')';
|
||||
print $form->selectForForms($bomkey, 'fk_default_bom', (GETPOSTISSET('fk_default_bom') ? GETPOST('fk_default_bom') : $object->fk_default_bom), 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
|
||||
*
|
||||
* 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
|
||||
@ -769,6 +770,15 @@ END;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Option to define a transport cost on supplier price
|
||||
if (!empty($conf->global->PRODUCT_CHARGES)) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Charges").'</td>';
|
||||
print '<td><input class="flat" name="charges" size="8" value="'.(GETPOST('charges') ? price(GETPOST('charges')) : (isset($object->fourn_charges) ? price($object->fourn_charges) : '')).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Discount qty min
|
||||
print '<tr><td>'.$langs->trans("DiscountQtyMin").'</td>';
|
||||
print '<td><input class="flat" name="remise_percent" size="4" value="'.(GETPOSTISSET('remise_percent') ? vatrate(price2num(GETPOST('remise_percent'), '', 2)) : (isset($object->fourn_remise_percent) ?vatrate($object->fourn_remise_percent) : '')).'"> %';
|
||||
@ -800,17 +810,6 @@ END;
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Option to define a transport cost on supplier price
|
||||
if (!empty($conf->global->PRODUCT_CHARGES)) {
|
||||
if (isModEnabled('margin')) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Charges").'</td>';
|
||||
print '<td><input class="flat width75" name="charges" value="'.(GETPOST('charges') ? price(GETPOST('charges')) : (isset($object->fourn_charges) ? price($object->fourn_charges) : '')).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Product description of the supplier
|
||||
if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
||||
//WYSIWYG Editor
|
||||
@ -948,6 +947,7 @@ END;
|
||||
'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5),
|
||||
'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9),
|
||||
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10),
|
||||
'pfp.charges'=>array('label'=>$langs->trans("Charges"), 'enabled' => !empty($conf->global->PRODUCT_CHARGES), 'checked'=>0, 'position'=>11),
|
||||
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>-1, 'position'=>13),
|
||||
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>-1, 'position'=>14),
|
||||
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15),
|
||||
@ -1035,6 +1035,10 @@ END;
|
||||
print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
$nbfields++;
|
||||
}
|
||||
if (!empty($arrayfields['pfp.charges']['checked'])) {
|
||||
print_liste_field_titre("Charges", $_SERVER["PHP_SELF"], "pfp.charges", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
$nbfields++;
|
||||
}
|
||||
print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
$nbfields++;
|
||||
if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) {
|
||||
@ -1177,6 +1181,13 @@ END;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Charges
|
||||
if (!empty($arrayfields['pfp.charges']['checked'])) {
|
||||
print '<td class="right">';
|
||||
print price($productfourn->fourn_charges);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Discount
|
||||
print '<td class="right">';
|
||||
print price2num($productfourn->fourn_remise_percent).'%';
|
||||
|
||||
@ -684,15 +684,16 @@ print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, 0, 'center')
|
||||
|
||||
print '<div align="center">';
|
||||
print '<div id="divsubscribe">';
|
||||
print '<div class="center subscriptionformhelptext opacitymedium justify">';
|
||||
print '<div class="center subscriptionformhelptext justify">';
|
||||
|
||||
// Welcome message
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EvntOrgWelcomeMessage").'</span>';
|
||||
print '<br>';
|
||||
print '<span class="eventlabel">'.$project->title . ' '. $conference->label.'</span><br>';
|
||||
|
||||
// Title
|
||||
print '<span class="eventlabel">'.dol_escape_htmltag($project->title . ' '. $conference->label).'</span><br>';
|
||||
if ($project->date_start_event || $project->date_end_event) {
|
||||
print '<span class="fa fa-calendar pictofixedwidth"></span>';
|
||||
print '<br><span class="fa fa-calendar pictofixedwidth"></span>';
|
||||
}
|
||||
if ($project->date_start_event) {
|
||||
$format = 'day';
|
||||
@ -717,7 +718,7 @@ if ($project->date_start_event || $project->date_end_event) {
|
||||
print '<br>';
|
||||
}
|
||||
if ($project->location) {
|
||||
print '<span class="fa fa-map-marked-alt pictofixedwidth"></span>'.$project->location.'<br>';
|
||||
print '<span class="fa fa-map-marked-alt pictofixedwidth"></span>'.dol_escape_htmltag($project->location).'<br>';
|
||||
}
|
||||
|
||||
$maxattendees = 0;
|
||||
|
||||
@ -781,7 +781,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && (
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)) {
|
||||
if ($companystatic->client > 0) {
|
||||
if ($obj->client > 0) {
|
||||
header("Location: ".DOL_URL_ROOT.'/comm/card.php?socid='.$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -1940,20 +1940,18 @@ class Ticket extends CommonObject
|
||||
{
|
||||
$contacts = array();
|
||||
|
||||
// Generation requete recherche
|
||||
// Forge the search SQL
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople";
|
||||
$sql .= " WHERE entity IN (".getEntity('contact').")";
|
||||
if (!empty($socid)) {
|
||||
$sql .= " AND fk_soc='".$this->db->escape($socid)."'";
|
||||
$sql .= " AND fk_soc = ".((int) $socid);
|
||||
}
|
||||
|
||||
if (!empty($email)) {
|
||||
$sql .= " AND ";
|
||||
|
||||
if (!$case) {
|
||||
$sql .= "email LIKE '".$this->db->escape($email)."'";
|
||||
$sql .= "email = '".$this->db->escape($email)."'";
|
||||
} else {
|
||||
$sql .= "email LIKE BINARY '".$this->db->escape($email)."'";
|
||||
$sql .= "email LIKE BINARY '".$this->db->escape($this->db->escapeforlike($email))."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user