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;
|
$ok=1;
|
||||||
foreach ($listfield as $f => $value)
|
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' && 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 == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
||||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||||
if ($value == 'color' && empty($_POST['color'])) continue;
|
if ($value == 'color' && empty($_POST['color'])) continue;
|
||||||
@ -1361,14 +1361,18 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
|||||||
continue;
|
continue;
|
||||||
} // For state page, we do not show the country input (we link to region, not country)
|
} // For state page, we do not show the country input (we link to region, not country)
|
||||||
print '<td>';
|
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>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'country_id') {
|
elseif ($fieldlist[$field] == 'country_id') {
|
||||||
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate)
|
||||||
print '<td>';
|
{
|
||||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||||
print '</td>';
|
print '<td>';
|
||||||
|
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'region') {
|
elseif ($fieldlist[$field] == 'region') {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -72,12 +72,12 @@ if ($action == 'update')
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader('',$langs->trans('SalariesSetup'));
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$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 '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|||||||
@ -229,7 +229,7 @@ if ($resql)
|
|||||||
if ($viewstatut == 1)
|
if ($viewstatut == 1)
|
||||||
$title.=' - '.$langs->trans('StatusOrderValidatedShort');
|
$title.=' - '.$langs->trans('StatusOrderValidatedShort');
|
||||||
if ($viewstatut == 2)
|
if ($viewstatut == 2)
|
||||||
$title.=' - '.$langs->trans('StatusOrderOnProcessShort');
|
$title.=' - '.$langs->trans('StatusOrderSentShort');
|
||||||
if ($viewstatut == 3)
|
if ($viewstatut == 3)
|
||||||
$title.=' - '.$langs->trans('StatusOrderToBillShort');
|
$title.=' - '.$langs->trans('StatusOrderToBillShort');
|
||||||
if ($viewstatut == 4)
|
if ($viewstatut == 4)
|
||||||
|
|||||||
@ -132,6 +132,8 @@ $tableparams = array_merge($commonparams, $tableparams);
|
|||||||
foreach($allparams as $key => $value) {
|
foreach($allparams as $key => $value) {
|
||||||
$paramslink .= '&' . $key . '=' . $value;
|
$paramslink .= '&' . $key . '=' . $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -209,7 +211,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
|||||||
$sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
|
$sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
|
||||||
}
|
}
|
||||||
$sql.= " AND f.entity = ".$conf->entity;
|
$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";
|
$sql.= " ORDER BY p.ref";
|
||||||
|
|
||||||
dol_syslog("cabyprodserv", LOG_DEBUG);
|
dol_syslog("cabyprodserv", LOG_DEBUG);
|
||||||
|
|||||||
@ -97,7 +97,6 @@ if ($filtre) {
|
|||||||
if ($typeid) {
|
if ($typeid) {
|
||||||
$sql .= " AND t.fk_typepayment=".$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->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($limit+1,$offset);
|
$sql.= $db->plimit($limit+1,$offset);
|
||||||
|
|
||||||
@ -186,6 +185,6 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
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
|
* 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;
|
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';
|
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);
|
$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->client = $thirdparty; // deprecated
|
||||||
$this->thirdparty = $thirdparty;
|
$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, ...
|
* 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
|
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
||||||
* @return array Array of attributes for all extra fields
|
* @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;
|
global $conf;
|
||||||
|
|
||||||
|
|||||||
@ -3096,13 +3096,14 @@ class Form
|
|||||||
/**
|
/**
|
||||||
* Show a form to select a project
|
* Show a form to select a project
|
||||||
*
|
*
|
||||||
* @param int $page Page
|
* @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 $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 int $selected Id pre-selected project
|
||||||
* @param string $htmlname Name of select field
|
* @param string $htmlname Name of select field
|
||||||
|
* @param int $discard_closed Hide all closed projects
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_project($page, $socid, $selected='', $htmlname='projectid')
|
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -3119,8 +3120,7 @@ class Form
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
//print "$socid,$selected,$htmlname";
|
$formproject->select_projects($socid,$selected,$htmlname,20,0,1,$discard_closed);
|
||||||
$formproject->select_projects($socid,$selected,$htmlname);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
print '</tr></table></form>';
|
print '</tr></table></form>';
|
||||||
|
|||||||
@ -49,11 +49,12 @@ class FormProjets
|
|||||||
* @param int $selected Id project preselected
|
* @param int $selected Id project preselected
|
||||||
* @param string $htmlname Nom de la zone html
|
* @param string $htmlname Nom de la zone html
|
||||||
* @param int $maxlength Maximum length of label
|
* @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 $show_empty Add an empty line
|
||||||
|
* @param int $discard_closed Discard closed projects
|
||||||
* @return int Nber of project if OK, <0 if KO
|
* @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;
|
global $user,$conf,$langs;
|
||||||
|
|
||||||
@ -104,6 +105,12 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if ($discard_closed && $obj->fk_statut == 2)
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$labeltoshow=dol_trunc($obj->ref,18);
|
$labeltoshow=dol_trunc($obj->ref,18);
|
||||||
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
||||||
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
//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.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
|
||||||
$sql.= ' WHERE f.fk_soc = '.$object->id;
|
$sql.= ' WHERE f.fk_soc = '.$object->id;
|
||||||
$sql.= " AND f.entity =".$conf->entity;
|
$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';
|
$sql.= ' ORDER BY f.datef DESC';
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -1546,6 +1546,7 @@ NbSpeMin=Minimum number of special characters
|
|||||||
NbSpeMin=Minimum number of special characters
|
NbSpeMin=Minimum number of special characters
|
||||||
NbIteConsecutive=Maximum number of repeating same characters
|
NbIteConsecutive=Maximum number of repeating same characters
|
||||||
NoAmbiCaracAutoGeneration=Do not use ambiguous characters ("1","l","i","|","0","O") for automatic generation
|
NoAmbiCaracAutoGeneration=Do not use ambiguous characters ("1","l","i","|","0","O") for automatic generation
|
||||||
|
SalariesSetup=Setup of module salaries
|
||||||
|
SortOrder=Sort order
|
||||||
Format=Format
|
Format=Format
|
||||||
TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type
|
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
|
ThankYou=Thank You
|
||||||
IConfirmDonationReception=The recipient declare reception, as a donation, of the following amount
|
IConfirmDonationReception=The recipient declare reception, as a donation, of the following amount
|
||||||
MinimumAmount=Minimum amount is %s
|
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
|
NewPayboxPaymentReceived=New Paybox payment received
|
||||||
NewPayboxPaymentFailed=New Paybox payment tried but failed
|
NewPayboxPaymentFailed=New Paybox payment tried but failed
|
||||||
PAYBOX_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or 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
|
RessourceSuccessfullyDeleted=Resource successfully deleted
|
||||||
DictionaryResourceType=Type of resources
|
DictionaryResourceType=Type of resources
|
||||||
|
|
||||||
|
DictionaryEMailTemplates=Modèles d'Emails
|
||||||
|
|
||||||
SelectResource=Select resource
|
SelectResource=Select resource
|
||||||
|
|||||||
@ -128,10 +128,10 @@ if ($socid > 0)
|
|||||||
|
|
||||||
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,";
|
$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.rowid as facid, f.facnumber, f.total as total_ht,";
|
||||||
$sql.= " f.datef, f.paye, f.fk_statut as statut,";
|
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,";
|
||||||
$sql.= " sum(d.total_ht) as selling_price,";
|
$sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive
|
||||||
$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.= " sum(d.qty * d.buy_price_ht) as buying_price,"; // always positive
|
||||||
$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.= " sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge"; // always positive
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||||
@ -140,9 +140,9 @@ if ($socid > 0)
|
|||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
$sql.= " AND f.fk_soc = $socid";
|
$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";
|
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;
|
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
||||||
// TODO: calculate total to display then restore pagination
|
// TODO: calculate total to display then restore pagination
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
@ -153,7 +153,7 @@ if ($socid > 0)
|
|||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$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;
|
$i = 0;
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
@ -183,16 +183,8 @@ if ($socid > 0)
|
|||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
if ($objp->marge < 0)
|
$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)?-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):'' ;
|
|
||||||
}
|
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
@ -205,7 +197,7 @@ if ($socid > 0)
|
|||||||
print "<td align=\"center\">";
|
print "<td align=\"center\">";
|
||||||
print dol_print_date($db->jdate($objp->datef),'day')."</td>";
|
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->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";
|
print "<td align=\"right\">".price($objp->marge, null, null, null, null, $rounding)."</td>\n";
|
||||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||||
print "<td align=\"right\">".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")."</td>\n";
|
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 '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
$cumul_achat += $objp->buying_price;
|
$cumul_achat += (($objp->type == 2 ? -1 : 1) * $objp->buying_price);
|
||||||
$cumul_vente += $objp->selling_price;
|
$cumul_vente += $objp->selling_price;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -260,7 +260,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$db->commit();
|
$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);
|
else unset($object->thirdparty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -300,7 +300,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
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);
|
$form->select_users($user->id,'userid',0,'',0,'',$contactsofproject);
|
||||||
print '</td></tr>';
|
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("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
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 ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -259,7 +259,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Customer
|
// Customer
|
||||||
print "<tr><td>".$langs->trans("ThirdParty")."</td>";
|
print "<tr><td>".$langs->trans("ThirdParty")."</td>";
|
||||||
print '<td colspan="3">';
|
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 ' ';
|
else print ' ';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,7 @@ llxHeader('',$langs->trans('Task'));
|
|||||||
|
|
||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
$projectstatic->fetch_thirdparty();
|
||||||
|
|
||||||
$userWrite = $projectstatic->restrictedProjectArea($user,'write');
|
$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("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
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 ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -225,7 +225,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print '<td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
|
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 ' ';
|
else print ' ';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($object->fetch($id,$ref) > 0)
|
if ($object->fetch($id,$ref) > 0)
|
||||||
{
|
{
|
||||||
$projectstatic->fetch($object->fk_project);
|
$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);
|
$object->project = dol_clone($projectstatic);
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
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 ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -196,7 +196,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
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' ';
|
else print' ';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -259,9 +259,7 @@ color: #444444 !important;
|
|||||||
|
|
||||||
margin: 8px 0px 8px 2px;
|
margin: 8px 0px 8px 2px;
|
||||||
|
|
||||||
border-left: 1px solid #DDD;
|
border: 1px solid #bbb;
|
||||||
border-right: 1px solid #DDD;
|
|
||||||
border-bottom: 1px solid #EEE;
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
-moz-border-radius: 8px;
|
-moz-border-radius: 8px;
|
||||||
|
|
||||||
@ -269,11 +267,7 @@ border-radius: 8px;
|
|||||||
-webkit-box-shadow: 4px 4px 4px #EEE;
|
-webkit-box-shadow: 4px 4px 4px #EEE;
|
||||||
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: -webkit-linear-gradient(bottom, rgb(255,255,255) 85%, rgb(255,255,255) 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%);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1976,18 +1976,6 @@ div.tabBar .noborder {
|
|||||||
* Boxes
|
* 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 {
|
.boxstats {
|
||||||
<?php print "float: ".$left.";\n"; ?>
|
<?php print "float: ".$left.";\n"; ?>
|
||||||
margin: 3px;
|
margin: 3px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user