Merge remote-tracking branch 'origin/3.7' into develop
This commit is contained in:
commit
06b663b92c
@ -453,8 +453,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'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) 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;
|
||||
@ -1361,14 +1361,18 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
||||
continue;
|
||||
} // For state page, we do not show the country input (we link to region, not country)
|
||||
print '<td>';
|
||||
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28);
|
||||
$fieldname='country';
|
||||
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28);
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'country_id') {
|
||||
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||
print '</td>';
|
||||
if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate)
|
||||
{
|
||||
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region') {
|
||||
print '<td>';
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
@ -45,7 +45,7 @@ $list = array (
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
$error = 0;
|
||||
@ -72,12 +72,12 @@ if ($action == 'update')
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
llxHeader('',$langs->trans('SalariesSetup'));
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans('ConfigSalaries'),$linkback,'setup');
|
||||
print_fiche_titre($langs->trans('SalariesSetup'),$linkback,'setup');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -98,7 +98,7 @@ foreach ($list as $key)
|
||||
print '<tr '.$bc[$var].' class="value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
$label = $langs->trans($key);
|
||||
print '<td><label for="'.$key.'">'.$label.'</label></td>';
|
||||
|
||||
// Value
|
||||
|
||||
@ -229,7 +229,7 @@ if ($resql)
|
||||
if ($viewstatut == 1)
|
||||
$title.=' - '.$langs->trans('StatusOrderValidatedShort');
|
||||
if ($viewstatut == 2)
|
||||
$title.=' - '.$langs->trans('StatusOrderOnProcessShort');
|
||||
$title.=' - '.$langs->trans('StatusOrderSentShort');
|
||||
if ($viewstatut == 3)
|
||||
$title.=' - '.$langs->trans('StatusOrderToBillShort');
|
||||
if ($viewstatut == 4)
|
||||
@ -295,7 +295,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'c.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
|
||||
@ -132,6 +132,8 @@ $tableparams = array_merge($commonparams, $tableparams);
|
||||
foreach($allparams as $key => $value) {
|
||||
$paramslink .= '&' . $key . '=' . $value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -174,12 +176,12 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
|
||||
// SQL request
|
||||
$catotal=0;
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label,";
|
||||
$sql.= " sum(l.total_ht) as amount, sum(l.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as l, ".MAIN_DB_PREFIX."product as p";
|
||||
if ($selected_cat === -2) // Without any category
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
|
||||
}
|
||||
@ -198,7 +200,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
if ($date_start && $date_end) {
|
||||
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
if ($selected_cat === -2) // Without any category
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.=" AND cp.fk_product is null";
|
||||
}
|
||||
@ -209,7 +211,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY p.rowid";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.label";
|
||||
$sql.= " ORDER BY p.ref";
|
||||
|
||||
dol_syslog("cabyprodserv", LOG_DEBUG);
|
||||
@ -390,7 +392,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
// $modecompta != 'CREANCES-DETTES'
|
||||
// "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an
|
||||
// invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ?
|
||||
// Because there is no way to know this, this report is not relevant.
|
||||
// Because there is no way to know this, this report is not relevant.
|
||||
print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,6 @@ if ($filtre) {
|
||||
if ($typeid) {
|
||||
$sql .= " AND t.fk_typepayment=".$typeid;
|
||||
}
|
||||
$sql.= " GROUP BY t.rowid, t.fk_typepayment, t.amount, t.datev, t.label";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
|
||||
@ -111,7 +110,7 @@ if ($result)
|
||||
|
||||
$param='';
|
||||
if ($typeid) $param.='&typeid='.$typeid;
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -125,7 +124,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("");
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="4" name="search_ref" value="'.$search_ref.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$search_label.'"></td>';
|
||||
@ -138,21 +137,21 @@ if ($result)
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
|
||||
if ($obj->payment_code <> '')
|
||||
{
|
||||
$type = '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||
$type = '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = '<td> </td>';
|
||||
}
|
||||
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
$tva_static->id=$obj->rowid;
|
||||
@ -172,12 +171,12 @@ if ($result)
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="4">'.$langs->trans("Total").'</td>';
|
||||
print "<td align=\"right\"><b>".price($total)."</b></td>";
|
||||
print "<td> </td></tr>";
|
||||
print "<td> </td></tr>";
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
@ -186,6 +185,6 @@ else
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -601,18 +601,22 @@ abstract class CommonObject
|
||||
/**
|
||||
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty()
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0;
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) return 0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$idtofetch=isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty);
|
||||
if ($force_thirdparty_id) $idtofetch=$force_thirdparty_id;
|
||||
|
||||
$thirdparty = new Societe($this->db);
|
||||
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty));
|
||||
$result=$thirdparty->fetch($idtofetch);
|
||||
$this->client = $thirdparty; // deprecated
|
||||
$this->thirdparty = $thirdparty;
|
||||
|
||||
|
||||
@ -510,17 +510,6 @@ class ExtraFields
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load array of labels
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function fetch_optionals()
|
||||
{
|
||||
$this->fetch_name_optionals_label();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load array this->attribute_xxx like attribute_label, attribute_type, ...
|
||||
*
|
||||
@ -528,7 +517,7 @@ class ExtraFields
|
||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
||||
* @return array Array of attributes for all extra fields
|
||||
*/
|
||||
function fetch_name_optionals_label($elementtype='adherent',$forceload=false)
|
||||
function fetch_name_optionals_label($elementtype,$forceload=false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@ -3096,13 +3096,14 @@ class Form
|
||||
/**
|
||||
* Show a form to select a project
|
||||
*
|
||||
* @param int $page Page
|
||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||
* @param int $selected Id pre-selected project
|
||||
* @param string $htmlname Name of select field
|
||||
* @param int $page Page
|
||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||
* @param int $selected Id pre-selected project
|
||||
* @param string $htmlname Name of select field
|
||||
* @param int $discard_closed Hide all closed projects
|
||||
* @return void
|
||||
*/
|
||||
function form_project($page, $socid, $selected='', $htmlname='projectid')
|
||||
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -3119,8 +3120,7 @@ class Form
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td>';
|
||||
//print "$socid,$selected,$htmlname";
|
||||
$formproject->select_projects($socid,$selected,$htmlname);
|
||||
$formproject->select_projects($socid,$selected,$htmlname,20,0,1,$discard_closed);
|
||||
print '</td>';
|
||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr></table></form>';
|
||||
@ -4103,20 +4103,20 @@ class Form
|
||||
if ($value_as_key) $array=array_combine($array, $array);
|
||||
|
||||
$out='';
|
||||
|
||||
// Add code for jquery to use multiselect
|
||||
if (empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')))
|
||||
{
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
$out='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
||||
// Add code for jquery to use multiselect
|
||||
if (empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')))
|
||||
{
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
$out='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
$out.='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" '.($moreparam?$moreparam:'').'>';
|
||||
|
||||
if ($show_empty)
|
||||
@ -4183,13 +4183,13 @@ class Form
|
||||
// Add code for jquery to use multiselect
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
||||
{
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
print '<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
||||
});
|
||||
});
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
print '<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
||||
@ -49,11 +49,12 @@ class FormProjets
|
||||
* @param int $selected Id project preselected
|
||||
* @param string $htmlname Nom de la zone html
|
||||
* @param int $maxlength Maximum length of label
|
||||
* @param int $option_only Option only
|
||||
* @param int $option_only Return only html options lines without the select tag
|
||||
* @param int $show_empty Add an empty line
|
||||
* @param int $discard_closed Discard closed projects
|
||||
* @return int Nber of project if OK, <0 if KO
|
||||
*/
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1)
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0)
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
|
||||
@ -104,6 +105,12 @@ class FormProjets
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($discard_closed && $obj->fk_statut == 2)
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$labeltoshow=dol_trunc($obj->ref,18);
|
||||
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
||||
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
||||
|
||||
@ -400,7 +400,7 @@ if ($object->fetch($id))
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
|
||||
$sql.= ' WHERE f.fk_soc = '.$object->id;
|
||||
$sql.= " AND f.entity =".$conf->entity;
|
||||
$sql.= ' GROUP BY f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye';
|
||||
$sql.= ' GROUP BY f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye';
|
||||
$sql.= ' ORDER BY f.datef DESC';
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -1546,6 +1546,7 @@ NbSpeMin=Minimum number of special characters
|
||||
NbSpeMin=Minimum number of special characters
|
||||
NbIteConsecutive=Maximum number of repeating same characters
|
||||
NoAmbiCaracAutoGeneration=Do not use ambiguous characters ("1","l","i","|","0","O") for automatic generation
|
||||
|
||||
SalariesSetup=Setup of module salaries
|
||||
SortOrder=Sort order
|
||||
Format=Format
|
||||
TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type
|
||||
|
||||
@ -31,3 +31,8 @@ DonationRecipient=Donation recipient
|
||||
ThankYou=Thank You
|
||||
IConfirmDonationReception=The recipient declare reception, as a donation, of the following amount
|
||||
MinimumAmount=Minimum amount is %s
|
||||
FreeTextOnDonations=Free text to show in footer
|
||||
FrenchOptions=Options for France
|
||||
DONATION_ART200=Show legacy article 200
|
||||
DONATION_ART238=Show legacy article 238
|
||||
DONATION_ART885=Show legacy article 885
|
||||
@ -35,3 +35,6 @@ MessageKO=Message on canceled payment return page
|
||||
NewPayboxPaymentReceived=New Paybox payment received
|
||||
NewPayboxPaymentFailed=New Paybox payment tried but failed
|
||||
PAYBOX_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or failed)
|
||||
PAYBOX_PBX_SITE=Value for PBX SITE
|
||||
PAYBOX_PBX_RANG=Value for PBX Rang
|
||||
PAYBOX_PBX_IDENTIFIANT=Value for PBX ID
|
||||
@ -34,4 +34,6 @@ ConfirmDeleteResource=Confirm to delete this resource
|
||||
RessourceSuccessfullyDeleted=Resource successfully deleted
|
||||
DictionaryResourceType=Type of resources
|
||||
|
||||
DictionaryEMailTemplates=Modèles d'Emails
|
||||
|
||||
SelectResource=Select resource
|
||||
|
||||
@ -128,10 +128,10 @@ if ($socid > 0)
|
||||
|
||||
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,";
|
||||
$sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,";
|
||||
$sql.= " f.datef, f.paye, f.fk_statut as statut,";
|
||||
$sql.= " sum(d.total_ht) as selling_price,";
|
||||
$sql.= " ".$db->ifsql('f.type =2','sum(d.qty * d.buy_price_ht *-1)','sum(d.qty * d.buy_price_ht)')." as buying_price,";
|
||||
$sql.= " ".$db->ifsql('f.type =2','sum(-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty)))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge";
|
||||
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,";
|
||||
$sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive
|
||||
$sql.= " sum(d.qty * d.buy_price_ht) as buying_price,"; // always positive
|
||||
$sql.= " sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge"; // always positive
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||
@ -140,9 +140,9 @@ if ($socid > 0)
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
$sql.= " AND d.fk_facture = f.rowid";
|
||||
$sql.= " AND f.fk_soc = $socid";
|
||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||
$sql.= " AND d.buy_price_ht IS NOT NULL";
|
||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.type";
|
||||
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
||||
// TODO: calculate total to display then restore pagination
|
||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||
@ -153,7 +153,7 @@ if ($socid > 0)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=$societe->id",$sortfield,$sortorder,'',0,0,'');
|
||||
print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=".$societe->id,$sortfield,$sortorder,'',0,0,'');
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
@ -183,16 +183,8 @@ if ($socid > 0)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
if ($objp->marge < 0)
|
||||
{
|
||||
$marginRate = ($objp->buying_price != 0)?-1*(100 * $objp->marge / $objp->buying_price):'' ;
|
||||
$markRate = ($objp->selling_price != 0)?-1*(100 * $objp->marge / $objp->selling_price):'' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
$marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ;
|
||||
$markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ;
|
||||
}
|
||||
$marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ;
|
||||
$markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ;
|
||||
|
||||
$var=!$var;
|
||||
|
||||
@ -205,7 +197,7 @@ if ($socid > 0)
|
||||
print "<td align=\"center\">";
|
||||
print dol_print_date($db->jdate($objp->datef),'day')."</td>";
|
||||
print "<td align=\"right\">".price($objp->selling_price, null, null, null, null, $rounding)."</td>\n";
|
||||
print "<td align=\"right\">".price($objp->buying_price, null, null, null, null, $rounding)."</td>\n";
|
||||
print "<td align=\"right\">".price(($objp->type == 2 ? -1 : 1) * $objp->buying_price, null, null, null, null, $rounding)."</td>\n";
|
||||
print "<td align=\"right\">".price($objp->marge, null, null, null, null, $rounding)."</td>\n";
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
print "<td align=\"right\">".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")."</td>\n";
|
||||
@ -214,7 +206,7 @@ if ($socid > 0)
|
||||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
$cumul_achat += $objp->buying_price;
|
||||
$cumul_achat += (($objp->type == 2 ? -1 : 1) * $objp->buying_price);
|
||||
$cumul_vente += $objp->selling_price;
|
||||
}
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ if (empty($reshook))
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
if (GETPOST('socid','int') > 0) $object->thirdparty->fetch(GETPOST('socid','int'));
|
||||
if (GETPOST('socid','int') > 0) $object->fetch_thirdparty(GETPOST('socid','int'));
|
||||
else unset($object->thirdparty);
|
||||
}
|
||||
}
|
||||
|
||||
@ -300,7 +300,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
$contactsofproject=$object->getListContactId('internal');
|
||||
$contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):'');
|
||||
$form->select_users($user->id,'userid',0,'',0,'',$contactsofproject);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -188,7 +188,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if (! empty($projectstatic->thridparty->id)) print $projectstatic->thridparty->getNomUrl(1);
|
||||
if (! empty($projectstatic->thirdparty->id)) print $projectstatic->thirdparty->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -259,7 +259,7 @@ if ($id > 0 || ! empty($ref))
|
||||
// Customer
|
||||
print "<tr><td>".$langs->trans("ThirdParty")."</td>";
|
||||
print '<td colspan="3">';
|
||||
if ($projectstatic->thridparty->id > 0) print $projectstatic->thridparty->getNomUrl(1);
|
||||
if ($projectstatic->thirdparty->id > 0) print $projectstatic->thirdparty->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ llxHeader('',$langs->trans('Task'));
|
||||
|
||||
if ($object->id > 0)
|
||||
{
|
||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
||||
$projectstatic->fetch_thirdparty();
|
||||
|
||||
$userWrite = $projectstatic->restrictedProjectArea($user,'write');
|
||||
|
||||
@ -152,7 +152,7 @@ if ($object->id > 0)
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1);
|
||||
if (! empty($projectstatic->thirdparty->id)) print $projectstatic->thirdparty->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -225,7 +225,7 @@ if ($object->id > 0)
|
||||
|
||||
// Third party
|
||||
print '<td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
|
||||
if ($projectstatic->societe->id) print $projectstatic->societe->getNomUrl(1);
|
||||
if ($projectstatic->thirdparty->id) print $projectstatic->thirdparty->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
$projectstatic->fetch($object->fk_project);
|
||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||
|
||||
$object->project = dol_clone($projectstatic);
|
||||
}
|
||||
@ -134,7 +134,7 @@ if ($object->id > 0)
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1);
|
||||
if (! empty($projectstatic->thirdparty->id)) print $projectstatic->thirdparty->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -196,7 +196,7 @@ if ($object->id > 0)
|
||||
|
||||
// Third party
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($projectstatic->societe->id > 0) print $projectstatic->societe->getNomUrl(1);
|
||||
if ($projectstatic->thirdparty->id > 0) print $projectstatic->thirdparty->getNomUrl(1);
|
||||
else print' ';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -259,9 +259,7 @@ color: #444444 !important;
|
||||
|
||||
margin: 8px 0px 8px 2px;
|
||||
|
||||
border-left: 1px solid #DDD;
|
||||
border-right: 1px solid #DDD;
|
||||
border-bottom: 1px solid #EEE;
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 8px;
|
||||
-moz-border-radius: 8px;
|
||||
|
||||
@ -269,11 +267,7 @@ border-radius: 8px;
|
||||
-webkit-box-shadow: 4px 4px 4px #EEE;
|
||||
box-shadow: 4px 4px 4px #EEE;
|
||||
|
||||
background-image: linear-gradient(bottom, rgb(246,248,250) 15%, rgb(235,235,238) 100%);
|
||||
background-image: -o-linear-gradient(bottom, rgb(246,248,250) 15%, rgb(235,235,238) 100%);
|
||||
background-image: -moz-linear-gradient(bottom, rgb(246,248,250) 15%, rgb(235,235,238) 100%);
|
||||
background-image: -webkit-linear-gradient(bottom, rgb(246,248,250) 15%, rgb(235,235,238) 100%);
|
||||
background-image: -ms-linear-gradient(bottom, rgb(246,248,250) 15%, rgb(235,235,238) 100%);
|
||||
background: -webkit-linear-gradient(bottom, rgb(255,255,255) 85%, rgb(255,255,255) 100%);
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1976,18 +1976,6 @@ div.tabBar .noborder {
|
||||
* Boxes
|
||||
*/
|
||||
|
||||
.tdboxstats {
|
||||
<?php if ($usecss3) { ?>
|
||||
background: -o-linear-gradient(bottom, rgb(<?php echo $colorbacklinepair1; ?>) 85%, rgb(<?php echo $colorbacklinepair2; ?>) 120%) !important;
|
||||
background: -moz-linear-gradient(bottom, rgb(<?php echo $colorbacklinepair1; ?>) 85%, rgb(<?php echo $colorbacklinepair2; ?>) 120%) !important;
|
||||
background: -webkit-linear-gradient(bottom, rgb(<?php echo $colorbacklinepair1; ?>) 85%, rgb(<?php echo $colorbacklinepair2; ?>) 120%) !important;
|
||||
background: -ms-linear-gradient(bottom, rgb(<?php echo $colorbacklinepair1; ?>) 85%, rgb(<?php echo $colorbacklinepair2; ?>) 120%) !important;
|
||||
background: linear-gradient(bottom, rgb(<?php echo $colorbacklinepair1; ?>) 85%, rgb(<?php echo $colorbacklinepair2; ?>) 120%) !important;
|
||||
<?php } else { ?>
|
||||
background: #ffffff !important;
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
.boxstats {
|
||||
<?php print "float: ".$left.";\n"; ?>
|
||||
margin: 3px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user