Fix regression
This commit is contained in:
parent
1251e80963
commit
5f2ba49dfa
@ -2670,26 +2670,16 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for mandatory fields in thirdparty (defined into setup)
|
// Check for mandatory fields in thirdparty (defined into setup)
|
||||||
|
if (!empty($this->thirdparty) && is_object($this->thirdparty)) {
|
||||||
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
||||||
foreach ($array_to_check as $key) {
|
foreach ($array_to_check as $key) {
|
||||||
$keymin = strtolower($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)) {
|
if (!property_exists($this->thirdparty, $keymin)) {
|
||||||
$langs->load('errors');
|
continue;
|
||||||
$this->error = $langs->trans('ErrorInvoiceLoadThirdPartyKey', $keymin, $this->ref);
|
|
||||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
$vallabel = $this->thirdparty->$keymin;
|
$vallabel = $this->thirdparty->$keymin;
|
||||||
|
|
||||||
|
$i = (int) preg_replace('/[^0-9]/', '', $key);
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
if ($this->thirdparty->isACompany()) {
|
if ($this->thirdparty->isACompany()) {
|
||||||
// Check for mandatory prof id (but only if country is other than ours)
|
// Check for mandatory prof id (but only if country is other than ours)
|
||||||
@ -2715,6 +2705,7 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -275,8 +275,6 @@ ErrorIsNotADraft=%s is not a draft
|
|||||||
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
|
||||||
ErrorNotApproverForHoliday=You are not the approver for leave %s
|
ErrorNotApproverForHoliday=You are not the approver for leave %s
|
||||||
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.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user