Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14.0_fix_invoice_situation_with_credit_note
This commit is contained in:
commit
a7482a9ea0
@ -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);
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -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">';
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -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'));
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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>.
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
@ -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)))) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user