Merge branch '12.0' of https://github.com/dolibarr/dolibarr into 12.0

This commit is contained in:
Laurent Destailleur 2020-08-12 20:26:01 +02:00
commit f22398a9d3
176 changed files with 2158 additions and 1136 deletions

View File

@ -3,6 +3,68 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
FIX: DebugBar hides content at page bottom
FIX: allow more harmless html tags
FIX: Bad back to link
FIX: Bad param
FIX: Can go on page even when module is disabled
FIX: Change position of line in BOM
FIX: Checkbox "drop table" was not checked when using php method to generate backup dump
FIX: ClickToDial tab of users has disappeared
FIX: CSS
FIX: date in supplier price log tooltip.
FIX: Debug module direct debit order. Solve conflict with credit transfer
FIX: Debug setup of receipt printer module
FIX: dolGetElementUrl and agenda page for external modules
FIX: DO not erase variable $key and $label during output of extrafields
FIX: duration fields size with firefox
FIX: Edit extrafield of type long text loose carriage returns
FIX: Fails to retraive accounting code of social contribution sometimes
FIX: Filter too large for extrafields with type text or html
FIX: If using a rounding step, localtax1+2 not included in total
FIX: input field of extrafields must keep data if form submit fails.
FIX: Label of opportunities in graph with special chars badly encoded
FIX: locataxes lost on lines when cloning a vendor invoice
FIX: Look and feel v12
FIX: Missing PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE conf support in supplier order
FIX: Navigation in object fails to find the next ref in some cases
FIX: null required
FIX: order by amount ht uses wrong column
FIX: Order by amount in product propal stats must be done on d.total_ht and not p.total
FIX: page for confirmation of payments is empty
FIX: Param of fetch_name_optionals_label must be object->table_element
FIX: Picto of HRM module
FIX: product label and desc were never updated when modifying translation
FIX: redirect on contact card from main search
FIX: Reposition and nav
FIX: search warehouse list
FIX: Setup of clicktodial hang on smartphone
FIX: Setup of currency limit and accuracy
FIX: shipping creation: checks not done on weight and sizes
FIX: Should not be able to edit qty on shipment when no stock available
FIX: Size of image on the help popup of modules
FIX: Sql error on stat by referring entries of a product
FIX: Warning if no bank account defined
FIX: We need to see unit line on PDF even though it's an option
FIX: wrong element var for fetch_name_optionals_label function with expeditions
FIX: wrong link to third invoice templates
FIX: Disable svg as supported image by default (can contains javascript). Set MAIN_ALLOW_SVG_FILES_AS_IMAGES to 1 to have svg accepted
FIX: #14076
FIX: #14146
FIX: #14209
FIX: #14222
FIX: #14236
FIX: #14241 Mysql 8 compatibility
FIX: #14253
FIX: #14256
FIX: #14259
FIX: #14279
FIX: #14291
FIX: #14292
FIX: #14336
***** ChangeLog for 12.0.1 compared to 12.0.0 *****
FIX: reposition was broken if url end with #anchor
FIX: $_POST must be GETPOST

View File

@ -14,7 +14,7 @@ Architecture: all
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5 | libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php,
php5-cli | php-cli,
# Required PHP extensions
php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd,
php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd, php5-zip | php-zip,
# Required PHP libraries
php-pear, php-mail-mime,
# php-tcpdf,

View File

@ -8,6 +8,7 @@ ALL:
Check "@CHANGE"
PrestaShopWebservice:
---------------------
Replace
@ -27,6 +28,19 @@ With
DEBUGBAR:
---------
Move
this.options = {
bodyMarginBottom: true,
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')),
};
few line lower in the
initialize: function() {
ESCPOS:
-------
Replace

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
<CstmrCdtTrfInitn>
<GrpHdr>
<MsgId>message-id-001</MsgId>
<CreDtTm>2010-09-28T14:07:00</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>10.1</CtrlSum>
<InitgPty>
<Nm>Bedrijfsnaam</Nm>
<Id>
<OrgId>
<Othr>
<Id>123456789123456</Id>
</Othr>
</OrgId>
</Id>
</InitgPty>
</GrpHdr>
<PmtInf>
<PmtInfId>minimaal gevuld</PmtInfId>
<PmtMtd>TRF</PmtMtd>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>10.1</CtrlSum>
<ReqdExctnDt>2009-11-01</ReqdExctnDt>
<Dbtr>
<Nm>Naam</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>NL44RABO0123456789</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC>RABONL2U</BIC>
</FinInstnId>
</DbtrAgt>
<CdtTrfTxInf>
<PmtId>
<EndToEndId>non ref</EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="EUR">10.1</InstdAmt>
</Amt>
<ChrgBr>SLEV</ChrgBr>
<CdtrAgt>
<FinInstnId>
<BIC>ABNANL2A</BIC>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>Naam creditor</Nm>
</Cdtr>
<CdtrAcct>
<Id>
<IBAN>NL90ABNA0111111111</IBAN>
</Id>
</CdtrAcct>
<RmtInf>
<Ustrd>vrije tekst</Ustrd>
</RmtInf>
</CdtTrfTxInf>
</PmtInf>
<PmtInf>
<PmtInfId>maximaal gevuld</PmtInfId>
<PmtMtd>TRF</PmtMtd>
<BtchBookg>true</BtchBookg>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>20.2</CtrlSum>
<PmtTpInf>
<InstrPrty>NORM</InstrPrty>
<SvcLvl>
<Cd>SEPA</Cd>
</SvcLvl>
<LclInstrm>
<Cd>IDEAL</Cd>
</LclInstrm>
<CtgyPurp>
<Cd>SECU</Cd>
</CtgyPurp>
</PmtTpInf>
<ReqdExctnDt>2009-11-01</ReqdExctnDt>
<Dbtr>
<Nm>Naam</Nm>
<PstlAdr>
<Ctry>NL</Ctry>
<AdrLine>Debtor straat 1</AdrLine>
<AdrLine>9999 XX Plaats debtor</AdrLine>
</PstlAdr>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>NL44RABO0123456789</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC>RABONL2U</BIC>
</FinInstnId>
</DbtrAgt>
<UltmtDbtr>
<Id>
<OrgId>
<Othr>
<Id>12345678</Id>
<SchmeNm>
<Prtry>klantnummer</Prtry>
</SchmeNm>
<Issr>klantnummer uitgifte instantie</Issr>
</Othr>
</OrgId>
</Id>
</UltmtDbtr>
<ChrgBr>SLEV</ChrgBr>
<CdtTrfTxInf>
<PmtId>
<InstrId>debtor-to-debtor-bank-01</InstrId>
<EndToEndId>End-to-end-id-debtor-to-creditor-01</EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="EUR">20.2</InstdAmt>
</Amt>
<CdtrAgt>
<FinInstnId>
<BIC>ABNANL2A</BIC>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>Naam creditor</Nm>
<PstlAdr>
<Ctry>NL</Ctry>
<AdrLine>Straat creditor 1</AdrLine>
<AdrLine>9999 XX Plaats creditor</AdrLine>
</PstlAdr>
</Cdtr>
<CdtrAcct>
<Id>
<IBAN>NL90ABNA0111111111</IBAN>
</Id>
</CdtrAcct>
<UltmtCdtr>
<Id>
<PrvtId>
<DtAndPlcOfBirth>
<BirthDt>1969-07-03</BirthDt>
<CityOfBirth>PLAATS</CityOfBirth>
<CtryOfBirth>NL</CtryOfBirth>
</DtAndPlcOfBirth>
</PrvtId>
</Id>
</UltmtCdtr>
<Purp>
<Cd>CHAR</Cd>
</Purp>
<RmtInf>
<Strd>
<CdtrRefInf>
<Tp>
<CdOrPrtry>
<Cd>SCOR</Cd>
</CdOrPrtry>
<Issr>CUR</Issr>
</Tp>
<Ref>1234567</Ref>
</CdtrRefInf>
</Strd>
</RmtInf>
</CdtTrfTxInf>
</PmtInf>
</CstmrCdtTrfInitn>
</Document>

View File

@ -1,2 +1,8 @@
Spec for credit transfer:
https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
To validate a SEPA file:
xmllint --schema pain.001.001.03.xsd T200801.xml --noout
To test a SEPA file:
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa

View File

@ -93,6 +93,7 @@ if ($action == 'update' || $action == 'add')
$constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
$constvalue = preg_replace('/:member$/', '', $constvalue);
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
@ -108,26 +109,6 @@ if ($action == 'update' || $action == 'add')
}
}
// Action to enable a submodule of the adherent module
if ($action == 'set')
{
$result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity);
if ($result < 0)
{
print $db->error();
}
}
// Action to disable a submodule of the adherent module
if ($action == 'unset')
{
$result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity);
if ($result < 0)
{
print $db->error();
}
}
/*

View File

@ -324,7 +324,7 @@ $boxactivated = InfoBox::listBoxes($db, 'activated', -1, null);
print "<br>\n";
print "\n\n".'<!-- Boxes Available -->'."\n";
print load_fiche_titre($langs->trans("BoxesAvailable"));
print load_fiche_titre($langs->trans("BoxesAvailable"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
@ -390,7 +390,7 @@ print "\n".'<!-- End Boxes Available -->'."\n";
//var_dump($boxactivated);
print "<br>\n\n";
print load_fiche_titre($langs->trans("BoxesActivated"));
print load_fiche_titre($langs->trans("BoxesActivated"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="tagtable liste">'."\n";
@ -452,7 +452,7 @@ print '<br>';
// Other parameters
print "\n\n".'<!-- Other Const -->'."\n";
print load_fiche_titre($langs->trans("Other"));
print load_fiche_titre($langs->trans("Other"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="addconst">';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -33,6 +33,10 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'aZ09');
if (! in_array('clicktodial', $conf->modules)) {
accessforbidden($langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name")));
}
/*
* Actions
@ -58,6 +62,8 @@ if ($action == 'setvalue' && $user->admin)
* View
*/
$form = new Form($db);
$user->fetch_clicktodial();
$wikihelp = 'EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es';
@ -73,6 +79,7 @@ print '<form method="post" action="clicktodial.php">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setvalue">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -105,6 +112,7 @@ print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__
print '</td></tr>';
print '</table>';
print '</div>';
print '<div class="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -111,6 +111,12 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
foreach ($arrayofimages as $varforimage)
{
if ($_FILES[$varforimage]["name"] && ! preg_match('/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage]["name"])) { // Logo can be used on a lot of different places. Only jpg and png can be supported.
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
break;
}
if ($_FILES[$varforimage]["tmp_name"])
{
$reg = array();
@ -494,10 +500,17 @@ if (!empty($mysoc->logo_mini)) {
print '</div>';
}
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
} else {
print '<div class="inline-block valignmiddle">';
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
print '</div>';
} elseif (!empty($mysoc->logo)) {
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
print '<div class="inline-block valignmiddle">';
print '<img style="max-height: 60px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo).'">';
print '</div>';
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
} else {
print '<div class="inline-block valignmiddle">';
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
print '</div>';
}
}
print '</div>';
print '</td></tr>';
@ -514,10 +527,18 @@ if (!empty($mysoc->logo_squarred_mini)) {
print '</div>';
}
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
} else {
print '<div class="inline-block valignmiddle">';
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
print '</div>';
} elseif (!empty($mysoc->logo_squarred)) {
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo_squarred)) {
print '<div class="inline-block valignmiddle">';
print '<img style="max-height: 60px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo_squarred).'">';
print '</div>';
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
}
else {
print '<div class="inline-block valignmiddle">';
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
print '</div>';
}
}
print '</div>';
print '</td></tr>';

View File

@ -93,7 +93,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup')
print '<br>';
$head = expedition_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending');
dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment');
// Miscellaneous parameters

View File

@ -197,7 +197,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup')
print '<br>';
$head = expedition_admin_prepare_head();
dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending');
dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'shipment');
// Shipment numbering model

View File

@ -76,7 +76,7 @@ print "<br>\n";
$head = expedition_admin_prepare_head();
dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'sending');
dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'shipment');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -77,7 +77,7 @@ print "<br>\n";
$head = expedition_admin_prepare_head();
dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'sending');
dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'shipment');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -187,7 +187,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup')
print '<br>';
$head = expedition_admin_prepare_head();
dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending');
dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment');
// Delivery numbering model

View File

@ -76,7 +76,7 @@ print "<br>\n";
$head = expedition_admin_prepare_head();
dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'sending');
dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'shipment');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -77,7 +77,7 @@ print "<br>\n";
$head = expedition_admin_prepare_head();
dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'sending');
dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'shipment');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -155,20 +155,20 @@ $sourceList = array();
// We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']"
$elementList = array();
if ($conf->propal->enabled) $elementList['propal_send'] = $langs->trans('MailToSendProposal');
if ($conf->commande->enabled) $elementList['order_send'] = $langs->trans('MailToSendOrder');
if ($conf->facture->enabled) $elementList['facture_send'] = $langs->trans('MailToSendInvoice');
if ($conf->propal->enabled && $user->rights->propal->lire) $elementList['propal_send'] = $langs->trans('MailToSendProposal');
if ($conf->commande->enabled && $user->rights->commande->lire) $elementList['order_send'] = $langs->trans('MailToSendOrder');
if ($conf->facture->enabled && $user->rights->facture->lire) $elementList['facture_send'] = $langs->trans('MailToSendInvoice');
if ($conf->expedition->enabled) $elementList['shipping_send'] = $langs->trans('MailToSendShipment');
if ($conf->reception->enabled) $elementList['reception_send'] = $langs->trans('MailToSendReception');
if ($conf->ficheinter->enabled) $elementList['fichinter_send'] = $langs->trans('MailToSendIntervention');
if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send'] = $langs->trans('MailToSendSupplierRequestForQuotation');
if ($conf->fournisseur->enabled && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled) $elementList['order_supplier_send'] = $langs->trans('MailToSendSupplierOrder');
if ($conf->fournisseur->enabled && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_invoice->enabled) $elementList['invoice_supplier_send'] = $langs->trans('MailToSendSupplierInvoice');
if ($conf->societe->enabled) $elementList['thirdparty'] = $langs->trans('MailToThirdparty');
if ($conf->adherent->enabled) $elementList['member'] = $langs->trans('MailToMember');
if ($conf->contrat->enabled) $elementList['contract'] = $langs->trans('MailToSendContract');
if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_order->enabled && $user->rights->supplier_order->lire)) $elementList['order_supplier_send'] = $langs->trans('MailToSendSupplierOrder');
if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_invoice->enabled && $user->rights->supplier_invoice->lire)) $elementList['invoice_supplier_send'] = $langs->trans('MailToSendSupplierInvoice');
if ($conf->societe->enabled && $user->rights->societe->lire) $elementList['thirdparty'] = $langs->trans('MailToThirdparty');
if ($conf->adherent->enabled && $user->rights->adherent->lire) $elementList['member'] = $langs->trans('MailToMember');
if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementList['contract'] = $langs->trans('MailToSendContract');
if ($conf->projet->enabled) $elementList['project'] = $langs->trans('MailToProject');
if ($conf->ticket->enabled) $elementList['ticket_send'] = $langs->trans('MailToTicket');
if ($conf->ticket->enabled && $user->rights->ticket->read) $elementList['ticket_send'] = $langs->trans('MailToTicket');
$elementList['user'] = $langs->trans('MailToUser');
$parameters = array('elementList'=>$elementList);
@ -558,6 +558,7 @@ if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforco
foreach ($fieldsforcontent as $tmpfieldlist)
{
print '<tr class="impair nodrag nodrop nohover"><td colspan="6" class="nobottom">';
// Label
if ($tmpfieldlist == 'topic')
{
@ -571,6 +572,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
if ($tmpfieldlist == 'content_lines')
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
// Input field
if ($tmpfieldlist == 'topic') {
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="'.(!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '').'">';
@ -652,33 +654,34 @@ if ($resql)
// Title line with search boxes
print '<tr class="liste_titre">';
$filterfound = 0;
foreach ($fieldlist as $field => $value)
{
if ($value == 'label') print '<td class="liste_titre"><input type="text" name="search_label" class="maxwidth100" value="'.dol_escape_htmltag($search_label).'"></td>';
elseif ($value == 'lang')
{
if ($value == 'label') {
print '<td class="liste_titre"><input type="text" name="search_label" class="maxwidth100" value="'.dol_escape_htmltag($search_label).'"></td>';
} elseif ($value == 'lang') {
print '<td class="liste_titre">';
print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1, 0, 0, 'maxwidth100');
print '</td>';
}
elseif ($value == 'fk_user')
{
} elseif ($value == 'fk_user') {
print '<td class="liste_titre">';
$restrictid = array();
if (!$user->admin) $restrictid = array($user->id);
//var_dump($restrictid);
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth100');
print '</td>';
}
elseif ($value == 'topic') print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
elseif ($value == 'type_template')
{
} elseif ($value == 'topic') {
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
} elseif ($value == 'type_template') {
print '<td class="liste_titre">'.$form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100 maxwidth100onsmartphone').'</td>';
} elseif (!in_array($value, array('content', 'content_lines'))) {
print '<td class="liste_titre"></td>';
}
elseif (!in_array($value, array('content', 'content_lines'))) print '<td class="liste_titre"></td>';
}
if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print '<td class="liste_titre"></td>';
// Action column
print '<td class="liste_titre right" width="64">';
$searchpicto = $form->showFilterButtons();

View File

@ -153,7 +153,7 @@ print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1);
dol_fiche_head($head, 'handler', '', -1);
print '<span class="opacitymedium">'.$langs->trans("MenusDesc")."</span><br>\n";
print "<br>\n";

View File

@ -235,7 +235,7 @@ $head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1);
dol_fiche_head($head, 'editor', '', -1);
print '<span class="opacitymedium">'.$langs->trans("MenusEditorDesc")."</span><br>\n";
print "<br>\n";

View File

@ -76,7 +76,7 @@ $head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
dol_fiche_head($head, 'misc', '', -1);
// Other Options

View File

@ -272,7 +272,7 @@ print '<div class="centpercent">';
$picto = 'object_'.$objMod->picto;
print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto);
print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto, 0, '', 'titlemodulehelp');
print '<br>';
dol_fiche_head($head, $mode, '', -1);

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php';
// Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "modulebuilder"));
$mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : 'commonkanban';
$mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : (empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common');
if (empty($mode)) $mode = 'common';
$action = GETPOST('action', 'alpha');
//var_dump($_POST);exit;

View File

@ -65,13 +65,13 @@ if (!function_exists('gzdecode')) {
}
}
/*
* Action
*/
if ($action == 'addprinter' && $user->admin) {
$error = 0;
$db->begin();
if (empty($printername)) {
$error++;
setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors');
@ -82,7 +82,8 @@ if ($action == 'addprinter' && $user->admin) {
}
if (!$error) {
$result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
$db->begin();
$result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
if ($result > 0) $error++;
if (!$error)
@ -101,14 +102,14 @@ if ($action == 'addprinter' && $user->admin) {
if ($action == 'deleteprinter' && $user->admin) {
$error = 0;
$db->begin();
if (empty($printerid)) {
$error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
}
if (!$error) {
$result = $printer->deletePrinter($printerid);
$db->begin();
$result = $printer->deletePrinter($printerid);
if ($result > 0) $error++;
if (!$error)
@ -127,14 +128,14 @@ if ($action == 'deleteprinter' && $user->admin) {
if ($action == 'updateprinter' && $user->admin) {
$error = 0;
$db->begin();
if (empty($printerid)) {
$error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
}
if (!$error) {
$result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
$db->begin();
$result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
if ($result > 0) $error++;
if (!$error) {
@ -193,14 +194,14 @@ if ($action == 'testtemplate' && $user->admin) {
if ($action == 'updatetemplate' && $user->admin) {
$error = 0;
$db->begin();
if (empty($templateid)) {
$error++;
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
}
if (!$error) {
$result = $printer->updateTemplate($templatename, $template, $templateid);
$db->begin();
$result = $printer->updateTemplate($templatename, $template, $templateid);
if ($result > 0) $error++;
if (!$error) {
@ -216,14 +217,14 @@ if ($action == 'updatetemplate' && $user->admin) {
if ($action == 'addtemplate' && $user->admin) {
$error = 0;
$db->begin();
if (empty($templatename)) {
$error++;
setEventMessages($langs->trans("TemplateNameEmpty"), null, 'errors');
}
if (!$error) {
$result = $printer->addTemplate($templatename, $template);
$db->begin();
$result = $printer->addTemplate($templatename, $template);
if ($result > 0) $error++;
if (!$error) {
@ -237,6 +238,29 @@ if ($action == 'addtemplate' && $user->admin) {
$action = '';
}
if ($action == 'deletetemplate' && $user->admin) {
$error = 0;
if (empty($templateid)) {
$error++;
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
}
if (!$error) {
$db->begin();
$result = $printer->deleteTemplate($templateid);
if ($result > 0) $error++;
if (!$error) {
$db->commit();
setEventMessages($langs->trans("TemplateDeleted", $templatename), null);
} else {
$db->rollback();
dol_print_error($db);
}
}
$action = '';
}
/*
* View
@ -251,6 +275,7 @@ print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_s
$head = receiptprinteradmin_prepare_head($mode);
// mode = config
if ($mode == 'config' && $user->admin) {
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -263,7 +288,7 @@ if ($mode == 'config' && $user->admin) {
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
print $langs->trans("ReceiptPrinterDesc")."<br><br>\n";
print '<span class="opacitymedium">'.$langs->trans("ReceiptPrinterDesc")."</span><br><br>\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre">';
@ -276,6 +301,22 @@ if ($mode == 'config' && $user->admin) {
$ret = $printer->listprinters();
$nbofprinters = count($printer->listprinters);
if ($action != 'editprinter') {
print '<tr>';
print '<td><input size="50" type="text" name="printername"></td>';
$ret = $printer->selectTypePrinter();
print '<td>'.$printer->resprint.'</td>';
$ret = $printer->selectProfilePrinter();
print '<td>'.$printer->profileresprint.'</td>';
print '<td><input size="60" type="text" name="parameter"></td>';
print '<td class="right">';
if ($action != 'editprinter') {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
}
print '</td>';
print '</tr>';
}
if ($ret > 0) {
setEventMessages($printer->error, $printer->errors, 'errors');
} else {
@ -289,7 +330,9 @@ if ($mode == 'config' && $user->admin) {
$ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
print '<td>'.$printer->profileresprint.'</td>';
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
print '<td></td>';
print '<td>';
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
print '</td>';
print '</tr>';
} else {
print '<td>'.$printer->listprinters[$line]['name'].'</td>';
@ -297,15 +340,15 @@ if ($mode == 'config' && $user->admin) {
print '<td>'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).'</td>';
print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
// edit icon
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=editprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'">';
print '<td class="right"><a class="editfielda marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=editprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'">';
print img_picto($langs->trans("Edit"), 'edit');
print '</a>';
// delete icon
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=deleteprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'&amp;printername='.$printer->listprinters[$line]['name'].'">';
print '<a class="marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=deleteprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'&amp;printername='.$printer->listprinters[$line]['name'].'">';
print img_picto($langs->trans("Delete"), 'delete');
print '</a>';
// test icon
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=testprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'&amp;printername='.$printer->listprinters[$line]['name'].'">';
print '<a class="marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&amp;action=testprinter&amp;printerid='.$printer->listprinters[$line]['rowid'].'&amp;printername='.$printer->listprinters[$line]['name'].'">';
print img_picto($langs->trans("TestPrinter"), 'printer');
print '</a></td>';
print '</tr>';
@ -313,38 +356,10 @@ if ($mode == 'config' && $user->admin) {
}
}
if ($action != 'editprinter') {
if ($nbofprinters > 0) {
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Type").'</th>';
print '<th>'.$langs->trans("Profile").'</th>';
print '<th>'.$langs->trans("Parameters").'</th>';
print '<th></th>';
print "</tr>\n";
}
print '<tr>';
print '<td><input size="50" type="text" name="printername"></td>';
$ret = $printer->selectTypePrinter();
print '<td>'.$printer->resprint.'</td>';
$ret = $printer->selectProfilePrinter();
print '<td>'.$printer->profileresprint.'</td>';
print '<td><input size="60" type="text" name="parameter"></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
}
print '</table>';
dol_fiche_end();
if ($action != 'editprinter') {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
} else {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
}
print '</form>';
print '<br>';
@ -374,8 +389,11 @@ if ($mode == 'config' && $user->admin) {
print '</table>';
}
// mode = template
if ($mode == 'template' && $user->admin) {
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
print '<input type="hidden" name="token" value="'.newToken().'">';
if ($action != 'edittemplate') {
print '<input type="hidden" name="action" value="addtemplate">';
@ -383,16 +401,11 @@ if ($mode == 'template' && $user->admin) {
print '<input type="hidden" name="action" value="updatetemplate">';
}
print load_fiche_titre($langs->trans("ReceiptPrinterTemplateDesc"), '', '')."<br><br>\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Template").'</th>';
print '<th></th>';
print '<th></th>';
print '<th></th>';
print "</tr>\n";
$ret = $printer->listPrintersTemplates();
//print '<pre>'.print_r($printer->listprinterstemplates, true).'</pre>';
@ -405,22 +418,23 @@ if ($mode == 'template' && $user->admin) {
if ($action == 'edittemplate' && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
print '<td><textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
print '<td>';
print '<textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
print '</td>';
print '<td></td>';
} else {
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
print '<td>'.nl2br(htmlentities($printer->listprinterstemplates[$line]['template'])).'</td>';
// edit icon
print '<td><a class="editfielda paddingleftonly paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=edittemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
print '<td><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=edittemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
print img_picto($langs->trans("Edit"), 'edit');
print '</a>';
// delete icon
print '<a class="paddingleftonly paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=deletetemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'&amp;templatename='.$printer->listprinterstemplates[$line]['name'].'">';
print '<a class="paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=deletetemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'&amp;templatename='.$printer->listprinterstemplates[$line]['name'].'">';
print img_picto($langs->trans("Delete"), 'delete');
print '</a>';
// test icon
print '<a class="paddingleftonly paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=testtemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'&amp;templatename='.$printer->listprinterstemplates[$line]['name'].'">';
print '<a class="paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&amp;action=testtemplate&amp;templateid='.$printer->listprinterstemplates[$line]['rowid'].'&amp;templatename='.$printer->listprinterstemplates[$line]['name'].'">';
print img_picto($langs->trans("TestPrinterTemplate"), 'printer');
print '</a></td>';
}
@ -428,20 +442,30 @@ if ($mode == 'template' && $user->admin) {
}
}
print '</table>';
if ($action != 'edittemplate') {
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
print '<tr>';
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
print '<td><textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
print '<td>';
print '<textarea name="template" wrap="soft" cols="120" rows="12">';
print GETPOSTISSET('template') ? GETPOST('template', 'alpha') : $printer->listprinterstemplates[$line]['template'];
print '</textarea>';
print '</td>';
print '<td></td>';
print '</tr>';
}
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
print '</table>';
if ($action != 'edittemplate') {
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
} else {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
}
print '</form>';
dol_fiche_end();
print '<br>';
print '<table class="noborder centpercent">'."\n";

View File

@ -28,7 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php';
if (!empty($conf->resouce->enabled)) require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "resource"));

View File

@ -28,21 +28,27 @@ require '../../main.inc.php';
$langs->load("admin");
if (!$user->admin)
if (!$user->admin) {
accessforbidden();
}
$action = GETPOST('action', 'alpha');
if ($action == 'convert')
{
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
$db->query($sql);
}
if ($action == 'convertutf8')
{
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
$db->query($sql);
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
$db->query($sql);
}
if ($action == 'convertdynamic')
{
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ROW_FORMAT=DYNAMIC;";
$db->query($sql);
}
@ -87,8 +93,8 @@ else
{
if ($base == 1)
{
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TableName").'</td>';
print '<td colspan="2">'.$langs->trans("Type").'</td>';
@ -119,13 +125,19 @@ else
print '<td>'.$obj->Engine.'</td>';
if (isset($obj->Engine) && $obj->Engine == "MyISAM")
{
print '<td><a class="reposition" href="database-tables.php?action=convert&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDB</a></td>';
print '<td><a class="reposition" href="database-tables.php?action=convert&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDb</a></td>';
}
else
{
print '<td>&nbsp;</td>';
}
print '<td>'.$obj->Row_format.'</td>';
print '<td>';
print $obj->Row_format;
if (isset($obj->Row_format) && (in_array($obj->Row_format, array("Compact"))))
{
print '<br><a class="reposition" href="database-tables.php?action=convertdynamic&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' Dynamic</a>';
}
print '</td>';
print '<td align="right">'.$obj->Rows.'</td>';
print '<td align="right">'.$obj->Avg_row_length.'</td>';
print '<td align="right">'.$obj->Data_length.'</td>';
@ -136,7 +148,7 @@ else
print '<td align="right">'.$obj->Collation;
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci"))))
{
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
}
print '</td>';
print '</tr>';
@ -149,8 +161,8 @@ else
if ($base == 2)
{
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TableName").'</td>';
print '<td>Nb of tuples</td>';
@ -189,8 +201,8 @@ else
if ($base == 4)
{
// Sqlite by PDO or by Sqlite3
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TableName").'</td>';
print '<td>'.$langs->trans("NbOfRecord").'</td>';

View File

@ -241,7 +241,8 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />';
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
print '</legend>';
print '<input type="checkbox" name="drop"'.(((!isset($_GET["drop"]) && !isset($_POST["drop"])) || GETPOST('drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
print '<input type="checkbox" name="drop"'.((! GETPOSTISSET("drop") || GETPOST('drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>';
print '</fieldset>';

View File

@ -40,7 +40,7 @@ $transkey = GETPOST('transkey', 'alphanohtml');
$transvalue = GETPOST('transvalue', 'none');
$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'overwrite';
$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'searchkey';
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@ -514,7 +514,7 @@ if ($mode == 'searchkey')
if ($i > ($offset + $limit)) break;
print '<tr class="oddeven"><td>'.$langcode.'</td><td>'.$key.'</td><td>';
print dol_escape_htmltag($val);
print '</td><td class="right">';
print '</td><td class="right nowraponall">';
if (!empty($newlangfileonly->tab_translate[$key]))
{
if ($val != $newlangfileonly->tab_translate[$key])
@ -534,7 +534,7 @@ if ($mode == 'searchkey')
print ' ';
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=delete">'.img_delete().'</a>';
print '&nbsp;&nbsp;';
$htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
$htmltext = $langs->trans("OriginalValueWas", '<i>'.$newlangfileonly->tab_translate[$key].'</i>');
print $form->textwithpicto('', $htmltext, 1, 'info');
}
elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
@ -549,7 +549,7 @@ if ($mode == 'searchkey')
//$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key;
$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key;
print ' &nbsp; <a href="'.$transifexurl.'" target="transifex">'.img_picto('FixOnTransifex', 'globe').'</a>';
print ' &nbsp; <a href="'.$transifexurl.'" target="transifex">'.img_picto($langs->trans('FixOnTransifex'), 'globe').'</a>';
}
}
else

View File

@ -254,15 +254,17 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
if ($tmpmodule != 'api')
$tmpmodule = preg_replace('/api$/i', '', $tmpmodule);
$classfile = str_replace('_', '', $tmpmodule);
if ($module == 'supplierproposals')
// Special cases that does not match name rules conventions
if ($moduleobject == 'supplierproposals')
$classfile = 'supplier_proposals';
if ($module == 'supplierorders')
if ($moduleobject == 'supplierorders')
$classfile = 'supplier_orders';
if ($module == 'supplierinvoices')
if ($moduleobject == 'supplierinvoices')
$classfile = 'supplier_invoices';
if ($module == 'ficheinter')
if ($moduleobject == 'ficheinter')
$classfile = 'interventions';
if ($module == 'interventions')
if ($moduleobject == 'interventions')
$classfile = 'interventions';
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php', 0, 2);

View File

@ -132,7 +132,7 @@ if ($object->id > 0)
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/bom/myobject_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.dol_buildpath('/bom/bom_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
/*

View File

@ -945,6 +945,7 @@ class BOM extends CommonObject
global $conf, $langs;
$langs->load("mrp");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'standard';

View File

@ -151,6 +151,7 @@ if ($action == 'create')
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print load_fiche_titre($langs->trans("NewBookmark"));

View File

@ -158,7 +158,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer));
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);

View File

@ -6,8 +6,8 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -1105,6 +1105,7 @@ if ($action == 'create')
print '<input type="hidden" name="origin" size="10" value="'.GETPOST('origin').'">';
}
$reg = array();
if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg))
{
$object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]);

View File

@ -529,6 +529,7 @@ if ($object->id > 0)
print "</table>";
// Prospection level and status
if ($object->client == 2 || $object->client == 3)
{
print '<br>';
@ -541,7 +542,7 @@ if ($object->id > 0)
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('ProspectLevel');
print '<td>';
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editlevel')
@ -564,7 +565,7 @@ if ($object->id > 0)
{
$titlealt = 'default';
if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label'];
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt, $val['code']).'</a>';
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus reposition" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt, $val['code']).'</a>';
}
print '</div></td></tr>';
print "</table>";
@ -1146,7 +1147,7 @@ if ($object->id > 0)
}
/*
* Last invoices
* Latest invoices
*/
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{

View File

@ -236,6 +236,7 @@ if (empty($reshook))
$outputlangs->setDefaultLang($newlang);
}
$ret = $object->fetch($id); // Reload to get new records
if ($ret > 0) $object->fetch_thirdparty();
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
@ -803,6 +804,7 @@ if (empty($reshook))
$outputlangs->setDefaultLang($newlang);
}
$ret = $object->fetch($id); // Reload to get new records
if ($ret > 0) $object->fetch_thirdparty();
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
@ -1284,6 +1286,7 @@ if (empty($reshook))
$outputlangs->setDefaultLang($newlang);
}
$ret = $object->fetch($id); // Reload to get new records
if ($ret > 0) $object->fetch_thirdparty();
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}

View File

@ -3787,6 +3787,7 @@ class Propal extends CommonObject
global $conf, $langs;
$langs->load("propale");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'azur';

View File

@ -3990,6 +3990,7 @@ class Commande extends CommonOrder
global $conf, $langs;
$langs->load("orders");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'einstein';

View File

@ -116,7 +116,7 @@ $hookmanager->initHooks(array('orderlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('commande');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// List of fields to search into when doing a "search in all"

View File

@ -423,7 +423,7 @@ class Facture extends CommonInvoice
$this->brouillon = 1;
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
{
@ -4402,6 +4402,7 @@ class Facture extends CommonInvoice
global $conf, $langs;
$langs->load("bills");
$outputlangs->load("products");
if (!dol_strlen($modele))
{

View File

@ -53,6 +53,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inv
$socid = GETPOST('socid', 'int');
$socid = GETPOST('socid', 'int');
// Security check
$id = (GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'));
$lineid = GETPOST('lineid', 'int');
@ -106,7 +108,7 @@ $hookmanager->initHooks(array('invoicereclist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('facture_rec');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
@ -151,6 +153,11 @@ if ($socid > 0) {
}
if ($socid > 0) {
$tmpthirdparty = new Societe($db);
$res = $tmpthirdparty->fetch($socid);
if ($res > 0) $search_societe = $tmpthirdparty->name;
}
/*
* Actions

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
@ -150,7 +150,7 @@ $hookmanager->initHooks(array('invoicelist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('facture');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
@ -554,6 +554,8 @@ if (!$sall)
$sql .= ' f.paye, f.fk_statut, f.close_code,';
$sql .= ' f.datec, f.tms, f.date_closing,';
$sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
$sql .= ' f.fk_user_author, f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva,';
$sql .= ' f.multicurrency_total_tva, f.multicurrency_total_ttc,';
$sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
$sql .= ' typent.code,';
$sql .= ' state.code_departement, state.nom,';
@ -842,12 +844,15 @@ if ($resql)
{
print '<td class="liste_titre center">';
print '<div class="nowrap">';
/*
print $langs->trans('From').' ';
print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to').' ';
print $langs->trans('to').' ';*/
print $langs->trans("Before").' ';
print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1);
print '<br><input type="checkbox" name="search_option" value="late"'.($option == 'late' ? ' checked' : '').'> '.$langs->trans("Alert");
print '</div>';
print '</td>';
}
@ -1458,7 +1463,7 @@ if ($resql)
{
$userstatic->id = $obj->fk_user_author;
$userstatic->login = $obj->login;
print '<td align="center">';
print '<td class="center tdoverflowmax100">';
if ($userstatic->id) print $userstatic->getLoginUrl(1);
else print '&nbsp;';
print "</td>\n";

View File

@ -38,8 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
if (!$user->rights->facture->lire) accessforbidden();
// Load translation files required by the page
$langs->loadLangs(array('bills', 'banks', 'withdrawals', 'companies'));
@ -51,7 +49,6 @@ $type = GETPOST('type', 'aZ09');
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
if ($type == 'bank-transfer') {
$object = new FactureFournisseur($db);
@ -63,6 +60,7 @@ if ($type == 'bank-transfer') {
if ($id > 0 || !empty($ref))
{
$ret = $object->fetch($id, $ref);
$isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
if ($ret > 0)
{
$object->fetch_thirdparty();
@ -71,6 +69,13 @@ if ($id > 0 || !empty($ref))
$hookmanager->initHooks(array('directdebitcard', 'globalcard'));
if ($type == 'bank-transfer') {
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', $fieldid, $isdraft);
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
} else {
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
if (!$user->rights->facture->lire) accessforbidden();
}
/*

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
@ -161,6 +161,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$reshook = $hookmanager->executeHooks('printFieldListWhereCustomerDraft', $parameters);
$sql .= $hookmanager->resPrint;
$sql.= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, ";
$sql.= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
// Add Group from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListGroupByCustomerDraft', $parameters);
$sql .= $hookmanager->resPrint;
$resql = $db->query($sql);
if ($resql)
@ -470,7 +478,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$sql .= $hookmanager->resPrint;
$sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye,";
$sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur";
$sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email";
$sql .= " ORDER BY ff.tms DESC ";
$sql .= $db->plimit($max, 0);

View File

@ -68,7 +68,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
$thirdpartystatic = new Societe($db);
$invoicestatic = new Facture($db);
$invoicestatic = new FactureFournisseur($db);
$bprev = new BonPrelevement($db);
print '<div class="div-table-responsive-no-min">';
@ -94,7 +94,7 @@ print '</td></tr></table></div><br>';
*/
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
$sql .= " pfd.date_demande, pfd.amount,";
$sql .= " s.nom as name, s.email, s.rowid as socid";
$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -138,13 +138,14 @@ if ($resql)
$thirdpartystatic->id = $obj->socid;
$thirdpartystatic->name = $obj->name;
$thirdpartystatic->email = $obj->email;
$thirdpartystatic->tva_intra = $obj->tva_intra;
print '<tr class="oddeven"><td>';
print $invoicestatic->getNomUrl(1, 'withdraw');
print '</td>';
print '<td>';
print $thirdpartystatic->getNomUrl(1, 'customer');
print $thirdpartystatic->getNomUrl(1, 'supplier');
print '</td>';
print '<td class="right">';

View File

@ -31,10 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'bills', 'withdrawals'));
if (!$user->rights->prelevement->bons->lire)
accessforbidden();
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals'));
// Security check
if ($user->socid > 0) accessforbidden();
@ -44,7 +41,6 @@ $action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int');
$type = GETPOST('type', 'aZ09');
// Load variable for pagination
@ -67,6 +63,13 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') {
accessforbidden();
}
if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') {
accessforbidden();
}
/*
* Actions
@ -83,7 +86,11 @@ if (empty($reshook))
$res = $object->delete($user);
if ($res > 0)
{
header("Location: index.php");
if ($object->type == 'bank-transfer') {
header("Location: ".DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php');
} else {
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/index.php');
}
exit;
}
}
@ -139,11 +146,9 @@ if (empty($reshook))
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$error = $object->set_infocredit($user, $dt);
if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -174,7 +179,7 @@ if ($id > 0 || $ref)
}*/
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php'.($object->type != 'bank-transfer' ? '' : '?type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
@ -200,7 +205,7 @@ if ($id > 0 || $ref)
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
print dol_print_date($object->date_trans, 'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
print $object->methodes_trans[$object->method_trans];
print '</td></tr>';
@ -223,7 +228,9 @@ if ($id > 0 || $ref)
$result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
print '<tr><td class="titlefield">';
print $langs->trans("BankToReceiveWithdraw");
$labelofbankfield = "BankToReceiveWithdraw";
if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
print $langs->trans($labelofbankfield);
print '</td>';
print '<td>';
if ($acc->id > 0)
@ -232,9 +239,13 @@ if ($id > 0 || $ref)
print '</tr>';
print '<tr><td class="titlefield">';
print $langs->trans("WithdrawalFile").'</td><td>';
$labelfororderfield = 'WithdrawalFile';
if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
print $langs->trans($labelfororderfield).'</td><td>';
$relativepath = 'receipts/'.$object->ref.'.xml';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
$modulepart = 'prelevement';
if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
print '</div>';

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,7 @@ class LignePrelevement
$langs->load("withdrawals");
$this->statuts[0] = $langs->trans("StatusWaiting");
$this->statuts[2] = $langs->trans("StatusCredited");
$this->statuts[2] = $langs->trans("StatusPaid");
$this->statuts[3] = $langs->trans("StatusRefused");
}

View File

@ -88,12 +88,9 @@ if (empty($reshook))
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty (we don't use them anymore)
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate, 0, $type);
if ($result < 0)
{
if ($result < 0) {
setEventMessages($bprev->error, $bprev->errors, 'errors');
}
elseif ($result == 0)
{
} elseif ($result == 0) {
$mesg = $langs->trans("NoInvoiceCouldBeWithdrawed", $format);
setEventMessages($mesg, null, 'errors');
$mesg .= '<br>'."\n";
@ -101,10 +98,12 @@ if (empty($reshook))
{
$mesg .= '<span class="warning">'.$val."</span><br>\n";
}
}
else
{
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
} else {
if ($type != 'bank-transfer') {
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
} else {
setEventMessages($langs->trans("CreditTransferOrderCreated", $bprev->getNomUrl(1)), null);
}
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id);
exit;
@ -375,10 +374,15 @@ if ($resql)
// RUM
print '<td>';
print $thirdpartystatic->display_rib('rum');
$format = $thirdpartystatic->display_rib('format');
if ($type != 'bank-transfer') {
if ($format) print ' ('.$format.')';
$rumtoshow = $thirdpartystatic->display_rib('rum');
if ($rumtoshow) {
print $rumtoshow;
$format = $thirdpartystatic->display_rib('format');
if ($type != 'bank-transfer') {
if ($format) print ' ('.$format.')';
}
} else {
print img_warning($langs->trans("NoBankAccount"));
}
print '</td>';
// Amount

View File

@ -107,14 +107,17 @@ if ($type != 'bank-transfer') {
llxHeader('', $title);
$thirdpartystatic = new Societe($db);
$invoicestatic = new Facture($db);
if ($type == 'bank-transfer') {
$invoicestatic = new FactureFournisseur($db);
} else {
$invoicestatic = new Facture($db);
}
// List of requests
$sql = "SELECT f.ref, f.rowid, f.total_ttc,";
$sql .= " s.nom as name, s.rowid as socid,";
$sql .= " pfd.date_demande as date_demande,";
$sql .= " pfd.fk_user_demande";
$sql .= " pfd.date_demande as date_demande, pfd.amount, pfd.fk_user_demande";
if ($type != 'bank-transfer') {
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
} else {
@ -128,6 +131,7 @@ $sql .= " AND f.entity IN (".getEntity('invoice').")";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
if (!$status) $sql .= " AND pfd.traite = 0";
$sql .= " AND pfd.ext_payment_id IS NULL";
if ($status) $sql .= " AND pfd.traite = ".$status;
$sql .= " AND f.total_ttc > 0";
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
@ -143,7 +147,6 @@ if ($search_facture) $sql .= natural_search("f.ref", $search_facture);
if ($search_societe) $sql .= natural_search("s.nom", $search_societe);
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -175,9 +178,9 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
$newcardbutton = '<a class="marginrightonly" href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
if ($type == 'bank-transfer') {
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php">'.$langs->trans("Back").'</a>';
$newcardbutton = '<a class="marginrightonly" href="'.DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php">'.$langs->trans("Back").'</a>';
}
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="searchFormList" name="searchFormList">';
@ -192,6 +195,14 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$param = '';
$label = 'NewStandingOrder';
$typefilter = '';
if ($type == 'bank-transfer') {
$label = 'NewPaymentByBankTransfer';
$typefilter = 'type='.$type;
}
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'.($typefilter ? '?'.$typefilter : ''));
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
print '<table class="liste centpercent">';
@ -199,7 +210,7 @@ print '<table class="liste centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right ');
print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right ');
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center ');
print_liste_field_titre('');
print '</tr>';
@ -222,12 +233,12 @@ while ($i < min($num, $limit))
$obj = $db->fetch_object($resql);
if (empty($obj)) break; // Should not happen
$invoicestatic->fetch($obj->rowid);
print '<tr class="oddeven">';
// Ref facture
print '<td>';
$invoicestatic->id = $obj->rowid;
$invoicestatic->ref = $obj->ref;
print $invoicestatic->getNomUrl(1, 'withdraw');
print '</td>';
@ -237,7 +248,9 @@ while ($i < min($num, $limit))
print $thirdpartystatic->getNomUrl(1, 'customer');
print '</td>';
print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td class="right">';
print price($obj->amount, 1, $langs, 1, -1, -1, $conf->currency).' / '.price($obj->total_ttc, 1, $langs, 1, -1, -1, $conf->currency);
print '</td>';
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';

View File

@ -32,21 +32,21 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'companies', 'withdrawals', 'bills'));
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals'));
// Securite acces client
if ($user->socid > 0) accessforbidden();
// Get supervariables
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
$ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int');
$type = GETPOST('type', 'aZ09');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
@ -57,6 +57,17 @@ if (!$sortorder) $sortorder = 'DESC';
$object = new BonPrelevement($db);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') {
accessforbidden();
}
if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') {
accessforbidden();
}
/*
@ -75,19 +86,17 @@ if ($id > 0 || $ref)
$head = prelevement_prepare_head($object);
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php'.($object->type != 'bank-transfer' ? '' : '?type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">';
print '<table class="border centpercent tableforfield">'."\n";
//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>';
// Status
//print '<tr><td>'.$langs->trans('Status').'</td><td>'.$object->getLibStatut(1).'</td></tr>';
if ($object->date_trans <> 0)
{
@ -96,7 +105,7 @@ if ($id > 0 || $ref)
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
print dol_print_date($object->date_trans, 'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
print $object->methodes_trans[$object->method_trans];
print '</td></tr>';
@ -119,7 +128,9 @@ if ($id > 0 || $ref)
$result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
print '<tr><td class="titlefield">';
print $langs->trans("BankToReceiveWithdraw");
$labelofbankfield = "BankToReceiveWithdraw";
if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
print $langs->trans($labelofbankfield);
print '</td>';
print '<td>';
if ($acc->id > 0)
@ -128,9 +139,13 @@ if ($id > 0 || $ref)
print '</tr>';
print '<tr><td class="titlefield">';
print $langs->trans("WithdrawalFile").'</td><td>';
$labelfororderfield = 'WithdrawalFile';
if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
print $langs->trans($labelfororderfield).'</td><td>';
$relativepath = 'receipts/'.$object->ref.'.xml';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
$modulepart = 'prelevement';
if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
print '</div>';
@ -145,19 +160,31 @@ if ($id > 0 || $ref)
// List of invoices
$sql = "SELECT pf.rowid,";
$sql = "SELECT pf.rowid, p.type,";
$sql .= " f.rowid as facid, f.ref as ref, f.total_ttc,";
$sql .= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql .= ", ".MAIN_DB_PREFIX."prelevement_facture as pf";
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
if ($object->type != 'bank-transfer') {
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
} else {
$sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f";
}
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid";
$sql .= " AND pl.fk_prelevement_bons = p.rowid";
$sql .= " AND f.fk_soc = s.rowid";
$sql .= " AND pf.fk_facture = f.rowid";
$sql .= " AND f.entity IN (".getEntity('invoice').")";
if ($object->type != 'bank-transfer') {
$sql .= " AND pf.fk_facture = f.rowid";
} else {
$sql .= " AND pf.fk_facture_fourn = f.rowid";
}
if ($object->type != 'bank-transfer') {
$sql .= " AND f.entity IN (".getEntity('invoice').")";
} else {
$sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
}
if ($object->id > 0) $sql .= " AND p.rowid=".$object->id;
if ($socid) $sql .= " AND s.rowid = ".$socid;
$sql .= $db->order($sortfield, $sortorder);
@ -166,8 +193,8 @@ $sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
@ -177,10 +204,10 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql .= $db->plimit($limit + 1, $offset);
$result = $db->query($sql);
if ($result)
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($result);
$num = $db->num_rows($resql);
$i = 0;
$param = "&id=".$id;
@ -209,22 +236,28 @@ if ($result)
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("AmountInvoice", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "pl.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("StatusDebitCredit", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre('');
print "</tr>\n";
$totalinvoices = 0;
$totalamount_requested = 0;
$invoicetmpcustomer = new Facture($db);
$invoicetmpsupplier = new FactureFournisseur($db);
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
$obj = $db->fetch_object($resql);
$invoicetmp->id = $obj->facid;
$invoicetmp->ref = $obj->ref;
if ($obj->type == 'bank-transfer') {
$invoicetmp = $invoicetmpsupplier;
} else {
$invoicetmp = $invoicetmpcustomer;
}
$invoicetmp->fetch($obj->facid);
$thirdpartytmp->id = $obj->socid;
$thirdpartytmp->name = $obj->name;
$thirdpartytmp->fetch($obj->socid);
print '<tr class="oddeven">';
@ -251,7 +284,11 @@ if ($result)
}
elseif ($obj->statut == 2)
{
print $langs->trans("StatusCredited");
if ($obj->type == 'bank-transfer') {
print $langs->trans("StatusDebited");
} else {
print $langs->trans("StatusCredited");
}
}
elseif ($obj->statut == 3)
{
@ -290,7 +327,7 @@ if ($result)
print "</table>";
print '</div>';
$db->free($result);
$db->free($resql);
}
else
{

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/compta/prelevement/fiche-rejet.php
* \ingroup prelevement
* \brief Withdraw reject
* \brief Debit order or credit transfer reject
*/
require '../../main.inc.php';
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
$langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills'));
// Securite acces client
// Security check
if ($user->socid > 0) accessforbidden();
// Get supervariables
@ -55,6 +55,15 @@ $pagenext = $page + 1;
$object = new BonPrelevement($db);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') {
accessforbidden();
}
if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') {
accessforbidden();
}
@ -71,7 +80,7 @@ if ($prev_id > 0 || $ref)
$head = prelevement_prepare_head($object);
dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php'.($object->type != 'bank-transfer' ? '' : '?type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
@ -83,13 +92,6 @@ if ($prev_id > 0 || $ref)
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>';
// Status
/*
print '<tr><td>'.$langs->trans('Status').'</td>';
print '<td>'.$object->getLibStatut(1).'</td>';
print '</tr>';
*/
if ($object->date_trans <> 0)
{
$muser = new User($db);
@ -97,7 +99,7 @@ if ($prev_id > 0 || $ref)
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
print dol_print_date($object->date_trans, 'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
print $object->methodes_trans[$object->method_trans];
print '</td></tr>';
@ -120,7 +122,9 @@ if ($prev_id > 0 || $ref)
$result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
print '<tr><td class="titlefield">';
print $langs->trans("BankToReceiveWithdraw");
$labelofbankfield = "BankToReceiveWithdraw";
if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
print $langs->trans($labelofbankfield);
print '</td>';
print '<td>';
if ($acc->id > 0)
@ -129,9 +133,13 @@ if ($prev_id > 0 || $ref)
print '</tr>';
print '<tr><td class="titlefield">';
print $langs->trans("WithdrawalFile").'</td><td>';
$labelfororderfield = 'WithdrawalFile';
if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
print $langs->trans($labelfororderfield).'</td><td>';
$relativepath = 'receipts/'.$object->ref.'.xml';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
$modulepart = 'prelevement';
if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
print '</div>';
@ -144,6 +152,7 @@ if ($prev_id > 0 || $ref)
}
}
$rej = new RejetPrelevement($db, $user);
/*
@ -225,7 +234,7 @@ if ($resql)
}
else
{
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
if ($num > 0)

View File

@ -20,7 +20,7 @@
/**
* \file htdocs/compta/prelevement/fiche-stat.php
* \ingroup prelevement
* \brief Prelevement statistics
* \brief Debit order or credit transfer statistics
*/
require '../../main.inc.php';
@ -54,6 +54,17 @@ $pagenext = $page + 1;
$object = new BonPrelevement($db);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') {
accessforbidden();
}
if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') {
accessforbidden();
}
/*
* View
@ -68,7 +79,7 @@ if ($prev_id > 0 || $ref)
$head = prelevement_prepare_head($object);
dol_fiche_head($head, 'statistics', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php'.($object->type != 'bank-transfer' ? '' : '?type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
@ -80,13 +91,6 @@ if ($prev_id > 0 || $ref)
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>';
// Status
/*
print '<tr><td>'.$langs->trans('Status').'</td>';
print '<td>'.$object->getLibStatut(1).'</td>';
print '</tr>';
*/
if ($object->date_trans <> 0)
{
$muser = new User($db);
@ -94,7 +98,7 @@ if ($prev_id > 0 || $ref)
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
print dol_print_date($object->date_trans, 'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
print $object->methodes_trans[$object->method_trans];
print '</td></tr>';
@ -117,7 +121,9 @@ if ($prev_id > 0 || $ref)
$result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
print '<tr><td class="titlefield">';
print $langs->trans("BankToReceiveWithdraw");
$labelofbankfield = "BankToReceiveWithdraw";
if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
print $langs->trans($labelofbankfield);
print '</td>';
print '<td>';
if ($acc->id > 0)
@ -126,9 +132,13 @@ if ($prev_id > 0 || $ref)
print '</tr>';
print '<tr><td class="titlefield">';
print $langs->trans("WithdrawalFile").'</td><td>';
$labelfororderfield = 'WithdrawalFile';
if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
print $langs->trans($labelfororderfield).'</td><td>';
$relativepath = 'receipts/'.$object->ref.'.xml';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
$modulepart = 'prelevement';
if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
print '</div>';
@ -137,14 +147,13 @@ if ($prev_id > 0 || $ref)
}
else
{
$langs->load("errors");
print $langs->trans("Error");
dol_print_error($db);
}
/*
* Stats
*/
$ligne = new LignePrelevement($db);
$line = new LignePrelevement($db);
$sql = "SELECT sum(pl.amount), pl.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
@ -170,7 +179,7 @@ if ($prev_id > 0 || $ref)
print '<tr class="oddeven"><td>';
print $ligne->LibStatut($row[1], 1);
print $line->LibStatut($row[1], 1);
print '</td><td class="right">';
print price($row[0]);

View File

@ -143,7 +143,7 @@ $hookmanager->initHooks(array('contactlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('contact');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
@ -200,7 +200,13 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
if (!empty($extrafields->attributes[$object->table_element]['list'][$key]))
$arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
$arrayfields["ef.".$key] = array(
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]),
'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key],
);
}
}
$object->fields = dol_sort_array($object->fields, 'position');
@ -412,8 +418,8 @@ else
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
@ -423,14 +429,14 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql .= $db->plimit($limit + 1, $offset);
$result = $db->query($sql);
if (!$result)
$resql = $db->query($sql);
if (! $resql)
{
dol_print_error($db);
exit;
}
$num = $db->num_rows($result);
$num = $db->num_rows($resql);
$arrayofselected = is_array($toselect) ? $toselect : array();
@ -786,7 +792,7 @@ $i = 0;
$totalarray = array();
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
$obj = $db->fetch_object($resql);
$arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
$contactstatic->lastname = $obj->lastname;
@ -986,7 +992,7 @@ while ($i < min($num, $limit))
$i++;
}
$db->free($result);
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook

View File

@ -2468,6 +2468,7 @@ class Contrat extends CommonObject
global $conf, $langs;
$langs->load("contracts");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'strato';

View File

@ -100,7 +100,7 @@ $hookmanager->initHooks(array('contractlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('contrat');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// List of fields to search into when doing a "search in all"

View File

@ -84,7 +84,7 @@ $hookmanager->initHooks(array('contractservicelist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('contratdet');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');

View File

@ -165,7 +165,7 @@ if ($action == 'update' && !empty($permissiontoadd))
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
} elseif ($object->fields[$key]['type'] == 'boolean') {
$value = (GETPOST($key) == 'on' ? 1 : 0);
$value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0);
} else {
$value = GETPOST($key, 'alpha');
}
@ -219,7 +219,7 @@ if ($action == "update_extras" && !empty($permissiontoadd))
$object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int'));
//var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit;
} else {
$object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, ' alpha');
$object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha');
}
$result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user);

View File

@ -270,6 +270,26 @@ class CMailFile
}
}
// Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc.=($addr_bcc?', ':'').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
$this->addr_to = $to;
$this->addr_cc = $addr_cc;
$this->addr_bcc = $addr_bcc;
$this->reply_to = $replyto;
$this->addr_from = $from;
$this->subject = $subject;
$this->errors_to = $errors_to;
$this->deliveryreceipt = $deliveryreceipt;
$this->trackid = $trackid;
if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
{
$this->addr_to = $conf->global->MAIN_MAIL_FORCE_SENDTO;
$this->addr_cc = '';
$this->addr_bcc = '';
}
// We set all data according to choosed sending method.
// We also set a value for ->msgid
if ($this->sendmode == 'mail')
@ -330,16 +350,16 @@ class CMailFile
$smtps->setCharSet($conf->file->character_set_client);
// Encode subject if required.
$subjecttouse = $subject;
$subjecttouse = $this->subject;
if (!ascii_check($subjecttouse)) {
$subjecttouse = $this->encodetorfc2822($subjecttouse);
}
$smtps->setSubject($subjecttouse);
$smtps->setTO($this->getValidAddress($to, 0, 1));
$smtps->setFrom($this->getValidAddress($from, 0, 1));
$smtps->setTrackId($trackid);
$smtps->setReplyTo($this->getValidAddress($replyto, 0, 1));
$smtps->setTO($this->getValidAddress($this->addr_to, 0, 1));
$smtps->setFrom($this->getValidAddress($this->addr_from, 0, 1));
$smtps->setTrackId($this->trackid);
$smtps->setReplyTo($this->getValidAddress($this->replyto, 0, 1));
if (!empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
@ -377,13 +397,13 @@ class CMailFile
}
}
$smtps->setCC($addr_cc);
$smtps->setBCC($addr_bcc);
$smtps->setErrorsTo($errors_to);
$smtps->setDeliveryReceipt($deliveryreceipt);
$smtps->setCC($this->addr_cc);
$smtps->setBCC($this->addr_bcc);
$smtps->setErrorsTo($this->errors_to);
$smtps->setDeliveryReceipt($this->deliveryreceipt);
$host = dol_getprefix('email');
$this->msgid = time().'.SMTPs-dolibarr-'.$trackid.'@'.$host;
$this->msgid = time().'.SMTPs-dolibarr-'.$this->trackid.'@'.$host;
$this->smtps = $smtps;
}
@ -405,8 +425,8 @@ class CMailFile
//$this->message = new Swift_SignedMessage();
// Adding a trackid header to a message
$headers = $this->message->getHeaders();
$headers->addTextHeader('X-Dolibarr-TRACKID', $trackid.'@'.$host);
$this->msgid = time().'.swiftmailer-dolibarr-'.$trackid.'@'.$host;
$headers->addTextHeader('X-Dolibarr-TRACKID', $this->trackid.'@'.$host);
$this->msgid = time().'.swiftmailer-dolibarr-'.$this->trackid.'@'.$host;
$headerID = $this->msgid;
$msgid = $headers->get('Message-ID');
$msgid->setId($headerID);
@ -415,33 +435,33 @@ class CMailFile
// Give the message a subject
try {
$result = $this->message->setSubject($subject);
$result = $this->message->setSubject($this->subject);
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
// Set the From address with an associative array
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
if (!empty($from)) {
if (! empty($this->addr_from)) {
try {
$result = $this->message->setFrom($this->getArrayAddress($from));
$result = $this->message->setFrom($this->getArrayAddress($this->addr_from));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
}
// Set the To addresses with an associative array
if (!empty($to)) {
if (! empty($this->addr_to)) {
try {
$result = $this->message->setTo($this->getArrayAddress($to));
$result = $this->message->setTo($this->getArrayAddress($this->addr_to));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
}
if (!empty($replyto)) {
if (! empty($this->reply_to)) {
try {
$result = $this->message->SetReplyTo($this->getArrayAddress($replyto));
$result = $this->message->SetReplyTo($this->getArrayAddress($this->reply_to));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
@ -495,10 +515,10 @@ class CMailFile
}
}
if (!empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc));
if (!empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc));
if (! empty($this->addr_cc)) $this->message->setCc($this->getArrayAddress($this->addr_cc));
if (! empty($this->addr_bcc)) $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
//if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
if (isset($deliveryreceipt) && $deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from));
}
else
{
@ -617,13 +637,6 @@ class CMailFile
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_EMAILING';
}
if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
{
$this->addr_to = $conf->global->MAIN_MAIL_FORCE_SENDTO;
$this->addr_cc = '';
$this->addr_bcc = '';
}
// Action according to choosed sending method
if ($this->sendmode == 'mail')
{
@ -768,14 +781,14 @@ class CMailFile
$from = $this->smtps->getFrom('org');
if ($res && !$from)
{
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>Sender address '$from' invalid";
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - Sender address '$from' invalid";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res = false;
}
$dest = $this->smtps->getTo();
if ($res && !$dest)
{
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>Recipient address '$dest' invalid";
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - Recipient address '$dest' invalid";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res = false;
}
@ -798,7 +811,7 @@ class CMailFile
else
{
if (empty($this->error)) $this->error = $result;
dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>".$this->error, LOG_ERR);
dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - ".$this->error, LOG_ERR);
$res = false;
}
}

View File

@ -1082,7 +1082,8 @@ abstract class CommonDocGenerator
$parameters = array(
'curY' => &$curY,
'columnText' => $columnText,
'colKey' => $colKey
'colKey' => $colKey,
'pdf' => &$pdf,
);
$reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -1899,14 +1899,15 @@ abstract class CommonObject
$row = $this->db->fetch_row($result);
$this->ref_previous = $row[0];
$sql = "SELECT MIN(te.".$fieldid.")";
$sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te";
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
}
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
$tmparray = explode('@', $this->ismultientitymanaged);
$sql .= ", ".MAIN_DB_PREFIX.$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity
} elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid
if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc";
$sql .= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists)
@ -1917,8 +1918,10 @@ abstract class CommonObject
if (!preg_match('/^\s*AND/i', $filter)) $sql .= " AND "; // For backward compatibility
$sql .= $filter;
}
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
$tmparray = explode('@', $this->ismultientitymanaged);
$sql .= ' AND te.'.$tmparray[0].' = '.($tmparray[1] == 'societe' ? 's' : 'parenttable').'.rowid'; // If we need to link to this table to limit select to entity
} elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
@ -1931,6 +1934,10 @@ abstract class CommonObject
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
}
}
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged) && $this->element != 'societe') {
$tmparray = explode('@', $this->ismultientitymanaged);
$sql .= ' AND parenttable.entity IN ('.getEntity($tmparray[1]).')';
}
if ($this->restrictiononfksoc == 1 && $socid && $this->element != 'societe') $sql .= ' AND te.fk_soc = '.$socid;
if ($this->restrictiononfksoc == 2 && $socid && $this->element != 'societe') $sql .= ' AND (te.fk_soc = '.$socid.' OR te.fk_soc IS NULL)';
if ($this->restrictiononfksoc && $socid && $this->element == 'societe') $sql .= ' AND te.rowid = '.$socid;
@ -5524,11 +5531,12 @@ abstract class CommonObject
$new_array_options[$key] = null;
}
break;
case 'double':
case 'price':
case 'double':
$value = price2num($value);
if (!is_numeric($value) && $value != '')
{
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." for ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
$this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
return -1;
}
@ -5582,9 +5590,6 @@ abstract class CommonObject
$new_array_options[$key] = $this->array_options[$key];
}
break;
case 'price':
$new_array_options[$key] = price2num($this->array_options[$key]);
break;
case 'date':
case 'datetime':
// If data is a string instead of a timestamp, we convert it
@ -5682,7 +5687,7 @@ abstract class CommonObject
{
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
{
if (in_array($tmpval, array('int', 'double'))) $sql .= ", 0";
if (in_array($tmpval, array('int', 'double', 'price'))) $sql .= ", 0";
else $sql .= ", ''";
}
}
@ -7043,7 +7048,7 @@ abstract class CommonObject
if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0)
{
$out .= "\n";
$out .= '<!-- showOptionalsInput --> ';
$out .= '<!-- showOptionals --> ';
$out .= "\n";
$extrafields_collapse_num = '';
@ -7181,7 +7186,7 @@ abstract class CommonObject
// HTML, select, integer and text add default value
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'select', 'int')))
{
if ($action == 'create') $value = $extrafields->attributes[$this->table_element]['default'][$key];
if ($action == 'create') $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ? GETPOST($keyprefix.'options_'.$key.$keysuffix, 'none', 3) : $extrafields->attributes[$this->table_element]['default'][$key];
else $value = $this->array_options['options_'.$key];
}
@ -7265,7 +7270,7 @@ abstract class CommonObject
setListDependencies();
});
</script>'."\n";
$out .= '<!-- /showOptionalsInput --> '."\n";
$out .= '<!-- /showOptionals --> '."\n";
}
}
return $out;
@ -7963,11 +7968,11 @@ abstract class CommonObject
if (array_key_exists('ref', $fieldvalues)) $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data
$keys = array();
$values = array();
$values = array(); // Array to store string forged for SQL syntax
foreach ($fieldvalues as $k => $v) {
$keys[$k] = $k;
$value = $this->fields[$k];
$values[$k] = $this->quote($v, $value);
$values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null
}
// Clean and check mandatory
@ -7977,8 +7982,7 @@ abstract class CommonObject
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key] = '';
if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = '';
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && !isset($values[$key]) && is_null($this->fields[$key]['default']))
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && (!isset($values[$key]) || $values[$key] === 'NULL') && is_null($this->fields[$key]['default']))
{
$error++;
$this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);

View File

@ -74,12 +74,12 @@ abstract class CommonObjectLine extends CommonObject
$label_type = 'short_label';
}
$sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
$sql = 'select '.$label_type.',code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
$resql = $this->db->query($sql);
if ($resql && $this->db->num_rows($resql) > 0)
{
$res = $this->db->fetch_array($resql);
$label = $res[$label_type];
$label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']);
$this->db->free($resql);
return $label;
}

View File

@ -468,6 +468,26 @@ class dolReceiptPrinter extends Printer
return $error;
}
/**
* Function to delete a printer template in db
*
* @param int $templateid Template ID
* @return int 0 if OK; >0 if KO
*/
public function deleteTemplate($templateid)
{
global $conf;
$error = 0;
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt_template';
$sql .= " WHERE rowid = ".((int) $this->db->escape($templateid));
$sql .= " AND entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = $this->db->lasterror;
}
return $error;
}
/**
* Function to Update a printer template in db

View File

@ -154,8 +154,8 @@ class ExtraFields
public static $type2label = array(
'varchar'=>'String',
'text'=>'TextLong',
'varchar'=>'String1Line',
'text'=>'TextLongNLines',
'html'=>'HtmlText',
'int'=>'Int',
'double'=>'Float',
@ -842,7 +842,7 @@ class ExtraFields
/**
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
*
* @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
* @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
* @param boolean $forceload Force load of extra fields whatever is status of cache.
* @return array Array of attributes keys+label for all extra fields.
*/
@ -856,6 +856,7 @@ class ExtraFields
if ($elementtype == 'thirdparty') $elementtype = 'societe';
if ($elementtype == 'contact') $elementtype = 'socpeople';
if ($elementtype == 'order_supplier') $elementtype = 'commande_fournisseur';
if ($elementtype == 'stock_mouvement') $elementtype = 'movement';
$array_name_label = array();
@ -2098,6 +2099,10 @@ class ExtraFields
{
$value_key = GETPOST("options_".$key, 'alpha');
}
elseif (in_array($key_type, array('text')))
{
$value_key = GETPOST("options_".$key, 'alphanohtml');
}
else
{
$value_key = GETPOST("options_".$key);

View File

@ -2743,9 +2743,9 @@ class Form
$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
if ($virtualstock > 0) {
$outval .= ' - <span class="product_line_stock_ok">';
$outval .= '<span class="product_line_stock_ok">';
}elseif ($virtualstock <= 0) {
$outval .= ' - <span class="product_line_stock_too_low">';
$outval .= '<span class="product_line_stock_too_low">';
}
$outval .= $virtualstock;
$outval .= '</span>';
@ -6744,7 +6744,7 @@ class Form
*/
public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
{
global $conf, $langs, $user;
global $conf, $langs, $user, $extrafields;
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
@ -6776,6 +6776,10 @@ class Form
}
if ($val['label'])
{
if (! empty($val['langfile']) && is_object($langs)) {
$langs->load($val['langfile']);
}
$lis .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.(empty($val['checked']) ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
}

View File

@ -546,7 +546,10 @@ class Translate
{
global $conf, $db;
if (!is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
if (!is_string($key)) {
//xdebug_print_function_stack('ErrorBadValueForParamNotAString');
return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
}
$newstr = $key;
if (preg_match('/^Civility([0-9A-Z]+)$/i', $key, $reg))

View File

@ -183,6 +183,8 @@ class DoliDBPgsql extends DoliDB
if ($type == 'dml')
{
$reg = array();
$line = preg_replace('/\s/', ' ', $line); // Replace tabulation with space
// we are inside create table statement so lets process datatypes

View File

@ -721,16 +721,16 @@ function translation_prepare_head()
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
$head[$h][1] = $langs->trans("TranslationOverwriteKey").'<span class="fa fa-plus-circle valignmiddle paddingleft"></span>';
$head[$h][2] = 'overwrite';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey";
$head[$h][1] = $langs->trans("TranslationKeySearch");
$head[$h][2] = 'searchkey';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
$head[$h][1] = $langs->trans("TranslationOverwriteKey").'<span class="fa fa-plus-circle valignmiddle paddingleft"></span>';
$head[$h][2] = 'overwrite';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin', 'remove');

View File

@ -1286,7 +1286,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Object db
* @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket|... to list events linked to an object
* @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object
* @param Contact $objcon Filter on object contact to filter events on a contact
* @param int $noprint Return string but does not output it
* @param string $actioncode Filter on actioncode
@ -1294,9 +1294,10 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
* @param array $filters Filter on other fields
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param string $module You can add module name here if elementtype in table llx_actioncomm is objectkey@module
* @return string|void Return html part or void if noprint is 1
*/
function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC')
function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '')
{
global $user, $conf;
global $form;
@ -1416,7 +1417,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && is_array($filterobj->fields['ref']) && $filterobj->table_element && $filterobj->element)
{
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element)."'";
// Generic case
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? '@'.$module : '')."'";
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
}
}

View File

@ -601,7 +601,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
$out = str_replace(array('"', '../'), '', trim($out));
$out = dol_string_nohtmltag($out, 1);
$out = dol_string_nohtmltag($out, 0);
}
break;
case 'restricthtml': // Recommended for most html textarea
@ -3172,7 +3172,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'setup', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic',
'home', 'hrm', 'companies', 'products', 'commercial', 'invoicing', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'members', 'ticket', 'generic',
'error', 'warning', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
)
@ -3195,7 +3195,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group',
@ -5694,8 +5694,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1)
{
$allowed_tags = array(
"html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link",
"ol", "p", "q", "s", "section", "span", "strike", "strong", "title",
"table", "tr", "th", "td", "u", "ul"
"ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6"
);
$allowed_tags_string = join("><", $allowed_tags);
$allowed_tags_string = preg_replace('/^>/', '', $allowed_tags_string);

View File

@ -1809,18 +1809,19 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
$ret = '';
$regs = array();
// If we ask an resource form external module (instead of default path)
// If we ask a resource form external module (instead of default path)
if (preg_match('/^([^@]+)@([^@]+)$/i', $objecttype, $regs)) {
$myobject = $regs[1];
$module = $regs[2];
}
// Parse $objecttype (ex: project_task)
$module = $myobject = $objecttype;
if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs))
{
$module = $regs[1];
$myobject = $regs[2];
else {
// Parse $objecttype (ex: project_task)
$module = $myobject = $objecttype;
if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs))
{
$module = $regs[1];
$myobject = $regs[2];
}
}
// Generic case for $classpath
@ -1896,7 +1897,7 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
// Generic case for $classfile and $classname
$classfile = strtolower($myobject); $classname = ucfirst($myobject);
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname;
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname." classpath=".$classpath;
if ($objecttype == 'invoice_supplier') {
$classfile = 'fournisseur.facture';

View File

@ -24,23 +24,23 @@
/**
* Function to return number in text.
* Function to return a number into a text.
* May use module NUMBERWORDS if found.
*
* @param float $num Number to convert
* @param float $num Number to convert (must be a numeric value, like reported by price2num())
* @param Translate $langs Language
* @param boolean $currency 0=number to translate | 1=currency to translate
* @param boolean $centimes 0=no centimes | 1=centimes to translate
* @param boolean $centimes 0=no cents/centimes | 1=there is cents/centimes to translate
* @return string|false Text of the number
*/
function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
{
global $conf;
$num = str_replace(array(',', ' '), '', trim($num));
if (!$num) {
return false;
}
//$num = str_replace(array(',', ' '), '', trim($num)); This should be useless since $num MUST be a php numeric value
if (!$num) {
return false;
}
if ($centimes && strlen($num) == 1) {
$num = $num * 10;
@ -57,78 +57,79 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
return $concatWords;
} else {
$TNum = explode('.', $num);
$num = (int) $TNum[0];
$words = array();
$list1 = array(
'',
$langs->transnoentitiesnoconv('one'),
$langs->transnoentitiesnoconv('two'),
$langs->transnoentitiesnoconv('three'),
$langs->transnoentitiesnoconv('four'),
$langs->transnoentitiesnoconv('five'),
$langs->transnoentitiesnoconv('six'),
$langs->transnoentitiesnoconv('seven'),
$langs->transnoentitiesnoconv('eight'),
$langs->transnoentitiesnoconv('nine'),
$langs->transnoentitiesnoconv('ten'),
$langs->transnoentitiesnoconv('eleven'),
$langs->transnoentitiesnoconv('twelve'),
$langs->transnoentitiesnoconv('thirteen'),
$langs->transnoentitiesnoconv('fourteen'),
$langs->transnoentitiesnoconv('fifteen'),
$langs->transnoentitiesnoconv('sixteen'),
$langs->transnoentitiesnoconv('seventeen'),
$langs->transnoentitiesnoconv('eighteen'),
$langs->transnoentitiesnoconv('nineteen')
);
$list2 = array(
'',
$langs->transnoentitiesnoconv('ten'),
$langs->transnoentitiesnoconv('twenty'),
$langs->transnoentitiesnoconv('thirty'),
$langs->transnoentitiesnoconv('forty'),
$langs->transnoentitiesnoconv('fifty'),
$langs->transnoentitiesnoconv('sixty'),
$langs->transnoentitiesnoconv('seventy'),
$langs->transnoentitiesnoconv('eighty'),
$langs->transnoentitiesnoconv('ninety'),
$langs->transnoentitiesnoconv('hundred')
);
$list3 = array(
'',
$langs->transnoentitiesnoconv('thousand'),
$langs->transnoentitiesnoconv('million'),
$langs->transnoentitiesnoconv('billion'),
$langs->transnoentitiesnoconv('trillion'),
$langs->transnoentitiesnoconv('quadrillion')
);
$num_length = strlen($num);
$levels = (int) (($num_length + 2) / 3);
$max_length = $levels * 3;
$num = substr('00'.$num, -$max_length);
$num_levels = str_split($num, 3);
$nboflevels = count($num_levels);
for ($i = 0; $i < $nboflevels; $i++) {
$levels--;
$hundreds = (int) ($num_levels[$i] / 100);
$hundreds = ($hundreds ? ' '.$list1[$hundreds].' '.$langs->transnoentities('hundred').($hundreds == 1 ? '' : 's').' ' : '');
$tens = (int) ($num_levels[$i] % 100);
$singles = '';
if ($tens < 20) {
$tens = ($tens ? ' '.$list1[$tens].' ' : '');
} else {
$tens = (int) ($tens / 10);
$tens = ' '.$list2[$tens].' ';
$singles = (int) ($num_levels[$i] % 10);
$singles = ' '.$list1[$singles].' ';
}
$words[] = $hundreds.$tens.$singles.(($levels && (int) ($num_levels[$i])) ? ' '.$list3[$levels].' ' : '');
} //end for loop
$commas = count($words);
if ($commas > 1) {
$commas = $commas - 1;
}
$num = (int) $TNum[0];
$words = array();
$list1 = array(
'',
$langs->transnoentitiesnoconv('one'),
$langs->transnoentitiesnoconv('two'),
$langs->transnoentitiesnoconv('three'),
$langs->transnoentitiesnoconv('four'),
$langs->transnoentitiesnoconv('five'),
$langs->transnoentitiesnoconv('six'),
$langs->transnoentitiesnoconv('seven'),
$langs->transnoentitiesnoconv('eight'),
$langs->transnoentitiesnoconv('nine'),
$langs->transnoentitiesnoconv('ten'),
$langs->transnoentitiesnoconv('eleven'),
$langs->transnoentitiesnoconv('twelve'),
$langs->transnoentitiesnoconv('thirteen'),
$langs->transnoentitiesnoconv('fourteen'),
$langs->transnoentitiesnoconv('fifteen'),
$langs->transnoentitiesnoconv('sixteen'),
$langs->transnoentitiesnoconv('seventeen'),
$langs->transnoentitiesnoconv('eighteen'),
$langs->transnoentitiesnoconv('nineteen')
);
$list2 = array(
'',
$langs->transnoentitiesnoconv('ten'),
$langs->transnoentitiesnoconv('twenty'),
$langs->transnoentitiesnoconv('thirty'),
$langs->transnoentitiesnoconv('forty'),
$langs->transnoentitiesnoconv('fifty'),
$langs->transnoentitiesnoconv('sixty'),
$langs->transnoentitiesnoconv('seventy'),
$langs->transnoentitiesnoconv('eighty'),
$langs->transnoentitiesnoconv('ninety'),
$langs->transnoentitiesnoconv('hundred')
);
$list3 = array(
'',
$langs->transnoentitiesnoconv('thousand'),
$langs->transnoentitiesnoconv('million'),
$langs->transnoentitiesnoconv('billion'),
$langs->transnoentitiesnoconv('trillion'),
$langs->transnoentitiesnoconv('quadrillion')
);
$num_length = strlen($num);
$levels = (int) (($num_length + 2) / 3);
$max_length = $levels * 3;
$num = substr('00'.$num, -$max_length);
$num_levels = str_split($num, 3);
$nboflevels = count($num_levels);
for ($i = 0; $i < $nboflevels; $i++) {
$levels--;
$hundreds = (int) ($num_levels[$i] / 100);
$hundreds = ($hundreds ? ' '.$list1[$hundreds].' '.$langs->transnoentities('hundred').($hundreds == 1 ? '' : 's').' ' : '');
$tens = (int) ($num_levels[$i] % 100);
$singles = '';
if ($tens < 20) {
$tens = ($tens ? ' '.$list1[$tens].' ' : '');
} else {
$tens = (int) ($tens / 10);
$tens = ' '.$list2[$tens].' ';
$singles = (int) ($num_levels[$i] % 10);
$singles = ' '.$list1[$singles].' ';
}
$words[] = $hundreds.$tens.$singles.(($levels && (int) ($num_levels[$i])) ? ' '.$list3[$levels].' ' : '');
} //end for loop
$commas = count($words);
if ($commas > 1) {
$commas = $commas - 1;
}
$concatWords = implode(' ', $words);
// Delete multi whitespaces
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
@ -138,12 +139,16 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
}
// If we need to write cents call again this function for cents
if (!empty($TNum[1])) {
$decimalpart = $TNum[1];
$decimalpart = preg_replace('/0+$/', '', $decimalpart);
if ($decimalpart) {
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
$concatWords .= ' '.dol_convertToWord($TNum[1], $langs, $currency, true);
$concatWords .= ' '.dol_convertToWord($decimalpart, $langs, '', true);
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
}
return $concatWords;
return $concatWords;
}
}
@ -159,10 +164,12 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
*/
function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
{
// If the number is negative convert to positive and return -1 if is too long
// If the number is negative convert to positive and return -1 if it is too long
if ($numero < 0) $numero *= -1;
if ($numero >= 1000000000001)
if ($numero >= 1000000000001) {
return -1;
}
// Get 2 decimals to cents, another functions round or truncate
$strnumber = number_format($numero, 10);
$len = strlen($strnumber);

View File

@ -33,11 +33,17 @@ $quality = 80;
* Return if a filename is file name of a supported image format
*
* @param string $file Filename
* @param int $acceptsvg 0=Default (depends on setup), 1=Always accept SVG as image files
* @return int -1=Not image filename, 0=Image filename but format not supported for conversion by PHP, 1=Image filename with format supported by this PHP
*/
function image_format_supported($file)
function image_format_supported($file, $acceptsvg = 0)
{
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm|\.svg'; // See also into product.class.php
global $conf;
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php
if ($acceptsvg || ! empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)) {
$regeximgext .= '|\.svg'; // Not allowed by default. SVG can contains javascript
}
// Case filename is not a format image
$reg = array();

View File

@ -65,10 +65,10 @@ function commande_prepare_head(Commande $object)
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;
$text = '';
if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments");
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= '/';
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - ';
if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings");
if ($nbShipments > 0 || $nbReceiption > 0) $text .= '<span class="badge marginleftonlyshort">'.($nbShipments ? $nbShipments : 0);
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= '/';
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - ';
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0);
if ($nbShipments > 0 || $nbReceiption > 0) $text .= '</span>';
$head[$h][1] = $text;

View File

@ -1859,7 +1859,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
}
if (empty($reshook))
{
if ($object->lines[$i]->special_code == 3) return '';
if (empty($hidedetails) || $hidedetails > 1) $result .= $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short'));
}
return $result;

View File

@ -39,8 +39,13 @@ function prelevement_prepare_head(BonPrelevement $object)
$h = 0;
$head = array();
$titleoftab = "WithdrawalsReceipts";
if ($object->type == 'bank-transfer') {
$titleoftab = "BankTransferReceipts";
}
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("WithdrawalsReceipts");
$head[$h][1] = $langs->trans($titleoftab);
$head[$h][2] = 'prelevement';
$h++;

View File

@ -40,8 +40,8 @@
* @param float $pu Unit price (HT or TTC selon price_base_type)
* @param float $remise_percent_ligne Discount for line
* @param float $txtva 0=do not apply VAT tax, VAT rate=apply (this is VAT rate only without text code, we don't need text code because we alreaydy have all tax info into $localtaxes_array)
* @param float $uselocaltax1_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
* @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
* @param float $uselocaltax1_rate 0=do not use localtax1, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
* @param float $uselocaltax2_rate 0=do not use localtax2, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
* @param float $remise_percent_global 0
* @param string $price_base_type HT=Unit price parameter is HT, TTC=Unit price parameter is TTC
* @param int $info_bits Miscellaneous informations on line

View File

@ -22,7 +22,7 @@
/**
* \file htdocs/core/lib/usergroups.lib.php
* \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes
* \brief Set of function to manage users, groups and permissions
*/
/**

View File

@ -29,6 +29,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?mainmenu=home&amp;leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?mainmenu=home&amp;leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/translation.php?mainmenu=home&amp;leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/defaultvalues.php?mainmenu=home&amp;leftmenu=setup', 'DefaultValues', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?mainmenu=home&amp;leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?mainmenu=home&amp;leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__);

View File

@ -234,12 +234,14 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
!empty($conf->ficheinter->enabled)
) ? 1 : 0,
'perms'=>(!empty($user->rights->propal->lire) ||
!empty($user->rights->commande->lire) ||
!empty($user->rights->fournisseur->lire) ||
!empty($user->rights->supplier_proposal->lire) ||
!empty($user->rights->supplier_order->lire) ||
!empty($user->rights->contrat->lire) ||
!empty($user->rights->ficheinter->lire)
!empty($user->rights->commande->lire) ||
!empty($user->rights->fournisseur->lire) ||
!empty($user->rights->supplier_proposal->lire) ||
!empty($user->rights->supplier_order->lire) ||
!empty($user->rights->contrat->lire) ||
!empty($user->rights->ficheinter->lire) ||
!empty($user->rights->supplier_order->lire) ||
!empty($user->rights->fournisseur->commande->lire)
),
'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
);

View File

@ -54,7 +54,7 @@ class modPaymentByBankTransfer extends DolibarrModules
$this->description = "Management of payment by bank transfer";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
$this->version = 'experimental';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of png file (without png) used for this module

View File

@ -183,7 +183,7 @@ class pdf_stdmovement extends ModelePDFMovement
/**
* Function to build a document on disk using the generic odt module.
*
* @param StockMovements $object Object source to build document
* @param MouvementStock $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details

View File

@ -223,7 +223,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
}
}
$total = $object->montant;
$total = $object->amount;
// Definition of $dir and $file
if ($object->specimen)
@ -550,12 +550,12 @@ class pdf_standard extends ModelePDFSuppliersPayments
// Total payments
$pdf->SetXY($this->page_largeur - $this->marge_droite - 50, $posy);
$pdf->MultiCell(50, 4, price($object->montant), 0, 'R', 1);
$pdf->MultiCell(50, 4, price($object->amount), 0, 'R', 1);
$posy += 20;
// translate amount
$currency = $conf->currency;
$translateinletter = strtoupper(dol_convertToWord($object->montant, $outputlangs, $currency));
$translateinletter = strtoupper(dol_convertToWord($object->amount, $outputlangs, $currency));
$pdf->SetXY($this->marge_gauche + 50, $posy);
$pdf->MultiCell(90, 8, $translateinletter, 0, 'L', 1);
$posy += 8;
@ -565,10 +565,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
$pdf->MultiCell(150, 4, $object->thirdparty->nom, 0, 'L', 1);
$pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy);
$pdf->MultiCell(35, 4, str_pad(price($object->montant).' '.$currency, 18, '*', STR_PAD_LEFT), 0, 'R', 1);
$pdf->MultiCell(35, 4, str_pad(price($object->amount).' '.$currency, 18, '*', STR_PAD_LEFT), 0, 'R', 1);
$posy += 10;
// City
$pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy);
$pdf->MultiCell(150, 4, $mysoc->town, 0, 'L', 1);
@ -608,9 +607,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$titre = strtoupper($mysoc->town).', le '.date("d").' '.$outputlangs->transnoentitiesnoconv(date("F")).' '.date("Y");
/*$titre = strtoupper($mysoc->town).' - '.dol_print_date(dol_now(), 'day', 'tzserver', $outputlangs);
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3) - 60, $tab_top - 6);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);*/
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top);
@ -774,7 +773,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'target', $object);
$usecontact = 0;
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'target', $object);
// Show recipient
$widthrecbox = 90;

View File

@ -186,8 +186,10 @@ elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($
?>
<!-- Label -->
<tr><td class="titlefield fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo $label; ?>"></td></tr>
<!-- Code -->
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><?php echo $attrname; ?></td></tr>
<!-- Type -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
<?php
@ -204,6 +206,10 @@ $typewecanchangeinto = array(
'phone'=>array('varchar', 'phone', 'mail', 'url', 'select'),
'select'=>array('varchar', 'phone', 'mail', 'url', 'select')
);
/* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert
if ($size <= 255 && in_array($type, array('text', 'html'))) {
$typewecanchangeinto['text'][] = 'varchar';
}*/
if (in_array($type, array_keys($typewecanchangeinto)))
{
@ -225,8 +231,10 @@ else
}
?>
</td></tr>
<!-- Size -->
<tr class="extra_size"><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td><input id="size" type="text" name="size" size="5" value="<?php echo $size; ?>"></td></tr>
<!-- Value (for some fields like password, select list, radio, ...) -->
<tr id="value_choice">
<td>
@ -247,33 +255,44 @@ else
</table>
</td>
</tr>
<!-- Position -->
<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo dol_escape_htmltag($pos); ?>"></td></tr>
<!-- Language file -->
<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag($langfile); ?>"></td></tr>
<!-- Computed value -->
<?php if (empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?>
<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" class="quatrevingtpercent" type="text" name="computed_value" value="<?php echo dol_escape_htmltag($computed); ?>"></td></tr>
<?php } else { ?>
<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?></td><td class="valeur"><input id="computed_value" class="quatrevingtpercent" type="text" name="computed_value" value="<?php echo dol_escape_htmltag($computed); ?>"></td></tr>
<?php } ?>
<!-- Default Value (at sql setup level) -->
<tr class="extra_default_value"><td><?php echo $langs->trans("DefaultValue").' ('.$langs->trans("Database").')'; ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo dol_escape_htmltag($default); ?>"></td></tr>
<!-- Unique -->
<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo ($unique ? ' checked' : ''); ?>></td></tr>
<!-- Required -->
<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required ? ' checked' : ''); ?>></td></tr>
<!-- Always editable -->
<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
<!-- Visibility -->
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list != '' ? $list : '1'); ?>"></td></tr>
<!-- Visibility for PDF-->
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
</td><td class="valeur"><input id="printable" class="minwidth100" type="text" name="printable" value="<?php echo dol_escape_htmltag($printable); ?>"></td></tr>
<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ($totalizable ? ' checked' : ''); ?>></td></tr>
<!-- Help tooltip -->
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
<?php if ($conf->multicompany->enabled) { ?>
<!-- Multicompany entity -->
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ? ' checked' : ''); ?>></td></tr>

View File

@ -131,7 +131,24 @@ if ($action == 'presend')
{
$formmail->fromid = $user->id;
}
$formmail->trackid = $trackid;
if ($object->element === 'facture' && !empty($conf->global->INVOICE_EMAIL_SENDER)) {
$formmail->frommail = $conf->global->INVOICE_EMAIL_SENDER;
$formmail->fromname = '';
$formmail->fromtype = 'special';
}
if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) {
$formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER;
$formmail->fromname = '';
$formmail->fromtype = 'special';
}
if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) {
$formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER;
$formmail->fromname = '';
$formmail->fromtype = 'special';
}
$formmail->trackid=$trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e
// we keep position for the first line
$totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
}
$totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
if (is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
}
if (!empty($val['isameasure']))
{

View File

@ -43,7 +43,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e
{
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
$morecss = '';
if (in_array($typeofextrafield, array('link', 'sellist'))) $morecss = 'maxwidth200';
if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) $morecss = 'maxwidth200';
echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
}
print '</td>';

View File

@ -29,6 +29,10 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e
}
else
{
if (! empty($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]) && is_object($langs)) {
$langs->load($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]);
}
$tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key];
print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align ? 'align="'.$align.'" data-titlekey="'.$key.'"' : 'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n";

View File

@ -54,50 +54,48 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$extrafields_collapse_num = '';
$extrafields_collapse_num_old = '';
$i = 0;
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
foreach ($extrafields->attributes[$object->table_element]['label'] as $tmpkeyextra => $tmplabelextra)
{
$i++;
// Discard if extrafield is a hidden field on form
$enabled = 1;
if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$key]))
if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra]))
{
$enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1);
$enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1);
}
if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key]))
if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra]))
{
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1);
}
$perms = 1;
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra]))
{
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1);
}
//print $key.'-'.$enabled.'-'.$perms.'-'.$label.$_POST["options_" . $key].'<br>'."\n";
//print $tmpkeyextra.'-'.$enabled.'-'.$perms.'-'.$tmplabelextra.$_POST["options_" . $tmpkeyextra].'<br>'."\n";
if (empty($enabled)) continue; // 0 = Never visible field
if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5 && abs($enabled) != 4) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list <> 4 = not visible at the creation
if (empty($perms)) continue; // 0 = Not visible
// Load language if required
if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]);
if (!empty($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra]);
if ($action == 'edit_extras')
{
$value = (isset($_POST["options_".$key]) ? $_POST["options_".$key] : $object->array_options["options_".$key]);
}
else
{
$value = $object->array_options["options_".$key];
//var_dump($key.' - '.$value);
$value = (isset($_POST["options_".$tmpkeyextra]) ? $_POST["options_".$tmpkeyextra] : $object->array_options["options_".$tmpkeyextra]);
} else {
$value = $object->array_options["options_".$tmpkeyextra];
//var_dump($tmpkeyextra.' - '.$value);
}
// Print line tr of extra field
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate')
if ($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra] == 'separate')
{
$extrafields_collapse_num = '';
$extrafield_param = $extrafields->attributes[$object->table_element]['param'][$key];
$extrafield_param = $extrafields->attributes[$object->table_element]['param'][$tmpkeyextra];
if (!empty($extrafield_param) && is_array($extrafield_param)) {
$extrafield_param_list = array_keys($extrafield_param['options']);
@ -105,17 +103,15 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
if ($extrafield_collapse_display_value == 1 || $extrafield_collapse_display_value == 2) {
$extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$key];
$extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$tmpkeyextra];
}
}
}
print $extrafields->showSeparator($key, $object);
print $extrafields->showSeparator($tmpkeyextra, $object);
$lastseparatorkeyfound = $key;
}
else
{
$lastseparatorkeyfound = $tmpkeyextra;
} else {
print '<tr class="trextrafields_collapse'.$extrafields_collapse_num;
/*if ($extrafields_collapse_num && $extrafields_collapse_num_old && $extrafields_collapse_num != $extrafields_collapse_num_old) {
print ' trextrafields_collapse_new';
@ -130,10 +126,10 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
print '<tr>';
print '<td class="';
if ((!empty($action) && ($action == 'create' || $action == 'edit')) && !empty($extrafields->attributes[$object->table_element]['required'][$key])) print ' fieldrequired';
if ((!empty($action) && ($action == 'create' || $action == 'edit')) && !empty($extrafields->attributes[$object->table_element]['required'][$tmpkeyextra])) print ' fieldrequired';
print '">';
if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key]));
else print $langs->trans($label);
if (!empty($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])) print $form->textwithpicto($langs->trans($tmplabelextra), $langs->trans($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra]));
else print $langs->trans($tmplabelextra);
print '</td>';
//TODO Improve element and rights detection
@ -151,54 +147,52 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
if ($object->element == 'mo') $permok = $user->rights->mrp->write;
$isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0));
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key]))
&& $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $key)
&& empty($extrafields->attributes[$object->table_element]['computed'][$key]))
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra]))
&& $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $tmpkeyextra)
&& empty($extrafields->attributes[$object->table_element]['computed'][$tmpkeyextra]))
{
$fieldid = 'id';
if ($object->table_element == 'societe') $fieldid = 'socid';
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$object->id.'&action=edit_extras&attribute='.$key.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$object->id.'&action=edit_extras&attribute='.$tmpkeyextra.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
}
print '</tr></table>';
print '</td>';
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
$html_id = !empty($object->id) ? $object->element.'_extras_'.$tmpkeyextra.'_'.$object->id : '';
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$key.' wordbreak"'.($cols ? ' colspan="'.$cols.'"' : '').'>';
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$tmpkeyextra.' wordbreak"'.($cols ? ' colspan="'.$cols.'"' : '').'>';
// Convert date into timestamp format
if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('date', 'datetime')))
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime')))
{
$datenotinstring = $object->array_options['options_'.$key];
// print 'X'.$object->array_options['options_' . $key].'-'.$datenotinstring.'x';
if (!is_numeric($object->array_options['options_'.$key])) // For backward compatibility
$datenotinstring = $object->array_options['options_'.$tmpkeyextra];
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) // For backward compatibility
{
$datenotinstring = $db->jdate($datenotinstring);
}
//print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
$value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring;
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
$value = isset($_POST["options_".$tmpkeyextra]) ? dol_mktime($_POST["options_".$tmpkeyextra."hour"], $_POST["options_".$tmpkeyextra."min"], 0, $_POST["options_".$tmpkeyextra."month"], $_POST["options_".$tmpkeyextra."day"], $_POST["options_".$tmpkeyextra."year"]) : $datenotinstring;
}
//TODO Improve element and rights detection
if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key)
if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $tmpkeyextra)
{
$fieldid = 'id';
if ($object->table_element == 'societe') $fieldid = 'socid';
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formextra">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="attribute" value="'.$tmpkeyextra.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="'.$fieldid.'" value="'.$object->id.'">';
print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id, $object->table_element);
print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object->id, $object->table_element);
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Modify')).'">';
print '</form>';
}
else
{
//var_dump($key.'-'.$value.'-'.$object->table_element);
print $extrafields->showOutputField($key, $value, '', $object->table_element);
} else {
//var_dump($tmpkeyextra.'-'.$value.'-'.$object->table_element);
print $extrafields->showOutputField($tmpkeyextra, $value, '', $object->table_element);
}
print '</td>';

View File

@ -1542,8 +1542,11 @@ if ($action == 'create')
}
if ($subj == 0) // Line not shown yet, we show it
{
print '<!-- line not shown yet, we show it -->';
print '<tr class="oddeven"><td colspan="3" ></td><td class="center">';
$warehouse_selected_id = GETPOST('entrepot_id', 'int');
print '<!-- line not shown yet, we show it -->';
print '<tr class="oddeven"><td colspan="3"></td><td class="center">';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$disabled = '';
@ -1551,6 +1554,9 @@ if ($action == 'create')
{
$disabled = 'disabled="disabled"';
}
if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty.
$disabled = 'disabled="disabled"';
}
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled ? ' '.$disabled : '').'> ';
}
else
@ -1562,7 +1568,6 @@ if ($action == 'create')
print '<td class="left">';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$warehouse_selected_id = GETPOST('entrepot_id', 'int');
if ($warehouse_selected_id > 0)
{
$warehouseObject = new Entrepot($db);
@ -1949,7 +1954,7 @@ elseif ($id || $ref)
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
// Sending method
print '<tr><td height="10">';

View File

@ -292,6 +292,7 @@ class Expedition extends CommonObject
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."expedition (";
$sql .= "ref";
$sql .= ", entity";
$sql .= ", ref_customer";
@ -331,10 +332,10 @@ class Expedition extends CommonObject
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : "null");
$sql .= ", '".$this->db->escape($this->tracking_number)."'";
$sql .= ", ".$this->weight;
$sql .= ", ".$this->sizeS; // TODO Should use this->trueDepth
$sql .= ", ".$this->sizeW; // TODO Should use this->trueWidth
$sql .= ", ".$this->sizeH; // TODO Should use this->trueHeight
$sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL');
$sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth
$sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth
$sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight
$sql .= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL');
$sql .= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL');
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
@ -2566,6 +2567,7 @@ class Expedition extends CommonObject
global $conf, $langs;
$langs->load("sendings");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'rouget';

View File

@ -109,7 +109,7 @@ $hookmanager->initHooks(array('expensereportlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('expensereport');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');

View File

@ -85,7 +85,7 @@ $hookmanager->initHooks(array('interventionlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label('fichinter');
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');

View File

@ -31,7 +31,7 @@
*/
if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (!defined('EURO')) define('EURO', chr(128));

View File

@ -455,6 +455,7 @@ class SupplierInvoices extends DolibarrApi
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
$paiement->paiementid = $paiementid;
$paiement->paiementcode = dol_getIdFromCode($this->db, $paiementid, 'c_paiement', 'id', 'code', 1);
$paiement->oper = $paiement->paiementcode; // For backward compatibility
$paiement->num_payment = $num_payment;
$paiement->note_public = $comment;

View File

@ -332,9 +332,11 @@ class CommandeFournisseur extends CommonOrder
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
$sql .= " WHERE c.entity IN (".getEntity('supplier_order').")";
if (empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")";
else $sql .= " WHERE c.rowid=".$id;
if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'";
else $sql .= " AND c.rowid=".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -1292,11 +1294,15 @@ class CommandeFournisseur extends CommonOrder
$error = 0;
$now = dol_now();
// $date_commande is deprecated
$date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set
if(empty($date)) $date = $now;
// Clean parameters
if (empty($this->source)) $this->source = 0;
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
{
@ -3078,6 +3084,7 @@ class CommandeFournisseur extends CommonOrder
global $conf, $langs;
$langs->load("suppliers");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'muscadet';

View File

@ -292,7 +292,9 @@ class CommandeFournisseurDispatch extends CommonObject
$this->batch = $obj->batch;
$this->eatby = $this->db->jdate($obj->eatby);
$this->sellby = $this->db->jdate($obj->sellby);
$this->fetch_optionals();
$this->fk_reception = $obj->fk_reception;
$this->fetch_optionals();
}
$this->db->free($resql);

View File

@ -359,7 +359,7 @@ class FactureFournisseur extends CommonInvoice
$remise = $this->remise;
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
{
@ -486,7 +486,7 @@ class FactureFournisseur extends CommonInvoice
$idligne,
$this->lines[$i]->description,
$this->lines[$i]->pu_ht,
$this->lines[$i]->tva_tx,
$this->lines[$i]->tva_tx.($this->lines[$i]->vat_src_code ? ' ('.$this->lines[$i]->vat_src_code.')' : ''),
$this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx,
$this->lines[$i]->qty,
@ -1290,7 +1290,7 @@ class FactureFournisseur extends CommonInvoice
$this->db->begin();
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn';
$sql .= ' SET paye = 1, fk_statut=2';
$sql .= ' SET paye = 1, fk_statut = '.self::STATUS_CLOSED;
$sql .= ' WHERE rowid = '.$this->id;
dol_syslog("FactureFournisseur::set_paid", LOG_DEBUG);
@ -1945,6 +1945,8 @@ class FactureFournisseur extends CommonInvoice
$localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $mysoc, $this->thirdparty);
$reg = array();
// Clean vat code
$vat_src_code = '';
if (preg_match('/\((.*)\)/', $vatrate, $reg))
@ -2337,7 +2339,8 @@ class FactureFournisseur extends CommonInvoice
$result = '';
if ($option == 'document') $url = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$this->id;
if ($option == 'withdraw') $url = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$this->id.'&type=bank-transfer';
elseif ($option == 'document') $url = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$this->id;
else $url = DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$this->id;
if ($short) return $url;
@ -2648,6 +2651,8 @@ class FactureFournisseur extends CommonInvoice
$object->id = 0;
$object->statut = self::STATUS_DRAFT;
$object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor
// Clear fields
$object->ref_supplier = (empty($this->ref_supplier) ? $langs->trans("CopyOf").' '.$object->ref_supplier : $this->ref_supplier);
$object->author = $user->id;
@ -2717,6 +2722,7 @@ class FactureFournisseur extends CommonInvoice
global $conf, $user, $langs;
$langs->load("suppliers");
$outputlangs->load("products");
// Set the model on the model name to use
if (empty($modele))

View File

@ -1025,7 +1025,7 @@ class ProductFournisseur extends Product
//$out .= '<td class="liste_titre right">'.$langs->trans("QtyMin").'</td>';
$out .= '<td class="liste_titre">'.$langs->trans("User").'</td></tr>';
foreach ($productFournLogList as $productFournLog) {
$out .= '<tr><td class="right">'.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').'</td>';
$out .= '<tr><td class="right">'.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').'</td>';
$out .= '<td class="right">'.price($productFournLog['price']).'</td>';
//$out.= '<td class="right">'.$productFournLog['quantity'].'</td>';
$out .= '<td>'.$productFournLog['lastname'].'</td></tr>';

View File

@ -459,11 +459,26 @@ if (empty($reshook))
if ($idprod > 0)
{
$label = $productsupplier->label;
// Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09'))
$newlang = GETPOST('lang_id', 'aZ09');
if (empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$desc = (!empty($productsupplier->multilangs [$outputlangs->defaultlang] ["description"])) ? $productsupplier->multilangs [$outputlangs->defaultlang] ["description"] : $productsupplier->description;
} else {
$desc = $productsupplier->description;
}
// if we use supplier description of the products
if (!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) {
$desc = $productsupplier->desc_supplier;
} else $desc = $productsupplier->description;
}
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
@ -2390,7 +2405,7 @@ elseif (!empty($object->id))
{
if ($user->rights->fournisseur->commande->approuver)
{
if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && !empty($object->user_approve_id))
if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && !empty($object->user_approve_id))
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("FirstApprovalAlreadyDone")).'">'.$langs->trans("ApproveOrder").'</a>';
}
@ -2406,7 +2421,7 @@ elseif (!empty($object->id))
}
// Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set)
if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
{
if ($object->statut == CommandeFournisseur::STATUS_VALIDATED)
{

Some files were not shown because too many files have changed in this diff Show More