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

develop

Conflicts:
	htdocs/theme/md/style.css.php
This commit is contained in:
Laurent Destailleur 2015-11-20 23:47:07 +01:00
commit 401b2a7389
352 changed files with 2293 additions and 2267 deletions

View File

@ -332,6 +332,12 @@ source_file = htdocs/langs/en_US/suppliers.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.supplier_proposal]
file_filter = htdocs/langs/<lang>/supplier_proposal.lang
source_file = htdocs/langs/en_US/supplier_proposal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.trips]
file_filter = htdocs/langs/<lang>/trips.lang
source_file = htdocs/langs/en_US/trips.lang

View File

@ -53,6 +53,7 @@ class modMyModule extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "other";
$this->module_position = 500;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -48,7 +48,8 @@ $boxes = array();
if ($action == 'addconst')
{
dolibarr_set_const($db, "MAIN_BOXES_MAXLINES",$_POST["MAIN_BOXES_MAXLINES"],'',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", $_POST["MAIN_BOXES_MAXLINES"],'',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"],'chaine',0,'',$conf->entity);
}
if ($action == 'add') {
@ -456,8 +457,8 @@ $var=false;
print '<tr class="liste_titre">';
print '<td class="liste_titre">'.$langs->trans("Parameter").'</td>';
print '<td class="liste_titre">'.$langs->trans("Value").'</td>';
print '<td class="liste_titre"></td>';
print '</tr>';
print '<tr '.$bc[$var].'>';
print '<td>';
print $langs->trans("MaxNbOfLinesForBoxes");
@ -465,12 +466,21 @@ print '</td>'."\n";
print '<td>';
print '<input type="text" class="flat" size="6" name="MAIN_BOXES_MAXLINES" value="'.$conf->global->MAIN_BOXES_MAXLINES.'">';
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'" name="Button">';
print '</td>'."\n";
print '</tr>';
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1);
print '</td>';
print '</tr>';
}
print '</table>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'" name="Button"></div>';
print '</form>';
print "\n".'<!-- End Other Const -->'."\n";

View File

@ -594,7 +594,7 @@ if ($action == 'edit' || $action == 'updateedit')
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print '<table class="nobordernopadding">';
print "<tr><td><label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
@ -602,8 +602,8 @@ if ($action == 'edit' || $action == 'updateedit')
{
print '<tr><td align="left"><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
print '</td></tr>';
}
print '</td></tr>';
$opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
@ -614,7 +614,7 @@ if ($action == 'edit' || $action == 'updateedit')
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"nolt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
@ -639,14 +639,14 @@ if ($action == 'edit' || $action == 'updateedit')
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print '<table class="nobordernopadding">';
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print '<tr><td align="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
if(! isOnlyOneLocalTax(2))
{
$formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
print '<tr><td align="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
print '</td></tr>';
}
print '<tr><td align="left"><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
@ -656,7 +656,7 @@ if ($action == 'edit' || $action == 'updateedit')
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
@ -965,7 +965,7 @@ else
$var=true;
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"use_vat\">".$langs->trans("VATIsUsedDesc")."</label></td></tr>";
@ -974,7 +974,7 @@ else
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label=\"no_vat\">".$langs->trans("VATIsNotUsedDesc")."</label></td></tr>";
@ -988,7 +988,7 @@ else
/*
* Local Taxes
*/
if ($mysoc->useLocalTax(1))
if ($mysoc->useLocalTax(1)) // True if we found at least on vat with a setup adding a localtax 1
{
// Local Tax 1
print '<br>';
@ -1000,7 +1000,7 @@ else
$var=true;
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td></label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
@ -1028,7 +1028,7 @@ else
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"no_lt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
@ -1039,7 +1039,7 @@ else
print "</table>";
}
if ($mysoc->useLocalTax(2))
if ($mysoc->useLocalTax(2)) // True if we found at least on vat with a setup adding a localtax 1
{
// Local Tax 2
print '<br>';
@ -1051,7 +1051,7 @@ else
$var=true;
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
@ -1080,7 +1080,7 @@ else
print "</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print "<tr ".$bc[$var]."><td width=\"160\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";

View File

@ -150,7 +150,7 @@ $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.t
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[10]= "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.fdm, c.decalage, c.active, c.sortorder FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.accountancy_code FROM ".MAIN_DB_PREFIX."c_paiement AS c";
@ -182,7 +182,7 @@ $tabsqlsort[6] ="a.type ASC, a.module ASC, a.position ASC, a.code ASC";
$tabsqlsort[7] ="country ASC, code ASC, a.libelle ASC";
$tabsqlsort[8] ="country DESC, libelle ASC";
$tabsqlsort[9] ="label ASC";
$tabsqlsort[10]="country ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
$tabsqlsort[10]="country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
$tabsqlsort[11]="element ASC, source ASC, code ASC";
$tabsqlsort[12]="sortorder ASC, code ASC";
$tabsqlsort[13]="code ASC";
@ -214,7 +214,7 @@ $tabfield[6] = "code,libelle,type,color,position";
$tabfield[7] = "code,libelle,country,accountancy_code,deductible";
$tabfield[8] = "code,libelle,country_id,country";
$tabfield[9] = "code,label,unicode";
$tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[10]= "country_id,country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11]= "element,source,code,libelle";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfield[13]= "code,libelle,type,accountancy_code";
@ -246,7 +246,7 @@ $tabfieldvalue[6] = "code,libelle,type,color,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
$tabfieldvalue[8] = "code,libelle,country";
$tabfieldvalue[9] = "code,label,unicode";
$tabfieldvalue[10]= "country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[10]= "country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[11]= "element,source,code,libelle";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfieldvalue[13]= "code,libelle,type,accountancy_code";
@ -278,7 +278,7 @@ $tabfieldinsert[6] = "code,libelle,type,color,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
$tabfieldinsert[8] = "code,libelle,fk_country";
$tabfieldinsert[9] = "code_iso,label,unicode";
$tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[10]= "fk_pays,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[11]= "element,source,code,libelle";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfieldinsert[13]= "code,libelle,type,accountancy_code";
@ -376,7 +376,7 @@ $tabhelp[6] = array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->
$tabhelp[7] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[8] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[9] = array('code'=>$langs->trans("EnterAnyCode"), 'unicode'=>$langs->trans("UnicodeCurrency"));
$tabhelp[10] = array('taux'=>$langs->trans("SellTaxRate"), 'recuperableonly'=>$langs->trans("RecuperableOnly"), 'localtax1_type'=>$langs->trans("LocalTaxDesc"), 'localtax2_type'=>$langs->trans("LocalTaxDesc"));
$tabhelp[10] = array('code'=>$langs->trans("EnterAnyCode"), 'taux'=>$langs->trans("SellTaxRate"), 'recuperableonly'=>$langs->trans("RecuperableOnly"), 'localtax1_type'=>$langs->trans("LocalTaxDesc"), 'localtax2_type'=>$langs->trans("LocalTaxDesc"));
$tabhelp[11] = array();
$tabhelp[12] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[13] = array('code'=>$langs->trans("EnterAnyCode"));
@ -486,7 +486,7 @@ if ($id == 25)
'shipping_send' => $langs->trans('MailToSendShipment'),
'fichinter_send' => $langs->trans('MailToSendIntervention'),
'askpricesupplier_send' => $langs->trans('MailToSendSupplierRequestForQuotation'),
'supplier_proposal_send' => $langs->trans('MailToSendSupplierRequestForQuotation'),
'order_supplier_send' => $langs->trans('MailToSendSupplierOrder'),
'invoice_supplier_send' => $langs->trans('MailToSendSupplierInvoice'),
@ -522,8 +522,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=1;
foreach ($listfield as $f => $value)
{
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
@ -692,7 +692,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$resql = $db->query($sql);
if (! $resql)
{
setEventMessage($db->error(), 'errors');
setEventMessages($db->error(), null, 'errors');
}
}
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
@ -1321,7 +1321,7 @@ if ($id)
// Can an entry be erased or disabled ?
$iserasable=1;$isdisable=1; // true by default
if (isset($obj->code))
if (isset($obj->code) && $id != 10)
{
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $isdisable = 0; }
else if ($obj->code == 'RECEP') { $iserasable = 0; $isdisable = 0; }
@ -1356,7 +1356,7 @@ if ($id)
print "</td>";
// Modify link
if ($iserasable) print '<td align="center"><a href="'.$url.'action=edit#'.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'">'.img_edit().'</a></td>';
if ($iserasable) print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>';
// Delete link
@ -1479,7 +1479,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
} // For state page, we do not show the country input (we link to region, not country)
print '<td>';
$fieldname='country';
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28);
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28, 'maxwidth300');
print '</td>';
}
elseif ($fieldlist[$field] == 'country_id')

View File

@ -70,7 +70,8 @@ if ($action == "save")
* View
*/
llxHeader('',$langs->trans("Audit"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Audit"),$wikihelp);
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@ -56,24 +56,28 @@ if (empty($conf->use_javascript_ajax))
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
}
/*
* Action
*/
if (GETPOST('cancel'))
{
$action='';
}
if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity);
@ -81,7 +85,14 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
/*
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity);
/*
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
@ -91,15 +102,22 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
*/
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
// This one is not always defined
if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity);
@ -199,16 +217,6 @@ if ($action == 'edit') // Edit
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
}
// Max size of lists
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
@ -327,11 +335,12 @@ if ($action == 'edit') // Edit
print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
print '<br>';
}
else // Show
{
@ -393,14 +402,6 @@ else // Show
print '<td width="20">&nbsp;</td>';
print "</tr>";
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("EnableFileCache").'</td><td>' . yn($conf->global->MAIN_ACTIVATE_FILECACHE) . '</td>';
print '<td width="20">&nbsp;</td>';
print "</tr>";
}
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
print '<td width="20">&nbsp;</td>';
@ -505,7 +506,6 @@ else // Show
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
print '<br>';
}

View File

@ -164,10 +164,15 @@ foreach ($modulesdir as $dir)
$special = $objMod->special;
$familykey = $objMod->family;
$moduleposition = ($objMod->module_position?$objMod->module_position:'500');
if ($moduleposition == 500 && ($objMod->isCoreOrExternalModule() == 'external'))
{
$moduleposition = 800;
}
if ($special == 1) $familykey='interface';
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$j; // Sort by family, then by module number
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
$dirmod[$i] = $dir;
// Set categ[$i]
$specialstring = isset($specialtostring[$special])?$specialtostring[$special]:'unknown';
@ -312,7 +317,7 @@ if ($mode != 'marketplace')
foreach ($orders as $key => $value)
{
$tab=explode('_',$value);
$familypos=$tab[0]; $familykey=$tab[1]; $numero=$tab[2];
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
$modName = $filename[$key];
$objMod = $modules[$key];
@ -426,12 +431,13 @@ if ($mode != 'marketplace')
}
else
{
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a>';
}
print '</td>'."\n";
// Config link
if (! empty($objMod->config_page_url) && !$disableSetup)
{
if (is_array($objMod->config_page_url))
@ -489,7 +495,7 @@ if ($mode != 'marketplace')
else
{
// Module non actif
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Disabled"),'switch_off');
print "</a>\n";
}

View File

@ -62,7 +62,8 @@ if ($action == 'remove')
* View
*/
llxHeader('',$langs->trans("DefaultRights"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("DefaultRights"), $wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@ -79,7 +79,8 @@ if (GETPOST("action") == 'set_proxy')
$form = new Form($db);
llxHeader('',$langs->trans("Proxy"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Proxy"), $wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@ -187,7 +187,8 @@ if ($action == 'maj_pattern')
*/
$form = new Form($db);
llxHeader('',$langs->trans("Passwords"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Passwords"),$wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@ -109,7 +109,8 @@ else if ($action == 'delete')
$form = new Form($db);
llxHeader('',$langs->trans("Files"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Files"),$wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@ -87,7 +87,8 @@ else if ($action == 'updateform')
$form = new Form($db);
llxHeader('',$langs->trans("Miscellaneous"));
$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('',$langs->trans("Miscellaneous"),$wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup');

View File

@ -25,12 +25,12 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php';
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
$langs->load("admin");
$langs->load("errors");
$langs->load('other');
$langs->load('askpricesupplier');
$langs->load('supplier_proposal');
if (! $user->admin) accessforbidden();
@ -38,7 +38,7 @@ $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$type='askpricesupplier';
$type='supplier_proposal';
/*
* Actions
@ -46,9 +46,9 @@ $type='askpricesupplier';
$error=0;
if ($action == 'updateMask')
{
$maskconstaskpricesupplier=GETPOST('maskconstaskpricesupplier','alpha');
$maskaskpricesupplier=GETPOST('maskaskpricesupplier','alpha');
if ($maskconstaskpricesupplier) $res = dolibarr_set_const($db,$maskconstaskpricesupplier,$maskaskpricesupplier,'chaine',0,'',$conf->entity);
$maskconstsupplier_proposal=GETPOST('maskconstsupplier_proposal','alpha');
$masksupplier_proposal=GETPOST('masksupplier_proposal','alpha');
if ($maskconstsupplier_proposal) $res = dolibarr_set_const($db,$maskconstsupplier_proposal,$masksupplier_proposal,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -66,15 +66,15 @@ if ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
$askpricesupplier = new AskPriceSupplier($db);
$askpricesupplier->initAsSpecimen();
$supplier_proposal = new SupplierProposal($db);
$supplier_proposal->initAsSpecimen();
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
$file=dol_buildpath($reldir."core/modules/askpricesupplier/doc/pdf_".$modele.".modules.php");
$file=dol_buildpath($reldir."core/modules/supplier_proposal/doc/pdf_".$modele.".modules.php");
if (file_exists($file))
{
$filefound=1;
@ -89,9 +89,9 @@ if ($action == 'specimen')
$module = new $classname($db);
if ($module->write_file($askpricesupplier,$langs) > 0)
if ($module->write_file($supplier_proposal,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=askpricesupplier&file=SPECIMEN.pdf");
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
return;
}
else
@ -107,11 +107,11 @@ if ($action == 'specimen')
}
}
if ($action == 'set_ASKPRICESUPPLIER_DRAFT_WATERMARK')
if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
{
$draft = GETPOST('ASKPRICESUPPLIER_DRAFT_WATERMARK','alpha');
$draft = GETPOST('SUPPLIER_PROPOSAL_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "ASKPRICESUPPLIER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
@ -124,11 +124,11 @@ if ($action == 'set_ASKPRICESUPPLIER_DRAFT_WATERMARK')
}
}
if ($action == 'set_ASKPRICESUPPLIER_FREE_TEXT')
if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
{
$freetext = GETPOST('ASKPRICESUPPLIER_FREE_TEXT'); // No alpha here, we want exact string
$freetext = GETPOST('SUPPLIER_PROPOSAL_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "ASKPRICESUPPLIER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -142,9 +142,9 @@ if ($action == 'set_ASKPRICESUPPLIER_FREE_TEXT')
}
}
if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER')
if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL')
{
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER",$value,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL",$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -198,15 +198,15 @@ else if ($action == 'del')
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->ASKPRICESUPPLIER_ADDON_PDF == "$value") dolibarr_del_const($db, 'ASKPRICESUPPLIER_ADDON_PDF',$conf->entity);
if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$value") dolibarr_del_const($db, 'SUPPLIER_PROPOSAL_ADDON_PDF',$conf->entity);
}
}
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "ASKPRICESUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
$conf->global->ASKPRICESUPPLIER_ADDON_PDF = $value;
$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF = $value;
}
// On active le modele
@ -222,7 +222,7 @@ else if ($action == 'setmod')
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "ASKPRICESUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON",$value,'chaine',0,'',$conf->entity);
}
@ -233,23 +233,23 @@ else if ($action == 'setmod')
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader('',$langs->trans("AskPriceSupplierSetup"));
llxHeader('',$langs->trans("SupplierProposalSetup"));
$form=new Form($db);
//if ($mesg) print $mesg;
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'title_setup');
print load_fiche_titre($langs->trans("SupplierProposalSetup"),$linkback,'title_setup');
$head = askpricesupplier_admin_prepare_head();
$head = supplier_proposal_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'askpricesupplier');
dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal');
/*
* Module numerotation
*/
print load_fiche_titre($langs->trans("AskPriceSupplierNumberingModules"),'','');
print load_fiche_titre($langs->trans("SupplierProposalNumberingModules"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -263,7 +263,7 @@ print '</tr>'."\n";
clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/askpricesupplier/");
$dir = dol_buildpath($reldir."core/modules/supplier_proposal/");
if (is_dir($dir))
{
@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir)
while (($file = readdir($handle))!==false)
{
if (substr($file, 0, 21) == 'mod_askpricesupplier_' && substr($file, dol_strlen($file)-3, 3) == 'php')
if (substr($file, 0, 21) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file)-3, 3) == 'php')
{
$file = substr($file, 0, dol_strlen($file)-4);
@ -302,7 +302,7 @@ foreach ($dirmodels as $reldir)
print '</td>'."\n";
print '<td align="center">';
if ($conf->global->ASKPRICESUPPLIER_ADDON == "$file")
if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file")
{
print img_picto($langs->trans("Activated"),'switch_on');
}
@ -314,13 +314,13 @@ foreach ($dirmodels as $reldir)
}
print '</td>';
$askpricesupplier=new AskPriceSupplier($db);
$askpricesupplier->initAsSpecimen();
$supplier_proposal=new SupplierProposal($db);
$supplier_proposal->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$askpricesupplier);
$nextval=$module->getNextValue($mysoc,$supplier_proposal);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) {
@ -351,7 +351,7 @@ print "</table><br>\n";
* Document templates generators
*/
print load_fiche_titre($langs->trans("AskPriceSupplierPDFModules"),'','');
print load_fiche_titre($langs->trans("SupplierProposalPDFModules"),'','');
// Load array def with activated templates
$def = array();
@ -394,7 +394,7 @@ foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
{
$dir = dol_buildpath($reldir."core/modules/askpricesupplier".$valdir);
$dir = dol_buildpath($reldir."core/modules/supplier_proposal".$valdir);
if (is_dir($dir))
{
@ -452,7 +452,7 @@ foreach ($dirmodels as $reldir)
// Defaut
print "<td align=\"center\">";
if ($conf->global->ASKPRICESUPPLIER_ADDON_PDF == "$name")
if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"),'on');
}
@ -526,10 +526,10 @@ print "</tr>";
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_ASKPRICESUPPLIER_FREE_TEXT">';
print '<input type="hidden" name="action" value="set_SUPPLIER_PROPOSAL_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnAskPriceSupplier").' ('.$langs->trans("AddCRIfTooLong").')<br>';
$variablename='ASKPRICESUPPLIER_FREE_TEXT';
print $langs->trans("FreeLegalTextOnSupplierProposal").' ('.$langs->trans("AddCRIfTooLong").')<br>';
$variablename='SUPPLIER_PROPOSAL_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
@ -548,10 +548,10 @@ print '</form>';
$var=!$var;
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"set_ASKPRICESUPPLIER_DRAFT_WATERMARK\">";
print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK\">";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("WatermarkOnDraftAskPriceSupplier").'<br>';
print '<input size="50" class="flat" type="text" name="ASKPRICESUPPLIER_DRAFT_WATERMARK" value="'.$conf->global->ASKPRICESUPPLIER_DRAFT_WATERMARK.'">';
print $langs->trans("WatermarkOnDraftSupplierProposal").'<br>';
print '<input size="50" class="flat" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
@ -561,20 +561,20 @@ if ($conf->banque->enabled)
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER").'</td><td>&nbsp</td><td align="right">';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp</td><td align="right">';
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER');
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
}
else
{
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER))
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
}
print '</td></tr>';
@ -583,7 +583,7 @@ else
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
}
print '</table>';
@ -601,7 +601,7 @@ print "<tr class=\"liste_titre\">\n";
print " <td>".$langs->trans("Name")."</td>\n";
print " <td>".$langs->trans("Value")."</td>\n";
print "</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->askpricesupplier->dir_output."</td>\n</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->supplier_proposal->dir_output."</td>\n</tr>\n";
print "</table>\n<br>";
$db->close();

View File

@ -111,7 +111,7 @@ if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin)
if (! $resql)
{
$error++;
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
// Add event purge

View File

@ -105,7 +105,7 @@ if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allf
if ($count) $mesg=$langs->trans("PurgeNDirectoriesDeleted", $count);
else $mesg=$langs->trans("PurgeNothingToDelete");
setEventMessage($mesg);
setEventMessages($mesg, null, 'mesgs');
}

View File

@ -100,7 +100,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
$head=user_admin_prepare_head();
dol_fiche_head($head,'card', $langs->trans("User"), 0, 'user');
dol_fiche_head($head,'card', $langs->trans("MenuUsersAndGroups"), 0, 'user');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -47,7 +47,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
else
{
setEventMessage($db->lasterror(),'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
}
@ -61,7 +61,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
}
else
{
setEventMessage($db->lasterror(),'errors');
setEventMessages($db->lasterror(), null, 'errors');
}
}

View File

@ -1508,9 +1508,11 @@ class Categorie extends CommonObject
/**
* Update ou cree les traductions des infos produits
*
* @param User $user Object user
*
* @return int <0 if KO, >0 if OK
*/
function setMultiLangs()
function setMultiLangs($user)
{
global $langs;
@ -1574,6 +1576,15 @@ class Categorie extends CommonObject
}
}
}
// Call trigger
$result = $this->call_trigger('CATEGORY_SET_MULTILANGS',$user);
if ($result < 0) {
$this->error = $this->db->lasterror();
return -1;
}
// End call triggers
return 1;
}

View File

@ -88,7 +88,7 @@ $cancel != $langs->trans("Cancel") &&
}
// sauvegarde en base
if ( $object->setMultiLangs() > 0 )
if ( $object->setMultiLangs($user) > 0 )
{
$action = '';
}
@ -121,7 +121,7 @@ $cancel != $langs->trans("Cancel") &&
}
}
if ( $object->setMultiLangs() > 0 )
if ( $object->setMultiLangs($user) > 0 )
{
$action = '';
}

View File

@ -439,7 +439,8 @@ class Propal extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
@ -600,7 +601,8 @@ class Propal extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@ -2739,7 +2741,7 @@ class Propal extends CommonObject
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@ -322,7 +322,7 @@ if ($result)
print '</div>';
}
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);

View File

@ -255,6 +255,7 @@ if (empty($reshook))
$object->demand_reason_id = GETPOST('demand_reason_id');
$object->date_livraison = $datelivraison;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int');
$object->fk_delivery_address = GETPOST('fk_address');
$object->contactid = GETPOST('contactid');
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
@ -549,6 +550,14 @@ if (empty($reshook))
}
}
// warehouse
else if ($action == 'setwarehouse' && $user->rights->commande->creer) {
$result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
else if ($action == 'setremisepercent' && $user->rights->commande->creer) {
$result = $object->set_remise($user, GETPOST('remise_percent'));
}
@ -1311,6 +1320,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0));
$availability_id = (!empty($objectsrc->availability_id)?$objectsrc->availability_id:(!empty($soc->availability_id)?$soc->availability_id:0));
$shipping_method_id = (! empty($objectsrc->shipping_method_id)?$objectsrc->shipping_method_id:(! empty($soc->shipping_method_id)?$soc->shipping_method_id:0));
$warehouse_id = (! empty($objectsrc->warehouse_id)?$objectsrc->warehouse_id:(! empty($soc->warehouse_id)?$soc->warehouse_id:0));
$demand_reason_id = (!empty($objectsrc->demand_reason_id)?$objectsrc->demand_reason_id:(!empty($soc->demand_reason_id)?$soc->demand_reason_id:0));
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
@ -1332,6 +1342,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$fk_account = $soc->fk_account;
$availability_id = $soc->availability_id;
$shipping_method_id = $soc->shipping_method_id;
$warehouse_id = $soc->warehouse_id;
$demand_reason_id = $soc->demand_reason_id;
$remise_percent = $soc->remise_percent;
$remise_absolue = 0;
@ -1464,6 +1475,15 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</td></tr>';
}
// Warehouse
if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct=new FormProduct($db);
print '<tr><td>' . $langs->trans('Warehouse') . '</td><td colspan="2">';
print $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1);
print '</td></tr>';
}
// What trigger creation
print '<tr><td>' . $langs->trans('Source') . '</td><td colspan="2">';
$form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1);
@ -1976,6 +1996,27 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</tr>';
}
// Warehouse
if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct=new FormProduct($db);
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('Warehouse');
print '</td>';
if ($action != 'editwarehouse' && $user->rights->commande->creer)
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editwarehouse&amp;id='.$object->id.'">'.img_edit($langs->trans('SetWarehouse'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editwarehouse') {
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
} else {
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
}
print '</td>';
print '</tr>';
}
// Terms of payment
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';

View File

@ -1220,7 +1220,8 @@ class Commande extends CommonOrder
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type,'', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@ -2442,7 +2443,8 @@ class Commande extends CommonOrder
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@ -2964,7 +2966,7 @@ class Commande extends CommonOrder
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);

View File

@ -179,19 +179,23 @@ if ($resql)
print '<form method="post" action="search.php" name="search_form">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
$moreforfilter = '';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('StartDate') . ' ';
$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
$moreforfilter .= ' - ';
$moreforfilter .= $langs->trans('EndDate') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1);
$moreforfilter .= '</div>';
if ($moreforfilter) {
if ($moreforfilter)
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>'."\n";
}
print '<table class="liste">'."\n";
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DateOperationShort'),$_SERVER['PHP_SELF'],'b.dateo','',$param,'align="center"',$sortfield,$sortorder);

View File

@ -85,87 +85,6 @@ if (GETPOST("mode") != 'sconly')
print "<br>";
}
// Payment Salary
if ($conf->salaries->enabled)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
$sal = new PaymentSalary($db);
print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
$sql.= " AND u.rowid = s.fk_user";
if ($year > 0)
{
$sql.= " AND (s.datesp between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " OR s.dateep between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."')";
}
if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$total = 0 ;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total = $total + $obj->amount;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td align="left">'.dol_print_date($db->jdate($obj->dateep),'day').'</td>'."\n";
print "<td>".$obj->label."</td>\n";
print '<td align="right">'.($obj->salary?price($obj->salary):'')."</td>";
// Ref payment
$sal_static->id=$obj->rowid;
$sal_static->ref=$obj->rowid;
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>";
print "</tr>\n";
$i++;
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
print '<td align="right">'."</td>";
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">'.price($total)."</td>";
print "</tr>";
print "</table>";
$db->free($result);
print "<br>";
}
else
{
dol_print_error($db);
}
}
}
if ($conf->tax->enabled)
{
@ -356,7 +275,8 @@ if ($conf->tax->enabled)
}
}
}
//localtax
// Localtax
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
$j=1;
@ -460,6 +380,91 @@ while($j<$numlt)
}
// Payment Salary
if ($conf->salaries->enabled)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
$sal = new PaymentSalary($db);
print '<br>';
print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
$sql.= " AND u.rowid = s.fk_user";
if ($year > 0)
{
$sql.= " AND (s.datesp between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " OR s.dateep between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."')";
}
if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$total = 0 ;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total = $total + $obj->amount;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td align="left">'.dol_print_date($db->jdate($obj->dateep),'day').'</td>'."\n";
print "<td>".$obj->label."</td>\n";
print '<td align="right">'.($obj->salary?price($obj->salary):'')."</td>";
// Ref payment
$sal_static->id=$obj->rowid;
$sal_static->ref=$obj->rowid;
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>";
print "</tr>\n";
$i++;
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
print '<td align="right">'."</td>";
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">'.price($total)."</td>";
print "</tr>";
print "</table>";
$db->free($result);
print "<br>";
}
else
{
dol_print_error($db);
}
}
}
llxFooter();
$db->close();

View File

@ -140,7 +140,7 @@ if (empty($reshook))
header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
exit();
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
@ -156,7 +156,7 @@ if (empty($reshook))
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
exit();
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -180,7 +180,7 @@ if (empty($reshook))
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
exit();
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
}
@ -213,7 +213,7 @@ if (empty($reshook))
exit();
}
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
@ -235,13 +235,13 @@ if (empty($reshook))
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
// Si avoir, le signe doit etre negatif
if ($object->total_ht >= 0) {
setEventMessage($langs->trans("ErrorInvoiceAvoirMustBeNegative"), 'errors');
setEventMessages($langs->trans("ErrorInvoiceAvoirMustBeNegative"), null, 'errors');
$action = '';
}
} else {
// Si non avoir, le signe doit etre positif
if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) {
setEventMessage($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), 'errors');
setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors');
$action = '';
}
}
@ -311,7 +311,7 @@ if (empty($reshook))
$object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']);
if ($object->date_lim_reglement < $object->date) {
$object->date_lim_reglement = $object->calculate_date_lim_reglement();
setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), 'warnings');
setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings');
}
$result = $object->update($user);
if ($result < 0)
@ -354,7 +354,7 @@ if (empty($reshook))
if ($ret > 0) {
$result = $object->insert_discount($_POST["remise_id"]);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
} else {
dol_print_error($db, $object->error);
@ -367,7 +367,7 @@ if (empty($reshook))
$result = $discount->link_to_invoice(0, $id);
if ($result < 0) {
setEventMessage($discount->error, 'errors');
setEventMessages($discount->error, $discount->errors, 'errors');
}
}
}
@ -402,7 +402,7 @@ if (empty($reshook))
$langs->load("errors");
$error ++;
setEventMessage($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), 'errors');
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), null, 'errors');
}
}
@ -418,7 +418,7 @@ if (empty($reshook))
{
if (! $idwarehouse || $idwarehouse == - 1) {
$error ++;
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action = '';
}
}
@ -448,8 +448,8 @@ if (empty($reshook))
}
else
{
if (count($object->errors)) setEventMessage($object->errors, 'errors');
else setEventMessage($object->error, 'errors');
if (count($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -477,7 +477,7 @@ if (empty($reshook))
{
if (! $idwarehouse || $idwarehouse == - 1) {
$error ++;
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action = '';
}
}
@ -511,7 +511,7 @@ if (empty($reshook))
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0)
{
$result=$object->set_draft($user, $idwarehouse);
if ($result<0) setEventMessage($object->error,'errors');
if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
// Define output language
@ -539,7 +539,7 @@ if (empty($reshook))
{
$object->fetch($id);
$result = $object->set_paid($user);
if ($result<0) setEventMessage($object->error,'errors');
if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
} // Classif "paid partialy"
else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement)
{
@ -548,7 +548,7 @@ if (empty($reshook))
$close_note = $_POST["close_note"];
if ($close_code) {
$result = $object->set_paid($user, $close_code, $close_note);
if ($result<0) setEventMessage($object->error,'errors');
if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
}
@ -559,7 +559,7 @@ if (empty($reshook))
$close_note = $_POST["close_note"];
if ($close_code) {
$result = $object->set_canceled($user, $close_code, $close_note);
if ($result<0) setEventMessage($object->error,'errors');
if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
}
@ -603,7 +603,7 @@ if (empty($reshook))
elseif ($object->type == Facture::TYPE_DEPOSIT)
$discount->description = '(DEPOSIT)';
else {
setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors');
setEventMessages($langs->trans('CantConvertToReducAnInvoiceOfThisType'), null, 'errors');
}
$discount->tva_tx = abs($object->total_ttc);
$discount->fk_soc = $object->socid;
@ -636,13 +636,13 @@ if (empty($reshook))
}
else
{
setEventMessage($object->error,'errors');
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
}
else
{
setEventMessage($discount->error,'errors');
setEventMessages($discount->error, $discount->errors, 'errors');
$db->rollback();
}
}
@ -705,7 +705,7 @@ if (empty($reshook))
$id = $object->createFromCurrent($user);
if ($id <= 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -979,7 +979,7 @@ if (empty($reshook))
$amountdeposit = ($totalamount * $valuedeposit) / 100;
}
} else {
setEventMessage($srcobject->error, 'errors');
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++;
}
}
@ -1054,7 +1054,7 @@ if (empty($reshook))
if ($discountid > 0) {
$result = $object->insert_discount($discountid); // This include link_to_invoice
} else {
setEventMessage($discount->error, 'errors');
setEventMessages($discount->error, $discount->errors, 'errors');
$error ++;
break;
}
@ -1119,12 +1119,12 @@ if (empty($reshook))
if ($reshook < 0)
$error ++;
} else {
setEventMessage($srcobject->error, 'errors');
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++;
}
}
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$error ++;
}
} // If some invoice's lines already known
@ -1237,11 +1237,11 @@ if (empty($reshook))
}
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++;
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error ++;
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
@ -1250,16 +1250,16 @@ if (empty($reshook))
$error ++;
}
if ($qty == '') {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++;
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
$error ++;
}
if ($qty < 0) {
$langs->load("errors");
setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors');
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++;
}
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
@ -1401,19 +1401,19 @@ if (empty($reshook))
// Margin
$fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');
$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we muste keep this value
$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
// Local Taxes
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc);
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc);
$info_bits = 0;
if ($tva_npr)
$info_bits |= 0x01;
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
setEventMessage($mesg, 'errors');
setEventMessages($mesg, null, 'errors');
} else {
// Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit);
@ -1473,7 +1473,7 @@ if (empty($reshook))
unset($_POST['situations']);
unset($_POST['progress']);
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
$action = '';
@ -1555,7 +1555,7 @@ if (empty($reshook))
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error ++;
}
} else {
@ -1570,7 +1570,7 @@ if (empty($reshook))
}
if ($qty < 0) {
$langs->load("errors");
setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors');
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++;
}
@ -1634,7 +1634,7 @@ if (empty($reshook))
unset($_POST['situations']);
unset($_POST['progress']);
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -1728,8 +1728,8 @@ if (empty($reshook))
$upload_dir = $conf->facture->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$action = '';
}
} elseif ($action == 'update_extras') {
@ -1775,9 +1775,9 @@ if (empty($reshook))
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
} else {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
} // bascule du statut d'un contact
@ -2387,7 +2387,7 @@ if ($action == 'create')
$cntinvoice=count($objectsrc->linkedObjects['facture']);
if ($cntinvoice>=1)
{
setEventMessage('WarningBillExist','warnings');
setEventMessages('WarningBillExist', null, 'warnings');
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
}
echo '</td></tr>';

View File

@ -898,7 +898,7 @@ class Facture extends CommonInvoice
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
@ -2045,8 +2045,8 @@ class Facture extends CommonInvoice
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
* @param double $qty Quantity
* @param double $txtva Force vat rate, -1 for auto
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
* @param double $txlocaltax1 Local tax 1 rate (deprecated)
* @param double $txlocaltax2 Local tax 2 rate (deprecated)
* @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line
* @param int $date_start Date start of service
@ -2141,6 +2141,7 @@ class Facture extends CommonInvoice
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, $situation_percent);
@ -2299,7 +2300,8 @@ class Facture extends CommonInvoice
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, $situation_percent);
$total_ht = $tabprice[0];

View File

@ -580,7 +580,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<td align="center">'.$langs->trans("DateDue").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Paid").'</td>';
print '<td>&nbsp;</td>';
print '<td align="center" width="16">&nbsp;</td>';
print '</tr>';
if ($num)
{

View File

@ -118,7 +118,7 @@ if (empty($reshook))
{
$langs->load("errors");
//$error++;
setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings');
setEventMessages($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), null, 'warnings');
}
}
@ -129,7 +129,7 @@ if (empty($reshook))
// Check parameters
if (! GETPOST('paiementcode'))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors');
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), null, 'errors');
$error++;
}
@ -138,20 +138,20 @@ if (empty($reshook))
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0)
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors');
$error++;
}
}
if (empty($totalpayment) && empty($atleastonepaymentnotnull))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors');
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), null, 'errors');
$error++;
}
if (empty($datepaye))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors');
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors');
$error++;
}
}
@ -194,7 +194,7 @@ if (empty($reshook))
// Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement
if (GETPOST('accountid') <= 0)
{
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors');
$error++;
}
}
@ -212,7 +212,7 @@ if (empty($reshook))
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0)
{
setEventMessage($paiement->error, 'errors');
setEventMessages($paiement->error, $paiement->errors, 'errors');
$error++;
}
}
@ -224,7 +224,7 @@ if (empty($reshook))
$result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),GETPOST('chqemetteur'),GETPOST('chqbank'));
if ($result < 0)
{
setEventMessage($paiement->error, 'errors');
setEventMessages($paiement->error, $paiement->errors, 'errors');
$error++;
}
}

View File

@ -70,7 +70,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char
}
else
{
setEventMessage($paiement->error, 'errors');
setEventMessages($paiement->error, $paiement->errors, 'errors');
$db->rollback();
}
}
@ -108,7 +108,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char
}
else
{
setEventMessage($paiement->error);
setEventMessages($paiement->error, $paiement->errors, 'errors');
$db->rollback();
}
}
@ -140,7 +140,7 @@ $h++;
dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, 'payment');
/*
* Confirmation de la suppression du paiement
* Deletion confirmation of payment
*/
if ($action == 'delete')
{
@ -149,7 +149,7 @@ if ($action == 'delete')
}
/*
* Confirmation de la validation du paiement
* Validation confirmation of payment
*/
if ($action == 'valide')
{

View File

@ -68,7 +68,7 @@ if ($action == 'confirm_rejet')
{
$error++;
$langs->load("error");
setEventMessage($langs->transnoentities("ErrorDateMustBeBeforeToday"),'errors');
setEventMessages($langs->transnoentities("ErrorDateMustBeBeforeToday"), null, 'errors');
}
if (GETPOST('motif','alpha') == 0)
@ -261,7 +261,7 @@ if ($id)
if ($sortfield == "") $sortfield="pl.fk_soc";
/*
* Liste des factures
* List of invoices
*/
$sql = "SELECT pf.rowid";
$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc, f.paye, f.fk_statut";

View File

@ -166,18 +166,18 @@ if ($action == 'delete')
{
$object->error=$accountline->error;
$db->rollback();
setEventMessage($object->error,'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
$db->rollback();
setEventMessage($object->error,'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
setEventMessage('Error try do delete a line linked to a conciliated bank transaction','errors');
setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors');
}
}

View File

@ -103,7 +103,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
}
elseif (! is_numeric($amount))
{
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors');
setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), null, 'errors');
$action = 'create';
}
else
@ -148,7 +148,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
}
elseif (! is_numeric($amount))
{
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors');
setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), null, 'errors');
$action = 'create';
}
else
@ -164,7 +164,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
$result=$chargesociales->update($user);
if ($result <= 0)
{
setEventMessage($chargesociales->error, 'errors');
setEventMessages($chargesociales->error, $chargesociales->errors, 'errors');
}
}
}

View File

@ -114,7 +114,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
else
{
$db->rollback();
setEventMessage($tva->error, 'errors');
setEventMessages($tva->error, $tva->errors, 'errors');
$action="create";
}
}
@ -150,18 +150,18 @@ if ($action == 'delete')
{
$tva->error=$accountline->error;
$db->rollback();
setEventMessage($tva->error,'errors');
setEventMessages($tva->error, $tva->errors, 'errors');
}
}
else
{
$db->rollback();
setEventMessage($tva->error,'errors');
setEventMessages($tva->error, $tva->errors, 'errors');
}
}
else
{
setEventMessage('Error try do delete a line linked to a conciliated bank transaction','errors');
setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors');
}
}

View File

@ -549,7 +549,7 @@ class Tva extends CommonObject
$result = $this->db->query($sql);
if ($result)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called paiementtva
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called 'payment_vat'
// Call trigger
//XXX: Should be done just befor commit no ?

View File

@ -143,7 +143,7 @@ if (empty($reshook))
$object->fetch($id);
if ($object->setstatus(0)<0)
{
setEventMessage($object->error,'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
else
{
@ -158,7 +158,7 @@ if (empty($reshook))
$object->fetch($id);
if ($object->setstatus(1)<0)
{
setEventMessage($object->error,'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
else
{
@ -397,8 +397,7 @@ if (empty($reshook))
}
else
{
setEventMessage($object->error,'errors');
setEventMessage($object->errors,'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';
}
}

View File

@ -65,12 +65,12 @@ if ($action == 'dolibarr2ldap')
if ($result >= 0)
{
setEventMessage($langs->trans("ContactSynchronized"));
setEventMessages($langs->trans("ContactSynchronized"), null, 'mesgs');
$db->commit();
}
else
{
setEventMessage($ldap->error, 'errors');
setEventMessages($ldap->error, $ldap->errors, 'errors');
$db->rollback();
}
}

View File

@ -1260,7 +1260,8 @@ class Contrat extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,$mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@ -1441,7 +1442,8 @@ class Contrat extends CommonObject
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];

View File

@ -94,9 +94,9 @@ if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM
{
$arrayresult['searchintosupplierorder']=array('text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue));
}
if (! empty($conf->askpricesupplier->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->askpricesupplier->lire)
if (! empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire)
{
$arrayresult['searchintosupplierpropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/askpricesupplier/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintosupplierpropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)

View File

@ -96,12 +96,20 @@ class box_factures_fourn_imp extends ModeleBoxes
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
$datem=$db->jdate($objp->tms);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->ref;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$facturestatic->date_echeance = $datelimite;
$facturestatic->statut = $objp->fk_statut;
$thirdpartytmp->id = $objp->socid;
$thirdpartytmp->name = $objp->name;
$thirdpartytmp->code_client = $objp->code_client;
$thirdpartytmp->name = $objp->name;
$thirdpartytmp->fournisseur = 1;
$thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
$thirdpartytmp->logo = $objp->logo;
$facturestatic->date_echeance = $datelimite;
$facturestatic->statut = $objp->fk_statut;
$late='';
if ($facturestatic->hasDelay()) {
@ -118,10 +126,9 @@ class box_factures_fourn_imp extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => ($objp->ref?$objp->ref:$objp->facid),
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
'asisi' => 1
);
$this->info_box_contents[$line][] = array(

View File

@ -2183,7 +2183,7 @@ abstract class CommonObject
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva';
if ($this->element == 'propal') $fieldttc='total';
if ($this->element == 'expensereport') $fieldtva='total_tva';
if ($this->element == 'askpricesupplier') $fieldttc='total';
if ($this->element == 'supplier_proposal') $fieldttc='total';
if (empty($nodatabaseupdate))
{
@ -2394,8 +2394,8 @@ abstract class CommonObject
else if ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
}
else if ($objecttype == 'askpricesupplier') {
$classpath = 'comm/askpricesupplier/class';
else if ($objecttype == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
}
else if ($objecttype == 'shipping') {
$classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
@ -3046,9 +3046,9 @@ abstract class CommonObject
// Description
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
if ($this->element == 'askpricesupplier')
if ($this->element == 'supplier_proposal')
{
print '<td class="linerefsupplier" align="right"><span id="title_fourn_ref">'.$langs->trans("AskPriceSupplierRefFourn").'</span></td>';
print '<td class="linerefsupplier" align="right"><span id="title_fourn_ref">'.$langs->trans("SupplierProposalRefFourn").'</span></td>';
}
// VAT

View File

@ -193,6 +193,7 @@ class Conf
{
$modulename=strtolower($reg[1]);
if ($modulename == 'propale') $modulename='propal';
if ($modulename == 'supplierproposal') $modulename='supplier_proposal';
if (! isset($this->$modulename) || ! is_object($this->$modulename)) $this->$modulename=new stdClass();
$this->$modulename->enabled=true;
$this->modules[]=$modulename; // Add this module in list of enabled modules
@ -451,7 +452,7 @@ class Conf
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024);
// Define list of limited modules
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,askpricesupplier,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later.
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,supplier_proposal,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later.
// Enable select2
if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT == '1') $this->global->MAIN_USE_JQUERY_MULTISELECT='select2';

View File

@ -3857,12 +3857,12 @@ class Form
dol_syslog(__METHOD__, LOG_DEBUG);
$sql = "SELECT DISTINCT t.taux, t.recuperableonly";
$sql = "SELECT DISTINCT t.code, t.taux, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = c.rowid";
$sql.= " AND t.active > 0";
$sql.= " AND c.code IN (".$country_code.")";
$sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC";
$sql.= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
$resql=$this->db->query($sql);
if ($resql)
@ -3873,8 +3873,9 @@ class Form
for ($i = 0; $i < $num; $i++)
{
$obj = $this->db->fetch_object($resql);
$this->cache_vatrates[$i]['code'] = $obj->code;
$this->cache_vatrates[$i]['txtva'] = $obj->taux;
$this->cache_vatrates[$i]['libtva'] = $obj->taux.'%';
$this->cache_vatrates[$i]['libtva'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
$this->cache_vatrates[$i]['nprtva'] = $obj->recuperableonly;
}
@ -3897,7 +3898,7 @@ class Form
* Output an HTML select vat rate.
* The name of this function should be selectVat. We keep bad name for compatibility purpose.
*
* @param string $htmlname Name of html select field
* @param string $htmlname Name of HTML select field
* @param float $selectedrate Force preselected vat rate. Use '' for no forcing.
* @param Societe $societe_vendeuse Thirdparty seller
* @param Societe $societe_acheteuse Thirdparty buyer
@ -3910,10 +3911,11 @@ class Form
* Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TVA par défaut=TVA du produit vendu. Fin de règle.
* Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle.
* Sinon la TVA proposee par defaut=0. Fin de regle.
* @param bool $options_only Return options only (for ajax treatment)
* @param bool $options_only Return HTML options lines only (for ajax treatment)
* @param int $addcode Add code into key in select list
* @return string
*/
function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false)
function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $addcode=0)
{
global $langs,$conf,$mysoc;
@ -4016,13 +4018,16 @@ class Form
$return.= '<option value="'.$rate['txtva'];
$return.= $rate['nprtva'] ? '*': '';
if ($addcode && $rate['code']) $return.=' ('.$rate['code'].')';
$return.= '"';
if ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr)
{
$return.= ' selected';
}
$return.= '>'.vatrate($rate['libtva']);
//$return.=($rate['code']?' '.$rate['code']:'');
$return.= $rate['nprtva'] ? ' *': '';
$return.= '</option>';
}
@ -4890,9 +4895,9 @@ class Form
$tplpath = 'comm/'.$element;
if (empty($conf->propal->enabled)) continue; // Do not show if module disabled
}
else if ($objecttype == 'askpricesupplier') {
else if ($objecttype == 'supplier_proposal') {
$tplpath = 'comm/'.$element;
if (empty($conf->askpricesupplier->enabled)) continue; // Do not show if module disabled
if (empty($conf->supplier_proposal->enabled)) continue; // Do not show if module disabled
}
else if ($objecttype == 'shipping' || $objecttype == 'shipment') {
$tplpath = 'expedition';
@ -5299,7 +5304,7 @@ class Form
$entity = (! empty($object->entity) ? $object->entity : $conf->entity);
$id = (! empty($object->id) ? $object->id : $object->rowid);
$ret='';$dir='';$file='';$altfile='';$email='';
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
if ($modulepart=='societe')
{
@ -5308,9 +5313,11 @@ class Form
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
if (! empty($object->logo))
{
// TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small');
else $file=$id.'/logos/thumbs/'.$smallfile;
$originalfile=$id.'/logos/thumbs/'.$smallfile;
}
}
else if ($modulepart=='contact')
@ -5318,9 +5325,11 @@ class Form
$dir=$conf->societe->multidir_output[$entity].'/contact';
if (! empty($object->photo))
{
// TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small');
else $file=$id.'/photos/'.$object->photo;
$originalfile=$id.'/photos/'.$object->photo;
}
}
else if ($modulepart=='userphoto')
@ -5331,6 +5340,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
$originalfile=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@ -5343,6 +5353,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
$originalfile=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@ -5355,6 +5366,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
$originalfile=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@ -5364,13 +5376,13 @@ class Form
{
if ($file && file_exists($dir."/".$file))
{
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='</a>';
}
else if ($altfile && file_exists($dir."/".$altfile))
{
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='</a>';
}

View File

@ -171,7 +171,7 @@ class FormActions
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
elseif ($typeelement == 'askpricesupplier') $title=$langs->trans('ActionsOnAskPriceSupplier');
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');

View File

@ -285,7 +285,7 @@ class FormFile
}
$printer=0;
if (in_array($modulepart,array('facture','askpricesupplier','propal','proposal','order','commande','expedition', 'commande_fournisseur'))) // The direct print feature is implemented only for such elements
if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur'))) // The direct print feature is implemented only for such elements
{
$printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false;
}
@ -329,13 +329,13 @@ class FormFile
$modellist=ModelePDFPropales::liste_modeles($this->db);
}
}
else if ($modulepart == 'askpricesupplier')
else if ($modulepart == 'supplier_proposal')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
{
include_once DOL_DOCUMENT_ROOT.'/core/modules/askpricesupplier/modules_askpricesupplier.php';
$modellist=ModelePDFAskPriceSupplier::liste_modeles($this->db);
include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php';
$modellist=ModelePDFSupplierProposal::liste_modeles($this->db);
}
}
else if ($modulepart == 'commande')
@ -992,10 +992,10 @@ class FormFile
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$object_instance=new Propal($this->db);
}
else if ($modulepart == 'askpricesupplier')
else if ($modulepart == 'supplier_proposal')
{
include_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php';
$object_instance=new AskPriceSupplier($this->db);
include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
$object_instance=new SupplierProposal($this->db);
}
else if ($modulepart == 'order')
{
@ -1058,7 +1058,7 @@ class FormFile
if ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices
if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'askpricesupplier') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'supplier_proposal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'order') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'order_supplier') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); }

View File

@ -524,7 +524,7 @@ class FormMail extends Form
$showinfobcc='';
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO;
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ASKPRICESUPPLIER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'askpricesupplier_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ASKPRICESUPPLIER_TO;
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO;
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO;
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO;
if ($showinfobcc) $out.=' + '.$showinfobcc;
@ -544,7 +544,7 @@ class FormMail extends Form
{
$defaultvaluefordeliveryreceipt=0;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ASKPRICESUPPLIER) && ! empty($this->param['models']) && $this->param['models'] == 'askpricesupplier_send') $defaultvaluefordeliveryreceipt=1;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_PROPOSAL) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $defaultvaluefordeliveryreceipt=1;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1;
$out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1);
@ -786,7 +786,7 @@ class FormMail extends Form
if ($type_template=='facture_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoice"); }
elseif ($type_template=='facture_relance') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoiceReminder"); }
elseif ($type_template=='propal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendProposal"); }
elseif ($type_template=='askpricesupplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendAskPriceSupplier"); }
elseif ($type_template=='supplier_proposal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierProposal"); }
elseif ($type_template=='order_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendOrder"); }
elseif ($type_template=='order_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierOrder"); }
elseif ($type_template=='invoice_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }

View File

@ -25,7 +25,7 @@
/**
* Class to manage generation of HTML components for proposal management
*/
class FormAskPriceSupplier
class FormSupplierProposal
{
var $db;
var $error;
@ -49,18 +49,18 @@ class FormAskPriceSupplier
* @param int $short Use short labels
* @return void
*/
function selectAskPriceSupplierStatus($selected='',$short=0)
function selectSupplierProposalStatus($selected='',$short=0)
{
global $langs;
$sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst";
$sql .= " WHERE active = 1";
dol_syslog(get_class($this)."::selectAskPriceSupplierStatus", LOG_DEBUG);
dol_syslog(get_class($this)."::selectSupplierProposalStatus", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
print '<select class="flat" name="askpricesupplier_statut">';
print '<select class="flat" name="supplier_proposal_statut">';
print '<option value="">&nbsp;</option>';
$num = $this->db->num_rows($resql);
$i = 0;

View File

@ -738,6 +738,15 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
$displaytab=0;
$nbintab=0;
$popuptab=0;
for ($i = 0 ; $i <= $maxkey ; $i++)
{
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
{
// si l'active est présent dans la box
if ($i >= $limittoshow)
$limittoshow--;
}
}
for ($i = 0 ; $i <= $maxkey ; $i++)
{
@ -745,13 +754,11 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
{
$isactive=true;
$bactive=true;
if ($i <=$limittoshow)
$limittoshow++;
}
else
$isactive=false;
if ($i <= $limittoshow || $isactive)
if ($i < $limittoshow || $isactive)
{
$out.='<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((! $isactive && ! empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT))?' hideonprint':'').'"><!-- id tab = '.(empty($links[$i][2])?'':$links[$i][2]).' -->';
if (isset($links[$i][2]) && $links[$i][2] == 'image')
@ -892,7 +899,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]);
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
if ($conf->browser->phone) $maxvisiblephotos=1;
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],1,-$maxvisiblephotos,0,0,0,$width,0).'</div>';
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',-$maxvisiblephotos,0,0,0,$width,0).'</div>';
else
{
$nophoto='/public/theme/common/nophoto.png';
@ -901,7 +908,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
else
{
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','',1,0,$maxvisiblephotos).'</div>';
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
}
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
@ -3088,12 +3095,18 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
*/
function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
{
// Test for compatibility
if (preg_match('/%/',$rate))
$morelabel='';
if (preg_match('/%/',$rate))
{
$rate=str_replace('%','',$rate);
$addpercent=true;
}
if (preg_match('/\((.*)\)/',$rate,$reg))
{
$morelabel=' ('.$reg[1].')';
$rate=preg_replace('/'.preg_quote($morelabel,'/').'/','',$rate);
}
if (preg_match('/\*/',$rate) || preg_match('/'.constant('MAIN_LABEL_MENTION_NPR').'/i',$rate))
{
$rate=str_replace('*','',$rate);
@ -3102,6 +3115,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
$ret=price($rate,0,'',0,0).($addpercent?'%':'');
if ($info_bits & 1) $ret.=' '.($usestarfornpr?'*':constant('MAIN_LABEL_MENTION_NPR'));
$ret.=$morelabel;
return $ret;
}
@ -3283,35 +3297,43 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
}
/**
* Return localtax rate for a particular vat, when selling a product with vat $tva, from a $thirdparty_buyer to a $thirdparty_seller
* Return localtax rate for a particular vat, when selling a product with vat $vatrate, from a $thirdparty_buyer to a $thirdparty_seller
* Note: This function applies same rules than get_default_tva
*
* @param float $tva Vat taxe
* @param float $vatrate Vat rate
* @param int $local Local tax to search and return (1 or 2 return only tax rate 1 or tax rate 2)
* @param Societe $thirdparty_buyer Object of buying third party
* @param Societe $thirdparty_seller Object of selling third party
* @return mixed 0 if not found, localtax if found
* @return mixed 0 if not found, localtax rate if found
* @see get_default_tva
*/
function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller="")
{
global $db, $conf, $mysoc;
if (empty($thirdparty_seller) || ! is_object($thirdparty_seller)) $thirdparty_seller=$mysoc;
dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')."/country_code=".(is_object($thirdparty_buyer)?$thirdparty_buyer->country_code:'')." thirdparty_seller id=".$thirdparty_seller->id."/country_code=".$thirdparty_seller->country_code." thirdparty_seller localtax1_assuj=".$thirdparty_seller->localtax1_assuj." thirdparty_seller localtax2_assuj=".$thirdparty_seller->localtax2_assuj);
dol_syslog("get_localtax tva=".$vatrate." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')."/country_code=".(is_object($thirdparty_buyer)?$thirdparty_buyer->country_code:'')." thirdparty_seller id=".$thirdparty_seller->id."/country_code=".$thirdparty_seller->country_code." thirdparty_seller localtax1_assuj=".$thirdparty_seller->localtax1_assuj." thirdparty_seller localtax2_assuj=".$thirdparty_seller->localtax2_assuj);
if($thirdparty_buyer->country_code!=$thirdparty_seller->country_code)
$vatratecleaned = $vatrate;
if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)"
{
$vatratecleaned = $reg[1];
$vatratecode = $reg[2];
}
/*if ($thirdparty_buyer->country_code != $thirdparty_seller->country_code)
{
return 0;
}
}*/
// Some test to guess with no need to make database access
if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe
{
if ($local == 1)
{
if(! $mysoc->localtax1_assuj) return 0;
if ($thirdparty_seller->id==$mysoc->id)
if (! $mysoc->localtax1_assuj) return 0;
if ($thirdparty_seller->id == $mysoc->id)
{
if (! $thirdparty_buyer->localtax1_assuj) return 0;
}
@ -3323,8 +3345,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
if ($local == 2)
{
if(! $mysoc->localtax2_assuj) return 0;
if ($thirdparty_seller->id==$mysoc->id )
if (! $mysoc->localtax2_assuj) return 0;
if ($thirdparty_seller->id == $mysoc->id)
{
if (! $thirdparty_buyer->localtax2_assuj) return 0;
}
@ -3350,63 +3372,72 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
}*/
// Search local taxes
if ($local==1)
if ($mysoc->country_code == 'ES' || ! empty($conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY))
{
if($thirdparty_seller!=$mysoc )
{
if(!isOnlyOneLocalTax($local))
{
return $thirdparty_seller->localtax1_value;
}
}
else
{
if(!isOnlyOneLocalTax($local))
{
return $conf->global->MAIN_INFO_VALUE_LOCALTAX1;
}
}
}
if ($local==2)
{
if($thirdparty_seller!=$mysoc)
{
if(!isOnlyOneLocalTax($local))
{
return $thirdparty_seller->localtax2_value;
}
}
else
{
if(!isOnlyOneLocalTax($local))
{
return $conf->global->MAIN_INFO_VALUE_LOCALTAX2;
}
}
if ($local==1)
{
if ($thirdparty_seller != $mysoc)
{
if (!isOnlyOneLocalTax($local)) // TODO We should provide $vatrate to search on correct line and not always on line with highest vat rate
{
return $thirdparty_seller->localtax1_value;
}
}
else // i am the seller
{
if (!isOnlyOneLocalTax($local)) // TODO If seller is me, why not always returning this, even if there is only one locatax vat.
{
return $conf->global->MAIN_INFO_VALUE_LOCALTAX1;
}
}
}
if ($local==2)
{
if ($thirdparty_seller != $mysoc)
{
if (!isOnlyOneLocalTax($local)) // TODO We should provide $vatrate to search on correct line and not always on line with highest vat rate
// TODO We should also return value defined on thirdparty only if defined
{
return $thirdparty_seller->localtax2_value;
}
}
else // i am the seller
{
if (!isOnlyOneLocalTax($local)) // This is for spain only, we don't return value found into datbase even if there is only one locatax vat.
{
return $conf->global->MAIN_INFO_VALUE_LOCALTAX2;
}
}
}
}
// By default, search value of local tax on line of common tax
$sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
$sql .= " AND t.taux = ".((float) $tva)." AND t.active = 1";
dol_syslog("get_localtax", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($local==1) return $obj->localtax1;
elseif ($local==2) return $obj->localtax2;
}
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
$sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
if ($vatratecode) $sql.= " AND t.code ='".$vatratecode."'";
dol_syslog("get_localtax", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($local==1) return $obj->localtax1;
elseif ($local==2) return $obj->localtax2;
}
return 0;
}
/**
* Return true if LocalTax is unique
* Return true if LocalTax (1 or 2) is unique.
* Example: If localtax1 is 5 on line with highest common vat rate, return true
* Example: If localtax1 is 5:8:15 on line with highest common vat rate, return false
*
* @param int $local Local taxt to test
* @return boolean True if LocalTax have multiple values, False if not
* @param int $local Local tax to test (1 or 2)
* @return boolean True if LocalTax have multiple values, False if not
*/
function isOnlyOneLocalTax($local)
{
@ -3414,7 +3445,7 @@ function isOnlyOneLocalTax($local)
$valors=explode(":", $tax);
if(count($valors)>1)
if (count($valors)>1)
{
return false;
}
@ -3425,7 +3456,7 @@ function isOnlyOneLocalTax($local)
}
/**
* Get values of localtaxes
* Get values of localtaxes (1 or 2) for company country for the common vat with the highest value
*
* @param int $local LocalTax to get
* @return number Values of localtax
@ -3435,9 +3466,10 @@ function get_localtax_by_third($local)
global $db, $mysoc;
$sql ="SELECT t.localtax1, t.localtax2 ";
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=t.fk_pays";
$sql.=" WHERE c.code = '".$mysoc->country_code."' AND t.taux=(SELECT max(tt.taux)";
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=tt.fk_pays";
$sql.=" WHERE c.code = '".$mysoc->country_code."')";
$sql.=" WHERE c.code = '".$mysoc->country_code."' AND t.active = 1 AND t.taux=(";
$sql.=" SELECT max(tt.taux) FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=tt.fk_pays";
$sql.=" WHERE c.code = '".$mysoc->country_code."' AND tt.active = 1";
$sql.=" )";
$resql=$db->query($sql);
if ($resql)
@ -3456,7 +3488,7 @@ function get_localtax_by_third($local)
* Get type and rate of localtaxes for a particular vat rate/country fo thirdparty
* TODO
* This function is also called to retrieve type for building PDF. Such call of function must be removed.
* Instead this function must be called when adding a line to get (array of localtax and type) and
* Instead this function must be called when adding a line to get the array of localtax and type, and then
* provide it to the function calcul_price_total.
*
* @param float $vatrate VAT Rate
@ -3467,15 +3499,24 @@ function get_localtax_by_third($local)
*/
function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller)
{
global $db;
global $db, $mysoc;
dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local);
$vatratecleaned = $vatrate;
if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)"
{
$vatratecleaned = $reg[1];
$vatratecode = $reg[2];
}
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'";
$sql .= " AND t.taux = ".((float) $vatrate)." AND t.active = 1";
if ($mysoc->country_code == 'ES') $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'";
else $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'";
$sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
if ($vatratecode) $sql.= " AND t.code ='".$vatratecode."'";
$resql=$db->query($sql);
if ($resql)
@ -5057,8 +5098,9 @@ function printCommonFooter($zone='private')
print '<!-- Set handler to add page_y param on some a href links -->'."\n";
print 'jQuery(".reposition").click(function() {
var page_y = $(document).scrollTop();
/* alert(page_y); */
this.href=this.href+\'&page_y=\'+page_y;
});';
});'."\n";
print '});'."\n";
print '</script>'."\n";
@ -5290,7 +5332,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
*
* @param string $file Original filename (full or relative path)
* @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini')
* @param string $extImgTarget Force image extension for thumbs. Use '' to keep same extension than original image.
* @param string $extImgTarget Force image extension for thumbs. Use '' to keep same extension than original image. Use '.png' for generated thumb files.
* @return string New file name (full or relative path, including the thumbs/)
*/
function getImageFileNameForSize($file, $extName, $extImgTarget='')

View File

@ -1608,8 +1608,8 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
if ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
}
if ($objecttype == 'askpricesupplier') {
$classpath = 'comm/askpricesupplier/class';
if ($objecttype == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
}
if ($objecttype == 'shipping') {
$classpath = 'expedition/class';
@ -1842,8 +1842,8 @@ function getElementProperties($element_type)
if ($element_type == 'propal') {
$classpath = 'comm/propal/class';
}
if ($element_type == 'askpricesupplier') {
$classpath = 'comm/askpricesupplier/class';
if ($element_type == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
}
if ($element_type == 'shipping') {
$classpath = 'expedition/class';

View File

@ -29,17 +29,17 @@
* @param object $object Object related to tabs
* @return array Array of tabs to show
*/
function askpricesupplier_prepare_head($object)
function supplier_proposal_prepare_head($object)
{
global $langs, $conf, $user;
$langs->load("askpricesupplier");
$langs->load("supplier_proposal");
$langs->load("compta");
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/card.php?id='.$object->id;
$head[$h][1] = $langs->trans('AskPriceSupplierCard');
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$object->id;
$head[$h][1] = $langs->trans('SupplierProposalCard');
$head[$h][2] = 'comm';
$h++;
@ -48,14 +48,14 @@ function askpricesupplier_prepare_head($object)
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'askpricesupplier');
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_proposal');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = 0;
if(!empty($object->note_private)) $nbNote++;
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/note.php?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$h][2] = 'note';
@ -63,20 +63,20 @@ function askpricesupplier_prepare_head($object)
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->askpricesupplier->dir_output . "/" . dol_sanitizeFileName($object->ref);
$upload_dir = $conf->supplier_proposal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/document.php?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
if($nbFiles > 0) $head[$h][1].= ' <span class="badge">'.$nbFiles.'</span>';
$head[$h][2] = 'document';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/info.php?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'askpricesupplier','remove');
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_proposal','remove');
return $head;
}
@ -86,14 +86,14 @@ function askpricesupplier_prepare_head($object)
*
* @return array head array with tabs
*/
function askpricesupplier_admin_prepare_head()
function supplier_proposal_admin_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/askpricesupplier.php';
$head[$h][0] = DOL_URL_ROOT.'/admin/supplier_proposal.php';
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$h++;
@ -102,19 +102,19 @@ function askpricesupplier_admin_prepare_head()
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,null,$head,$h,'askpricesupplier_admin');
complete_head_from_modules($conf,$langs,null,$head,$h,'supplier_proposal_admin');
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/askpricesupplier_extrafields.php';
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/admin/supplier_proposal_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/askpricesupplierdet_extrafields.php';
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/admin/supplier_proposaldet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines';
$h++;
complete_head_from_modules($conf,$langs,null,$head,$h,'askpricesupplier_admin','remove');
complete_head_from_modules($conf,$langs,null,$head,$h,'supplier_proposal_admin','remove');
return $head;
}

View File

@ -382,46 +382,51 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '</td></tr>';
// Use Hover
$var=!$var;
// BackgroundColor
if ($foruserprofile)
{
/* Must first change option to choose color of highlight insteado of yes or no.
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER" disabled="disabled" type="checkbox" '.($conf->global->THEME_ELDY_USE_HOVER?" checked":"").'></td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled="disabled"').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
print '</tr>';
*/
}
else
{
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("HighlightLinesColor").'</td>';
print '<td colspan="'.($colspan-1).'">';
//print '<input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
//print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
{
/*$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'</td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TOPMENU_BACK1" id="check_THEME_ELDY_TOPMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>';
if ($edit)
{
if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='edf4fb';
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),'');
print $formother->selectColor($color,'THEME_ELDY_USE_HOVER','formcolor',1).' ';
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' ';
}
else
{
if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='edf4fb';
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("None");
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
else print '';
}
print ' &nbsp; ('.$langs->trans("Default").': <strong>edf4fb</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
print '</tr>';
}
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';*/
}
else
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("BackgroundColor").'</td>';
print '<td colspan="'.($colspan-1).'">';
//var_dump($conf->global->THEME_ELDY_BACKBODY);
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY,array()),''),'THEME_ELDY_BACKBODY','formcolor',1).' ';
}
else
{
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default");
}
print ' &nbsp; ('.$langs->trans("Default").': <strong>ffffff</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
}
// TopMenuBackgroundColor
if ($foruserprofile)
{
@ -492,6 +497,90 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '</tr>';
}
// Use Hover
$var=!$var;
if ($foruserprofile)
{
/* Must first change option to choose color of highlight instead of yes or no.
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER" disabled="disabled" type="checkbox" '.($conf->global->THEME_ELDY_USE_HOVER?" checked":"").'></td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled="disabled"').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
print '</tr>';
*/
}
else
{
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("HighlightLinesColor").'</td>';
print '<td colspan="'.($colspan-1).'">';
//print '<input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
//print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
if ($edit)
{
if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='edf4fb';
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),'');
print $formother->selectColor($color,'THEME_ELDY_USE_HOVER','formcolor',1).' ';
}
else
{
if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='edf4fb';
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("None");
}
print ' &nbsp; ('.$langs->trans("Default").': <strong>edf4fb</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
print '</tr>';
}
// TopMenuBackgroundColor
if ($foruserprofile)
{
/*$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'</td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TOPMENU_BACK1" id="check_THEME_ELDY_TOPMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' ';
}
else
{
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
else print '';
}
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';*/
}
else
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("LinkColor").'</td>';
print '<td colspan="'.($colspan-1).'">';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''),'THEME_ELDY_TEXTLINK','formcolor',1).' ';
}
else
{
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default");
}
print ' &nbsp; ('.$langs->trans("Default").': <strong>000078</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
}
print '</table>';
}

View File

@ -444,7 +444,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
print '<div class="menu_titre" id="menu_titre_logo"></div>';
print '<div class="menu_top" id="menu_top_logo"></div>';
print '<div class="menu_contenu" id="menu_contenu_logo">';
print '<div class="center"><img title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 80%"></div>'."\n";
print '<div class="center"><img class="companylogo" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 80%"></div>'."\n";
print '</div>';
print '<div class="menu_end" id="menu_end_logo"></div>';
print '</div>'."\n";
@ -672,11 +672,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("companies");
// Propal
// Customer proposal
if (! empty($conf->propal->enabled))
{
$langs->load("propal");
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Prop"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals');
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Prop"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100);
$newmenu->add("/comm/propal.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire);
if (empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire);
@ -692,7 +692,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->commande->enabled))
{
$langs->load("orders");
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200);
$newmenu->add("/commande/card.php?action=create&amp;leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
$newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
@ -708,7 +708,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->fournisseur->enabled))
{
$langs->load("orders");
$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers');
$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400);
$newmenu->add("/fourn/commande/card.php?action=create&amp;leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer);
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire);
@ -729,7 +729,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->contrat->enabled))
{
$langs->load("contracts");
$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("Contracts"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts');
$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("Contracts"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000);
$newmenu->add("/contrat/card.php?action=create&amp;leftmenu=contracts", $langs->trans("NewContract"), 1, $user->rights->contrat->creer);
$newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire);
$newmenu->add("/contrat/services.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire);
@ -743,7 +743,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->ficheinter->enabled))
{
$langs->load("interventions");
$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 200);
$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200);
$newmenu->add("/fichinter/card.php?action=create&amp;leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202);
}
@ -1400,6 +1400,17 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
//var_dump($menu_array);exit;
if (! is_array($menu_array)) return 0;
// TODO Use the position property in menu_array to reorder the $menu_array
//var_dump($menu_array);
/*$new_menu_array = array();
$level=0; $cusor=0; $position=0;
$nbentry = count($menu_array);
while (findNextEntryForLevel($menu_array, $cursor, $position, $level))
{
$cursor++;
}*/
// Show menu
$invert=empty($conf->global->MAIN_MENU_INVERT)?"":"invert";
if (empty($noout))

View File

@ -34,21 +34,31 @@
*/
class DolibarrModules // Can not be abstract, because we need to instantiant it into unActivateModule to be able to disable a module whose files were removed.
{
/**
* @var DoliDb Database handler
*/
public $db;
/**
* @var int Module unique ID
*/
public $numero;
/**
* @var string Family
*/
public $family;
/**
* @var int module_position
*/
public $module_position=500;
/**
* @var string Module name
*/
public $name;
/**
* @var DoliDb Database handler
*/
public $db;
/**
* @var array Paths to create when module is activated
*/

View File

@ -44,6 +44,7 @@ class modAccounting extends DolibarrModules
$this->numero = 50400;
$this->family = "financial";
$this->module_position = 610;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Advanced accounting management";

View File

@ -49,6 +49,7 @@ class modAdherent extends DolibarrModules
$this->numero = 310;
$this->family = "hr";
$this->module_position = 20;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Management of members of a foundation or association";

View File

@ -50,6 +50,7 @@ class modAgenda extends DolibarrModules
$this->numero = 2400;
$this->family = "projects";
$this->module_position = 15;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion de l'agenda et des actions";

View File

@ -49,6 +49,7 @@ class modBanque extends DolibarrModules
$this->numero = 85;
$this->family = "financial";
$this->module_position = 510;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des comptes financiers de type Comptes bancaires ou postaux";

View File

@ -46,6 +46,7 @@ class modCashDesk extends DolibarrModules
$this->rights_class = 'cashdesk';
$this->family = "portal";
$this->module_position = 10;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "CashDesk module";

View File

@ -51,6 +51,7 @@ class modCommande extends DolibarrModules
$this->numero = 25;
$this->family = "crm";
$this->module_position = 30;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des commandes clients";

View File

@ -48,6 +48,7 @@ class modComptabilite extends DolibarrModules
$this->numero = 10;
$this->family = "financial";
$this->module_position = 600;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion sommaire de comptabilite";

View File

@ -45,6 +45,7 @@ class modDocumentGeneration extends DolibarrModules
$this->numero = 1520;
$this->family = "technic";
$this->module_position = 10000;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Direct mail document generation";

View File

@ -48,6 +48,7 @@ class modECM extends DolibarrModules
// Family can be 'crm','financial','hr','projects','product','ecm','technic','other'
// It is used to sort modules in module setup page
$this->family = "ecm";
$this->module_position = 10;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)

View File

@ -49,6 +49,7 @@ class modExpedition extends DolibarrModules
$this->numero = 80;
$this->family = "crm";
$this->module_position = 40;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des expeditions";

View File

@ -52,6 +52,7 @@ class modExpenseReport extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "hr";
$this->module_position = 40;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -48,6 +48,7 @@ class modFacture extends DolibarrModules
$this->numero = 30;
$this->family = "financial";
$this->module_position = 10;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des factures";

View File

@ -48,6 +48,7 @@ class modFournisseur extends DolibarrModules
$this->numero = 40;
$this->family = "products";
$this->module_position = 10;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des fournisseurs";

View File

@ -53,6 +53,7 @@ class modHoliday extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "hr";
$this->module_position = 30;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -48,6 +48,7 @@ class modMargin extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "financial";
$this->module_position = 550;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -47,6 +47,7 @@ class modOauth extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->module_position = 510;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -52,6 +52,7 @@ class modOpenSurvey extends DolibarrModules
// Family can be 'crm','financial','hr','projects','product','technic','other'
// It is used to group modules in module setup page
$this->family = "projects";
$this->module_position = 40;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is value MyModule)

View File

@ -48,6 +48,7 @@ class modPrelevement extends DolibarrModules
$this->numero = 57;
$this->family = "financial";
$this->module_position = 520;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des Prelevements";

View File

@ -47,6 +47,7 @@ class modPrinting extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->module_position = 520;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -50,6 +50,7 @@ class modProduct extends DolibarrModules
$this->numero = 50;
$this->family = "products";
$this->module_position = 20;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des produits";

View File

@ -46,6 +46,8 @@ class modProductBatch extends DolibarrModules
$this->numero = 39000;
$this->family = "products";
$this->module_position = 45;
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Batch number, eat-by and sell-by date management module";

View File

@ -50,6 +50,7 @@ class modProjet extends DolibarrModules
$this->numero = 400;
$this->family = "projects";
$this->module_position = 10;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des projets";

View File

@ -49,6 +49,7 @@ class modPropale extends DolibarrModules
$this->numero = 20;
$this->family = "crm";
$this->module_position = 20;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des propositions commerciales";

View File

@ -47,6 +47,7 @@ class modReceiptPrinter extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->module_position = 530;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -47,12 +47,14 @@ class modResource extends DolibarrModules
// Use a free id here
// (See in Home -> System information -> Dolibarr for list of used modules id).
$this->numero = 63000;
// Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'resource';
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "projects";
$this->module_position = 20;
// Module label (no space allowed)
// used if translation string 'ModuleXXXName' not found
// (where XXX is value of numeric property 'numero' of module)

View File

@ -48,6 +48,7 @@ class modService extends DolibarrModules
$this->numero = 53;
$this->family = "products";
$this->module_position = 30;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des services";

View File

@ -49,6 +49,7 @@ class modSociete extends DolibarrModules
$this->numero = 1;
$this->family = "crm";
$this->module_position = 10;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des societes et contacts";

View File

@ -48,6 +48,7 @@ class modStock extends DolibarrModules
$this->numero = 52;
$this->family = "products";
$this->module_position = 40;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des stocks";

View File

@ -21,11 +21,11 @@
*/
/**
* \defgroup askpricesupplier Module askpricesupplier
* \defgroup supplier_proposal Module supplier_proposal
* \brief Module to request supplier price proposals
* \file htdocs/core/modules/modAskPriceSupplier.class.php
* \ingroup askpricesupplier
* \brief File to describe and activate module AskPriceSupplier
* \file htdocs/core/modules/modSupplierProposal.class.php
* \ingroup supplier_proposal
* \brief File to describe and activate module SupplierProposal
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
@ -33,7 +33,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* Class to describe and enable module AskPriceSupllier
*/
class modAskPriceSupplier extends DolibarrModules
class modSupplierProposal extends DolibarrModules
{
/**
@ -50,43 +50,43 @@ class modAskPriceSupplier extends DolibarrModules
$this->family = "products";
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "askpricesupplierDESC";
$this->description = "supplier_proposalDESC";
$this->version = 'experimental';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='askpricesupplier';
$this->picto='supplier_proposal';
$this->dirs = array();
// Dependancies
$this->depends = array('modFournisseur');
$this->requiredby = array();
$this->config_page_url = array("askpricesupplier.php");
$this->langfiles = array("askpricesupplier");
$this->config_page_url = array("supplier_proposal.php");
$this->langfiles = array("supplier_proposal");
// Constants
$this->const = array();
$r=0;
$this->const[$r][0] = "ASKPRICESUPPLIER_ADDON_PDF";
$this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "aurore";
$this->const[$r][3] = 'Name of submodule to generate PDF for supplier quotation request';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ASKPRICESUPPLIER_ADDON";
$this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_askpricesupplier_marbre";
$this->const[$r][2] = "mod_supplier_proposal_marbre";
$this->const[$r][3] = 'Name of submodule to number supplier quotation request';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ASKPRICESUPPLIER_ADDON_PDF_ODT_PATH";
$this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/askpricesupplier";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_proposal";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
@ -95,7 +95,7 @@ class modAskPriceSupplier extends DolibarrModules
// Permissions
$this->rights = array();
$this->rights_class = 'askpricesupplier';
$this->rights_class = 'supplier_proposal';
$r=0;
$r++;
@ -142,40 +142,40 @@ class modAskPriceSupplier extends DolibarrModules
$this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'askpricesupplierMENU_LEFT_TITLE',
'leftmenu'=>'askpricesuppliersubmenu',
'url'=>'/comm/askpricesupplier/index.php',
'langs'=>'askpricesupplier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'enabled'=>'$conf->askpricesupplier->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->askpricesupplier->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'titre'=>'supplier_proposalMENU_LEFT_TITLE',
'leftmenu'=>'supplier_proposalsubmenu',
'url'=>'/supplier_proposal/index.php',
'langs'=>'supplier_proposal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'enabled'=>'$conf->supplier_proposal->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->supplier_proposal->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
'position'=>30
'position'=>300
);
$r++;
$this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=askpricesuppliersubmenu',
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
'type'=>'left',
'titre'=>'askpricesupplierMENU_LEFT_TITLE_NEW',
'url'=>'/comm/askpricesupplier/card.php?action=create',
'langs'=>'askpricesupplier',
'enabled'=>'$conf->askpricesupplier->enabled',
'perms'=>'$user->rights->askpricesupplier->creer',
'titre'=>'supplier_proposalMENU_LEFT_TITLE_NEW',
'url'=>'/supplier_proposal/card.php?action=create',
'langs'=>'supplier_proposal',
'enabled'=>'$conf->supplier_proposal->enabled',
'perms'=>'$user->rights->supplier_proposal->creer',
'user'=>2,
'position'=>31
'position'=>301
);
$r++;
$this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=askpricesuppliersubmenu',
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
'type'=>'left',
'titre'=>'askpricesupplierMENU_LEFT_TITLE_LIST',
'url'=>'/comm/askpricesupplier/list.php',
'langs'=>'askpricesupplier',
'enabled'=>'$conf->askpricesupplier->enabled',
'perms'=>'$user->rights->askpricesupplier->lire',
'titre'=>'supplier_proposalMENU_LEFT_TITLE_LIST',
'url'=>'/supplier_proposal/list.php',
'langs'=>'supplier_proposal',
'enabled'=>'$conf->supplier_proposal->enabled',
'perms'=>'$user->rights->supplier_proposal->lire',
'user'=>2,
'position'=>32
'position'=>302
);
$r++;
}
@ -197,9 +197,9 @@ class modAskPriceSupplier extends DolibarrModules
$this->remove($options);
//ODT template
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/askpricesupplier/template_askpricesupplier.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/askpricesupplier';
$dest=$dirodt.'/template_askpricesupplier.odt';
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_proposal/template_supplier_proposal.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/supplier_proposal';
$dest=$dirodt.'/template_supplier_proposal.odt';
if (file_exists($src) && ! file_exists($dest))
{
@ -216,9 +216,29 @@ class modAskPriceSupplier extends DolibarrModules
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','askpricesupplier',".$conf->entity.")",
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','supplier_proposal',".$conf->entity.")",
);
return $this->_init($sql, $options);
}
/**
* Function called when module is disabled.
* Remove from database constants, boxes and permissions from Dolibarr database.
* Data directories are not deleted
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
public function remove($options = '')
{
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'askpricesupplier'"
);
return $this->_remove($sql, $options);
}
}

View File

@ -46,6 +46,7 @@ class modUser extends DolibarrModules
$this->numero = 0;
$this->family = "hr"; // Family for module (or "base" if core module)
$this->module_position = 10;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des utilisateurs (requis)";

View File

@ -42,10 +42,11 @@ class modWebsite extends DolibarrModules
$this->db = $db;
$this->numero = 10000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "portal";
$this->module_position = 20;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the public website with CMS features";

View File

@ -23,7 +23,7 @@
* \brief File of class to build ODT documents for third parties
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/askpricesupplier/modules_askpricesupplier.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
/**
* Class to build documents using ODF templates generator
*/
class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
{
var $emetteur; // Objet societe qui emet
@ -57,7 +57,7 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
$this->db = $db;
$this->name = "ODT templates";
$this->description = $langs->trans("DocumentModelOdt");
$this->scandir = 'ASKPRICESUPPLIER_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan
$this->scandir = 'SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan
// Dimension page pour format A4
$this->type = 'odt';
@ -105,19 +105,19 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$texte.= '<input type="hidden" name="action" value="setModuleOptions">';
$texte.= '<input type="hidden" name="param1" value="ASKPRICESUPPLIER_ADDON_PDF_ODT_PATH">';
if ($conf->global->MAIN_ASKPRICESUPPLIER_CHOOSE_ODT_DOCUMENT > 0)
$texte.= '<input type="hidden" name="param1" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH">';
if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0)
{
$texte.= '<input type="hidden" name="param2" value="ASKPRICESUPPLIER_ADDON_PDF_ODT_DEFAULT">';
$texte.= '<input type="hidden" name="param3" value="ASKPRICESUPPLIER_ADDON_PDF_ODT_TOBILL">';
$texte.= '<input type="hidden" name="param4" value="ASKPRICESUPPLIER_ADDON_PDF_ODT_CLOSED">';
$texte.= '<input type="hidden" name="param2" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT">';
$texte.= '<input type="hidden" name="param3" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL">';
$texte.= '<input type="hidden" name="param4" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED">';
}
$texte.= '<table class="nobordernopadding" width="100%">';
// List of directories area
$texte.= '<tr><td>';
$texttitle=$langs->trans("ListOfDirectories");
$listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->ASKPRICESUPPLIER_ADDON_PDF_ODT_PATH)));
$listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH)));
$listoffiles=array();
foreach($listofdir as $key=>$tmpdir)
{
@ -141,7 +141,7 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
$texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1);
$texte.= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
$texte.= '<textarea class="flat" cols="60" name="value1">';
$texte.=$conf->global->ASKPRICESUPPLIER_ADDON_PDF_ODT_PATH;
$texte.=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH;
$texte.= '</textarea>';
$texte.= '</div><div style="display: inline-block; vertical-align: middle;">';
$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
@ -152,27 +152,27 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
{
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
if ($conf->global->MAIN_ASKPRICESUPPLIER_CHOOSE_ODT_DOCUMENT > 0)
if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0)
{
// Model for creation
$liste=ModelePDFAskPriceSupplier::liste_modeles($this->db);
$liste=ModelePDFSupplierProposal::liste_modeles($this->db);
$texte.= '<table width="50%;">';
$texte.= '<tr>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelAskPriceSupplierCreate").'</td>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelSupplierProposalCreate").'</td>';
$texte.= '<td colspan="">';
$texte.= $form->selectarray('value2',$liste,$conf->global->ASKPRICESUPPLIER_ADDON_PDF_ODT_DEFAULT);
$texte.= $form->selectarray('value2',$liste,$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT);
$texte.= "</td></tr>";
$texte.= '<tr>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelAskPriceSupplierToBill").'</td>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelSupplierProposalToBill").'</td>';
$texte.= '<td colspan="">';
$texte.= $form->selectarray('value3',$liste,$conf->global->ASKPRICESUPPLIER_ADDON_PDF_ODT_TOBILL);
$texte.= $form->selectarray('value3',$liste,$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL);
$texte.= "</td></tr>";
$texte.= '<tr>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelAskPriceSupplierClosed").'</td>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelSupplierProposalClosed").'</td>';
$texte.= '<td colspan="">';
$texte.= $form->selectarray('value4',$liste,$conf->global->ASKPRICESUPPLIER_ADDON_PDF_ODT_CLOSED);
$texte.= $form->selectarray('value4',$liste,$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED);
$texte.= "</td></tr>";
$texte.= '</table>';
}
@ -230,13 +230,13 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
$outputlangs->load("companies");
$outputlangs->load("bills");
if ($conf->askpricesupplier->dir_output)
if ($conf->supplier_proposal->dir_output)
{
// If $object is id instead of object
if (! is_object($object))
{
$id = $object;
$object = new AskPriceSupplier($this->db);
$object = new SupplierProposal($this->db);
$result=$object->fetch($id);
if ($result < 0)
{
@ -245,7 +245,7 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
}
}
$dir = $conf->askpricesupplier->dir_output;
$dir = $conf->supplier_proposal->dir_output;
$objectref = dol_sanitizeFileName($object->ref);
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".odt";
@ -285,7 +285,7 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
//print "file=".$file;
//print "conf->propal->dir_temp=".$conf->propal->dir_temp;
dol_mkdir($conf->askpricesupplier->dir_temp);
dol_mkdir($conf->supplier_proposal->dir_temp);
// If BILLING contact defined on invoice, we use it
@ -324,7 +324,7 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
// Line of free text
$newfreetext='';
$paramfreetext='ASKPRICESUPPLIER_FREE_TEXT';
$paramfreetext='SUPPLIER_PROPOSAL_FREE_TEXT';
if (! empty($conf->global->$paramfreetext))
{
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
@ -336,7 +336,7 @@ class doc_generic_askpricesupplier_odt extends ModelePDFAskPriceSupplier
$odfHandler = new odf(
$srctemplatepath,
array(
'PATH_TO_TMP' => $conf->askpricesupplier->dir_temp,
'PATH_TO_TMP' => $conf->supplier_proposal->dir_temp,
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
'DELIMITER_LEFT' => '{',
'DELIMITER_RIGHT' => '}'

View File

@ -25,7 +25,7 @@
* \ingroup propale
* \brief Fichier de la classe permettant de generer les propales au modele Azur
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/askpricesupplier/modules_askpricesupplier.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/**
* Class to generate PDF proposal Azur
*/
class pdf_aurore extends ModelePDFAskPriceSupplier
class pdf_aurore extends ModelePDFSupplierProposal
{
var $db;
var $name;
@ -103,7 +103,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
$this->posxtva=102;
$this->posxup=116;
$this->posxup=126;
$this->posxqty=145;
$this->posxdiscount=162;
$this->postotalht=174;
@ -149,14 +149,14 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
$outputlangs->load("dict");
$outputlangs->load("companies");
$outputlangs->load("bills");
$outputlangs->load("askpricesupplier");
$outputlangs->load("supplier_proposal");
$outputlangs->load("products");
$nblignes = count($object->lines);
// Loop on each lines to detect if there is at least one image to show
$realpatharray=array();
if (! empty($conf->global->MAIN_GENERATE_ASKPRICESUPPLIER_WITH_PICTURE))
if (! empty($conf->global->MAIN_GENERATE_SUPPLIER_PROPOSAL_WITH_PICTURE))
{
for ($i = 0 ; $i < $nblignes ; $i++)
{
@ -182,7 +182,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
}
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
if ($conf->askpricesupplier->dir_output)
if ($conf->supplier_proposal->dir_output)
{
$object->fetch_thirdparty();
@ -191,13 +191,13 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
// Definition of $dir and $file
if ($object->specimen)
{
$dir = $conf->askpricesupplier->dir_output;
$dir = $conf->supplier_proposal->dir_output;
$file = $dir . "/SPECIMEN.pdf";
}
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->askpricesupplier->dir_output . "/" . $objectref;
$dir = $conf->supplier_proposal->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
}
@ -421,6 +421,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
/*
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
@ -433,13 +434,15 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
$pdf->SetXY($this->posxup, $curY);
if ($up_excl_tax > 0)
$pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
*/
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars
// Discount on line
/*
if ($object->lines[$i]->remise_percent)
{
$pdf->SetXY($this->posxdiscount-2, $curY);
@ -452,7 +455,8 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
$pdf->SetXY($this->postotalht, $curY);
if ($total_excl_tax > 0)
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
*/
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
$tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
@ -591,7 +595,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
}
else
{
$this->error=$langs->trans("ErrorConstantNotDefined","ASKSUPPLIERPICE_OUTPUTDIR");
$this->error=$langs->trans("ErrorConstantNotDefined","SUPPLIER_PROPOSAL_OUTPUTDIR");
return 0;
}
}
@ -685,7 +689,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
}*/
// Show payments conditions
if (empty($conf->global->ASKPRICESUPPLIER_PDF_HIDE_PAYMENTTERMCOND) && ($object->cond_reglement_code || $object->cond_reglement))
if (empty($conf->global->SUPPLIER_PROPOSAL_PDF_HIDE_PAYMENTTERMCOND) && ($object->cond_reglement_code || $object->cond_reglement))
{
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
@ -715,7 +719,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
$posy=$pdf->GetY()+3;
}
if (empty($conf->global->ASKPRICESUPPLIER_PDF_HIDE_PAYMENTTERMCOND))
if (empty($conf->global->SUPPLIER_PROPOSAL_PDF_HIDE_PAYMENTTERMCOND))
{
// Show payment mode
if ($object->mode_reglement_code
@ -1148,7 +1152,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
if (empty($hidetop))
{
$pdf->SetXY($this->posxup-1, $tab_top+1);
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("AskPriceSupplierUHT"),'','C');
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
}
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
@ -1193,7 +1197,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
$outputlangs->load("main");
$outputlangs->load("bills");
$outputlangs->load("askpricesupplier");
$outputlangs->load("supplier_proposal");
$outputlangs->load("companies");
$default_font_size = pdf_getPDFFontSize($outputlangs);
@ -1201,9 +1205,9 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
// Show Draft Watermark
if($object->statut==0 && (! empty($conf->global->ASKPRICESUPPLIER_DRAFT_WATERMARK)) )
if($object->statut==0 && (! empty($conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK)) )
{
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->ASKPRICESUPPLIER_DRAFT_WATERMARK);
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK);
}
$pdf->SetTextColor(0,0,60);
@ -1264,7 +1268,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("AskPriceSupplierDate")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R');
*/
if ($object->client->code_client)
@ -1386,7 +1390,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{
$showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'ASKPRICESUPPLIER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_PROPOSAL_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}
}

View File

@ -23,13 +23,13 @@
* \brief File of class to manage commercial proposal numbering rules Marbre
*/
require_once DOL_DOCUMENT_ROOT .'/core/modules/askpricesupplier/modules_askpricesupplier.php';
require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_proposal/modules_supplier_proposal.php';
/**
* Class to manage customer order numbering rules Marbre
*/
class mod_askpricesupplier_marbre extends ModeleNumRefAskPriceSupplier
class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='DF';
@ -74,7 +74,7 @@ class mod_askpricesupplier_marbre extends ModeleNumRefAskPriceSupplier
$posindice=8;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql.= " FROM ".MAIN_DB_PREFIX."askpricesupplier";
$sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal";
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
$sql.= " AND entity = ".$conf->entity;
@ -101,17 +101,17 @@ class mod_askpricesupplier_marbre extends ModeleNumRefAskPriceSupplier
* Return next value
*
* @param Societe $objsoc Object third party
* @param Propal $askpricesupplier Object commercial proposal
* @param Propal $supplier_proposal Object commercial proposal
* @return string Next value
*/
function getNextValue($objsoc,$askpricesupplier)
function getNextValue($objsoc,$supplier_proposal)
{
global $db,$conf;
// D'abord on recupere la valeur max
$posindice=8;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
$sql.= " FROM ".MAIN_DB_PREFIX."askpricesupplier";
$sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal";
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
$sql.= " AND entity = ".$conf->entity;

View File

@ -25,13 +25,13 @@
* \brief File that contains the numbering module rules Saphir
*/
require_once DOL_DOCUMENT_ROOT .'/core/modules/askpricesupplier/modules_askpricesupplier.php';
require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_proposal/modules_supplier_proposal.php';
/**
* Class of file that contains the numbering module rules Saphir
*/
class mod_askpricesupplier_saphir extends ModeleNumRefAskPriceSupplier
class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $error = '';
@ -55,7 +55,7 @@ class mod_askpricesupplier_saphir extends ModeleNumRefAskPriceSupplier
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$texte.= '<input type="hidden" name="action" value="updateMask">';
$texte.= '<input type="hidden" name="maskconstaskpricesupplier" value="ASKPRICESUPPLIER_SAPHIR_MASK">';
$texte.= '<input type="hidden" name="maskconstsupplier_proposal" value="SUPPLIER_PROPOSAL_SAPHIR_MASK">';
$texte.= '<table class="nobordernopadding" width="100%">';
$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("CommRequest"),$langs->transnoentities("CommRequest"));
@ -66,7 +66,7 @@ class mod_askpricesupplier_saphir extends ModeleNumRefAskPriceSupplier
// Parametrage du prefix
$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskaskpricesupplier" value="'.$conf->global->ASKPRICESUPPLIER_SAPHIR_MASK.'">',$tooltip,1,1).'</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="masksupplier_proposal" value="'.$conf->global->SUPPLIER_PROPOSAL_SAPHIR_MASK.'">',$tooltip,1,1).'</td>';
$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
@ -103,17 +103,17 @@ class mod_askpricesupplier_saphir extends ModeleNumRefAskPriceSupplier
* Return next value
*
* @param Societe $objsoc Object third party
* @param Propal $askpricesupplier Object askpricesupplier
* @param Propal $supplier_proposal Object supplier_proposal
* @return string Value if OK, 0 if KO
*/
function getNextValue($objsoc,$askpricesupplier)
function getNextValue($objsoc,$supplier_proposal)
{
global $db,$conf;
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
// On defini critere recherche compteur
$mask=$conf->global->ASKPRICESUPPLIER_SAPHIR_MASK;
$mask=$conf->global->SUPPLIER_PROPOSAL_SAPHIR_MASK;
if (! $mask)
{
@ -121,9 +121,9 @@ class mod_askpricesupplier_saphir extends ModeleNumRefAskPriceSupplier
return 0;
}
$date=$askpricesupplier->datep;
$date=$supplier_proposal->datep;
$customercode=$objsoc->code_client;
$numFinal=get_next_value($db,$mask,'askpricesupplier','ref','',$customercode,$date);
$numFinal=get_next_value($db,$mask,'supplier_proposal','ref','',$customercode,$date);
return $numFinal;
}

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requ
/**
* Classe mere des modeles de propale
*/
abstract class ModelePDFAskPriceSupplier extends CommonDocGenerator
abstract class ModelePDFSupplierProposal extends CommonDocGenerator
{
var $error='';
@ -50,7 +50,7 @@ abstract class ModelePDFAskPriceSupplier extends CommonDocGenerator
{
global $conf;
$type='askpricesupplier';
$type='supplier_proposal';
$liste=array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@ -64,7 +64,7 @@ abstract class ModelePDFAskPriceSupplier extends CommonDocGenerator
/**
* Classe mere des modeles de numerotation des references de propales
*/
abstract class ModeleNumRefAskPriceSupplier
abstract class ModeleNumRefSupplierProposal
{
var $error='';
@ -86,7 +86,7 @@ abstract class ModeleNumRefAskPriceSupplier
function info()
{
global $langs;
$langs->load("askpricesupplier");
$langs->load("supplier_proposal");
return $langs->trans("NoDescription");
}
@ -98,7 +98,7 @@ abstract class ModeleNumRefAskPriceSupplier
function getExample()
{
global $langs;
$langs->load("askpricesupplier");
$langs->load("supplier_proposal");
return $langs->trans("NoExample");
}
@ -149,17 +149,17 @@ abstract class ModeleNumRefAskPriceSupplier
* Create a document onto disk according to template module.
*
* @param DoliDB $db Database handler
* @param AskPriceSupplier $object Object askpricesupplier
* @param SupplierProposal $object Object supplier_proposal
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
* @deprecated Use the new function generateDocument of AskPriceSupplier class
* @see AskPriceSupplier::generateDocument()
* @deprecated Use the new function generateDocument of SupplierProposal class
* @see SupplierProposal::generateDocument()
*/
function askpricesupplier_pdf_create(DoliDB $db, AskPriceSupplier $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
function supplier_proposal_pdf_create(DoliDB $db, SupplierProposal $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);

View File

@ -48,7 +48,7 @@ $savingdocmask='';
if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
{
//var_dump($modulepart);
if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','askpricesupplier','ficheinter','contract','project','project_task','expensereport')))
if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','project','project_task','expensereport')))
{
$savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
}

View File

@ -50,7 +50,7 @@ if (! empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES))
// Special cases
if ($module == 'propal') { $permission=$user->rights->propale->creer;}
elseif ($module == 'askpricesupplier') { $permission=$user->rights->askpricesupplier->creer;}
elseif ($module == 'supplier_proposal') { $permission=$user->rights->supplier_proposal->creer;}
elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer;}
elseif ($module == 'project') { $permission=$user->rights->projet->creer;}
elseif ($module == 'project_task') { $permission=$user->rights->projet->creer;}

View File

@ -32,7 +32,10 @@
$usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','askpricesupplier','commande'))) $usemargins=1;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande')))
{
$usemargins=1;
}
global $forceall, $senderissupplier, $inputalsopricewithtax;
if (empty($dateSelector)) $dateSelector=0;
@ -43,7 +46,7 @@ if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0;
// Define colspan for button Add
$colspan = 3; // Col total ht + col edit + col delete
if (in_array($object->element,array('propal', 'askpricesupplier','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button
if (in_array($object->element,array('propal', 'supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button
//print $object->element;
?>
@ -53,8 +56,8 @@ if (in_array($object->element,array('propal', 'askpricesupplier','facture','invo
<td class="linecoldescription" <?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?>
</td>
<?php if ($object->element == 'askpricesupplier') { ?>
<tdclass="linecolrefsupplier" align="right"><span id="title_fourn_ref"><?php echo $langs->trans('AskPriceSupplierRefFourn'); ?></span></td>
<?php if ($object->element == 'supplier_proposal') { ?>
<td class="linecolrefsupplier" align="right"><span id="title_fourn_ref"><?php echo $langs->trans('SupplierProposalRefFourn'); ?></span></td>
<?php } ?>
<td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td>
<td class="linecoluht" align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td>
@ -211,13 +214,13 @@ else {
?>
</td>
<?php if ($object->element == 'askpricesupplier') { ?>
<?php if ($object->element == 'supplier_proposal') { ?>
<td class="nobottom linecolresupplier" align="right"><input id="fourn_ref" name="fourn_ref" class="flat" value="" size="12"></td>
<?php } ?>
<td class="nobottom linecolvat" align="right"><?php
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true);
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer, 0, 0, '', false, 1);
?>
</td>
<td class="nobottom linecoluht" align="right">
@ -291,8 +294,8 @@ else {
elseif ($this->table_element_line=='propaldet') {
$newline = new PropaleLigne($this->db);
}
elseif ($this->table_element_line=='askpricesupplierdet') {
$newline = new AskPriceSupplierLine($this->db);
elseif ($this->table_element_line=='supplier_proposaldet') {
$newline = new SupplierProposalLine($this->db);
}
elseif ($this->table_element_line=='facturedet') {
$newline = new FactureLigne($this->db);
@ -338,7 +341,7 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
// With this, there is a column move button ONLY if lines > 1
if (in_array($object->element, array(
'propal',
'askpricesupplier',
'supplier_proposal',
'facture',
'invoice',
'commande',

View File

@ -32,7 +32,7 @@
$usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal', 'askpricesupplier','commande'))) $usemargins=1;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;
global $forceall, $senderissupplier, $inputalsopricewithtax;
if (empty($dateSelector)) $dateSelector=0;
@ -44,7 +44,7 @@ if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0;
// Define colspan for button Add
$colspan = 3; // Col total ht + col edit + col delete
if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc
if (in_array($object->element,array('propal','askpricesupplier','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button
if (in_array($object->element,array('propal','supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button
?>
<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->
@ -104,14 +104,14 @@ $coldisplay=-1; // We remove first td
?>
</td>
<?php if ($object->element == 'askpricesupplier') { ?>
<?php if ($object->element == 'supplier_proposal') { ?>
<td align="right"><input id="fourn_ref" name="fourn_ref" class="flat" value="<?php echo $line->ref_fourn; ?>" size="12"></td>
<?php } ?>
<?php
$coldisplay++;
if ($this->situation_counter == 1 || !$this->situation_cycle_ref) {
print '<td align="right">' . $form->load_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type) . '</td>';
print '<td align="right">' . $form->load_tva('tva_tx', $line->tva_tx, $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>';
} else {
print '<td align="right"><input size="1" type="text" class="flat" name="tva_tx" value="' . price($line->tva_tx) . '" readonly />%</td>';
}

View File

@ -37,7 +37,7 @@
global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins;
$usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal', 'askpricesupplier','commande'))) $usemargins=1;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;
if (empty($dateSelector)) $dateSelector=0;
if (empty($forceall)) $forceall=0;
@ -124,7 +124,7 @@ if (empty($usemargins)) $usemargins=0;
}
?>
</td>
<?php if ($object->element == 'askpricesupplier') { ?>
<?php if ($object->element == 'supplier_proposal') { ?>
<td class="linecolrefsupplier" align="right"><?php echo $line->ref_fourn; ?></td>
<?php } ?>
<td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>

View File

@ -100,6 +100,7 @@ class InterfaceDemo extends DolibarrTriggers
case 'PRODUCT_MODIFY':
case 'PRODUCT_DELETE':
case 'PRODUCT_PRICE_MODIFY':
case 'PRODUCT_SET_MULTILANGS':
//Stock mouvement
case 'STOCK_MOVEMENT':
@ -149,17 +150,17 @@ class InterfaceDemo extends DolibarrTriggers
case 'LINEPROPAL_DELETE':
// Askpricesupplier
case 'ASKPRICESUPPLIER_CREATE':
case 'ASKPRICESUPPLIER_CLONE':
case 'ASKPRICESUPPLIER_MODIFY':
case 'ASKPRICESUPPLIER_VALIDATE':
case 'ASKPRICESUPPLIER_SENTBYMAIL':
case 'ASKPRICESUPPLIER_CLOSE_SIGNED':
case 'ASKPRICESUPPLIER_CLOSE_REFUSED':
case 'ASKPRICESUPPLIER_DELETE':
case 'LINEASKPRICESUPPLIER_INSERT':
case 'LINEASKPRICESUPPLIER_UPDATE':
case 'LINEASKPRICESUPPLIER_DELETE':
case 'SUPPLIER_PROPOSAL_CREATE':
case 'SUPPLIER_PROPOSAL_CLONE':
case 'SUPPLIER_PROPOSAL_MODIFY':
case 'SUPPLIER_PROPOSAL_VALIDATE':
case 'SUPPLIER_PROPOSAL_SENTBYMAIL':
case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED':
case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED':
case 'SUPPLIER_PROPOSAL_DELETE':
case 'LINESUPPLIER_PROPOSAL_INSERT':
case 'LINESUPPLIER_PROPOSAL_UPDATE':
case 'LINESUPPLIER_PROPOSAL_DELETE':
// Contracts
case 'CONTRACT_CREATE':
@ -234,6 +235,7 @@ class InterfaceDemo extends DolibarrTriggers
case 'CATEGORY_CREATE':
case 'CATEGORY_MODIFY':
case 'CATEGORY_DELETE':
case 'CATEGORY_SET_MULTILANGS':
// Projects
case 'PROJECT_CREATE':

View File

@ -541,10 +541,10 @@ if ($object->id > 0)
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
}
if ($conf->askpricesupplier->enabled && $user->rights->askpricesupplier->creer)
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer)
{
$langs->load("askpricesupplier");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/askpricesupplier/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAskPriceSupplier").'</a>';
$langs->load("supplier_proposal");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
}
if ($user->rights->fournisseur->facture->creer)

View File

@ -113,7 +113,7 @@ class CommandeFournisseur extends CommonOrder
* @var CommandeFournisseurLigne[]
*/
public $lines = array();
//Ajout pour askpricesupplier
//Ajout pour supplier_proposal
var $origin;
var $origin_id;
var $linked_objects=array();
@ -589,7 +589,7 @@ class CommandeFournisseur extends CommonOrder
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
@ -1314,7 +1314,8 @@ class CommandeFournisseur extends CommonOrder
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc,$this->thirdparty);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $this->thirdparty, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@ -2072,7 +2073,8 @@ class CommandeFournisseur extends CommonOrder
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc, $this->thirdparty);
$txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];

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