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

This commit is contained in:
Laurent Destailleur 2020-11-04 18:51:06 +01:00
commit 79a56571f1
8 changed files with 48 additions and 48 deletions

View File

@ -6,7 +6,7 @@
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg)
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## LICENCE

View File

@ -15,7 +15,7 @@ You can use it as a standalone application or as a web application to access it
Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg)
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## LICENSE

View File

@ -278,13 +278,13 @@ print "<div class='tabsAction'>\n";
if ($user->rights->categorie->creer)
{
$socid = ($object->socid ? "&amp;socid=".$object->socid : "");
print "<a class='butAction' href='edit.php?id=".$object->id.$socid."&amp;type=".$type."'>".$langs->trans("Modify")."</a>";
$socid = ($object->socid ? "&socid=".$object->socid : "");
print '<a class="butAction" href="edit.php?id='.$object->id.$socid.'&type='.$type.'">'.$langs->trans("Modify").'</a>';
}
if ($user->rights->categorie->supprimer)
{
print "<a class='butActionDelete' href='".DOL_URL_ROOT."/categories/viewcat.php?action=delete&amp;token='.newToken().'&amp;id=".$object->id."&amp;type=".$type."'>".$langs->trans("Delete")."</a>";
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans("Delete").'</a>';
}
print "</div>";

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2017-2019 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
@ -70,8 +70,14 @@ class PaymentVarious extends CommonObject
*/
public $label;
/**
* @var string accountancy code
*/
public $accountancy_code;
/**
* @var string subledger account
*/
public $subledger_account;
/**
@ -121,6 +127,9 @@ class PaymentVarious extends CommonObject
*/
// BEGIN MODULEBUILDER PROPERTIES
/**
* @var array fields definition
*/
public $fields = array(
// TODO: fill this array
);
@ -182,22 +191,19 @@ class PaymentVarious extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql)
{
if (!$resql) {
$this->error = "Error ".$this->db->lasterror();
return -1;
}
if (!$notrigger)
{
if (!$notrigger) {
// Call trigger
$result = $this->call_trigger('PAYMENT_VARIOUS_MODIFY', $user);
if ($result < 0) $error++;
// End call triggers
}
if (!$error)
{
if (!$error) {
$this->db->commit();
return 1;
} else {
@ -303,8 +309,7 @@ class PaymentVarious extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql)
{
if (!$resql) {
$this->error = "Error ".$this->db->lasterror();
return -1;
}
@ -348,8 +353,7 @@ class PaymentVarious extends CommonObject
$newamount = price2num($this->amount, 'MT');
// Validation of parameters
if (!($newamount) > 0 || empty($this->datep))
{
if (!($newamount) > 0 || empty($this->datep)) {
return false;
}
@ -476,8 +480,7 @@ class PaymentVarious extends CommonObject
// Update fk_bank into llx_paiement.
// So we know the payment which has generate the banking ecriture
if ($bank_line_id > 0)
{
if ($bank_line_id > 0) {
$this->update_fk_bank($bank_line_id);
} else {
$this->error = $acc->error;
@ -572,29 +575,23 @@ class PaymentVarious extends CommonObject
// phpcs:enable
global $langs;
if ($mode == 0)
{
if ($mode == 0) {
return $langs->trans($this->statuts[$status]);
} elseif ($mode == 1)
{
} elseif ($mode == 1) {
return $langs->trans($this->statuts_short[$status]);
} elseif ($mode == 2)
{
} elseif ($mode == 2) {
if ($status == 0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status == 1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status == 2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
} elseif ($mode == 3)
{
} elseif ($mode == 3) {
if ($status == 0 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status == 2 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
} elseif ($mode == 4)
{
} elseif ($mode == 4) {
if ($status == 0 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status == 2 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
} elseif ($mode == 5)
{
} elseif ($mode == 5) {
if ($status == 0 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status == 1 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status == 2 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
@ -609,9 +606,10 @@ class PaymentVarious extends CommonObject
* @param string $option link option
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $notooltip 1=Disable tooltip
* @param string $morecss morecss string
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0)
public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
{
global $db, $conf, $langs, $hookmanager;
global $langs;

View File

@ -19,7 +19,7 @@
*/
/**
* \file cashcontrol/class/cashcontrol.class.php
* \file htdocs/compta/cashcontrol/class/cashcontrol.class.php
* \ingroup cashdesk|takepos
* \brief This file is CRUD class file (Create/Read/Update/Delete) for cash fence table
*/
@ -76,6 +76,9 @@ class CashControl extends CommonObject
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')),
);
/**
* @var int Object Id
*/
public $id;
public $opening;
public $status;
@ -286,7 +289,7 @@ class CashControl extends CommonObject
public function fetch($id, $ref = null)
{
$result = $this->fetchCommon($id, $ref);
if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines();
//if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines();
return $result;
}
@ -420,8 +423,10 @@ class CashControl extends CommonObject
$hookmanager->initHooks(array('cashfencedao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) { $result = $hookmanager->resPrint;
} else { $result .= $hookmanager->resPrint;
if ($reshook > 0) {
$result = $hookmanager->resPrint;
} else {
$result .= $hookmanager->resPrint;
}
return $result;

View File

@ -373,11 +373,8 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
}
$chars = explode(" ", $text);
reset($chars);
while (list($n, $v) = each($chars))
{
if (trim($v))
{
foreach ($chars as $v) {
if (trim($v)) {
$inf = explode(":", $v);
$fontsize = $scale * ($inf[1] / 1.8);
$fontheight = $total_y - ($fontsize / 2.7) + 2;
@ -387,16 +384,14 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
/* output the image */
$mode = strtolower($mode);
if ($mode == 'jpg' || $mode == 'jpeg')
{
if ($mode == 'jpg' || $mode == 'jpeg') {
header("Content-Type: image/jpeg; name=\"barcode.jpg\"");
imagejpeg($im);
} elseif ($mode == 'gif')
{
} elseif ($mode == 'gif') {
header("Content-Type: image/gif; name=\"barcode.gif\"");
imagegif($im);
} elseif (!empty($filebarcode)) // To wxrite into afile onto disk
{
} elseif (!empty($filebarcode)) {
// To wxrite into afile onto disk
imagepng($im, $filebarcode);
} else {
header("Content-Type: image/png; name=\"barcode.png\"");

View File

@ -46,7 +46,7 @@ FutureManager=Future manager
ResponsibleOfRecruitement=Responsible of recruitment
IfJobIsLocatedAtAPartner=If job is located at a partner place
PositionToBeFilled=Job position
PositionsToBeFilled=Job positionss
PositionsToBeFilled=Job positions
ListOfPositionsToBeFilled=List of job positions
NewPositionToBeFilled=New job positions

View File

@ -704,7 +704,7 @@ class Reception extends CommonObject
* @param integer $eatby eat-by date
* @param integer $sellby sell-by date
* @param string $batch Lot number
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, index of line if OK
*/
public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '')
{
@ -752,6 +752,8 @@ class Reception extends CommonObject
$line->fk_reception = $this->id;
$this->lines[$num] = $line;
return $num;
}