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

Conflicts:
	htdocs/compta/facture/card.php
	htdocs/fourn/product/list.php
	htdocs/product/fournisseurs.php
	htdocs/societe/card.php
This commit is contained in:
Laurent Destailleur 2020-11-10 11:10:35 +01:00
commit 47b3b30aaa
8 changed files with 39 additions and 46 deletions

View File

@ -386,6 +386,7 @@ class AccountancyExport
foreach ($objectLines as $line) {
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
print $date.$separator;
print $line->code_journal.$separator;
print length_accountg($line->numero_compte).$separator;
@ -394,7 +395,7 @@ class AccountancyExport
print price($line->debit).$separator;
print price($line->credit).$separator;
print 'E'.$separator;
print length_accountg($line->subledger_account).$separator;
print length_accounta($line->subledger_account).$separator;
print $end_line;
}
}

View File

@ -854,7 +854,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$date.'"'.$sep;
print '"'.$val["type_payment"].'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print " ".$sep;
print '"'.$reflabel.'"'.$sep;
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
@ -882,7 +882,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
print '"'.$val["type_payment"].'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
if ($tabtype[$key] == 'payment_supplier') {
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
} elseif ($tabtype[$key] == 'payment') {
@ -892,7 +892,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
} elseif ($tabtype[$key] == 'payment_salary') {
print '"'.$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT.'"'.$sep;
} else {
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
}
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$reflabel.'"'.$sep;
@ -915,7 +915,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$date.'"'.$sep;
print '"'.$val["type_payment"].'"'.$sep;
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
print '"'.length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
print "".$sep;
print '"'.$reflabel.'"'.$sep;
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
@ -1115,7 +1115,7 @@ if (empty($action) || $action == 'view') {
if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
if ($tabtype[$key] == 'member') $account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
if ($tabtype[$key] == 'payment_various') $account_ledger = $tabpay[$key]["account_various"];
$accounttoshow = length_accounta($account_ledger);
$accounttoshow = length_accountg($account_ledger);
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
{
if ($tabtype[$key] == 'unknown')

View File

@ -333,14 +333,9 @@ if (empty($reshook))
}
}
}
} elseif ($action == 'set_thirdparty' && $usercancreate)
{
$object->fetch($id);
$object->setValueFrom('fk_soc', $socid, '', null, 'int', '', $user, 'BILL_MODIFY');
}
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id);
exit();
} elseif ($action == 'classin' && $usercancreate)
elseif ($action == 'classin' && $usercancreate)
{
$object->fetch($id);
$object->setProject($_POST['projectid']);

View File

@ -89,6 +89,7 @@ class box_birthdays extends ModeleBoxes
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.entity IN (".getEntity('user').")";
$sql.= " AND u.statut = 1";
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
$sql .= " ORDER BY u.birth ASC";
$sql .= $this->db->plimit($max, 0);

View File

@ -35,10 +35,10 @@ $langs->loadLangs(array("products", "suppliers"));
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
$sref = GETPOST('sref');
$sref = GETPOST('sref', 'alphanohtml');
$sRefSupplier = GETPOST('srefsupplier');
$snom = GETPOST('snom');
$type = GETPOST('type');
$snom = GETPOST('snom', 'alphanohtml');
$type = GETPOST('type', 'alphanohtml');
$optioncss = GETPOST('optioncss', 'alpha');
// Load variable for pagination
@ -127,7 +127,7 @@ if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions =
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity, tosell, tobuy,";
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity, p.tosell, p.tobuy, p.barcode, p.fk_barcode_type,";
$sql .= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
$sql .= " s.rowid as socid, s.nom as name";
// Add fields to SELECT from hooks
@ -208,12 +208,10 @@ if ($resql)
llxHeader("", "", $texte);
$param = "&tobuy=".$tobuy."&sref=".$sref."&snom=".$snom."&fourn_id=".$fourn_id.(isset($type) ? "&amp;type=".$type : "").(empty($sRefSupplier) ? "" : "&amp;srefsupplier=".$sRefSupplier);
$param = "&sref=".$sref."&snom=".$snom."&fourn_id=".$fourn_id.(isset($type) ? "&amp;type=".$type : "").(empty($sRefSupplier) ? "" : "&amp;srefsupplier=".$sRefSupplier);
if ($optioncss != '') $param .= '&optioncss='.$optioncss;
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
if (!empty($catid))
{
print "<div id='ways'>";
@ -243,13 +241,13 @@ if ($resql)
// Fields title search
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="sref" value="'.$sref.'" size="12">';
print '<input class="flat maxwidth100" type="text" name="sref" value="'.$sref.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="srefsupplier" value="'.$sRefSupplier.'" size="12">';
print '<input class="flat maxwidth100" type="text" name="srefsupplier" value="'.$sRefSupplier.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
print '<input class="flat maxwidth100" type="text" name="snom" value="'.$snom.'">';
print '</td>';
print '<td></td>';
print '<td></td>';
@ -283,21 +281,22 @@ if ($resql)
print_liste_field_titre('', $_SERVER["PHP_SELF"]);
print "</tr>\n";
$oldid = '';
while ($i < min($num, $limit))
{
$objp = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>';
$productstatic->id = $objp->rowid;
$productstatic->ref = $objp->ref;
$productstatic->type = $objp->fk_product_type;
$productstatic->entity = $objp->entity;
$productstatic->status = $objp->tosell;
$productstatic->status_buy = $objp->tobuy;
$productstatic->barcode = $objp->barcode;
$productstatic->barcode_type = $objp->fk_barcode_type;
print '<tr class="oddeven">';
print '<td>';
print $productstatic->getNomUrl(1, 'supplier');
print '</td>';

View File

@ -38,6 +38,7 @@ MenuOrdersSupplierToBill=Purchase orders to invoice
NbDaysToDelivery=Delivery delay (days)
DescNbDaysToDelivery=The longest delivery delay of the products from this order
SupplierReputation=Vendor reputation
ReferenceReputation=Reference reputation
DoNotOrderThisProductToThisSupplier=Do not order
NotTheGoodQualitySupplier=Low quality
ReputationForThisProduct=Reputation

View File

@ -610,21 +610,17 @@ if ($id > 0 || $ref)
</script>';
}
if ($conf->multicurrency->enabled) {
// Currency
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
print '<td>';
$currencycodetouse = GETPOST('multicurrency_code') ?GETPOST('multicurrency_code') : (isset($object->fourn_multicurrency_code) ? $object->fourn_multicurrency_code : '');
if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) $currencycodetouse = $conf->currency;
print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1);
print '</td>';
print '</tr>';
// Currency tx
print '<tr><td class="fieldrequired">'.$langs->trans("CurrencyRate").'</td>';
print '<td><input class="flat" name="multicurrency_tx" size="4" value="'.vatrate(GETPOST('multicurrency_tx') ?GETPOST('multicurrency_tx') : (isset($object->fourn_multicurrency_tx) ? $object->fourn_multicurrency_tx : '')).'">';
print '</td>';
print '</tr>';
if ($conf->multicurrency->enabled) {
// Currency
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
print '<td>';
$currencycodetouse = GETPOST('multicurrency_code') ?GETPOST('multicurrency_code') : (isset($object->fourn_multicurrency_code) ? $object->fourn_multicurrency_code : '');
if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) $currencycodetouse = $conf->currency;
print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1);
print ' &nbsp; '.$langs->trans("CurrencyRate").' ';
print '<input class="flat" name="multicurrency_tx" size="4" value="'.vatrate(GETPOST('multicurrency_tx') ? GETPOST('multicurrency_tx') : (isset($object->fourn_multicurrency_tx) ? $object->fourn_multicurrency_tx : '')).'">';
print '</td>';
print '</tr>';
// Currency price qty min
print '<tr><td class="fieldrequired">'.$langs->trans("PriceQtyMinCurrency").'</td>';
@ -719,7 +715,7 @@ END;
print '</tr>';
// Reputation
print '<tr><td>'.$langs->trans("SupplierReputation").'</td><td>';
print '<tr><td>'.$langs->trans("ReferenceReputation").'</td><td>';
echo $form->selectarray('supplier_reputation', $object->reputations, $supplier_reputation ? $supplier_reputation : $object->supplier_reputation);
print '</td></tr>';

View File

@ -1521,7 +1521,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '<tr>';
print '<td>'.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1);
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1);
// Note: If user has no right to "see all thirdparties", we force selection of sale representative to him, so after creation he can see the record.
$selected = (count(GETPOST('commercial', 'array')) > 0 ? GETPOST('commercial', 'array') : (GETPOST('commercial', 'int') > 0 ? array(GETPOST('commercial', 'int')) : (empty($user->rights->societe->client->voir) ? array($user->id) : array())));
print $form->multiselectarray('commercial', $userlist, $selected, null, null, null, null, "90%");
@ -2173,7 +2173,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '<tr>';
print '<td>'.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1);
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1);
$arrayselected = GETPOST('commercial', 'array');
if (empty($arrayselected)) $arrayselected = $object->getSalesRepresentatives($user, 1);
print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%");