Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14.0
This commit is contained in:
commit
e34c921f8b
10
.travis.yml
10
.travis.yml
@ -50,7 +50,7 @@ jobs:
|
|||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
- stage: PHP 5.6-7.4
|
- stage: PHP 5.6-7.4
|
||||||
if: type = pull_request OR type = push
|
if: type = pull_request OR type = push
|
||||||
php: '7.4'
|
php: '7.4.22'
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- stage: PHP Dev
|
- stage: PHP Dev
|
||||||
if: type = push AND branch = develop
|
if: type = push AND branch = develop
|
||||||
@ -106,7 +106,7 @@ install:
|
|||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
squizlabs/php_codesniffer ^3
|
squizlabs/php_codesniffer ^3
|
||||||
fi
|
fi
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then
|
||||||
composer -n require phpunit/phpunit ^7 \
|
composer -n require phpunit/phpunit ^7 \
|
||||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
@ -241,7 +241,7 @@ before_script:
|
|||||||
# enable php-fpm
|
# enable php-fpm
|
||||||
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
||||||
- |
|
- |
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
# Copy the included pool
|
# Copy the included pool
|
||||||
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
||||||
fi
|
fi
|
||||||
@ -276,7 +276,7 @@ script:
|
|||||||
set -e
|
set -e
|
||||||
#parallel-lint --exclude htdocs/includes --blame .
|
#parallel-lint --exclude htdocs/includes --blame .
|
||||||
# Exclusions are defined in the ruleset.xml file
|
# Exclusions are defined in the ruleset.xml file
|
||||||
if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
if [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then
|
||||||
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||||
@ -291,7 +291,7 @@ script:
|
|||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
# Exclusions are defined in the ruleset.xml file
|
# Exclusions are defined in the ruleset.xml file
|
||||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then
|
||||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
||||||
fi
|
fi
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
@ -137,9 +137,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->acco
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||||
$sql1 .= ' WHERE l.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
$sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
||||||
|
|
||||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
|
|||||||
@ -112,6 +112,7 @@ if ($conf->accounting->enabled) {
|
|||||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||||
|
if (!empty($user->rights->accounting->chartofaccount)) {
|
||||||
print "<br>\n"; print "<br>\n";
|
print "<br>\n"; print "<br>\n";
|
||||||
|
|
||||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||||
@ -180,8 +181,8 @@ if ($conf->accounting->enabled) {
|
|||||||
print $s;
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
// Step A - E
|
// Step A - E
|
||||||
|
|
||||||
|
|||||||
@ -140,9 +140,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->acco
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||||
$sql1 .= ' WHERE l.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
$sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
||||||
|
|
||||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
|
|||||||
@ -920,8 +920,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$object->country = $tmparray['label'];
|
$object->country = $tmparray['label'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($socid)) {
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
|
if (!empty($socid)) {
|
||||||
if ($socid > 0) {
|
if ($socid > 0) {
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -205,7 +205,7 @@ if (!empty($conf->expedition->enabled)) {
|
|||||||
$elementList['shipping_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendShipment'));
|
$elementList['shipping_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendShipment'));
|
||||||
}
|
}
|
||||||
if (!empty($conf->reception->enabled)) {
|
if (!empty($conf->reception->enabled)) {
|
||||||
$elementList['reception_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception'));
|
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception'));
|
||||||
}
|
}
|
||||||
if (!empty($conf->ficheinter->enabled)) {
|
if (!empty($conf->ficheinter->enabled)) {
|
||||||
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));
|
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));
|
||||||
|
|||||||
@ -126,8 +126,10 @@ $utils = new Utils($db);
|
|||||||
|
|
||||||
if ($compression == 'zip') {
|
if ($compression == 'zip') {
|
||||||
$file .= '.zip';
|
$file .= '.zip';
|
||||||
$excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
|
|
||||||
|
$excludefiles = '/(\.back|\.old|\.log|\.pdf_preview-.*\.png|[\/\\\]temp[\/\\\]|[\/\\\]admin[\/\\\]documents[\/\\\])/i';
|
||||||
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles);
|
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles);
|
||||||
|
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
if ($ret == -2) {
|
if ($ret == -2) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@ -348,6 +348,9 @@ class DolibarrApi
|
|||||||
$operand = preg_replace('/[^a-z0-9\._]/i', '', trim($tmp[0]));
|
$operand = preg_replace('/[^a-z0-9\._]/i', '', trim($tmp[0]));
|
||||||
|
|
||||||
$operator = strtoupper(preg_replace('/[^a-z<>=]/i', '', trim($tmp[1])));
|
$operator = strtoupper(preg_replace('/[^a-z<>=]/i', '', trim($tmp[1])));
|
||||||
|
if ($operator == 'NOTLIKE') {
|
||||||
|
$operator = 'NOT LIKE';
|
||||||
|
}
|
||||||
|
|
||||||
$tmpescaped = trim($tmp[2]);
|
$tmpescaped = trim($tmp[2]);
|
||||||
$regbis = array();
|
$regbis = array();
|
||||||
|
|||||||
@ -66,7 +66,7 @@ function printDropdownBookmarksList()
|
|||||||
|
|
||||||
|
|
||||||
// Url to list bookmark
|
// Url to list bookmark
|
||||||
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('ListOfBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
||||||
$listbtn .= img_picto('', 'bookmark', 'class="paddingright"').$langs->trans('Bookmarks').'</a>';
|
$listbtn .= img_picto('', 'bookmark', 'class="paddingright"').$langs->trans('Bookmarks').'</a>';
|
||||||
|
|
||||||
// Url to go on create new bookmark page
|
// Url to go on create new bookmark page
|
||||||
|
|||||||
@ -659,7 +659,7 @@ if (empty($reshook) && $action == 'update') {
|
|||||||
$categories = GETPOST('categories', 'array');
|
$categories = GETPOST('categories', 'array');
|
||||||
$object->setCategories($categories);
|
$object->setCategories($categories);
|
||||||
|
|
||||||
$object->loadReminders();
|
$object->loadReminders($remindertype, 0, false);
|
||||||
if (!empty($object->reminders) && $object->datep > dol_now()) {
|
if (!empty($object->reminders) && $object->datep > dol_now()) {
|
||||||
foreach ($object->reminders as $reminder) {
|
foreach ($object->reminders as $reminder) {
|
||||||
$reminder->delete($user);
|
$reminder->delete($user);
|
||||||
@ -1439,6 +1439,10 @@ if ($id > 0) {
|
|||||||
$("#fullday").change(function() {
|
$("#fullday").change(function() {
|
||||||
setdatefields();
|
setdatefields();
|
||||||
});
|
});
|
||||||
|
$("#actioncode").change(function() {
|
||||||
|
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
|
||||||
|
else $("#dateend").removeClass("fieldrequired");
|
||||||
|
});
|
||||||
})';
|
})';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
@ -1483,7 +1487,12 @@ if ($id > 0) {
|
|||||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'></td></tr>';
|
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'></td></tr>';
|
||||||
|
|
||||||
// Date start - end
|
// Date start - end
|
||||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
|
print '<tr><td class="nowrap">';
|
||||||
|
print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
|
||||||
|
print ' - ';
|
||||||
|
print '<span id="dateend"'.($object->type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
|
||||||
|
print '</td><td td colspan="3">';
|
||||||
|
//print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
|
||||||
if (GETPOST("afaire") == 1) {
|
if (GETPOST("afaire") == 1) {
|
||||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
|
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
|
||||||
} elseif (GETPOST("afaire") == 2) {
|
} elseif (GETPOST("afaire") == 2) {
|
||||||
|
|||||||
@ -231,8 +231,11 @@ if (empty($reshook)) {
|
|||||||
// Remove line
|
// Remove line
|
||||||
$result = $object->deleteline($lineid);
|
$result = $object->deleteline($lineid);
|
||||||
// reorder lines
|
// reorder lines
|
||||||
if ($result) {
|
if ($result > 0) {
|
||||||
$object->line_order(true);
|
$object->line_order(true);
|
||||||
|
} else {
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
|
|||||||
@ -980,6 +980,8 @@ class Propal extends CommonObject
|
|||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
$this->error = $line->error;
|
||||||
|
$this->errors = $line->errors;
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -4166,7 +4168,17 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".((int) $this->rowid);
|
if (!$notrigger) {
|
||||||
|
// Call trigger
|
||||||
|
$result = $this->call_trigger('LINEPROPAL_DELETE', $user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "propaldet WHERE rowid = " . ((int) $this->rowid);
|
||||||
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
|
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
|
||||||
if ($this->db->query($sql)) {
|
if ($this->db->query($sql)) {
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
@ -4175,27 +4187,21 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
|
||||||
// Call trigger
|
|
||||||
$result = $this->call_trigger('LINEPROPAL_DELETE', $user);
|
|
||||||
if ($result < 0) {
|
|
||||||
$this->db->rollback();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// End call triggers
|
|
||||||
|
|
||||||
$this->db->commit();
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->error()." sql=".$sql;
|
$this->error = $this->db->error() . " sql=" . $sql;
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error) {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -349,9 +349,9 @@ if ($action == 'validate' && $permissiontovalidate) {
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($toselect as $checked) {
|
foreach ($toselect as $checked) {
|
||||||
if ($tmpproposal->fetch($checked)) {
|
if ($tmpproposal->fetch($checked) > 0) {
|
||||||
if ($tmpproposal->statut == 0) {
|
if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) {
|
||||||
if ($tmpproposal->valid($user)) {
|
if ($tmpproposal->valid($user) > 0) {
|
||||||
setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
|
setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($langs->trans('CantBeValidated'), 'errors');
|
setEventMessage($langs->trans('CantBeValidated'), 'errors');
|
||||||
@ -362,7 +362,7 @@ if ($action == 'validate' && $permissiontovalidate) {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -380,13 +380,13 @@ if ($action == "sign" && $permissiontoclose) {
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($toselect as $checked) {
|
foreach ($toselect as $checked) {
|
||||||
if ($tmpproposal->fetch($checked)) {
|
if ($tmpproposal->fetch($checked) > 0) {
|
||||||
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
||||||
$tmpproposal->statut = $tmpproposal::STATUS_SIGNED;;
|
$tmpproposal->statut = $tmpproposal::STATUS_SIGNED;
|
||||||
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED)) {
|
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) {
|
||||||
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
|
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -394,7 +394,7 @@ if ($action == "sign" && $permissiontoclose) {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -405,27 +405,28 @@ if ($action == "sign" && $permissiontoclose) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "nosign" && $permissiontoclose) {
|
if ($action == "nosign" && $permissiontoclose) {
|
||||||
if (GETPOST('confirm') == 'yes') {
|
if (GETPOST('confirm') == 'yes') {
|
||||||
$tmpproposal = new Propal($db);
|
$tmpproposal = new Propal($db);
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($toselect as $checked) {
|
foreach ($toselect as $checked) {
|
||||||
if ($tmpproposal->fetch($checked)) {
|
if ($tmpproposal->fetch($checked) > 0) {
|
||||||
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
||||||
$tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
|
$tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
|
||||||
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED)) {
|
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
|
||||||
setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs');
|
setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($tmpproposal->ref." ".$langs->trans('CantBeClosed'), 'errors');
|
setEventMessage($tmpproposal->ref." ".$langs->trans('CantBeNoSign'), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -337,15 +337,15 @@ if ($action == 'shipped' && $permissiontoadd) {
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($toselect as $checked) {
|
foreach ($toselect as $checked) {
|
||||||
if ($objecttmp->fetch($checked)) {
|
if ($objecttmp->fetch($checked)) {
|
||||||
if ($objecttmp->statut == 1) {
|
if ($objecttmp->statut == 1 || $objecttmp->statut == 2) {
|
||||||
if ($objecttmp->cloture($user)) {
|
if ($objecttmp->cloture($user)) {
|
||||||
setEventMessage($objecttmp->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
|
setEventMessage($objecttmp->ref." ".$langs->trans('PassedInShippedStatus'), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($langs->trans('CantBeValidated'), 'errors');
|
setEventMessage($langs->trans('YouCantShipThis'), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($objecttmp->ref." ".$langs->trans('IsNotADraft'), 'errors');
|
setEventMessage($objecttmp->ref." ".$langs->trans('MustBeValidatedBefore'), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/compta/accounting-files.php
|
* \file htdocs/compta/accounting-files.php
|
||||||
* \ingroup compta
|
* \ingroup compta
|
||||||
* \brief Page to show portoflio and files of a thirdparty and download it
|
* \brief Page to show portoflio and files of a thirdparty and download it
|
||||||
@ -499,7 +499,7 @@ if ($result && $action == "dl" && !$error) {
|
|||||||
$zip->addFromString('transactions.csv', $log);
|
$zip->addFromString('transactions.csv', $log);
|
||||||
$zip->close();
|
$zip->close();
|
||||||
|
|
||||||
///Then download the zipped file.
|
// Then download the zipped file.
|
||||||
header('Content-Type: application/zip');
|
header('Content-Type: application/zip');
|
||||||
header('Content-disposition: attachment; filename='.basename($zipname));
|
header('Content-disposition: attachment; filename='.basename($zipname));
|
||||||
header('Content-Length: '.filesize($zipname));
|
header('Content-Length: '.filesize($zipname));
|
||||||
@ -588,14 +588,13 @@ foreach ($listofchoices as $choice => $val) {
|
|||||||
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.$disabled.'> <label for="'.$choice.'">'.$langs->trans($val['label']).'</label></div>';
|
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.$disabled.'> <label for="'.$choice.'">'.$langs->trans($val['label']).'</label></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input class="button" type="submit" name="search" value="'.$langs->trans("Search").'">';
|
print '<input type="submit" class="button small" name="search" value="'.$langs->trans("Search").'">';
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
if (!empty($date_start) && !empty($date_stop)) {
|
if (!empty($date_start) && !empty($date_stop)) {
|
||||||
$param = 'action=searchfiles';
|
|
||||||
$param .= '&date_startday='.GETPOST('date_startday', 'int');
|
$param .= '&date_startday='.GETPOST('date_startday', 'int');
|
||||||
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int');
|
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int');
|
||||||
$param .= '&date_startyear='.GETPOST('date_startyear', 'int');
|
$param .= '&date_startyear='.GETPOST('date_startyear', 'int');
|
||||||
@ -603,13 +602,30 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
$param .= '&date_stopmonth='.GETPOST('date_stopmonth', 'int');
|
$param .= '&date_stopmonth='.GETPOST('date_stopmonth', 'int');
|
||||||
$param .= '&date_stopyear='.GETPOST('date_stopyear', 'int');
|
$param .= '&date_stopyear='.GETPOST('date_stopyear', 'int');
|
||||||
foreach ($listofchoices as $choice => $val) {
|
foreach ($listofchoices as $choice => $val) {
|
||||||
$param .= '&'.$choice.'='.(GETPOST($choice, 'int') ? 1 : 0);
|
if (GETPOST($choice, 'int')) {
|
||||||
|
$param .= '&'.$choice.'=1';
|
||||||
}
|
}
|
||||||
print '<form name="dl" action="'.$_SERVER["PHP_SELF"].'?action=dl" method="POST">'."\n";
|
}
|
||||||
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
|
||||||
|
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
||||||
|
|
||||||
|
|
||||||
|
$filename = dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel').'_export.zip';
|
||||||
|
|
||||||
echo dol_print_date($date_start, 'day', 'tzuserrel')." - ".dol_print_date($date_stop, 'day', 'tzuserrel');
|
echo dol_print_date($date_start, 'day', 'tzuserrel')." - ".dol_print_date($date_stop, 'day', 'tzuserrel');
|
||||||
|
|
||||||
|
print '<a class="marginleftonly small'.(empty($TData) ? ' butActionRefused' : ' butAction').'" href="'.$_SERVER["PHP_SELF"].'?action=dl&token='.newToken().'&output=file&file='.urlencode($filename).$param.'"';
|
||||||
|
if (empty($TData)) {
|
||||||
|
print " disabled";
|
||||||
|
}
|
||||||
|
print '>'."\n";
|
||||||
|
print $langs->trans("Download");
|
||||||
|
print '</a><br>';
|
||||||
|
|
||||||
|
$param .= '&action=searchfiles';
|
||||||
|
|
||||||
|
/*
|
||||||
|
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
||||||
print '<input type="hidden" name="date_startday" value="'.GETPOST('date_startday', 'int').'" />';
|
print '<input type="hidden" name="date_startday" value="'.GETPOST('date_startday', 'int').'" />';
|
||||||
print '<input type="hidden" name="date_startmonth" value="'.GETPOST('date_startmonth', 'int').'" />';
|
print '<input type="hidden" name="date_startmonth" value="'.GETPOST('date_startmonth', 'int').'" />';
|
||||||
print '<input type="hidden" name="date_startyear" value="'.GETPOST('date_startyear', 'int').'" />';
|
print '<input type="hidden" name="date_startyear" value="'.GETPOST('date_startyear', 'int').'" />';
|
||||||
@ -620,8 +636,13 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
print '<input type="hidden" name="'.$choice.'" value="'.GETPOST($choice).'">';
|
print '<input type="hidden" name="'.$choice.'" value="'.GETPOST($choice).'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input class="butAction butDownload" type="submit" value="'.$langs->trans("Download").'" />';
|
print '<input class="butAction butDownload small marginleftonly" type="submit" value="'.$langs->trans("Download").'"';
|
||||||
|
if (empty($TData)) {
|
||||||
|
print " disabled";
|
||||||
|
}
|
||||||
|
print '/>';
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
*/
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -645,11 +666,9 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
print '<td class="center">'.$langs->trans("Currency").'</td>';
|
print '<td class="center">'.$langs->trans("Currency").'</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($result) {
|
|
||||||
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
|
||||||
|
|
||||||
if (empty($TData)) {
|
if (empty($TData)) {
|
||||||
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoItem").'</td>';
|
print '<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td>';
|
||||||
if (!empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
@ -672,7 +691,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
print '<tr class="oddeven '.$html_class.'">';
|
print '<tr class="oddeven '.$html_class.'">';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<td>'.$langs->trans($data['item']).'</td>';
|
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans($data['item'])).'">'.$langs->trans($data['item']).'</td>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
@ -685,7 +704,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td class="nowraponall">';
|
print '<td class="nowraponall tdoverflowmax150">';
|
||||||
|
|
||||||
if ($data['item'] == 'Invoice') {
|
if ($data['item'] == 'Invoice') {
|
||||||
$invoice->id = $data['id'];
|
$invoice->id = $data['id'];
|
||||||
@ -733,23 +752,33 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// File link
|
// File link
|
||||||
print '<td>';
|
print '<td class="tdoverflowmax150">';
|
||||||
if (!empty($data['files'])) {
|
if (!empty($data['files'])) {
|
||||||
foreach ($data['files'] as $id => $filecursor) {
|
foreach ($data['files'] as $id => $filecursor) {
|
||||||
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a> '.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'<br>';
|
$tmppreview = $formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name'], 0);
|
||||||
|
if ($tmppreview) {
|
||||||
|
print $tmppreview;
|
||||||
|
}
|
||||||
|
$filename = ($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']);
|
||||||
|
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank" rel="noopener noreferrer" title="'.dol_escape_htmltag($filename).'">';
|
||||||
|
if (empty($tmppreview)) {
|
||||||
|
print img_picto('', 'generic', '', false, 0, 0, '', 'pictonopreview pictofixedwidth paddingright');
|
||||||
|
}
|
||||||
|
print $filename;
|
||||||
|
print '</a><br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Paid
|
// Paid
|
||||||
print '<td aling="left">'.$data['paid'].'</td>';
|
print '<td class="center">'.($data['paid'] ? yn($data['paid']) : '').'</td>';
|
||||||
|
|
||||||
// Total ET
|
// Total ET
|
||||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."</td>\n";
|
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."</span></td>\n";
|
||||||
// Total IT
|
// Total IT
|
||||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT'))."</td>\n";
|
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT'))."</span></td>\n";
|
||||||
// Total VAT
|
// Total VAT
|
||||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."</td>\n";
|
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."</span></td>\n";
|
||||||
|
|
||||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($data['thirdparty_name']).'">'.dol_escape_htmltag($data['thirdparty_name'])."</td>\n";
|
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($data['thirdparty_name']).'">'.dol_escape_htmltag($data['thirdparty_name'])."</td>\n";
|
||||||
|
|
||||||
@ -757,6 +786,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
|
|
||||||
print '<td class="center">'.$data['country_code']."</td>\n";
|
print '<td class="center">'.$data['country_code']."</td>\n";
|
||||||
|
|
||||||
|
// VAT number
|
||||||
print '<td class="tdoverflowmax150 right" title="'.dol_escape_htmltag($data['vatnum']).'">'.dol_escape_htmltag($data['vatnum'])."</td>\n";
|
print '<td class="tdoverflowmax150 right" title="'.dol_escape_htmltag($data['vatnum']).'">'.dol_escape_htmltag($data['vatnum'])."</td>\n";
|
||||||
|
|
||||||
if ($data['sens']) {
|
if ($data['sens']) {
|
||||||
@ -810,7 +840,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -179,7 +179,7 @@ if (empty($reshook)) {
|
|||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delete') {
|
if ($action == 'confirm_delete' && $confirm == 'yes') {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
if ($object->rappro == 0) {
|
if ($object->rappro == 0) {
|
||||||
@ -548,6 +548,12 @@ if ($id) {
|
|||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Confirmation of the removal of the Various Payment
|
||||||
|
if ($action == 'delete') {
|
||||||
|
$text = $langs->trans('ConfirmDeleteVariousPayment');
|
||||||
|
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteVariousPayment'), $text, 'confirm_delete', '', '', 2);
|
||||||
|
}
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, $object->picto);
|
print dol_get_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, $object->picto);
|
||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
|||||||
@ -765,8 +765,8 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
// Define special_code for special lines
|
// Define special_code for special lines
|
||||||
$special_code = GETPOST('special_code', 'int');
|
$special_code = GETPOST('special_code', 'int');
|
||||||
if (!GETPOST('qty', 'alpha')) {
|
if ($special_code == 3) {
|
||||||
$special_code = 3;
|
$special_code = 0; // Options should not exists on invoices
|
||||||
}
|
}
|
||||||
|
|
||||||
/*$line = new FactureLigne($db);
|
/*$line = new FactureLigne($db);
|
||||||
|
|||||||
@ -589,40 +589,6 @@ if (empty($reshook)) {
|
|||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
// Check parameters
|
|
||||||
|
|
||||||
// Check for mandatory fields in thirdparty (defined into setup)
|
|
||||||
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
|
||||||
foreach ($array_to_check as $key) {
|
|
||||||
$keymin = strtolower($key);
|
|
||||||
$i = (int) preg_replace('/[^0-9]/', '', $key);
|
|
||||||
$vallabel = $object->thirdparty->$keymin;
|
|
||||||
|
|
||||||
if ($i > 0) {
|
|
||||||
if ($object->thirdparty->isACompany()) {
|
|
||||||
// Check for mandatory prof id (but only if country is other than ours)
|
|
||||||
if ($mysoc->country_id > 0 && $object->thirdparty->country_id == $mysoc->country_id) {
|
|
||||||
$idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
|
|
||||||
if (!$vallabel && !empty($conf->global->$idprof_mandatory)) {
|
|
||||||
$langs->load("errors");
|
|
||||||
$error++;
|
|
||||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $object->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//var_dump($conf->global->SOCIETE_EMAIL_MANDATORY);
|
|
||||||
if ($key == 'EMAIL') {
|
|
||||||
// Check for mandatory
|
|
||||||
if (!empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && !isValidEMail($object->thirdparty->email)) {
|
|
||||||
$langs->load("errors");
|
|
||||||
$error++;
|
|
||||||
setEventMessages($langs->trans("ErrorBadEMail", $object->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for mandatory fields in invoice
|
// Check for mandatory fields in invoice
|
||||||
$array_to_check = array('REF_CLIENT'=>'RefCustomer');
|
$array_to_check = array('REF_CLIENT'=>'RefCustomer');
|
||||||
foreach ($array_to_check as $key => $val) {
|
foreach ($array_to_check as $key => $val) {
|
||||||
@ -2371,9 +2337,9 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Define special_code for special lines
|
// Define special_code for special lines
|
||||||
$special_code = GETPOST('special_code');
|
$special_code = GETPOST('special_code', 'int');
|
||||||
if (!GETPOST('qty')) {
|
if ($special_code == 3) {
|
||||||
$special_code = 3;
|
$special_code = 0; // Options should not exists on invoices
|
||||||
}
|
}
|
||||||
|
|
||||||
$line = new FactureLigne($db);
|
$line = new FactureLigne($db);
|
||||||
@ -2898,6 +2864,9 @@ if ($action == 'create') {
|
|||||||
if (empty($mode_reglement_id)) {
|
if (empty($mode_reglement_id)) {
|
||||||
$mode_reglement_id = $soc->mode_reglement_id;
|
$mode_reglement_id = $soc->mode_reglement_id;
|
||||||
}
|
}
|
||||||
|
if (empty($fk_account)) {
|
||||||
|
$fk_account = $soc->fk_account;
|
||||||
|
}
|
||||||
if (!$remise_percent) {
|
if (!$remise_percent) {
|
||||||
$remise_percent = $soc->remise_percent;
|
$remise_percent = $soc->remise_percent;
|
||||||
}
|
}
|
||||||
@ -3005,6 +2974,9 @@ if ($action == 'create') {
|
|||||||
$mode_reglement_id = GETPOST("mode_reglement_id", 'int');
|
$mode_reglement_id = GETPOST("mode_reglement_id", 'int');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value
|
||||||
|
$fk_account = GETPOSTISSET("fk_account") ? GETPOST("fk_account", 'int') : $fk_account;
|
||||||
|
|
||||||
if (!empty($soc->id)) {
|
if (!empty($soc->id)) {
|
||||||
$absolute_discount = $soc->getAvailableDiscounts();
|
$absolute_discount = $soc->getAvailableDiscounts();
|
||||||
}
|
}
|
||||||
@ -3607,8 +3579,8 @@ if ($action == 'create') {
|
|||||||
// Bank Account
|
// Bank Account
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
||||||
$fk_account = GETPOST('fk_account', 'int');
|
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
|
print $form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2619,7 +2619,7 @@ class Facture extends CommonInvoice
|
|||||||
*/
|
*/
|
||||||
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0, $batch_rule = 0)
|
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0, $batch_rule = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs, $mysoc;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$productStatic = null;
|
$productStatic = null;
|
||||||
@ -2658,6 +2658,53 @@ class Facture extends CommonInvoice
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for mandatory fields in thirdparty (defined into setup)
|
||||||
|
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
||||||
|
foreach ($array_to_check as $key) {
|
||||||
|
$keymin = strtolower($key);
|
||||||
|
$i = (int) preg_replace('/[^0-9]/', '', $key);
|
||||||
|
if ($i == 1) {
|
||||||
|
if (!is_object($this->thirdparty)) {
|
||||||
|
$langs->load('errors');
|
||||||
|
$this->error = $langs->trans('ErrorInvoiceLoadThirdParty', $this->ref);
|
||||||
|
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!property_exists($this->thirdparty, $keymin)) {
|
||||||
|
$langs->load('errors');
|
||||||
|
$this->error = $langs->trans('ErrorInvoiceLoadThirdPartyKey', $keymin, $this->ref);
|
||||||
|
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
$vallabel = $this->thirdparty->$keymin;
|
||||||
|
|
||||||
|
if ($i > 0) {
|
||||||
|
if ($this->thirdparty->isACompany()) {
|
||||||
|
// Check for mandatory prof id (but only if country is other than ours)
|
||||||
|
if ($mysoc->country_id > 0 && $this->thirdparty->country_id == $mysoc->country_id) {
|
||||||
|
$idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
|
||||||
|
if (!$vallabel && !empty($conf->global->$idprof_mandatory)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $this->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
|
||||||
|
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($key == 'EMAIL') {
|
||||||
|
// Check for mandatory
|
||||||
|
if (!empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && !isValidEMail($this->thirdparty->email)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
|
||||||
|
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($amounts[key($amounts)] <= 0) {
|
if (empty($amounts[key($amounts)])) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
|
|||||||
@ -857,31 +857,28 @@ if ($modecompta == 'BOOKKEEPING') {
|
|||||||
|
|
||||||
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
|
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
|
||||||
if ($modecompta == 'CREANCES-DETTES') {
|
if ($modecompta == 'CREANCES-DETTES') {
|
||||||
$column = 'p.datev';
|
$column = 's.dateep'; // We use the date of end of period of salary
|
||||||
|
|
||||||
|
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, s.label as label, date_format($column,'%Y-%m') as dm, sum(s.amount) as amount";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||||
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||||
|
$sql .= " WHERE s.entity IN (".getEntity('salary').")";
|
||||||
|
if (!empty($date_start) && !empty($date_end)) {
|
||||||
|
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||||
|
}
|
||||||
|
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, s.label, dm";
|
||||||
} else {
|
} else {
|
||||||
$column = 'p.datep';
|
$column = 'p.datep';
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid = p.fk_salary";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
||||||
if (!empty($date_start) && !empty($date_end)) {
|
if (!empty($date_start) && !empty($date_end)) {
|
||||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||||
}
|
}
|
||||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
|
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
|
||||||
|
|
||||||
// For backward compatibility with old module salary
|
|
||||||
$sql .= " UNION ";
|
|
||||||
$sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
|
|
||||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
|
||||||
if (!empty($date_start) && !empty($date_end)) {
|
|
||||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
|
||||||
}
|
}
|
||||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
|
|
||||||
|
|
||||||
$newsortfield = $sortfield;
|
$newsortfield = $sortfield;
|
||||||
if ($newsortfield == 's.nom, s.rowid') {
|
if ($newsortfield == 's.nom, s.rowid') {
|
||||||
@ -896,7 +893,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
|||||||
$sql .= $db->order($newsortfield, $sortorder);
|
$sql .= $db->order($newsortfield, $sortorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog("get payment salaries");
|
dol_syslog("get salaries");
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$subtotal_ht = 0;
|
$subtotal_ht = 0;
|
||||||
$subtotal_ttc = 0;
|
$subtotal_ttc = 0;
|
||||||
|
|||||||
@ -611,21 +611,31 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
|
|||||||
|
|
||||||
if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||||
if ($modecompta == 'CREANCES-DETTES') {
|
if ($modecompta == 'CREANCES-DETTES') {
|
||||||
$column = 'p.datev';
|
$column = 's.dateep'; // we use the date of end of period of salary
|
||||||
|
|
||||||
|
$sql = "SELECT s.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(s.amount) as amount";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||||
|
$sql .= " WHERE s.entity IN (".getEntity('salary').")";
|
||||||
|
if (!empty($date_start) && !empty($date_end)) {
|
||||||
|
$sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
|
||||||
|
}
|
||||||
|
$sql .= " GROUP BY s.label, dm";
|
||||||
}
|
}
|
||||||
if ($modecompta == "RECETTES-DEPENSES") {
|
if ($modecompta == "RECETTES-DEPENSES") {
|
||||||
$column = 'p.datep';
|
$column = 'p.datep';
|
||||||
}
|
|
||||||
|
|
||||||
$subtotal_ht = 0;
|
|
||||||
$subtotal_ttc = 0;
|
|
||||||
$sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
|
$sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||||
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON p.fk_salary = s.rowid";
|
||||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
||||||
if (!empty($date_start) && !empty($date_end)) {
|
if (!empty($date_start) && !empty($date_end)) {
|
||||||
$sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
|
$sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
|
||||||
}
|
}
|
||||||
$sql .= " GROUP BY p.label, dm";
|
$sql .= " GROUP BY p.label, dm";
|
||||||
|
}
|
||||||
|
|
||||||
|
$subtotal_ht = 0;
|
||||||
|
$subtotal_ttc = 0;
|
||||||
|
|
||||||
dol_syslog("get social salaries payments");
|
dol_syslog("get social salaries payments");
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -57,6 +57,7 @@ $socid = GETPOST('socid', 'int');
|
|||||||
|
|
||||||
// Category
|
// Category
|
||||||
$selected_cat = (int) GETPOST('search_categ', 'int');
|
$selected_cat = (int) GETPOST('search_categ', 'int');
|
||||||
|
if ($selected_cat == -1) $selected_cat = '';
|
||||||
$subcat = false;
|
$subcat = false;
|
||||||
if (GETPOST('subcat', 'alpha') === 'yes') {
|
if (GETPOST('subcat', 'alpha') === 'yes') {
|
||||||
$subcat = true;
|
$subcat = true;
|
||||||
|
|||||||
@ -503,6 +503,29 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update extrafields
|
||||||
|
if ($action == 'update_extras' && ! empty($user->rights->societe->contact->creer)) {
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
|
// Fill array 'array_options' with data from update form
|
||||||
|
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||||
|
if ($ret < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$result = $object->insertExtraFields('CONTACT_MODIFY');
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error) {
|
||||||
|
$action = 'edit_extras';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$triggersendname = 'CONTACT_SENTBYMAIL';
|
$triggersendname = 'CONTACT_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
|
|||||||
@ -1246,9 +1246,9 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) {
|
|||||||
$model = $objecttmp->model_pdf;
|
$model = $objecttmp->model_pdf;
|
||||||
$ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records
|
$ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records
|
||||||
// To be sure vars is defined
|
// To be sure vars is defined
|
||||||
$hidedetails = !empty($hidedetails) ? $hidedetails : 0;
|
$hidedetails = !empty($hidedetails) ? $hidedetails : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||||
$hidedesc = !empty($hidedesc) ? $hidedesc : 0;
|
$hidedesc = !empty($hidedesc) ? $hidedesc : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||||
$hideref = !empty($hideref) ? $hideref : 0;
|
$hideref = !empty($hideref) ? $hideref : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||||
$moreparams = !empty($moreparams) ? $moreparams : null;
|
$moreparams = !empty($moreparams) ? $moreparams : null;
|
||||||
|
|
||||||
$result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
@ -1378,13 +1378,13 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
|
|||||||
|
|
||||||
// To be sure vars is defined
|
// To be sure vars is defined
|
||||||
if (empty($hidedetails)) {
|
if (empty($hidedetails)) {
|
||||||
$hidedetails = 0;
|
$hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||||
}
|
}
|
||||||
if (empty($hidedesc)) {
|
if (empty($hidedesc)) {
|
||||||
$hidedesc = 0;
|
$hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||||
}
|
}
|
||||||
if (empty($hideref)) {
|
if (empty($hideref)) {
|
||||||
$hideref = 0;
|
$hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||||
}
|
}
|
||||||
if (empty($moreparams)) {
|
if (empty($moreparams)) {
|
||||||
$moreparams = null;
|
$moreparams = null;
|
||||||
|
|||||||
@ -79,6 +79,9 @@ class box_dolibarr_state_board extends ModeleBoxes
|
|||||||
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) {
|
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) {
|
||||||
$hookmanager = new HookManager($this->db);
|
$hookmanager = new HookManager($this->db);
|
||||||
$hookmanager->initHooks(array('index'));
|
$hookmanager->initHooks(array('index'));
|
||||||
|
$object = new stdClass;
|
||||||
|
$action = '';
|
||||||
|
$hookmanager->executeHooks('addStatisticLine', array(), $object, $action);
|
||||||
$boxstatItems = array();
|
$boxstatItems = array();
|
||||||
$boxstatFromHook = '';
|
$boxstatFromHook = '';
|
||||||
$boxstatFromHook = $hookmanager->resPrint;
|
$boxstatFromHook = $hookmanager->resPrint;
|
||||||
|
|||||||
@ -162,7 +162,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
|||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right"',
|
'td' => 'class="right"',
|
||||||
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-dolly" ></i> '.dol_print_date($delivery_date, 'day', 'tzuserrel').'</span>',
|
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-flip-dolly" ></i> '.dol_print_date($delivery_date, 'day', 'tzuserrel').'</span>',
|
||||||
'asis' => 1
|
'asis' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,7 @@ trait CommonIncoterm
|
|||||||
$this->fk_incoterms = $id_incoterm;
|
$this->fk_incoterms = $id_incoterm;
|
||||||
$this->location_incoterms = $location;
|
$this->location_incoterms = $location;
|
||||||
|
|
||||||
$sql = 'SELECT libelle as label_incotermsFROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
|
$sql = 'SELECT libelle as label_incoterms FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
|
||||||
$res = $this->db->query($sql);
|
$res = $this->db->query($sql);
|
||||||
if ($res) {
|
if ($res) {
|
||||||
$obj = $this->db->fetch_object($res);
|
$obj = $this->db->fetch_object($res);
|
||||||
|
|||||||
@ -54,12 +54,21 @@ class DiscountAbsolute
|
|||||||
public $fk_soc;
|
public $fk_soc;
|
||||||
|
|
||||||
public $discount_type; // 0 => customer discount, 1 => supplier discount
|
public $discount_type; // 0 => customer discount, 1 => supplier discount
|
||||||
public $amount_ht; //
|
|
||||||
public $amount_tva; //
|
public $total_ht;
|
||||||
public $amount_ttc; //
|
public $total_tva;
|
||||||
public $multicurrency_amount_ht;
|
public $total_ttc;
|
||||||
public $multicurrency_amount_tva;
|
public $amount_ht; // deprecated
|
||||||
public $multicurrency_amount_ttc;
|
public $amount_tva; // deprecated
|
||||||
|
public $amount_ttc; // deprecated
|
||||||
|
|
||||||
|
public $multicurrency_total_ht;
|
||||||
|
public $multicurrency_total_tva;
|
||||||
|
public $multicurrency_total_ttc;
|
||||||
|
public $multicurrency_amount_ht; // deprecated
|
||||||
|
public $multicurrency_amount_tva; // deprecated
|
||||||
|
public $multicurrency_amount_ttc; // deprecated
|
||||||
|
|
||||||
// Vat rate
|
// Vat rate
|
||||||
public $tva_tx;
|
public $tva_tx;
|
||||||
public $vat_src_code;
|
public $vat_src_code;
|
||||||
@ -163,13 +172,21 @@ class DiscountAbsolute
|
|||||||
$this->fk_soc = $obj->fk_soc;
|
$this->fk_soc = $obj->fk_soc;
|
||||||
$this->discount_type = $obj->discount_type;
|
$this->discount_type = $obj->discount_type;
|
||||||
|
|
||||||
$this->amount_ht = $obj->amount_ht;
|
$this->total_ht = $obj->amount_ht;
|
||||||
$this->amount_tva = $obj->amount_tva;
|
$this->total_tva = $obj->amount_tva;
|
||||||
$this->amount_ttc = $obj->amount_ttc;
|
$this->total_ttc = $obj->amount_ttc;
|
||||||
|
// For backward compatibility
|
||||||
|
$this->amount_ht = $this->total_ht;
|
||||||
|
$this->amount_tva = $this->total_tva;
|
||||||
|
$this->amount_ttc = $this->total_ttc;
|
||||||
|
|
||||||
$this->multicurrency_amount_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
|
$this->multicurrency_total_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
|
||||||
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
|
$this->multicurrency_total_tva = $obj->multicurrency_amount_tva;
|
||||||
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
|
$this->multicurrency_total_ttc = $obj->multicurrency_amount_ttc;
|
||||||
|
// For backward compatibility
|
||||||
|
$this->multicurrency_amount_ht = $this->multicurrency_total_ht;
|
||||||
|
$this->multicurrency_amount_tva = $this->multicurrency_total_tva;
|
||||||
|
$this->multicurrency_amount_ttc = $this->multicurrency_total_ttc;
|
||||||
|
|
||||||
$this->tva_tx = $obj->tva_tx;
|
$this->tva_tx = $obj->tva_tx;
|
||||||
$this->vat_src_code = $obj->vat_src_code;
|
$this->vat_src_code = $obj->vat_src_code;
|
||||||
|
|||||||
@ -3400,7 +3400,7 @@ class Form
|
|||||||
'value'=>$outref,
|
'value'=>$outref,
|
||||||
'label'=>$outval,
|
'label'=>$outval,
|
||||||
'qty'=>$outqty,
|
'qty'=>$outqty,
|
||||||
'price_ht'=>price2num($objp->unitprice, 'MT'),
|
'price_ht'=>price2num($objp->unitprice, 'MU'),
|
||||||
'discount'=>$outdiscount,
|
'discount'=>$outdiscount,
|
||||||
'type'=>$outtype,
|
'type'=>$outtype,
|
||||||
'duration_value'=>$outdurationvalue,
|
'duration_value'=>$outdurationvalue,
|
||||||
|
|||||||
@ -356,10 +356,19 @@ class Utils
|
|||||||
|
|
||||||
dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_INFO);
|
dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_INFO);
|
||||||
|
|
||||||
|
|
||||||
|
/* If value has been forced with a php_admin_value, this has no effect. Example of value: '512M' */
|
||||||
|
$MemoryLimit = getDolGlobalString('MAIN_MEMORY_LIMIT_DUMP');
|
||||||
|
if (!empty($MemoryLimit)) {
|
||||||
|
@ini_set('memory_limit', $MemoryLimit);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO Replace with executeCLI function
|
// TODO Replace with executeCLI function
|
||||||
if ($execmethod == 1) {
|
if ($execmethod == 1) {
|
||||||
$output_arr = array();
|
$output_arr = array();
|
||||||
$retval = null;
|
$retval = null;
|
||||||
|
|
||||||
exec($fullcommandclear, $output_arr, $retval);
|
exec($fullcommandclear, $output_arr, $retval);
|
||||||
|
|
||||||
if ($retval != 0) {
|
if ($retval != 0) {
|
||||||
@ -376,9 +385,9 @@ class Utils
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fwrite($handle, $read.($execmethod == 2 ? '' : "\n"));
|
fwrite($handle, $read.($execmethod == 2 ? '' : "\n"));
|
||||||
if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) {
|
if (preg_match('/'.preg_quote('-- Dump completed', '/').'/i', $read)) {
|
||||||
$ok = 1;
|
$ok = 1;
|
||||||
} elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) {
|
} elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES', '/').'/i', $read)) {
|
||||||
$ok = 1;
|
$ok = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1162,7 +1162,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Force to hide menus when page is inside an iFrame
|
// Force to hide menus when page is inside an iFrame
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
if (window.location !== window.parent.location ) {
|
if (window.location && window.location.pathname.indexOf("externalsite/frametop.php") == -1 && window.location !== window.parent.location ) {
|
||||||
console.log("Page is detected to be into an iframe, we hide by CSS the menus");
|
console.log("Page is detected to be into an iframe, we hide by CSS the menus");
|
||||||
// The page is in an iframe
|
// The page is in an iframe
|
||||||
jQuery(".side-nav-vert, .side-nav, .websitebar").hide();
|
jQuery(".side-nav-vert, .side-nav, .websitebar").hide();
|
||||||
|
|||||||
@ -1355,7 +1355,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
|||||||
$note = $prodser->multilangs[$outputlangs->defaultlang]["other"];
|
$note = $prodser->multilangs[$outputlangs->defaultlang]["other"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($object->element == 'facture' || $object->element == 'facturefourn') {
|
} elseif (($object->element == 'facture' || $object->element == 'facturefourn') && preg_match('/^\(DEPOSIT\).+/', $desc)) { // We must not replace '(DEPOSIT)' when it is alone, it will be translated and detailed later
|
||||||
$desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc);
|
$desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -290,11 +290,11 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
// Definition of $dir and $file
|
// Definition of $dir and $file
|
||||||
if ($object->specimen) {
|
if ($object->specimen) {
|
||||||
$dir = $conf->facture->dir_output;
|
$dir = empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity];
|
||||||
$file = $dir."/SPECIMEN.pdf";
|
$file = $dir."/SPECIMEN.pdf";
|
||||||
} else {
|
} else {
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $conf->facture->dir_output."/".$objectref;
|
$dir = (empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity])."/".$objectref;
|
||||||
$file = $dir."/".$objectref.".pdf";
|
$file = $dir."/".$objectref.".pdf";
|
||||||
}
|
}
|
||||||
if (!file_exists($dir)) {
|
if (!file_exists($dir)) {
|
||||||
@ -837,7 +837,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$tab3_width = 80;
|
$tab3_width = 80;
|
||||||
$tab3_height = 4;
|
$tab3_height = 4;
|
||||||
if ($this->page_largeur < 210) { // To work with US executive format
|
if ($this->page_largeur < 210) { // To work with US executive format
|
||||||
$tab3_posx -= 20;
|
$tab3_posx -= 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
@ -1211,7 +1211,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$col1x = 120;
|
$col1x = 120;
|
||||||
$col2x = 170;
|
$col2x = 170;
|
||||||
if ($this->page_largeur < 210) { // To work with US executive format
|
if ($this->page_largeur < 210) { // To work with US executive format
|
||||||
$col2x -= 20;
|
$col1x -= 15;
|
||||||
|
$col2x -= 10;
|
||||||
}
|
}
|
||||||
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||||
|
|
||||||
|
|||||||
@ -498,7 +498,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->useTemplate($tplidx);
|
$pdf->useTemplate($tplidx);
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
||||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
|
||||||
}
|
}
|
||||||
// $this->_pagefoot($pdf,$object,$outputlangs,1);
|
// $this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
@ -556,7 +556,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->useTemplate($tplidx);
|
$pdf->useTemplate($tplidx);
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
||||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
|
||||||
}
|
}
|
||||||
$height_note = $posyafter - $tab_top_newpage;
|
$height_note = $posyafter - $tab_top_newpage;
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
|
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
|
||||||
@ -578,7 +578,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->useTemplate($tplidx);
|
$pdf->useTemplate($tplidx);
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
||||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
|
||||||
}
|
}
|
||||||
|
|
||||||
$posyafter = $tab_top_newpage;
|
$posyafter = $tab_top_newpage;
|
||||||
@ -873,7 +873,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->setPage($pagenb);
|
$pdf->setPage($pagenb);
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
||||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -891,7 +891,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
||||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -977,7 +977,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$tab3_width = 80;
|
$tab3_width = 80;
|
||||||
$tab3_height = 4;
|
$tab3_height = 4;
|
||||||
if ($this->page_largeur < 210) { // To work with US executive format
|
if ($this->page_largeur < 210) { // To work with US executive format
|
||||||
$tab3_posx -= 20;
|
$tab3_posx -= 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
@ -1292,7 +1292,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$col1x = 120;
|
$col1x = 120;
|
||||||
$col2x = 170;
|
$col2x = 170;
|
||||||
if ($this->page_largeur < 210) { // To work with US executive format
|
if ($this->page_largeur < 210) { // To work with US executive format
|
||||||
$col2x -= 20;
|
$col1x -= 15;
|
||||||
|
$col2x -= 10;
|
||||||
}
|
}
|
||||||
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||||
|
|
||||||
|
|||||||
@ -855,7 +855,7 @@ class modProduct extends DolibarrModules
|
|||||||
}
|
}
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
|
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
|
||||||
'sp.packagning'=>'1',
|
'sp.packaging'=>'10',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -252,7 +252,7 @@ class modResource extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'resource as r';
|
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'resource as r';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = r.rowid';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = r.rowid';
|
||||||
$this->export_sql_end[$r] .= ' AND r.entity IN ('.getEntity('resource').')';
|
$this->export_sql_end[$r] .= ' WHERE r.entity IN ('.getEntity('resource').')';
|
||||||
|
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
|
|||||||
@ -786,7 +786,7 @@ class modService extends DolibarrModules
|
|||||||
}
|
}
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
|
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
|
||||||
'sp.packagning'=>'1',
|
'sp.packagning'=>'10',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -132,7 +133,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->name = "standard";
|
$this->name = "standard";
|
||||||
$this->description = $langs->trans('DocumentModelStandardPDF');
|
$this->description = $langs->trans('DocumentModelStandardPDF');
|
||||||
$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
|
$this->update_main_doc_field = 0; // Save the name of generated file as the main doc when generating a doc with this template
|
||||||
|
|
||||||
// Page size for A4 format
|
// Page size for A4 format
|
||||||
$this->type = 'pdf';
|
$this->type = 'pdf';
|
||||||
|
|||||||
@ -18,15 +18,14 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
|
|||||||
if (empty($extrafieldsobjectprefix)) {
|
if (empty($extrafieldsobjectprefix)) {
|
||||||
$extrafieldsobjectprefix = 'ef.';
|
$extrafieldsobjectprefix = 'ef.';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
|
||||||
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['list'][$key])) {
|
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['list'][$key])) {
|
||||||
$arrayfields[$extrafieldsobjectprefix.$key] = array(
|
$arrayfields[$extrafieldsobjectprefix.$key] = array(
|
||||||
'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key],
|
'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key],
|
||||||
'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key],
|
'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key],
|
||||||
'checked' => (($extrafields->attributes[$extrafieldsobjectkey]['list'][$key] < 0) ? 0 : 1),
|
'checked' => ((dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1) <= 0) ? 0 : 1),
|
||||||
'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key],
|
'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key],
|
||||||
'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && $extrafields->attributes[$extrafieldsobjectkey]['perms'][$key]),
|
'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1)),
|
||||||
'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key],
|
'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key],
|
||||||
'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key],
|
'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -156,6 +156,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
|||||||
//var_dump($user->rights);
|
//var_dump($user->rights);
|
||||||
$permok = false;
|
$permok = false;
|
||||||
$keyforperm = $object->element;
|
$keyforperm = $object->element;
|
||||||
|
|
||||||
if ($object->element == 'fichinter') {
|
if ($object->element == 'fichinter') {
|
||||||
$keyforperm = 'ficheinter';
|
$keyforperm = 'ficheinter';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1194,6 +1194,7 @@ if ($action == 'create') {
|
|||||||
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl center" type="text" size="4" value="'.$deliverableQty.'">';
|
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl center" type="text" size="4" value="'.$deliverableQty.'">';
|
||||||
} else {
|
} else {
|
||||||
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
|
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
|
||||||
|
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
||||||
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
|
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -370,6 +370,7 @@ class Expedition extends CommonObject
|
|||||||
// Insert of lines
|
// Insert of lines
|
||||||
$num = count($this->lines);
|
$num = count($this->lines);
|
||||||
for ($i = 0; $i < $num; $i++) {
|
for ($i = 0; $i < $num; $i++) {
|
||||||
|
if (empty($this->lines[$i]->product_type) || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||||
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
|
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
|
||||||
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
|
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -380,6 +381,7 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error && $this->id && $this->origin_id) {
|
if (!$error && $this->id && $this->origin_id) {
|
||||||
$ret = $this->add_object_linked();
|
$ret = $this->add_object_linked();
|
||||||
@ -916,6 +918,7 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
// Copy the rang of the order line to the expedition line
|
// Copy the rang of the order line to the expedition line
|
||||||
$line->rang = $orderline->rang;
|
$line->rang = $orderline->rang;
|
||||||
|
$line->product_type = $orderline->product_type;
|
||||||
|
|
||||||
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
|
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
|
||||||
$fk_product = $orderline->fk_product;
|
$fk_product = $orderline->fk_product;
|
||||||
@ -968,6 +971,8 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->lines[$num] = $line;
|
$this->lines[$num] = $line;
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
@ -2602,6 +2607,12 @@ class ExpeditionLigne extends CommonObjectLine
|
|||||||
*/
|
*/
|
||||||
public $product_desc;
|
public $product_desc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of the product. 0 for product, 1 for service
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $product_type = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int rang of line
|
* @var int rang of line
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1282,6 +1282,15 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($qty);
|
||||||
|
unset($value_unit_ht);
|
||||||
|
unset($value_unit);
|
||||||
|
unset($vatrate);
|
||||||
|
unset($comments);
|
||||||
|
unset($fk_c_type_fees);
|
||||||
|
unset($fk_project);
|
||||||
|
unset($date);
|
||||||
}
|
}
|
||||||
|
|
||||||
//header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
//header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
* \brief File of class to manage suppliers orders
|
* \brief File of class to manage suppliers orders
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
if (!empty($conf->productbatch->enabled)) {
|
if (!empty($conf->productbatch->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
|
||||||
@ -431,6 +431,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* Lines
|
* Lines
|
||||||
*/
|
*/
|
||||||
$result = $this->fetch_lines();
|
$result = $this->fetch_lines();
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
@ -453,7 +454,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
//$result=$this->fetch_lines();
|
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
$sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,";
|
$sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,";
|
||||||
@ -464,22 +465,12 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql .= " l.fk_unit,";
|
$sql .= " l.fk_unit,";
|
||||||
$sql .= " l.date_start, l.date_end,";
|
$sql .= " l.date_start, l.date_end,";
|
||||||
$sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc';
|
$sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc';
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
|
||||||
$sql .= ", pfp.rowid as fk_pfp, pfp.packaging, MAX(pfp.quantity) as max_qty";
|
|
||||||
}
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
$sql .= " WHERE l.fk_commande = ".((int) $this->id);
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".((int) $this->socid);
|
|
||||||
}
|
|
||||||
$sql .= " WHERE l.fk_commande = ".$this->id;
|
|
||||||
if ($only_product) {
|
if ($only_product) {
|
||||||
$sql .= ' AND p.fk_product_type = 0';
|
$sql .= ' AND p.fk_product_type = 0';
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
|
||||||
$sql.= " AND l.qty >= pfp.quantity ";
|
|
||||||
$sql.= " GROUP BY l.rowid HAVING max_qty = MAX(pfp.quantity) ";
|
|
||||||
}
|
|
||||||
$sql .= " ORDER BY l.rang, l.rowid";
|
$sql .= " ORDER BY l.rang, l.rowid";
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|
||||||
@ -527,8 +518,31 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$line->ref_supplier = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since
|
$line->ref_supplier = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$line->fk_fournprice = $objp->fk_pfp;
|
// TODO We should not fetch this properties into the fetch_lines. This is NOT properties of a line.
|
||||||
$line->packaging = $objp->packaging;
|
// Move this into another method and call it when required.
|
||||||
|
|
||||||
|
// Take better packaging for $objp->qty (first supplier ref quantity <= $objp->qty)
|
||||||
|
$sqlsearchpackage = 'SELECT rowid, packaging FROM '.MAIN_DB_PREFIX."product_fournisseur_price";
|
||||||
|
$sqlsearchpackage .= ' WHERE entity IN ('.getEntity('product_fournisseur_price').")";
|
||||||
|
$sqlsearchpackage .= " AND fk_product = ".((int) $objp->fk_product);
|
||||||
|
$sqlsearchpackage .= " AND ref_fourn = '".$this->db->escape($objp->ref_supplier)."'";
|
||||||
|
$sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified
|
||||||
|
$sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified
|
||||||
|
$sqlsearchpackage .= " AND fk_soc = ".((int) $this->socid);
|
||||||
|
$sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first
|
||||||
|
$sqlsearchpackage .= " LIMIT 1";
|
||||||
|
|
||||||
|
$resqlsearchpackage = $this->db->query($sqlsearchpackage);
|
||||||
|
if ($resqlsearchpackage) {
|
||||||
|
$objsearchpackage = $this->db->fetch_object($resqlsearchpackage);
|
||||||
|
if ($objsearchpackage) {
|
||||||
|
$line->fk_fournprice = $objsearchpackage->rowid;
|
||||||
|
$line->packaging = $objsearchpackage->packaging;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$line->date_start = $this->db->jdate($objp->date_start);
|
$line->date_start = $this->db->jdate($objp->date_start);
|
||||||
@ -1807,6 +1821,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$prod = new Product($this->db, $fk_product);
|
$prod = new Product($this->db, $fk_product);
|
||||||
$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc ? $this->fk_soc : $this->socid));
|
$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc ? $this->fk_soc : $this->socid));
|
||||||
|
|
||||||
if ($qty < $prod->packaging) {
|
if ($qty < $prod->packaging) {
|
||||||
$qty = $prod->packaging;
|
$qty = $prod->packaging;
|
||||||
} else {
|
} else {
|
||||||
@ -3515,25 +3530,18 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx, cd.special_code,';
|
$sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx, cd.special_code,';
|
||||||
$sql .= ' cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.ref,';
|
$sql .= ' cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.ref as ref_supplier,';
|
||||||
$sql .= ' cd.remise, cd.remise_percent, cd.subprice,';
|
$sql .= ' cd.remise, cd.remise_percent, cd.subprice,';
|
||||||
$sql .= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,';
|
$sql .= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,';
|
||||||
$sql .= ' cd.total_localtax1, cd.total_localtax2,';
|
$sql .= ' cd.total_localtax1, cd.total_localtax2,';
|
||||||
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc,';
|
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc,';
|
||||||
$sql .= ' cd.date_start, cd.date_end, cd.fk_unit,';
|
$sql .= ' cd.date_start, cd.date_end, cd.fk_unit,';
|
||||||
$sql .= ' cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc';
|
$sql .= ' cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc,';
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
$sql .= ' c.fk_soc as socid';
|
||||||
$sql .= ", pfp.rowid as fk_pfp, pfp.packaging, MAX(pfp.quantity) as max_qty";
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseur as c, '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
|
||||||
}
|
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
|
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
$sql .= ' WHERE cd.fk_commande = c.rowid AND cd.rowid = '.((int) $rowid);
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn";
|
|
||||||
}
|
|
||||||
$sql .= ' WHERE cd.rowid = '.((int) $rowid);
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
|
||||||
$sql .= " AND cd.qty >= pfp.quantity GROUP BY cd.rowid HAVING max_qty = MAX(pfp.quantity)";
|
|
||||||
}
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
@ -3544,8 +3552,8 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$this->fk_commande = $objp->fk_commande;
|
$this->fk_commande = $objp->fk_commande;
|
||||||
$this->desc = $objp->description;
|
$this->desc = $objp->description;
|
||||||
$this->qty = $objp->qty;
|
$this->qty = $objp->qty;
|
||||||
$this->ref_fourn = $objp->ref;
|
$this->ref_fourn = $objp->ref_supplier;
|
||||||
$this->ref_supplier = $objp->ref;
|
$this->ref_supplier = $objp->ref_supplier;
|
||||||
$this->subprice = $objp->subprice;
|
$this->subprice = $objp->subprice;
|
||||||
$this->tva_tx = $objp->tva_tx;
|
$this->tva_tx = $objp->tva_tx;
|
||||||
$this->localtax1_tx = $objp->localtax1_tx;
|
$this->localtax1_tx = $objp->localtax1_tx;
|
||||||
@ -3569,9 +3577,33 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$this->product_ref = $objp->product_ref;
|
$this->product_ref = $objp->product_ref;
|
||||||
$this->product_label = $objp->product_label;
|
$this->product_label = $objp->product_label;
|
||||||
$this->product_desc = $objp->product_desc;
|
$this->product_desc = $objp->product_desc;
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$this->packaging = $objp->packaging;
|
// TODO We should not fetch this properties into the fetch_lines. This is NOT properties of a line.
|
||||||
$this->fk_fournprice = $objp->fk_pfp;
|
// Move this into another method and call it when required.
|
||||||
|
|
||||||
|
// Take better packaging for $objp->qty (first supplier ref quantity <= $objp->qty)
|
||||||
|
$sqlsearchpackage = 'SELECT rowid, packaging FROM '.MAIN_DB_PREFIX."product_fournisseur_price";
|
||||||
|
$sqlsearchpackage .= ' WHERE entity IN ('.getEntity('product_fournisseur_price').")";
|
||||||
|
$sqlsearchpackage .= " AND fk_product = ".((int) $objp->fk_product);
|
||||||
|
$sqlsearchpackage .= " AND ref_fourn = '".$this->db->escape($objp->ref_supplier)."'";
|
||||||
|
$sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified
|
||||||
|
$sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified
|
||||||
|
$sqlsearchpackage .= " AND fk_soc = ".((int) $objp->socid);
|
||||||
|
$sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first
|
||||||
|
$sqlsearchpackage .= " LIMIT 1";
|
||||||
|
|
||||||
|
$resqlsearchpackage = $this->db->query($sqlsearchpackage);
|
||||||
|
if ($resqlsearchpackage) {
|
||||||
|
$objsearchpackage = $this->db->fetch_object($resqlsearchpackage);
|
||||||
|
if ($objsearchpackage) {
|
||||||
|
$this->fk_fournprice = $objsearchpackage->rowid;
|
||||||
|
$this->packaging = $objsearchpackage->packaging;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->date_start = $this->db->jdate($objp->date_start);
|
$this->date_start = $this->db->jdate($objp->date_start);
|
||||||
|
|||||||
@ -317,7 +317,9 @@ class ProductFournisseur extends Product
|
|||||||
$qty = price2num($qty, 'MS');
|
$qty = price2num($qty, 'MS');
|
||||||
$unitBuyPrice = price2num($buyprice / $qty, 'MU');
|
$unitBuyPrice = price2num($buyprice / $qty, 'MU');
|
||||||
|
|
||||||
$packaging = price2num(((empty($this->packaging) || $this->packaging < $qty) ? $qty : $this->packaging), 'MS');
|
// We can have a puchase ref that need to buy 100 min for a given price and with a packaging of 50.
|
||||||
|
//$packaging = price2num(((empty($this->packaging) || $this->packaging < $qty) ? $qty : $this->packaging), 'MS');
|
||||||
|
$packaging = price2num((empty($this->packaging) ? $qty : $this->packaging), 'MS');
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
@ -405,6 +407,7 @@ class ProductFournisseur extends Product
|
|||||||
$sql .= ", packaging = ".(empty($packaging) ? 1 : $packaging);
|
$sql .= ", packaging = ".(empty($packaging) ? 1 : $packaging);
|
||||||
}
|
}
|
||||||
$sql .= " WHERE rowid = ".((int) $this->product_fourn_price_id);
|
$sql .= " WHERE rowid = ".((int) $this->product_fourn_price_id);
|
||||||
|
//print $sql;exit;
|
||||||
// TODO Add price_base_type and price_ttc
|
// TODO Add price_base_type and price_ttc
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::update_buyprice update knowing id of line = product_fourn_price_id = '.$this->product_fourn_price_id, LOG_DEBUG);
|
dol_syslog(get_class($this).'::update_buyprice update knowing id of line = product_fourn_price_id = '.$this->product_fourn_price_id, LOG_DEBUG);
|
||||||
@ -593,13 +596,7 @@ class ProductFournisseur extends Product
|
|||||||
$this->supplier_barcode = $obj->barcode;
|
$this->supplier_barcode = $obj->barcode;
|
||||||
$this->supplier_fk_barcode_type = $obj->fk_barcode_type;
|
$this->supplier_fk_barcode_type = $obj->fk_barcode_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
|
||||||
$this->packaging = $obj->packaging;
|
$this->packaging = $obj->packaging;
|
||||||
if ($this->packaging < $this->fourn_qty) {
|
|
||||||
$this->packaging = $this->fourn_qty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) {
|
if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) {
|
||||||
$priceparser = new PriceParser($this->db);
|
$priceparser = new PriceParser($this->db);
|
||||||
@ -647,10 +644,7 @@ class ProductFournisseur extends Product
|
|||||||
$sql .= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
|
$sql .= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
|
||||||
$sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,";
|
$sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,";
|
||||||
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,";
|
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,";
|
||||||
$sql .= " pfp.barcode, pfp.fk_barcode_type";
|
$sql .= " pfp.barcode, pfp.fk_barcode_type, pfp.packaging";
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
|
||||||
$sql .= ", pfp.packaging";
|
|
||||||
}
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
|
$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
|
||||||
$sql .= " AND pfp.fk_soc = s.rowid AND pfp.fk_product = p.rowid";
|
$sql .= " AND pfp.fk_soc = s.rowid AND pfp.fk_product = p.rowid";
|
||||||
@ -704,12 +698,7 @@ class ProductFournisseur extends Product
|
|||||||
$prodfourn->fourn_multicurrency_id = $record["fk_multicurrency"];
|
$prodfourn->fourn_multicurrency_id = $record["fk_multicurrency"];
|
||||||
$prodfourn->fourn_multicurrency_code = $record["multicurrency_code"];
|
$prodfourn->fourn_multicurrency_code = $record["multicurrency_code"];
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
|
||||||
$prodfourn->packaging = $record["packaging"];
|
$prodfourn->packaging = $record["packaging"];
|
||||||
if ($prodfourn->packaging < $prodfourn->fourn_qty) {
|
|
||||||
$prodfourn->packaging = $prodfourn->fourn_qty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($conf->barcode->enabled)) {
|
if (!empty($conf->barcode->enabled)) {
|
||||||
$prodfourn->supplier_barcode = $record["barcode"];
|
$prodfourn->supplier_barcode = $record["barcode"];
|
||||||
|
|||||||
@ -274,6 +274,8 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
$default_ref_supplier=dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||||
|
|
||||||
foreach ($orders as $id_order) {
|
foreach ($orders as $id_order) {
|
||||||
$cmd = new CommandeFournisseur($db);
|
$cmd = new CommandeFournisseur($db);
|
||||||
if ($cmd->fetch($id_order) <= 0) {
|
if ($cmd->fetch($id_order) <= 0) {
|
||||||
@ -291,7 +293,8 @@ if (empty($reshook)) {
|
|||||||
$objecttmp->fk_project = $cmd->fk_project;
|
$objecttmp->fk_project = $cmd->fk_project;
|
||||||
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
|
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
|
||||||
if (empty($createbills_onebythird)) {
|
if (empty($createbills_onebythird)) {
|
||||||
$objecttmp->ref_client = $cmd->ref_client;
|
$objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : $default_ref_supplier;
|
||||||
|
$default_ref_supplier+=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||||
|
|||||||
@ -113,7 +113,7 @@ if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write &&
|
|||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'holiday', $object->id, 'holiday');
|
$result = restrictedArea($user, 'holiday', $object->id, 'holiday', '', '', 'rowid', $object->statut);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1400,7 +1400,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
|
|
||||||
// Confirmation messages
|
// Confirmation messages
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
if ($user->rights->holiday->delete) {
|
if ($candelete) {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("TitleDeleteCP"), $langs->trans("ConfirmDeleteCP"), "confirm_delete", '', 0, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("TitleDeleteCP"), $langs->trans("ConfirmDeleteCP"), "confirm_delete", '', 0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("holiday"));
|
$langs->loadLangs(array('holiday', 'hrm'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
@ -112,7 +112,7 @@ if (empty($reshook)) {
|
|||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'cp.ref'=>array('label'=>$langs->trans('Ref'), 'checked'=>1),
|
'cp.ref'=>array('label'=>$langs->trans('Ref'), 'checked'=>1),
|
||||||
'cp.fk_user'=>array('label'=>$langs->trans('Employee'), 'checked'=>1),
|
'cp.fk_user'=>array('label'=>$langs->trans('Employee'), 'checked'=>1),
|
||||||
'ct.label'=>array('label'=>$langs->trans('Type'), 'checked'=>1),
|
'cp.fk_type'=>array('label'=>$langs->trans('Type'), 'checked'=>1),
|
||||||
'cp.date_debut'=>array('label'=>$langs->trans('DateDebCP'), 'checked'=>1),
|
'cp.date_debut'=>array('label'=>$langs->trans('DateDebCP'), 'checked'=>1),
|
||||||
'cp.date_fin'=>array('label'=>$langs->trans('DateFinCP'), 'checked'=>1),
|
'cp.date_fin'=>array('label'=>$langs->trans('DateFinCP'), 'checked'=>1),
|
||||||
'used_days'=>array('label'=>$langs->trans('NbUseDaysCPShort'), 'checked'=>1),
|
'used_days'=>array('label'=>$langs->trans('NbUseDaysCPShort'), 'checked'=>1),
|
||||||
@ -141,10 +141,9 @@ $search_month = GETPOST("remonth", 'int') ?GETPOST("remonth", 'int') : date("m",
|
|||||||
$search_year = GETPOST("reyear", 'int') ?GETPOST("reyear", 'int') : date("Y", time());
|
$search_year = GETPOST("reyear", 'int') ?GETPOST("reyear", 'int') : date("Y", time());
|
||||||
$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
|
$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
|
||||||
|
|
||||||
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday";
|
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
|
$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
|
|
||||||
$sql .= " WHERE cp.rowid > 0";
|
$sql .= " WHERE cp.rowid > 0";
|
||||||
$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
|
$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
|
||||||
$sql .= " AND (";
|
$sql .= " AND (";
|
||||||
@ -244,7 +243,7 @@ if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Filter: Type
|
// Filter: Type
|
||||||
if (!empty($arrayfields['ct.label']['checked'])) {
|
if (!empty($arrayfields['cp.fk_type']['checked'])) {
|
||||||
$typeleaves = $holidaystatic->getTypes(1, -1);
|
$typeleaves = $holidaystatic->getTypes(1, -1);
|
||||||
$arraytypeleaves = array();
|
$arraytypeleaves = array();
|
||||||
foreach ($typeleaves as $key => $val) {
|
foreach ($typeleaves as $key => $val) {
|
||||||
@ -297,6 +296,9 @@ if (!empty($arrayfields['cp.ref']['checked'])) {
|
|||||||
if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'cp.fk_user', '', '', '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'cp.fk_user', '', '', '', $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
|
if (!empty($arrayfields['cp.fk_type']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
if (!empty($arrayfields['ct.label']['checked'])) {
|
if (!empty($arrayfields['ct.label']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
@ -382,8 +384,8 @@ if ($num == 0) {
|
|||||||
if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
||||||
print '<td>'.$user->getFullName($langs).'</td>';
|
print '<td>'.$user->getFullName($langs).'</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['ct.label']['checked'])) {
|
if (!empty($arrayfields['cp.fk_type']['checked'])) {
|
||||||
print '<td>'.$obj->label.'</td>';
|
print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['cp.date_debut']['checked'])) {
|
if (!empty($arrayfields['cp.date_debut']['checked'])) {
|
||||||
@ -418,7 +420,7 @@ if ($num == 0) {
|
|||||||
print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).'</td>';
|
print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).'</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['cp.description']['checked'])) {
|
if (!empty($arrayfields['cp.description']['checked'])) {
|
||||||
print '<td class="maxwidth300 small">'.dol_escape_htmltag(dolGetFirstLineOfText($obj->description)).'</td>';
|
print '<td class="maxwidth300 small">'.dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1)).'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|||||||
@ -43,6 +43,8 @@ create table llx_commande_fournisseur_dispatch_extrafields
|
|||||||
|
|
||||||
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
|
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
|
||||||
|
|
||||||
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1;
|
||||||
|
|
||||||
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
|
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
|
||||||
|
|
||||||
create table llx_c_shipment_package_type
|
create table llx_c_shipment_package_type
|
||||||
|
|||||||
@ -566,7 +566,8 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES
|
|||||||
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_customers_outstanding_bill_reached.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_customers_outstanding_bill_reached.php' AND entity = 1);
|
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_customers_outstanding_bill_reached.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_customers_outstanding_bill_reached.php' AND entity = 1);
|
||||||
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_scheduled_jobs.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_scheduled_jobs.php' AND entity = 1);
|
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_scheduled_jobs.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_scheduled_jobs.php' AND entity = 1);
|
||||||
|
|
||||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
||||||
|
|
||||||
|
|||||||
@ -84,6 +84,9 @@ UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'a
|
|||||||
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo';
|
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo';
|
||||||
DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo');
|
DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo');
|
||||||
|
|
||||||
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging real DEFAULT NULL;
|
||||||
|
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging real DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
-- For v14
|
-- For v14
|
||||||
|
|
||||||
|
|||||||
@ -50,8 +50,7 @@ create table llx_product_fournisseur_price
|
|||||||
import_key varchar(14), -- Import key
|
import_key varchar(14), -- Import key
|
||||||
delivery_time_days integer,
|
delivery_time_days integer,
|
||||||
supplier_reputation varchar(10),
|
supplier_reputation varchar(10),
|
||||||
packaging varchar(64),
|
packaging real DEFAULT NULL,
|
||||||
|
|
||||||
fk_multicurrency integer,
|
fk_multicurrency integer,
|
||||||
multicurrency_code varchar(255),
|
multicurrency_code varchar(255),
|
||||||
multicurrency_tx double(24,8) DEFAULT 1,
|
multicurrency_tx double(24,8) DEFAULT 1,
|
||||||
|
|||||||
@ -146,9 +146,11 @@ ConfirmPaySalary=Are you sure you want to classify this salary card as paid?
|
|||||||
DeleteSocialContribution=Delete a social or fiscal tax payment
|
DeleteSocialContribution=Delete a social or fiscal tax payment
|
||||||
DeleteVAT=Delete a VAT declaration
|
DeleteVAT=Delete a VAT declaration
|
||||||
DeleteSalary=Delete a salary card
|
DeleteSalary=Delete a salary card
|
||||||
|
DeleteVariousPayment=Delete a various payment
|
||||||
ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fiscal tax payment ?
|
ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fiscal tax payment ?
|
||||||
ConfirmDeleteVAT=Are you sure you want to delete this VAT declaration ?
|
ConfirmDeleteVAT=Are you sure you want to delete this VAT declaration ?
|
||||||
ConfirmDeleteSalary=Are you sure you want to delete this salary?
|
ConfirmDeleteSalary=Are you sure you want to delete this salary ?
|
||||||
|
ConfirmDeleteVariousPayment=Are you sure you want to delete this various payment ?
|
||||||
ExportDataset_tax_1=Social and fiscal taxes and payments
|
ExportDataset_tax_1=Social and fiscal taxes and payments
|
||||||
CalcModeVATDebt=Mode <b>%sVAT on commitment accounting%s</b>.
|
CalcModeVATDebt=Mode <b>%sVAT on commitment accounting%s</b>.
|
||||||
CalcModeVATEngagement=Mode <b>%sVAT on incomes-expenses%s</b>.
|
CalcModeVATEngagement=Mode <b>%sVAT on incomes-expenses%s</b>.
|
||||||
|
|||||||
@ -272,6 +272,8 @@ ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it
|
|||||||
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.
|
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.
|
||||||
ErrorExecIdFailed=Can't execute command "id"
|
ErrorExecIdFailed=Can't execute command "id"
|
||||||
ErrorBadCharIntoLoginName=Unauthorized character in the login name
|
ErrorBadCharIntoLoginName=Unauthorized character in the login name
|
||||||
|
ErrorInvoiceLoadThirdParty=Can't load third-party object for invoice "%s"
|
||||||
|
ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s"
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||||
@ -305,5 +307,8 @@ WarningTheHiddenOptionIsOn=Warning, the hidden option <b>%s</b> is on.
|
|||||||
WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list
|
WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list
|
||||||
WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection.
|
WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection.
|
||||||
WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
|
WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
|
||||||
|
<<<<<<< HEAD
|
||||||
WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online payment features not working correctly. Use 'Lax' instead.
|
WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online payment features not working correctly. Use 'Lax' instead.
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
|
||||||
|
|||||||
@ -102,6 +102,9 @@ ConfirmCancelOrder=Are you sure you want to cancel this order?
|
|||||||
ConfirmMakeOrder=Are you sure you want to confirm you made this order on <b>%s</b>?
|
ConfirmMakeOrder=Are you sure you want to confirm you made this order on <b>%s</b>?
|
||||||
GenerateBill=Generate invoice
|
GenerateBill=Generate invoice
|
||||||
ClassifyShipped=Classify delivered
|
ClassifyShipped=Classify delivered
|
||||||
|
PassedInShippedStatus=classified delivered
|
||||||
|
YouCantShipThis=I can't classify this. Please check user permissions
|
||||||
|
MustBeValidatedBefore=must be Validated or In process in order to be classified as shipped
|
||||||
DraftOrders=Draft orders
|
DraftOrders=Draft orders
|
||||||
DraftSuppliersOrders=Draft purchase orders
|
DraftSuppliersOrders=Draft purchase orders
|
||||||
OnProcessOrders=In process orders
|
OnProcessOrders=In process orders
|
||||||
|
|||||||
@ -345,7 +345,7 @@ UseProductFournDesc=Add a feature to define the descriptions of products defined
|
|||||||
ProductSupplierDescription=Vendor description for the product
|
ProductSupplierDescription=Vendor description for the product
|
||||||
UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents)
|
UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents)
|
||||||
PackagingForThisProduct=Packaging
|
PackagingForThisProduct=Packaging
|
||||||
PackagingForThisProductDesc=On supplier order, you will automaticly order this quantity (or a multiple of this quantity). Cannot be less than minimum buying quantity
|
PackagingForThisProductDesc=You will automaticaly purchase a multiple of this quantity.
|
||||||
QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging
|
QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging
|
||||||
|
|
||||||
#Attributes
|
#Attributes
|
||||||
|
|||||||
@ -275,3 +275,4 @@ UsageOrganizeEvent=Usage: Event Organization
|
|||||||
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress)
|
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress)
|
||||||
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects.
|
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects.
|
||||||
SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them
|
SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them
|
||||||
|
ErrorPROJECTLEADERRoleMissingRestoreIt=The "PROJECTLEADER" role is missing or has been de-activited, please restore in the dictionary of contact types
|
||||||
|
|||||||
@ -85,6 +85,22 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature
|
|||||||
ProposalsStatisticsSuppliers=Vendor proposals statistics
|
ProposalsStatisticsSuppliers=Vendor proposals statistics
|
||||||
CaseFollowedBy=Case followed by
|
CaseFollowedBy=Case followed by
|
||||||
SignedOnly=Signed only
|
SignedOnly=Signed only
|
||||||
|
NoSign=Set not signed
|
||||||
|
NoSigned=set not signed
|
||||||
|
CantBeNoSign=cannot be set not signed
|
||||||
|
ConfirmMassNoSignature=Bulk Not signed confirmation
|
||||||
|
ConfirmMassNoSignatureQuestion=Are you sure you want to set not signed the selected records ?
|
||||||
|
IsNotADraft=is not a draft
|
||||||
|
PassedInOpenStatus=has been validated
|
||||||
|
CantBeSign=cannot be signed
|
||||||
|
Sign=Sign
|
||||||
|
Signed=signed
|
||||||
|
CantBeSign=cannot be signed
|
||||||
|
CantBeValidated=cannot be validated
|
||||||
|
ConfirmMassValidation=Bulk Validate confirmation
|
||||||
|
ConfirmMassSignature=Bulk Signature confirmation
|
||||||
|
ConfirmMassValidationQuestion=Are you sure you want to validate the selected records ?
|
||||||
|
ConfirmMassSignatureQuestion=Are you sure you want to sign the selected records ?
|
||||||
IdProposal=Proposal ID
|
IdProposal=Proposal ID
|
||||||
IdProduct=Product ID
|
IdProduct=Product ID
|
||||||
PrParentLine=Proposal Parent Line
|
PrParentLine=Proposal Parent Line
|
||||||
|
|||||||
@ -176,7 +176,7 @@ ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock cor
|
|||||||
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
|
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
|
||||||
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
|
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
|
||||||
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
|
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
|
||||||
AddStockLocationLine=Decrease quantity then click to add another warehouse for this product
|
AddStockLocationLine=Decrease quantity then click to split the line
|
||||||
InventoryDate=Inventory date
|
InventoryDate=Inventory date
|
||||||
Inventories=Inventories
|
Inventories=Inventories
|
||||||
NewInventory=New inventory
|
NewInventory=New inventory
|
||||||
|
|||||||
@ -146,9 +146,11 @@ ConfirmPaySalary=Voulez-vous vraiment classer ce salaire comme payé ?
|
|||||||
DeleteSocialContribution=Effacer une charge fiscale ou sociale
|
DeleteSocialContribution=Effacer une charge fiscale ou sociale
|
||||||
DeleteVAT=Supprimer une déclaration de TVA
|
DeleteVAT=Supprimer une déclaration de TVA
|
||||||
DeleteSalary=Supprimer un salaire
|
DeleteSalary=Supprimer un salaire
|
||||||
|
DeleteVariousPayment=Supprimer un paiement divers
|
||||||
ConfirmDeleteSocialContribution=Voulez-vous vraiment supprimer ce paiement de taxe sociale / fiscale?
|
ConfirmDeleteSocialContribution=Voulez-vous vraiment supprimer ce paiement de taxe sociale / fiscale?
|
||||||
ConfirmDeleteVAT=Voulez-vous vraiment supprimer cette déclaration de TVA ?
|
ConfirmDeleteVAT=Voulez-vous vraiment supprimer cette déclaration de TVA ?
|
||||||
ConfirmDeleteSalary=Êtes-vous sûr de vouloir supprimer ce salaire ?
|
ConfirmDeleteSalary=Êtes-vous sûr de vouloir supprimer ce salaire ?
|
||||||
|
ConfirmDeleteVariousPayment=Voulez-vous vraiment supprimer ce paiement divers ?
|
||||||
ExportDataset_tax_1=Taxes sociales et fiscales et paiements
|
ExportDataset_tax_1=Taxes sociales et fiscales et paiements
|
||||||
CalcModeVATDebt=Mode <b>%sTVA sur débit%s</b>.
|
CalcModeVATDebt=Mode <b>%sTVA sur débit%s</b>.
|
||||||
CalcModeVATEngagement=Mode <b>%sTVA sur encaissement%s</b>.
|
CalcModeVATEngagement=Mode <b>%sTVA sur encaissement%s</b>.
|
||||||
|
|||||||
@ -102,6 +102,9 @@ ConfirmCancelOrder=Êtes-vous sûr de vouloir annuler cette commande ?
|
|||||||
ConfirmMakeOrder=Êtes-vous sûr de vouloir confirmer cette commande en date du <b>%s</b> ?
|
ConfirmMakeOrder=Êtes-vous sûr de vouloir confirmer cette commande en date du <b>%s</b> ?
|
||||||
GenerateBill=Facturer
|
GenerateBill=Facturer
|
||||||
ClassifyShipped=Classer livrée
|
ClassifyShipped=Classer livrée
|
||||||
|
PassedInShippedStatus=classée livrée
|
||||||
|
YouCantShipThis=Classement impossible : veuillez vérifier les droits utilisateur
|
||||||
|
MustBeValidatedBefore=doit être Validée ou En cours de livraison pour pouvoir être classée livrée
|
||||||
DraftOrders=Commandes brouillons
|
DraftOrders=Commandes brouillons
|
||||||
DraftSuppliersOrders=Commandes fournisseurs brouillons
|
DraftSuppliersOrders=Commandes fournisseurs brouillons
|
||||||
OnProcessOrders=Commandes en cours de traitement
|
OnProcessOrders=Commandes en cours de traitement
|
||||||
|
|||||||
@ -346,7 +346,7 @@ UseProductFournDesc=Ajouter une fonctionnalité pour définir la description pro
|
|||||||
ProductSupplierDescription=Description du fournisseur du produit
|
ProductSupplierDescription=Description du fournisseur du produit
|
||||||
UseProductSupplierPackaging=Utiliser le conditionnement/emballage sur les prix fournisseur (recalculer les quantités en fonction de l'emballage défini sur le prix fournisseur lors de l'ajout / mise à jour de la ligne dans les documents fournisseurs)
|
UseProductSupplierPackaging=Utiliser le conditionnement/emballage sur les prix fournisseur (recalculer les quantités en fonction de l'emballage défini sur le prix fournisseur lors de l'ajout / mise à jour de la ligne dans les documents fournisseurs)
|
||||||
PackagingForThisProduct=Emballage
|
PackagingForThisProduct=Emballage
|
||||||
PackagingForThisProductDesc=Sur une commande fournisseur, vous commanderez automatiquement cette quantité ou un multiple. Vous ne pourrez pas saisir un montant inférieur
|
PackagingForThisProductDesc=Sur une commande fournisseur, vous commanderez automatiquement cette quantité ou un multiple.
|
||||||
QtyRecalculatedWithPackaging=La quantité de la ligne a été recalculée en fonction de l'emballage du fournisseur
|
QtyRecalculatedWithPackaging=La quantité de la ligne a été recalculée en fonction de l'emballage du fournisseur
|
||||||
|
|
||||||
#Attributes
|
#Attributes
|
||||||
|
|||||||
@ -112,8 +112,8 @@ class Mo extends CommonObject
|
|||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,),
|
||||||
'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,),
|
'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,),
|
||||||
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'),
|
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'),
|
||||||
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'),
|
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'),
|
||||||
'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'),
|
'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'),
|
||||||
'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,),
|
'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||||
|
|||||||
@ -148,25 +148,8 @@ if ($action == 'other') {
|
|||||||
$value = GETPOST('activate_FillProductDescAuto', 'alpha');
|
$value = GETPOST('activate_FillProductDescAuto', 'alpha');
|
||||||
$res = dolibarr_set_const($db, "PRODUIT_AUTOFILL_DESC", $value, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRODUIT_AUTOFILL_DESC", $value, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if ($value) {
|
|
||||||
$sql_test = "SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
|
|
||||||
$resql = $db->query($sql_test);
|
|
||||||
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') { // if the field does not exist, we create it
|
|
||||||
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN desc_fourn text";
|
|
||||||
$resql_new = $db->query($sql_new);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
|
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
|
||||||
$res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity);
|
||||||
if ($value) {
|
|
||||||
$sql_test = "SELECT count(packaging) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
|
|
||||||
$resql = $db->query($sql_test);
|
|
||||||
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') { // if the field does not exist, we create it
|
|
||||||
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1";
|
|
||||||
$resql_new = $db->query($sql_new);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'specimen') { // For products
|
if ($action == 'specimen') { // For products
|
||||||
|
|||||||
@ -1947,7 +1947,10 @@ class Product extends CommonObject
|
|||||||
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,";
|
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,";
|
||||||
$sql .= " pfp.packaging";
|
$sql .= " pfp.packaging";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||||
$sql .= " WHERE pfp.fk_product = ".((int) $product_id);
|
$sql .= " WHERE 1 = 1";
|
||||||
|
if ($product_id > 0) {
|
||||||
|
$sql .= " AND pfp.fk_product = ".((int) $product_id);
|
||||||
|
}
|
||||||
if ($fourn_ref != 'none') {
|
if ($fourn_ref != 'none') {
|
||||||
$sql .= " AND pfp.ref_fourn = '".$this->db->escape($fourn_ref)."'";
|
$sql .= " AND pfp.ref_fourn = '".$this->db->escape($fourn_ref)."'";
|
||||||
}
|
}
|
||||||
@ -2189,7 +2192,8 @@ class Product extends CommonObject
|
|||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
} else {
|
} else {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
dol_print_error($this->db);
|
$this->error = $this->db->lasterror();
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -320,9 +320,10 @@ if (empty($reshook)) {
|
|||||||
if (empty($packaging)) {
|
if (empty($packaging)) {
|
||||||
$packaging = 1;
|
$packaging = 1;
|
||||||
}
|
}
|
||||||
|
/* We can have a puchase ref that need to buy 100 min for a given price and with a packaging of 50.
|
||||||
if ($packaging < $quantity) {
|
if ($packaging < $quantity) {
|
||||||
$packaging = $quantity;
|
$packaging = $quantity;
|
||||||
}
|
}*/
|
||||||
$object->packaging = $packaging;
|
$object->packaging = $packaging;
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
|
|||||||
@ -171,10 +171,15 @@ if (empty($reshook)) {
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error) {
|
if (!$error) {
|
||||||
//$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2);
|
//$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2);
|
||||||
$localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them.
|
$localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them.
|
||||||
$object->updatePrice(0, $object->price_base_type, $user, $tva_tx, '', 0, $npr, 0, 0, $localtaxarray, $vatratecode);
|
$ret = $object->updatePrice(0, $object->price_base_type, $user, $tva_tx, '', 0, $npr, 0, 0, $localtaxarray, $vatratecode);
|
||||||
|
|
||||||
|
if ($ret < 0) {
|
||||||
|
$error++;
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@ -394,13 +399,21 @@ if (empty($reshook)) {
|
|||||||
if ($action == 'activate_price_by_qty') {
|
if ($action == 'activate_price_by_qty') {
|
||||||
// Activating product price by quantity add a new price line with price_by_qty set to 1
|
// Activating product price by quantity add a new price line with price_by_qty set to 1
|
||||||
$level = GETPOST('level', 'int');
|
$level = GETPOST('level', 'int');
|
||||||
$object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 1);
|
$ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 1);
|
||||||
|
|
||||||
|
if ($ret < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Unset Price by quantity
|
// Unset Price by quantity
|
||||||
if ($action == 'disable_price_by_qty') {
|
if ($action == 'disable_price_by_qty') {
|
||||||
// Disabling product price by quantity add a new price line with price_by_qty set to 0
|
// Disabling product price by quantity add a new price line with price_by_qty set to 0
|
||||||
$level = GETPOST('level', 'int');
|
$level = GETPOST('level', 'int');
|
||||||
$object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 0);
|
$ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 0);
|
||||||
|
|
||||||
|
if ($ret < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'edit_price_by_qty') { // Edition d'un prix par quantité
|
if ($action == 'edit_price_by_qty') { // Edition d'un prix par quantité
|
||||||
@ -1483,14 +1496,18 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
|
|||||||
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
|
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
|
||||||
// We emulate the change of the price from interface with the same value than the one into table llx_product
|
// We emulate the change of the price from interface with the same value than the one into table llx_product
|
||||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||||
$object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
|
$ret = $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
|
||||||
} else {
|
} else {
|
||||||
$object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
|
$ret = $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($ret < 0) {
|
||||||
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
|
} else {
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($num > 0) {
|
if ($num > 0) {
|
||||||
// Default prices or
|
// Default prices or
|
||||||
|
|||||||
@ -180,9 +180,14 @@ if (empty($reshook)) {
|
|||||||
$result = $object->create($user);
|
$result = $object->create($user);
|
||||||
if (!$error && $result > 0) {
|
if (!$error && $result > 0) {
|
||||||
// Add myself as project leader
|
// Add myself as project leader
|
||||||
$typeofcontact = 'PROJECTLEADER'; // TODO If use rename this code in dictionary, the add_contact will generate an error.
|
$typeofcontact = 'PROJECTLEADER';
|
||||||
$result = $object->add_contact($user->id, $typeofcontact, 'internal');
|
$result = $object->add_contact($user->id, $typeofcontact, 'internal');
|
||||||
if ($result < 0) {
|
|
||||||
|
// -3 means type not found (PROJECTLEADER renamed, de-activated or deleted), so don't prevent creation if it has been the case
|
||||||
|
if ($result == -3) {
|
||||||
|
setEventMessage('ErrorPROJECTLEADERRoleMissingRestoreIt', 'errors');
|
||||||
|
$error++;
|
||||||
|
} elseif ($result < 0) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -615,11 +620,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($array) > 0) {
|
if (count($array) > 0) {
|
||||||
print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
print $form->selectarray('public', $array, GETPOST('public'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<input type="hidden" name="public" id="public" value="'.(GETPOSTISSET('public') ? GETPOST('public') : $object->public).'">';
|
print '<input type="hidden" name="public" id="public" value="'.GETPOST('public').'">';
|
||||||
|
|
||||||
if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) {
|
if (GETPOST('public') == 0) {
|
||||||
print $langs->trans("PrivateProject");
|
print $langs->trans("PrivateProject");
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("SharedProject");
|
print $langs->trans("SharedProject");
|
||||||
|
|||||||
@ -1604,16 +1604,6 @@ class Task extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time";
|
|
||||||
$sql .= " WHERE rowid = ".$this->timespent_id;
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if (!$resql) {
|
|
||||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
if (!$notrigger) {
|
if (!$notrigger) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('TASK_TIMESPENT_DELETE', $user);
|
$result = $this->call_trigger('TASK_TIMESPENT_DELETE', $user);
|
||||||
@ -1622,6 +1612,16 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time";
|
||||||
|
$sql .= " WHERE rowid = ".$this->timespent_id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (!$resql) {
|
||||||
|
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
|||||||
@ -254,10 +254,10 @@ if (empty($reshook)) {
|
|||||||
$object->origin = $origin;
|
$object->origin = $origin;
|
||||||
$object->origin_id = $origin_id;
|
$object->origin_id = $origin_id;
|
||||||
$object->fk_project = GETPOST('projectid', 'int');
|
$object->fk_project = GETPOST('projectid', 'int');
|
||||||
$object->weight = GETPOST('weight', 'int') == '' ? "NULL" : GETPOST('weight', 'int');
|
$object->weight = GETPOST('weight', 'int') == '' ? null : GETPOST('weight', 'int');
|
||||||
$object->sizeH = GETPOST('sizeH', 'int') == '' ? "NULL" : GETPOST('sizeH', 'int');
|
$object->sizeH = GETPOST('sizeH', 'int') == '' ? null : GETPOST('sizeH', 'int');
|
||||||
$object->sizeW = GETPOST('sizeW', 'int') == '' ? "NULL" : GETPOST('sizeW', 'int');
|
$object->sizeW = GETPOST('sizeW', 'int') == '' ? null : GETPOST('sizeW', 'int');
|
||||||
$object->sizeS = GETPOST('sizeS', 'int') == '' ? "NULL" : GETPOST('sizeS', 'int');
|
$object->sizeS = GETPOST('sizeS', 'int') == '' ? null : GETPOST('sizeS', 'int');
|
||||||
$object->size_units = GETPOST('size_units', 'int');
|
$object->size_units = GETPOST('size_units', 'int');
|
||||||
$object->weight_units = GETPOST('weight_units', 'int');
|
$object->weight_units = GETPOST('weight_units', 'int');
|
||||||
|
|
||||||
@ -679,7 +679,7 @@ if (empty($reshook)) {
|
|||||||
$triggersendname = 'RECEPTION_SENTBYMAIL';
|
$triggersendname = 'RECEPTION_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$mode = 'emailfromreception';
|
$mode = 'emailfromreception';
|
||||||
$trackid = 'shi'.$object->id;
|
$trackid = 'rec'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1921,15 +1921,16 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Warehouse source
|
// Warehouse source
|
||||||
if (!empty($conf->stock->enabled)) {
|
if (!empty($conf->stock->enabled)) {
|
||||||
print '<td class="left">';
|
|
||||||
|
|
||||||
if ($lines[$i]->fk_entrepot > 0) {
|
if ($lines[$i]->fk_entrepot > 0) {
|
||||||
$entrepot = new Entrepot($db);
|
$entrepot = new Entrepot($db);
|
||||||
$entrepot->fetch($lines[$i]->fk_entrepot);
|
$entrepot->fetch($lines[$i]->fk_entrepot);
|
||||||
print $entrepot->getNomUrl(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
print '<td class="left tdoverflowmax150" title="'.dol_escape_htmltag($entrepot->label).'">';
|
||||||
|
print $entrepot->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
} else {
|
||||||
|
print '<td></td>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batch number managment
|
// Batch number managment
|
||||||
|
|||||||
@ -236,7 +236,6 @@ class Reception extends CommonObject
|
|||||||
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."reception (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."reception (";
|
||||||
@ -273,12 +272,12 @@ class Reception extends CommonObject
|
|||||||
$sql .= ", ".$this->fk_project;
|
$sql .= ", ".$this->fk_project;
|
||||||
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : "null");
|
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : "null");
|
||||||
$sql .= ", '".$this->db->escape($this->tracking_number)."'";
|
$sql .= ", '".$this->db->escape($this->tracking_number)."'";
|
||||||
$sql .= ", ".$this->weight;
|
$sql .= ", ".(is_null($this->weight) ? "NULL" : ((double) $this->weight));
|
||||||
$sql .= ", ".$this->sizeS; // TODO Should use this->trueDepth
|
$sql .= ", ".(is_null($this->sizeS) ? "NULL" : ((double) $this->sizeS)); // TODO Should use this->trueDepth
|
||||||
$sql .= ", ".$this->sizeW; // TODO Should use this->trueWidth
|
$sql .= ", ".(is_null($this->sizeW) ? "NULL" : ((double) $this->sizeW)); // TODO Should use this->trueWidth
|
||||||
$sql .= ", ".$this->sizeH; // TODO Should use this->trueHeight
|
$sql .= ", ".(is_null($this->sizeH) ? "NULL" : ((double) $this->sizeH)); // TODO Should use this->trueHeight
|
||||||
$sql .= ", ".$this->weight_units;
|
$sql .= ", ".(is_null($this->weight_units) ? "NULL" : ((double) $this->weight_units));
|
||||||
$sql .= ", ".$this->size_units;
|
$sql .= ", ".(is_null($this->size_units) ? "NULL" : ((double) $this->size_units));
|
||||||
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
|
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
|
||||||
$sql .= ", ".(!empty($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null");
|
$sql .= ", ".(!empty($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null");
|
||||||
$sql .= ", ".(!empty($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null");
|
$sql .= ", ".(!empty($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null");
|
||||||
@ -566,7 +565,7 @@ class Reception extends CommonObject
|
|||||||
|
|
||||||
// Loop on each product line to add a stock movement
|
// Loop on each product line to add a stock movement
|
||||||
// TODO in future, reception lines may not be linked to order line
|
// TODO in future, reception lines may not be linked to order line
|
||||||
$sql = "SELECT cd.fk_product, cd.subprice,";
|
$sql = "SELECT cd.fk_product, cd.subprice, cd.remise_percent,";
|
||||||
$sql .= " ed.rowid, ed.qty, ed.fk_entrepot,";
|
$sql .= " ed.rowid, ed.qty, ed.fk_entrepot,";
|
||||||
$sql .= " ed.eatby, ed.sellby, ed.batch";
|
$sql .= " ed.eatby, ed.sellby, ed.batch";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,";
|
||||||
@ -592,12 +591,19 @@ class Reception extends CommonObject
|
|||||||
$mouvS = new MouvementStock($this->db);
|
$mouvS = new MouvementStock($this->db);
|
||||||
$mouvS->origin = &$this;
|
$mouvS->origin = &$this;
|
||||||
|
|
||||||
|
// get unit price with discount
|
||||||
|
$up_ht_disc = $obj->subprice;
|
||||||
|
if (!empty($obj->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) {
|
||||||
|
$up_ht_disc = price2num($up_ht_disc * (100 - $obj->remise_percent) / 100, 'MU');
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($obj->batch)) {
|
if (empty($obj->batch)) {
|
||||||
// line without batch detail
|
// line without batch detail
|
||||||
|
|
||||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
|
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
|
||||||
$inventorycode = '';
|
$inventorycode = '';
|
||||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), '', '', '', '', 0, $inventorycode);
|
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $up_ht_disc, $langs->trans("ReceptionValidatedInDolibarr", $numref), '', '', '', '', 0, $inventorycode);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = $mouvS->error;
|
$this->errors[] = $mouvS->error;
|
||||||
@ -610,7 +616,8 @@ class Reception extends CommonObject
|
|||||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
|
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
|
||||||
// Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version)
|
// Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version)
|
||||||
$inventorycode = '';
|
$inventorycode = '';
|
||||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', 0, $inventorycode);
|
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $up_ht_disc, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', 0, $inventorycode);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = $mouvS->error;
|
$this->errors[] = $mouvS->error;
|
||||||
@ -727,8 +734,14 @@ class Reception extends CommonObject
|
|||||||
$line->qty = $qty;
|
$line->qty = $qty;
|
||||||
|
|
||||||
$supplierorderline = new CommandeFournisseurLigne($this->db);
|
$supplierorderline = new CommandeFournisseurLigne($this->db);
|
||||||
$supplierorderline->fetch($id);
|
$result = $supplierorderline->fetch($id);
|
||||||
|
if ($result <= 0) {
|
||||||
|
$this->error = $supplierorderline->error;
|
||||||
|
$this->errors = $supplierorderline->errors;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fk_product = 0;
|
||||||
if (!empty($conf->stock->enabled) && !empty($supplierorderline->fk_product)) {
|
if (!empty($conf->stock->enabled) && !empty($supplierorderline->fk_product)) {
|
||||||
$fk_product = $supplierorderline->fk_product;
|
$fk_product = $supplierorderline->fk_product;
|
||||||
|
|
||||||
|
|||||||
@ -491,6 +491,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
|
|||||||
if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all
|
if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
}
|
}
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql .= " WHERE e.entity IN (".getEntity('reception').")";
|
$sql .= " WHERE e.entity IN (".getEntity('reception').")";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all
|
if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all
|
||||||
$sql .= " AND e.fk_soc = sc.fk_soc";
|
$sql .= " AND e.fk_soc = sc.fk_soc";
|
||||||
@ -976,6 +979,9 @@ while ($i < min($num, $limit)) {
|
|||||||
{
|
{
|
||||||
}*/
|
}*/
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked'])) {
|
if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked'])) {
|
||||||
@ -1071,6 +1077,13 @@ if ($num == 0) {
|
|||||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show total line
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|
||||||
|
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -225,7 +225,7 @@ if ($action == "setaskforshippingmet") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Activate "Disable prospect/customer type"
|
// Activate "Disable prospect/customer type"
|
||||||
if ($action == "setdisableprospectcustomer") {
|
if ($action == "setdisableprospectcustomer") {
|
||||||
$setdisableprospectcustomer = GETPOST('value', 'int');
|
$setdisableprospectcustomer = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
||||||
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
@ -986,21 +986,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$modCodeFournisseur = new $module;
|
$modCodeFournisseur = new $module;
|
||||||
|
|
||||||
// Define if customer/prospect or supplier status is set or not
|
// Define if customer/prospect or supplier status is set or not
|
||||||
if (GETPOST("type") != 'f') {
|
if (GETPOST("type", 'aZ') != 'f') {
|
||||||
$object->client = -1;
|
$object->client = -1;
|
||||||
if (!empty($conf->global->THIRDPARTY_CUSTOMERPROSPECT_BY_DEFAULT)) {
|
if (!empty($conf->global->THIRDPARTY_CUSTOMERPROSPECT_BY_DEFAULT)) {
|
||||||
$object->client = 3;
|
$object->client = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Prospect / Customer
|
// Prospect / Customer
|
||||||
if (GETPOST("type") == 'c') {
|
if (GETPOST("type", 'aZ') == 'c') {
|
||||||
if (!empty($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT)) {
|
if (!empty($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT)) {
|
||||||
$object->client = $conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT;
|
$object->client = $conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT;
|
||||||
} else {
|
} else {
|
||||||
$object->client = 3;
|
$object->client = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GETPOST("type") == 'p') {
|
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS) && $object->client == 3) {
|
||||||
|
$object->client = 1;
|
||||||
|
}
|
||||||
|
if (GETPOST("type", 'aZ') == 'p') {
|
||||||
$object->client = 2;
|
$object->client = 2;
|
||||||
}
|
}
|
||||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) {
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if (!isset($action)) {
|
|||||||
}
|
}
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$langs->loadLangs(array("main", "cashdesk", "companies"));
|
$langs->loadLangs(array("main", "bills", "cashdesk", "companies"));
|
||||||
|
|
||||||
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant
|
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ if (empty($user->rights->takepos->run)) {
|
|||||||
top_httphead('text/html');
|
top_httphead('text/html');
|
||||||
|
|
||||||
if ($place > 0) {
|
if ($place > 0) {
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj) {
|
if ($obj) {
|
||||||
@ -79,6 +79,7 @@ $object = new Facture($db);
|
|||||||
$object->fetch($facid);
|
$object->fetch($facid);
|
||||||
|
|
||||||
// Call to external receipt modules if exist
|
// Call to external receipt modules if exist
|
||||||
|
$parameters = array();
|
||||||
$hookmanager->initHooks(array('takeposfrontend'), $facid);
|
$hookmanager->initHooks(array('takeposfrontend'), $facid);
|
||||||
$reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
|
$reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
|
||||||
if (!empty($hookmanager->resPrint)) {
|
if (!empty($hookmanager->resPrint)) {
|
||||||
|
|||||||
@ -536,7 +536,14 @@ class ProductCombination
|
|||||||
$new_price += $variation_price;
|
$new_price += $variation_price;
|
||||||
}
|
}
|
||||||
|
|
||||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq, 0, array(), $parent->default_vat_code);
|
$ret = $child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq, 0, array(), $parent->default_vat_code);
|
||||||
|
|
||||||
|
if ($ret < 0) {
|
||||||
|
$this->db->rollback();
|
||||||
|
$this->error = $child->error;
|
||||||
|
$this->errors = $child->errors;
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -558,7 +565,14 @@ class ProductCombination
|
|||||||
$new_price += $this->variation_price;
|
$new_price += $this->variation_price;
|
||||||
}
|
}
|
||||||
|
|
||||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, 1, $new_npr, $new_psq);
|
$ret = $child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, 1, $new_npr, $new_psq);
|
||||||
|
|
||||||
|
if ($ret < 0) {
|
||||||
|
$this->db->rollback();
|
||||||
|
$this->error = $child->error;
|
||||||
|
$this->errors = $child->errors;
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -567,6 +581,8 @@ class ProductCombination
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
|
$this->error = $child->error;
|
||||||
|
$this->errors = $child->errors;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -234,7 +234,14 @@ if (empty($modulepart)) {
|
|||||||
accessforbidden('Bad value for parameter modulepart', 0, 0, 1);
|
accessforbidden('Bad value for parameter modulepart', 0, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname);
|
// When logged in a different entity, medias cannot be accessed because $conf->$module->multidir_output
|
||||||
|
// is not set on the requested entity, but they are public documents, so reset entity
|
||||||
|
if ($modulepart === 'medias' && $entity != $conf->entity) {
|
||||||
|
$conf->entity = $entity;
|
||||||
|
$conf->setValues($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, $refname);
|
||||||
$accessallowed = $check_access['accessallowed'];
|
$accessallowed = $check_access['accessallowed'];
|
||||||
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
|
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
|
||||||
$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name
|
$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user