merge conflict

This commit is contained in:
jpb
2021-08-12 09:36:34 +02:00
80 changed files with 1237 additions and 472 deletions

View File

@@ -1519,6 +1519,12 @@ class Account extends CommonObject
*/
public function needIBAN()
{
global $conf;
if (!empty($conf->global->MAIN_IBAN_IS_NEVER_MANDATORY)) {
return 0;
}
$country_code = $this->getCountryCode();
$country_code_in_EEC = array(

View File

@@ -234,6 +234,7 @@ $arrayfields = array(
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>166),
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170),
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>171),
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180),
@@ -1257,6 +1258,9 @@ if ($resql) {
print '<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'">';
print '</td>';
}
if (!empty($arrayfields['sale_representative']['checked'])) {
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
print '<td class="liste_titre" align="right">';
print '</td>';
@@ -1449,6 +1453,9 @@ if ($resql) {
if (!empty($arrayfields['u.login']['checked'])) {
print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
}
if (!empty($arrayfields['sale_representative']['checked'])) {
print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
}
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
print_liste_field_titre($arrayfields['f.retained_warranty']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
}
@@ -1939,6 +1946,53 @@ if ($resql) {
}
}
if (!empty($arrayfields['sale_representative']['checked'])) {
// Sales representatives
print '<td>';
if ($obj->socid > 0) {
$listsalesrepresentatives = $thirdpartystatic->getSalesRepresentatives($user);
if ($listsalesrepresentatives < 0) {
dol_print_error($db);
}
$nbofsalesrepresentative = count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 6) {
// We print only number
print $nbofsalesrepresentative;
} elseif ($nbofsalesrepresentative > 0) {
$j = 0;
foreach ($listsalesrepresentatives as $val) {
$userstatic->id = $val['id'];
$userstatic->lastname = $val['lastname'];
$userstatic->firstname = $val['firstname'];
$userstatic->email = $val['email'];
$userstatic->statut = $val['statut'];
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
$userstatic->login = $val['login'];
$userstatic->office_phone = $val['office_phone'];
$userstatic->office_fax = $val['office_fax'];
$userstatic->user_mobile = $val['user_mobile'];
$userstatic->job = $val['job'];
$userstatic->gender = $val['gender'];
//print '<div class="float">':
print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
$j++;
if ($j < $nbofsalesrepresentative) {
print ' ';
}
//print '</div>';
}
}
//else print $langs->trans("NoSalesRepresentativeAffected");
} else {
print '&nbsp;';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
print '<td align="right amount">'.(!empty($obj->retained_warranty) ?price($obj->retained_warranty).'%' : '&nbsp;').'</td>';
}

View File

@@ -200,7 +200,8 @@ if ($id > 0 || $ref) {
//print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->getNomUrl(1).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec, 'day').'</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount).'</span></td></tr>';
// Status
/*

View File

@@ -82,7 +82,8 @@ class BonPrelevement extends CommonObject
const STATUS_DRAFT = 0;
const STATUS_TRANSFERED = 1;
const STATUS_CREDITED = 2;
const STATUS_CREDITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
const STATUS_DEBITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
/**
@@ -2343,17 +2344,22 @@ class BonPrelevement extends CommonObject
//$langs->load("mymodule");
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('StatusWaiting');
$this->labelStatus[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans');
$this->labelStatus[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('StatusWaiting');
$this->labelStatusShort[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans');
$this->labelStatusShort[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
if ($this->type == 'bank-transfer') {
$this->labelStatus[self::STATUS_DEBITED] = $langs->trans('StatusDebited');
$this->labelStatusShort[self::STATUS_DEBITED] = $langs->trans('StatusDebited');
} else {
$this->labelStatus[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
$this->labelStatusShort[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
}
}
$statusType = 'status1';
if ($status == self::STATUS_TRANSFERED) {
$statusType = 'status3';
}
if ($status == self::STATUS_CREDITED) {
if ($status == self::STATUS_CREDITED || $status == self::STATUS_DEBITED) {
$statusType = 'status6';
}

View File

@@ -31,6 +31,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
@@ -135,6 +136,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$tva_static = new Tva($db);
$bankstatic = new Account($db);
$accountingjournal = new AccountingJournal($db);
@@ -445,7 +447,13 @@ while ($i < min($num, $limit)) {
// Ref
if (!empty($arrayfields['t.rowid']['checked'])) {
print '<td>'.$tva_static->getNomUrl(1).'</td>';
print '<td>';
print $tva_static->getNomUrl(1);
$filename = dol_sanitizeFileName($tva_static->ref);
$filedir = $conf->tax->dir_output.'/vat/'.dol_sanitizeFileName($tva_static->ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$tva_static->id;
print $formfile->getDocumentsLink($tva_static->element, $filename, $filedir, '', 'valignmiddle paddingleft2imp');
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}