This commit is contained in:
Laurent Destailleur 2018-12-14 18:58:55 +01:00
parent 31c5ac470b
commit 59bc15377d
3 changed files with 16 additions and 16 deletions

View File

@ -241,17 +241,17 @@ if ($action == 'setforcedate')
if ($action == 'setDefaultPDFModulesByType') if ($action == 'setDefaultPDFModulesByType')
{ {
$invoicetypemodels = GETPOST('invoicetypemodels'); $invoicetypemodels = GETPOST('invoicetypemodels');
if(!empty($invoicetypemodels) && is_array($invoicetypemodels)) if(!empty($invoicetypemodels) && is_array($invoicetypemodels))
{ {
$error = 0; $error = 0;
foreach ($invoicetypemodels as $type => $value) foreach ($invoicetypemodels as $type => $value)
{ {
$res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;
} }
if (! $error) if (! $error)
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
@ -621,7 +621,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n"; print "</tr>\n";
$listtype=array( $listtype=array(
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
@ -632,7 +632,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
{ {
$listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation");
} }
foreach ($listtype as $type => $trans) foreach ($listtype as $type => $trans)
{ {
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type; $thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type;
@ -642,7 +642,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
print '<td colspan="2" >'.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).'</td>'; print '<td colspan="2" >'.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).'</td>';
print "</tr>\n"; print "</tr>\n";
} }
print '</table>'; print '</table>';
print "</form>"; print "</form>";
} }
@ -698,7 +698,7 @@ if (! empty($conf->banque->enabled))
} }
else else
{ {
print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>"; print '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
} }
} }
} }

View File

@ -358,7 +358,7 @@ $thirdpartystatic=new Societe($db);
$sql = 'SELECT'; $sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql.= ' f.rowid as id, f.ref as ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,'; $sql.= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
$sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,'; $sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
$sql.= ' f.paye as paye, f.fk_statut,'; $sql.= ' f.paye as paye, f.fk_statut,';

View File

@ -2058,20 +2058,20 @@ class Form
$selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; $selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
(count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock"; (count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock";
$sql = "SELECT "; $sql = "SELECT ";
$sql.= $selectFields . $selectFieldsGrouped; $sql.= $selectFields . $selectFieldsGrouped;
if (! empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) if (! empty($conf->global->PRODUCT_SORT_BY_CATEGORY))
{ {
//Product category //Product category
$sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie $sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie
FROM ".MAIN_DB_PREFIX."categorie_product FROM ".MAIN_DB_PREFIX."categorie_product
WHERE ".MAIN_DB_PREFIX."categorie_product.fk_product=p.rowid WHERE ".MAIN_DB_PREFIX."categorie_product.fk_product=p.rowid
LIMIT 1 LIMIT 1
) AS categorie_product_id "; ) AS categorie_product_id ";
} }
//Price by customer //Price by customer
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid))
{ {
@ -2181,7 +2181,7 @@ class Form
{ {
$sql.= ' GROUP BY'.$selectFields; $sql.= ' GROUP BY'.$selectFields;
} }
//Sort by category //Sort by category
if(! empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) if(! empty($conf->global->PRODUCT_SORT_BY_CATEGORY))
{ {
@ -2195,7 +2195,7 @@ class Form
} }
$sql.= $db->plimit($limit, 0); $sql.= $db->plimit($limit, 0);
// Build output string // Build output string
dol_syslog(get_class($this)."::select_produits_list search product", LOG_DEBUG); dol_syslog(get_class($this)."::select_produits_list search product", LOG_DEBUG);
$result=$this->db->query($sql); $result=$this->db->query($sql);
@ -3636,8 +3636,8 @@ class Form
} }
else else
{ {
if ($statut == 0) print $langs->trans("NoActiveBankAccountDefined"); if ($statut == 0) print '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
else print $langs->trans("NoBankAccountFound"); else print '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
} }
} }
else { else {