forked from Wavyzz/dolibarr
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into patch-1
This commit is contained in:
@@ -129,12 +129,13 @@ $sqls=array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__'",
|
||||
),
|
||||
'project'=>array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__')",
|
||||
// TODO set fk_project to null on object that refer to project
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_task IN (select rowid FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'",
|
||||
),
|
||||
'contact'=>array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople IN (select rowid FROM ".MAIN_DB_PREFIX."socpeople where date < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople IN (select rowid FROM ".MAIN_DB_PREFIX."socpeople where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."socpeople where datec < '__DATE__'",
|
||||
),
|
||||
'thirdparty'=>array(
|
||||
@@ -286,7 +287,7 @@ foreach($sqls as $family => $familysql)
|
||||
|
||||
if ($error || $mode != 'confirm')
|
||||
{
|
||||
print "Rollback any changes.\n";
|
||||
print "\nRollback any changes.\n";
|
||||
$db->rollback();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -183,6 +183,10 @@ if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! emp
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
|
||||
print '<td>';
|
||||
print $form->selectarray('ADHERENT_BANK_USE', $arraychoices, $conf->global->ADHERENT_BANK_USE, 0);
|
||||
if ($conf->global->ADHERENT_BANK_USE == 'bankdirect' || $conf->global->ADHERENT_BANK_USE == 'bankviainvoice')
|
||||
{
|
||||
print '<br><div style="padding-top: 5px;"><span class="opacitymedium">'.$langs->trans("ABankAccountMustBeDefinedOnPaymentModeSetup").'</span></div>';
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@@ -44,7 +44,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'setbarcodeproducton')
|
||||
{
|
||||
$res=dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", GETPOST('value'), 'chaine', 0, '', $conf->entity);
|
||||
$barcodenumberingmodule = GETPOST('value', 'alpha');
|
||||
$res=dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity);
|
||||
if ($barcodenumberingmodule == 'mod_barcode_product_standard' && empty($conf->global->BARCODE_STANDARD_PRODUCT_MASK))
|
||||
{
|
||||
$res=dolibarr_set_const($db, "BARCODE_STANDARD_PRODUCT_MASK", '020{000000000}', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
elseif ($action == 'setbarcodeproductoff')
|
||||
{
|
||||
@@ -406,13 +411,13 @@ if ($conf->produit->enabled)
|
||||
|
||||
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file")
|
||||
{
|
||||
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&value='.$file.'">';
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&value='.$file.'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&value='.$file.'">';
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&value='.$file.'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
@@ -419,11 +419,11 @@ if (!empty($date_start) && !empty($date_stop))
|
||||
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
|
||||
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
|
||||
print '<tr class="oddeven '.$html_class.'">';
|
||||
print "<td align=\"center\">";
|
||||
print "<td class=\"center\">";
|
||||
print dol_print_date($data['date'], 'day');
|
||||
print "</td>\n";
|
||||
print '<td aling="left">'.$langs->trans($data['item']).'</td>';
|
||||
print '<td aling="left">'.$data['ref'].'</td>';
|
||||
print '<td class="left">'.$langs->trans($data['item']).'</td>';
|
||||
print '<td class="left">'.$data['ref'].'</td>';
|
||||
|
||||
// File link
|
||||
print '<td><a href='.DOL_URL_ROOT.'/'.$data['link'].">".$data['name']."</a></td>\n";
|
||||
|
||||
@@ -252,14 +252,14 @@ if ($id > 0)
|
||||
|
||||
print '<tr class="oddeven '.$html_class.'">';
|
||||
|
||||
print "<td align=\"center\">";
|
||||
print "<td class=\"center\">";
|
||||
if (!empty($data['fk_facture'])) print dol_print_date($data['date'], 'day');
|
||||
elseif (!empty($data['fk_paiement'])) print dol_print_date($data['date'], 'dayhour');
|
||||
print "</td>\n";
|
||||
|
||||
print '<td>'.$data['link']."</td>\n";
|
||||
|
||||
print '<td aling="left">'.$data['status'].'</td>';
|
||||
print '<td class="left">'.$data['status'].'</td>';
|
||||
|
||||
print '<td class="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
|
||||
|
||||
|
||||
@@ -122,14 +122,14 @@ class PaymentSocialContribution extends CommonObject
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_charge)) $this->fk_charge=trim($this->fk_charge);
|
||||
if (isset($this->fk_charge)) $this->fk_charge= (int) $this->fk_charge;
|
||||
if (isset($this->amount)) $this->amount=trim($this->amount);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement=trim($this->fk_typepaiement);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement= (int) $this->fk_typepaiement;
|
||||
if (isset($this->num_paiement)) $this->num_paiement=trim($this->num_paiement);
|
||||
if (isset($this->note)) $this->note=trim($this->note);
|
||||
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
||||
if (isset($this->fk_bank)) $this->fk_bank= (int) $this->fk_bank;
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat= (int) $this->fk_user_creat;
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif= (int) $this->fk_user_modif;
|
||||
|
||||
$totalamount = 0;
|
||||
foreach ($this->amounts as $key => $value) // How payment is dispatch
|
||||
@@ -299,14 +299,14 @@ class PaymentSocialContribution extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
|
||||
if (isset($this->fk_charge)) $this->fk_charge=trim($this->fk_charge);
|
||||
if (isset($this->fk_charge)) $this->fk_charge= (int) $this->fk_charge;
|
||||
if (isset($this->amount)) $this->amount=trim($this->amount);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement=trim($this->fk_typepaiement);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement= (int) $this->fk_typepaiement;
|
||||
if (isset($this->num_paiement)) $this->num_paiement=trim($this->num_paiement);
|
||||
if (isset($this->note)) $this->note=trim($this->note);
|
||||
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
||||
if (isset($this->fk_bank)) $this->fk_bank= (int) $this->fk_bank;
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat= (int) $this->fk_user_creat;
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif= (int) $this->fk_user_modif;
|
||||
|
||||
|
||||
|
||||
@@ -337,10 +337,10 @@ class PaymentSocialContribution extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
@@ -350,8 +350,8 @@ class PaymentSocialContribution extends CommonObject
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
@@ -478,13 +478,6 @@ class PaymentSocialContribution extends CommonObject
|
||||
{
|
||||
$this->error=$object->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
@@ -913,6 +913,7 @@ class Contrat extends CommonObject
|
||||
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
|
||||
$sql.= ")";
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$error=0;
|
||||
@@ -930,8 +931,8 @@ class Contrat extends CommonObject
|
||||
{
|
||||
$modCodeContract = new $module();
|
||||
|
||||
if (!empty($modCodeContract->code_auto)) {
|
||||
// Update ref
|
||||
if (! empty($modCodeContract->code_auto)) {
|
||||
// Force the ref to a draft value if numbering module is an automatic numbering
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
@@ -940,9 +941,6 @@ class Contrat extends CommonObject
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
$this->error='Failed to get PROV number';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class Ctypent // extends CommonObject
|
||||
$sql.= " ".(! isset($this->id)?'NULL':"'".$this->db->escape($this->id)."'").",";
|
||||
$sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").",";
|
||||
$sql.= " ".(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").",";
|
||||
$sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->active($this->active)."'").",";
|
||||
$sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->escape($this->active)."'").",";
|
||||
$sql.= " ".(! isset($this->module)?'NULL':"'".$this->db->escape($this->module)."'")."";
|
||||
|
||||
|
||||
|
||||
@@ -553,11 +553,11 @@ class Form
|
||||
{
|
||||
if ($type == 'info' || $type == 'help') return $text;
|
||||
}
|
||||
// If info or help with smartphone, show only text (tooltip on lick does not works with dialog on smaprtphone)
|
||||
if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger))
|
||||
{
|
||||
if ($type == 'info' || $type == 'help') return $text;
|
||||
}
|
||||
// If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone)
|
||||
//if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger))
|
||||
//{
|
||||
//if ($type == 'info' || $type == 'help') return '<a href="'..'">'.$text.''</a>';
|
||||
//}
|
||||
|
||||
$img='';
|
||||
if ($type == 'info') $img = img_help(0, $alt);
|
||||
@@ -6651,7 +6651,7 @@ class Form
|
||||
$objp = $this->db->fetch_object($resqllist);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td aling="left">';
|
||||
print '<td class="left">';
|
||||
print '<input type="radio" name="idtolinkto" value=' . $objp->rowid . '>';
|
||||
print '</td>';
|
||||
print '<td class="center">' . $objp->ref . '</td>';
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
abstract class Stats
|
||||
{
|
||||
protected $db;
|
||||
private $_lastfetchdate=array(); // Dates of cache file read by methods
|
||||
protected $lastfetchdate=array(); // Dates of cache file read by methods
|
||||
public $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts)
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ abstract class Stats
|
||||
{
|
||||
$foundintocache=1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -117,7 +117,7 @@ abstract class Stats
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
// return array(array('Month',val1,val2,val3),...)
|
||||
@@ -164,7 +164,7 @@ abstract class Stats
|
||||
{
|
||||
$foundintocache=1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -215,7 +215,7 @@ abstract class Stats
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
}
|
||||
else dol_syslog("Failed to write cache file", LOG_ERR);
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
return $data;
|
||||
@@ -290,7 +290,7 @@ abstract class Stats
|
||||
{
|
||||
$foundintocache=1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -323,7 +323,7 @@ abstract class Stats
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
}
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -43,37 +43,40 @@ else header('Cache-Control: no-cache');
|
||||
|
||||
|
||||
// Wrapper to show tooltips (html or onclick popup)
|
||||
print "\n/* JS CODE TO ENABLE Tooltips on all object with class classfortooltip */\n";
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
|
||||
if (empty($conf->dol_no_mouse_hover))
|
||||
{
|
||||
print "\n/* JS CODE TO ENABLE Tooltips on all object with class classfortooltip */\n";
|
||||
print '
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(".classfortooltip").tooltip({
|
||||
show: { collision: "flipfit", effect:\'toggle\', delay:50 },
|
||||
hide: { delay: 50 },
|
||||
tooltipClass: "mytooltip",
|
||||
content: function () {
|
||||
return $(this).prop(\'title\'); /* To force to get title as is */
|
||||
}
|
||||
});
|
||||
jQuery(".classfortooltiponclicktext").dialog(
|
||||
{ closeOnEscape: true, classes: { "ui-dialog": "highlight" },
|
||||
maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? 400 : 700).',
|
||||
modal: true,
|
||||
autoOpen: false }).css("z-index: 5000");
|
||||
jQuery(".classfortooltiponclick").click(function () {
|
||||
console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\'));
|
||||
if ($(this).attr(\'dolid\'))
|
||||
{
|
||||
obj=$("#idfortooltiponclick_"+$(this).attr(\'dolid\')); /* obj is a div component */
|
||||
obj.dialog("open");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
' . "\n";
|
||||
print 'jQuery(".classfortooltip").tooltip({
|
||||
show: { collision: "flipfit", effect:\'toggle\', delay:50 },
|
||||
hide: { delay: 50 },
|
||||
tooltipClass: "mytooltip",
|
||||
content: function () {
|
||||
return $(this).prop(\'title\'); /* To force to get title as is */
|
||||
}
|
||||
});'."\n";
|
||||
}
|
||||
|
||||
print '
|
||||
jQuery(".classfortooltiponclicktext").dialog(
|
||||
{ closeOnEscape: true, classes: { "ui-dialog": "highlight" },
|
||||
maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? max($_SESSION['dol_screenwidth']-20, 320) : 700).',
|
||||
modal: true,
|
||||
autoOpen: false }).css("z-index: 5000");
|
||||
jQuery(".classfortooltiponclick").click(function () {
|
||||
console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\'));
|
||||
if ($(this).attr(\'dolid\'))
|
||||
{
|
||||
obj=$("#idfortooltiponclick_"+$(this).attr(\'dolid\')); /* obj is a div component */
|
||||
obj.dialog("open");
|
||||
return false;
|
||||
}
|
||||
});'."\n";
|
||||
|
||||
print "});\n";
|
||||
|
||||
|
||||
// Wrapper to manage dropdown
|
||||
if (! defined('JS_JQUERY_DISABLE_DROPDOWN'))
|
||||
{
|
||||
|
||||
@@ -816,7 +816,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
|
||||
|
||||
|
||||
/**
|
||||
* Function to output a dialog bog for copy/paste
|
||||
* Function to output a dialog box for copy/paste
|
||||
*
|
||||
* @param string text Text to put into copy/paste area
|
||||
* @param string text2 Text to put under the copy/paste area
|
||||
|
||||
@@ -95,8 +95,11 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
|
||||
$tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("BarCode"), $langs->transnoentities("BarCode"));
|
||||
$tooltip.=$langs->trans("GenericMaskCodes3");
|
||||
$tooltip.=$langs->trans("GenericMaskCodes4c");
|
||||
$tooltip.=$langs->trans("GenericMaskCodes5");
|
||||
$tooltip.='<strong>'.$langs->trans("Example").':</strong><br>';
|
||||
$tooltip.='020{000000000} (for internal use)<br>';
|
||||
$tooltip.='9771234{00000} (example of ISSN code with prefix 1234)<br>';
|
||||
$tooltip.='9791234{00000} (example of ISMN code with prefix 1234)<br>';
|
||||
//$tooltip.=$langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Mask parameter
|
||||
//$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):</td>';
|
||||
|
||||
@@ -420,6 +420,6 @@ class modAgenda extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')';
|
||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)';
|
||||
if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id);
|
||||
$this->export_sql_order[$r] .=' ORDER BY ac.datep';
|
||||
$this->export_sql_order[$r] =' ORDER BY ac.datep';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,6 +283,8 @@ class modExpedition extends DolibarrModules
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
$keyforselect='expeditiondet'; $keyforelement='shipment_line'; $keyforaliasextra='extra2';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
$keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extraprod';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expedition as c';
|
||||
@@ -295,6 +297,7 @@ class modExpedition extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'expeditiondet_extrafields as extra2 ON ed.rowid = extra2.fk_object';
|
||||
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extraprod ON p.rowid = extraprod.fk_object';
|
||||
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT))
|
||||
{
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
|
||||
|
||||
@@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
|
||||
/**
|
||||
* Class DataPolicy
|
||||
*/
|
||||
Class DataPolicy
|
||||
class DataPolicy
|
||||
{
|
||||
/**
|
||||
* getAllContactNotInformed
|
||||
|
||||
@@ -229,25 +229,30 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
||||
$resql=$this->db->query($sql);
|
||||
if (!$resql) $error++;
|
||||
|
||||
if (is_array($this->lines) && count($this->lines)>0)
|
||||
if (!$resql)
|
||||
{
|
||||
foreach ($this->lines as $i => $val)
|
||||
{
|
||||
$newndfline=new ExpenseReportLine($this->db);
|
||||
$newndfline=$this->lines[$i];
|
||||
$newndfline->fk_expensereport=$this->id;
|
||||
if ($result >= 0)
|
||||
{
|
||||
$result=$newndfline->insert();
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (is_array($this->lines) && count($this->lines)>0)
|
||||
{
|
||||
foreach ($this->lines as $i => $val)
|
||||
{
|
||||
//$newndfline=new ExpenseReportLine($this->db);
|
||||
$newndfline=$this->lines[$i];
|
||||
$newndfline->fk_expensereport=$this->id;
|
||||
$result=$newndfline->insert();
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error = $newndfline->error;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -2560,7 +2565,7 @@ class ExpenseReportLine
|
||||
*/
|
||||
public function insert($notrigger = 0, $fromaddline = false)
|
||||
{
|
||||
global $langs,$user,$conf;
|
||||
global $langs, $user, $conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
@@ -2634,10 +2639,10 @@ class ExpenseReportLine
|
||||
/**
|
||||
* Function to get total amount in expense reports for a same rule
|
||||
*
|
||||
* @param ExpenseReportRule $rule object rule to check
|
||||
* @param int $fk_user user author id
|
||||
* @param string $mode day|EX_DAY / month|EX_MON / year|EX_YEA to get amount
|
||||
* @return amount
|
||||
* @param ExpenseReportRule $rule object rule to check
|
||||
* @param int $fk_user user author id
|
||||
* @param string $mode day|EX_DAY / month|EX_MON / year|EX_YEA to get amount
|
||||
* @return amount Amount
|
||||
*/
|
||||
public function getExpAmount(ExpenseReportRule $rule, $fk_user, $mode = 'day')
|
||||
{
|
||||
@@ -2650,10 +2655,10 @@ class ExpenseReportLine
|
||||
if (!empty($this->id)) $sql.= ' AND d.rowid <> '.$this->id;
|
||||
$sql .= ' AND d.fk_c_type_fees = '.$rule->fk_c_type_fees;
|
||||
if ($mode == 'day' || $mode == 'EX_DAY') $sql .= ' AND d.date = \''.dol_print_date($this->date, '%Y-%m-%d').'\'';
|
||||
elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\'';
|
||||
elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\'';
|
||||
elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\''; // @TODO DATE_FORMAT is forbidden
|
||||
elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\''; // @TODO DATE_FORMAT is forbidden
|
||||
|
||||
dol_syslog('ExpenseReportLine::getExpAmountByDay sql='.$sql);
|
||||
dol_syslog('ExpenseReportLine::getExpAmount');
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@@ -2670,19 +2675,18 @@ class ExpenseReportLine
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
|
||||
return $amount + $this->total_ttc;
|
||||
}
|
||||
|
||||
/**
|
||||
* update
|
||||
*
|
||||
* @param User $fuser User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update($fuser)
|
||||
public function update(User $user)
|
||||
{
|
||||
global $fuser,$langs,$conf;
|
||||
global $langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2018 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2018 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,9 +25,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file fichinter/card-rec.php
|
||||
* \ingroup intervention
|
||||
* \brief Page to show predefined fichinter
|
||||
* \file fichinter/card-rec.php
|
||||
* \ingroup intervention
|
||||
* \brief Page to show predefined fichinter
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@@ -396,7 +396,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
if ($num) {
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Duration").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Duration").'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
while ($i < $num) {
|
||||
@@ -413,7 +413,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $text.' '.nl2br($objp->description);
|
||||
|
||||
// Qty
|
||||
print '<td align="center">'.convertSecondToTime($objp->duree).'</td>';
|
||||
print '<td class="center">'.convertSecondToTime($objp->duree).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
$i++;
|
||||
@@ -429,7 +429,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
@@ -495,13 +495,13 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects(
|
||||
$morehtmlref.=$formproject->select_projects(
|
||||
$object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1
|
||||
);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project(
|
||||
$morehtmlref.=$form->form_project(
|
||||
$_SERVER['PHP_SELF'].'?id='.$object->id,
|
||||
$object->socid, $object->fk_project,
|
||||
'none', 0, 0, 0, 1
|
||||
@@ -552,7 +552,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $langs->trans('Contract');
|
||||
print '</td>';
|
||||
if ($action != 'contrat') {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print img_edit($langs->trans('SetContract'), 1);
|
||||
print '</a></td>';
|
||||
}
|
||||
@@ -560,17 +560,15 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print '</td><td>';
|
||||
if ($action == 'contrat') {
|
||||
$formcontract= new Formcontract($db);
|
||||
$formcontract->formSelectContract(
|
||||
$_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid,
|
||||
$object->fk_contrat, 'contratid', 0, 1
|
||||
);
|
||||
$formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contrat, 'contratid', 0, 1);
|
||||
} else {
|
||||
if ($object->fk_contrat) {
|
||||
$contratstatic = new Contrat($db);
|
||||
$contratstatic->fetch($object->fk_contrat);
|
||||
print $contratstatic->getNomUrl(0, '', 1);
|
||||
} else
|
||||
print " ";
|
||||
} else {
|
||||
print " ";
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@@ -595,7 +593,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $langs->trans('Frequency');
|
||||
print '</td>';
|
||||
if ($action != 'editfrequency' && $user->rights->ficheinter->creer) {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&id='.$id.'">';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&id='.$id.'">';
|
||||
print img_edit($langs->trans('Edit'), 1) . '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@@ -720,7 +718,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Duration").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Duration").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$num = count($object->lines);
|
||||
@@ -744,7 +742,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $text.' '.nl2br($object->lines[$i]->desc);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">'.convertSecondToTime($object->lines[$i]->duree).'</td>';
|
||||
print '<td class="center">'.convertSecondToTime($object->lines[$i]->duree).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
@@ -801,66 +799,38 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
print_barre_liste(
|
||||
$langs->trans("RepeatableInterventional"), $page,
|
||||
$_SERVER['PHP_SELF'], "&socid=$socid", $sortfield, $sortorder,
|
||||
'', $num, '', 'title_commercial.png'
|
||||
);
|
||||
print_barre_liste(
|
||||
$langs->trans("RepeatableInterventional"),
|
||||
$page,
|
||||
$_SERVER['PHP_SELF'],
|
||||
"&socid=$socid",
|
||||
$sortfield,
|
||||
$sortorder,
|
||||
'',
|
||||
$num,
|
||||
'',
|
||||
'title_commercial.png'
|
||||
);
|
||||
|
||||
print $langs->trans("ToCreateAPredefinedInterventional").'<br><br>';
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Ref"), $_SERVER['PHP_SELF'], "f.titre", "", "",
|
||||
'width="200px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Company"), $_SERVER['PHP_SELF'], "s.nom", "", "",
|
||||
'width="200px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
if (! empty($conf->contrat->enabled))
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Contract"), $_SERVER['PHP_SELF'],
|
||||
"f.fk_contrat", "", "",
|
||||
'width="100px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
|
||||
if (! empty($conf->projet->enabled))
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Project"), $_SERVER['PHP_SELF'],
|
||||
"f.fk_project", "", "",
|
||||
'width="100px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Duration"), $_SERVER['PHP_SELF'],
|
||||
'f.duree', '', '',
|
||||
'width="50px" align="right"', $sortfiled, $sortorder
|
||||
);
|
||||
// Recurring or not
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Frequency"), $_SERVER['PHP_SELF'],
|
||||
"f.frequency", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
$langs->trans("NbOfGenerationDone"), $_SERVER['PHP_SELF'],
|
||||
"f.nb_gen_done", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
|
||||
print_liste_field_titre(
|
||||
$langs->trans("DateLastGeneration"), $_SERVER['PHP_SELF'],
|
||||
"f.date_last_gen", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
$langs->trans("NextDateToIntervention"), $_SERVER['PHP_SELF'],
|
||||
"f.date_when", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
|
||||
print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
|
||||
if (! empty($conf->contrat->enabled)) {
|
||||
print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
|
||||
}
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
print_liste_field_titre("Project", $_SERVER['PHP_SELF'], "f.fk_project", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
|
||||
}
|
||||
print_liste_field_titre("Duration", $_SERVER['PHP_SELF'], 'f.duree', '', '', 'width="50px"', $sortfield, $sortorder, 'right ');
|
||||
// Recurring or not
|
||||
print_liste_field_titre("Frequency", $_SERVER['PHP_SELF'], "f.frequency", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("NbOfGenerationDone", $_SERVER['PHP_SELF'], "f.nb_gen_done", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateLastGeneration", $_SERVER['PHP_SELF'], "f.date_last_gen", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("NextDateToIntervention", $_SERVER['PHP_SELF'], "f.date_when", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print '<th width="100px"></th>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -899,36 +869,36 @@ print_liste_field_titre(
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td align=right>'.convertSecondToTime($objp->duree).'</td>';
|
||||
print '<td class=right>'.convertSecondToTime($objp->duree).'</td>';
|
||||
|
||||
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
print '<td class="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($objp->frequency) {
|
||||
print $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') ;
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->date_last_gen), 'day') ;
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->date_when), 'day');
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans('NA').'</span>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<span class="opacitymedium">'.$langs->trans('NA').'</span>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<span class="opacitymedium">'.$langs->trans('NA').'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if ($user->rights->ficheinter->creer) {
|
||||
// Action column
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($user->rights->ficheinter->creer) {
|
||||
if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=createfrommodel';
|
||||
|
||||
@@ -1282,7 +1282,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
if ($action != 'contrat')
|
||||
{
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print img_edit($langs->trans('SetContract'), 1);
|
||||
print '</a></td>';
|
||||
}
|
||||
@@ -1393,8 +1393,8 @@ elseif ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="liste_titre" align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="liste_titre" align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td class="liste_titre center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="liste_titre right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@@ -1414,10 +1414,10 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print dol_htmlentitiesbr($objp->description);
|
||||
|
||||
// Date
|
||||
print '<td align="center" width="150">'.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)?dol_print_date($db->jdate($objp->date_intervention), 'dayhour'):dol_print_date($db->jdate($objp->date_intervention), 'day')).'</td>';
|
||||
print '<td class="center" width="150">'.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)?dol_print_date($db->jdate($objp->date_intervention), 'dayhour'):dol_print_date($db->jdate($objp->date_intervention), 'day')).'</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right" width="150">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').'</td>';
|
||||
print '<td class="right" width="150">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').'</td>';
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
@@ -1425,16 +1425,16 @@ elseif ($id > 0 || ! empty($ref))
|
||||
// Icone d'edition et suppression
|
||||
if ($object->statut == 0 && $user->rights->ficheinter->creer)
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&line_id='.$objp->rowid.'#'.$objp->rowid.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=ask_deleteline&line_id='.$objp->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a></td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($num > 1)
|
||||
{
|
||||
if ($i > 0)
|
||||
@@ -1484,7 +1484,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Date d'intervention
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) {
|
||||
print $form->selectDate($db->jdate($objp->date_intervention), 'di', 0, 0, 0, "date_intervention");
|
||||
} else {
|
||||
@@ -1493,7 +1493,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if (empty($conf->global->FICHINTER_WITHOUT_DURATION)) {
|
||||
$selectmode = 'select';
|
||||
if (!empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION))
|
||||
@@ -1502,7 +1502,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<td class="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||
print '</tr>' . "\n";
|
||||
|
||||
@@ -1532,8 +1532,8 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '<td>';
|
||||
print '<a name="add"></a>'; // ancre
|
||||
print $langs->trans('Description').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
@@ -1549,7 +1549,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Date intervention
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
$now=dol_now();
|
||||
$timearray=dol_getdate($now);
|
||||
if (! GETPOST('diday', 'int')) {
|
||||
@@ -1565,7 +1565,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if (empty($conf->global->FICHINTER_WITHOUT_DURATION)) {
|
||||
$selectmode = 'select';
|
||||
if (!empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) {
|
||||
@@ -1575,7 +1575,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" valign="middle" colspan="3"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline"></td>';
|
||||
print '<td class="center" valign="middle" colspan="3"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline"></td>';
|
||||
print '</tr>';
|
||||
|
||||
//Line extrafield
|
||||
|
||||
@@ -128,7 +128,7 @@ if ($resql)
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="impair"><td align="center" colspan="2">';
|
||||
print '<tr class="impair"><td class="center" colspan="2">';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$dolgraph = new DolGraph();
|
||||
@@ -150,7 +150,7 @@ if ($resql)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$fichinterstatic->LibStatut($status, $bool, 0).'</td>';
|
||||
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
||||
print '<td class="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
||||
print $fichinterstatic->LibStatut($status, $bool, 3);
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
@@ -160,8 +160,8 @@ if ($resql)
|
||||
}
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'.$total.'</td></tr>';
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td><td class="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
||||
print "</table><br>";
|
||||
}
|
||||
else
|
||||
@@ -263,7 +263,7 @@ if ($resql)
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@@ -274,7 +274,7 @@ if ($resql)
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
|
||||
print '<td align="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@@ -331,7 +331,7 @@ if (! empty($conf->ficheinter->enabled))
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@@ -342,7 +342,7 @@ if (! empty($conf->ficheinter->enabled))
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'</a></td>';
|
||||
|
||||
print '<td align="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@@ -383,7 +383,7 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short
|
||||
$liststatus=$objectstatic->statuts_short;
|
||||
if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
|
||||
@@ -403,7 +403,7 @@ if ($resql)
|
||||
{
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@@ -420,13 +420,13 @@ if ($resql)
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['fd.description']['checked'])) print_liste_field_titre($arrayfields['fd.description']['label'], $_SERVER["PHP_SELF"], '');
|
||||
if (! empty($arrayfields['fd.date']['checked'])) print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['fd.duree']['checked'])) print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (! empty($arrayfields['fd.date']['checked'])) print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['fd.duree']['checked'])) print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
@@ -469,7 +469,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
// Other picto tool
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->ficheinter->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@@ -504,7 +504,7 @@ if ($resql)
|
||||
// Date creation
|
||||
if (! empty($arrayfields['f.datec']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@@ -512,7 +512,7 @@ if ($resql)
|
||||
// Date modification
|
||||
if (! empty($arrayfields['f.tms']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@@ -520,7 +520,7 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td align="right">'.$objectstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$objectstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Fields of detail of line
|
||||
@@ -531,18 +531,18 @@ if ($resql)
|
||||
}
|
||||
if (! empty($arrayfields['fd.date']['checked']))
|
||||
{
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dp), 'dayhour')."</td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->dp), 'dayhour')."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['fd.duree']['checked']))
|
||||
{
|
||||
print '<td align="right">'.convertSecondToTime($obj->duree, 'allhourmin').'</td>';
|
||||
print '<td class="right">'.convertSecondToTime($obj->duree, 'allhourmin').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totaldurationfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalduration']+=$obj->duree;
|
||||
}
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
@@ -571,7 +571,7 @@ if ($resql)
|
||||
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totaldurationfield'] == $i) print '<td align="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
|
||||
elseif ($totalarray['totaldurationfield'] == $i) print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@@ -254,7 +254,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
arsort($arrayyears);
|
||||
print $form->selectarray('year', $arrayyears, $year, 0);
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br><br>';
|
||||
@@ -263,13 +263,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre" height="24">';
|
||||
print '<td align="center">'.$langs->trans("Year").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NbOfinterventions").'</td>';
|
||||
print '<td align="right">%</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="right">%</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="right">%</td>';
|
||||
print '<td class="center">'.$langs->trans("Year").'</td>';
|
||||
print '<td class="right">'.$langs->trans("NbOfinterventions").'</td>';
|
||||
print '<td class="right">%</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td class="right">%</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td class="right">%</td>';
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
@@ -282,26 +282,26 @@ foreach ($data as $val)
|
||||
$oldyear--;
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right"></td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right"></td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right"></td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right"></td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right"></td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '<td align="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
|
||||
print '<td align="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
print '<td align="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
|
||||
print '<td align="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
|
||||
print '<td align="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
|
||||
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
print '<td class="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
|
||||
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
|
||||
print '<td class="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
|
||||
print '</tr>';
|
||||
$oldyear=$year;
|
||||
}
|
||||
@@ -314,7 +314,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// Show graphs
|
||||
print '<table class="border" width="100%"><tr class="pair nohover"><td align="center">';
|
||||
print '<table class="border" width="100%"><tr class="pair nohover"><td class="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
print $px1->show();
|
||||
|
||||
@@ -47,10 +47,10 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td><?php echo $langs->trans("Intervention"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td></td>
|
||||
<td align="center"><?php echo dol_print_date($objectlink->datev, 'day'); ?></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->datev, 'day'); ?></td>
|
||||
<td></td>
|
||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('PaymentConditions');
|
||||
print '<td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editconditions')
|
||||
@@ -251,7 +251,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '<td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode')
|
||||
@@ -269,7 +269,7 @@ if ($object->id > 0)
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerRelativeDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
@@ -283,7 +283,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
@@ -442,7 +442,7 @@ if ($object->id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("Summary").'</td>';
|
||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id.'">'.$langs->trans("ShowSupplierPreview").'</a></td></tr></table></td>';
|
||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id.'">'.$langs->trans("ShowSupplierPreview").'</a></td></tr></table></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
@@ -471,7 +471,7 @@ if ($object->id > 0)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre'.(($num == 0) ? ' nobottom':'').'">';
|
||||
print '<td colspan="3">'.$langs->trans("ProductsAndServices").'</td><td align="right">';
|
||||
print '<td colspan="3">'.$langs->trans("ProductsAndServices").'</td><td class="right">';
|
||||
print '<a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'">'.$langs->trans("AllProductReferencesOfSupplier").' <span class="badge">'.$object->nbOfProductRefs().'</span>';
|
||||
print '</a></td></tr>';
|
||||
|
||||
@@ -498,8 +498,8 @@ if ($object->id > 0)
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print dol_trunc(dol_htmlentities($objp->label), 30);
|
||||
print '</td>';
|
||||
//print '<td align="right" class="nowrap">'.dol_print_date($objp->tms, 'day').'</td>';
|
||||
print '<td align="right">';
|
||||
//print '<td class="right" class="nowrap">'.dol_print_date($objp->tms, 'day').'</td>';
|
||||
print '<td class="right">';
|
||||
//print (isset($objp->unitprice) ? price($objp->unitprice) : '');
|
||||
if (isset($objp->price))
|
||||
{
|
||||
@@ -546,8 +546,8 @@ if ($object->id > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastSupplierProposals", ($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'">'.$langs->trans("AllPriceRequests").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'">'.$langs->trans("AllPriceRequests").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -565,7 +565,7 @@ if ($object->id > 0)
|
||||
$proposalstatic->total_ttc = $obj->total_ttc;
|
||||
print $proposalstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="center" width="80">';
|
||||
print '<td class="center" width="80">';
|
||||
if ($obj->dc)
|
||||
{
|
||||
print dol_print_date($db->jdate($obj->dc), 'day');
|
||||
@@ -575,7 +575,7 @@ if ($object->id > 0)
|
||||
print "-";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.$proposalstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right" class="nowrap">'.$proposalstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@@ -649,8 +649,8 @@ if ($object->id > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders", ($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -668,7 +668,7 @@ if ($object->id > 0)
|
||||
$orderstatic->total_ttc = $obj->total_ttc;
|
||||
print $orderstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="center" width="80">';
|
||||
print '<td class="center" width="80">';
|
||||
if ($obj->dc)
|
||||
{
|
||||
print dol_print_date($db->jdate($obj->dc), 'day');
|
||||
@@ -678,7 +678,7 @@ if ($object->id > 0)
|
||||
print "-";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.$orderstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right" class="nowrap">'.$orderstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@@ -721,8 +721,8 @@ if ($object->id > 0)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills', ($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills', ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -745,9 +745,9 @@ if ($object->id > 0)
|
||||
print $obj->ref_supplier?' - '.$obj->ref_supplier:'';
|
||||
print ($obj->libelle?' - ':'').dol_trunc($obj->libelle, 14);
|
||||
print '</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df), 'day').'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($obj->amount).'</td>';
|
||||
print '<td align="right" class="nowrap">';
|
||||
print '<td class="center nowrap">'.dol_print_date($db->jdate($obj->df), 'day').'</td>';
|
||||
print '<td class="right nowrap">'.price($obj->amount).'</td>';
|
||||
print '<td class="right nowrap">';
|
||||
print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $obj->am);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -523,12 +523,12 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
}
|
||||
print '<td align="right">' . $langs->trans("SupplierRef") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("QtyOrdered") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("QtyDispatchedShort") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("QtyToDispatchShort") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("SupplierRef") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyOrdered") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyDispatchedShort") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyToDispatchShort") . '</td>';
|
||||
print '<td width="32"></td>';
|
||||
print '<td align="right">' . $langs->trans("Warehouse") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("Warehouse") . '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@@ -595,17 +595,17 @@ if ($id > 0 || ! empty($ref)) {
|
||||
$up_ht_disc = price2num($up_ht_disc * (100 - $objp->remise_percent) / 100, 'MU');
|
||||
|
||||
// Supplier ref
|
||||
print '<td align="right">'.$objp->sref.'</td>';
|
||||
print '<td class="right">'.$objp->sref.'</td>';
|
||||
|
||||
// Qty ordered
|
||||
print '<td align="right">' . $objp->qty . '</td>';
|
||||
print '<td class="right">' . $objp->qty . '</td>';
|
||||
|
||||
// Already dispatched
|
||||
print '<td align="right">' . $products_dispatched[$objp->rowid] . '</td>';
|
||||
print '<td class="right">' . $products_dispatched[$objp->rowid] . '</td>';
|
||||
|
||||
if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) {
|
||||
$type = 'batch';
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '</td>'; // Qty to dispatch
|
||||
print '<td>';
|
||||
//print img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
|
||||
@@ -645,7 +645,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
} else {
|
||||
|
||||
$type = 'dispatch';
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '</td>'; // Qty to dispatch
|
||||
print '<td>';
|
||||
//print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
|
||||
@@ -672,7 +672,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
|
||||
// Qty to dispatch
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '<input id="qty' . $suffix . '" name="qty' . $suffix . '" type="text" class="width50 right" value="' . (GETPOST('qty' . $suffix) != '' ? GETPOST('qty' . $suffix) : $remaintodispatch) . '">';
|
||||
print '</td>';
|
||||
|
||||
@@ -691,7 +691,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '</td>';
|
||||
|
||||
// Warehouse
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if (count($listwarehouses) > 1) {
|
||||
print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
|
||||
} elseif (count($listwarehouses) == 1) {
|
||||
@@ -796,12 +796,12 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td class="dispatch_dluo_title">' . $langs->trans("EatByDate") . '</td>';
|
||||
print '<td class="dispatch_dlc_title">' . $langs->trans("SellByDate") . '</td>';
|
||||
}
|
||||
print '<td align="right">' . $langs->trans("QtyDispatched") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyDispatched") . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td>' . $langs->trans("Warehouse") . '</td>';
|
||||
print '<td>' . $langs->trans("Comment") . '</td>';
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled))
|
||||
print '<td align="center" colspan="2">' . $langs->trans("Status") . '</td>';
|
||||
print '<td class="center" colspan="2">' . $langs->trans("Status") . '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -836,7 +836,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
|
||||
// Qty
|
||||
print '<td align="right">' . $objp->qty . '</td>';
|
||||
print '<td class="right">' . $objp->qty . '</td>';
|
||||
print '<td> </td>';
|
||||
|
||||
// Warehouse
|
||||
@@ -851,14 +851,14 @@ if ($id > 0 || ! empty($ref)) {
|
||||
|
||||
// Status
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) {
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
$supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
|
||||
// print $supplierorderdispatch->status;
|
||||
print $supplierorderdispatch->getLibStatut(5);
|
||||
print '</td>';
|
||||
|
||||
// Add button to check/uncheck disaptching
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))
|
||||
{
|
||||
if (empty($objp->status)) {
|
||||
@@ -887,13 +887,13 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
print '</td>';
|
||||
}elseif(!empty($conf->reception->enabled)){
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if(!empty($reception->id)){
|
||||
print $reception->getLibStatut(5);
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
|
||||
@@ -119,13 +119,13 @@ if ($resql)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($statut, 0).'</td>';
|
||||
print '<td align="right"><a href="list.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
|
||||
print '<td class="right"><a href="list.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="impair"><td align="center" colspan="2">';
|
||||
print '<tr class="impair"><td class="center" colspan="2">';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$dolgraph = new DolGraph();
|
||||
@@ -140,8 +140,8 @@ if ($resql)
|
||||
print '</td></tr>';
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'.$total.'</td></tr>';
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')</td><td class="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
||||
|
||||
print "</table><br>";
|
||||
}
|
||||
@@ -176,7 +176,7 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><th>'.$langs->trans("Status").'</th>';
|
||||
print '<th align="right">'.$langs->trans("Nb").'</th>';
|
||||
print '<th class="right">'.$langs->trans("Nb").'</th>';
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < $num)
|
||||
@@ -185,7 +185,7 @@ if ($resql)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($row[1]).'</td>';
|
||||
print '<td align="right"><a href="list.php?statut='.$row[1].'">'.$row[0].' '.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
print '<td class="right"><a href="list.php?statut='.$row[1].'">'.$row[0].' '.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
@@ -341,7 +341,7 @@ if ($resql)
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@@ -352,7 +352,7 @@ if ($resql)
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@@ -408,7 +408,7 @@ print '<td width="16" class="nobordernopadding nowrap">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@@ -419,7 +419,7 @@ print '</td>';
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
|
||||
|
||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@@ -791,21 +791,21 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
// Company type
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
|
||||
print '</td>';
|
||||
}
|
||||
// Date order
|
||||
if (! empty($arrayfields['cf.date_commande']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_orderday" value="'.$search_orderday.'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_ordermonth" value="'.$search_ordermonth.'">';
|
||||
$formother->select_year($search_orderyear?$search_orderyear:-1, 'search_orderyear', 1, 20, 5);
|
||||
@@ -814,7 +814,7 @@ if ($resql)
|
||||
// Date delivery
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_deliveryday" value="'.$search_deliveryday.'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_deliverymonth" value="'.$search_deliverymonth.'">';
|
||||
$formother->select_year($search_deliveryyear?$search_deliveryyear:-1, 'search_deliveryyear', 1, 20, 5);
|
||||
@@ -823,21 +823,21 @@ if ($resql)
|
||||
if (! empty($arrayfields['cf.total_ht']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_total_ht" value="'.$search_total_ht.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['cf.total_vat']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_total_vat" value="'.$search_total_vat.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -863,19 +863,19 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$formorder->selectSupplierOrderStatus((strstr($search_status, ',')?-1:$search_status), 1, 'search_status');
|
||||
print '</td>';
|
||||
}
|
||||
// Status billed
|
||||
if (! empty($arrayfields['cf.billed']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
print '<td class="liste_titre middle">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@@ -891,25 +891,25 @@ if ($resql)
|
||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['cf.fk_author']['checked'])) print_liste_field_titre($arrayfields['cf.fk_author']['label'], $_SERVER["PHP_SELF"], "cf.fk_author", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.date_commande']['checked'])) print_liste_field_titre($arrayfields['cf.date_commande']['label'], $_SERVER["PHP_SELF"], "cf.date_commande", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked'])) print_liste_field_titre($arrayfields['cf.date_delivery']['label'], $_SERVER["PHP_SELF"], 'cf.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'], $_SERVER["PHP_SELF"], "cf.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.total_vat']['checked'])) print_liste_field_titre($arrayfields['cf.total_vat']['label'], $_SERVER["PHP_SELF"], "cf.tva", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked'])) print_liste_field_titre($arrayfields['cf.total_ttc']['label'], $_SERVER["PHP_SELF"], "cf.total_ttc", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.date_commande']['checked'])) print_liste_field_titre($arrayfields['cf.date_commande']['label'], $_SERVER["PHP_SELF"], "cf.date_commande", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked'])) print_liste_field_titre($arrayfields['cf.date_delivery']['label'], $_SERVER["PHP_SELF"], 'cf.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'], $_SERVER["PHP_SELF"], "cf.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['cf.total_vat']['checked'])) print_liste_field_titre($arrayfields['cf.total_vat']['label'], $_SERVER["PHP_SELF"], "cf.tva", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked'])) print_liste_field_titre($arrayfields['cf.total_ttc']['label'], $_SERVER["PHP_SELF"], "cf.total_ttc", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['cf.datec']['checked'])) print_liste_field_titre($arrayfields['cf.datec']['label'], $_SERVER["PHP_SELF"], "cf.date_creation", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.tms']['checked'])) print_liste_field_titre($arrayfields['cf.tms']['label'], $_SERVER["PHP_SELF"], "cf.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked'])) print_liste_field_titre($arrayfields['cf.fk_statut']['label'], $_SERVER["PHP_SELF"], "cf.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.billed']['checked'])) print_liste_field_titre($arrayfields['cf.billed']['label'], $_SERVER["PHP_SELF"], 'cf.billed', '', $param, 'align="center"', $sortfield, $sortorder, '');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (! empty($arrayfields['cf.datec']['checked'])) print_liste_field_titre($arrayfields['cf.datec']['label'], $_SERVER["PHP_SELF"], "cf.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['cf.tms']['checked'])) print_liste_field_titre($arrayfields['cf.tms']['label'], $_SERVER["PHP_SELF"], "cf.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked'])) print_liste_field_titre($arrayfields['cf.fk_statut']['label'], $_SERVER["PHP_SELF"], "cf.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['cf.billed']['checked'])) print_liste_field_titre($arrayfields['cf.billed']['label'], $_SERVER["PHP_SELF"], 'cf.billed', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@@ -952,7 +952,7 @@ if ($resql)
|
||||
//print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
//print '</td>';
|
||||
// Other picto tool
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->fournisseur->commande->dir_output.'/' . dol_sanitizeFileName($obj->ref);
|
||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||
@@ -1027,7 +1027,7 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
$tmparray=getCountry($obj->fk_pays, 'all');
|
||||
print $tmparray['label'];
|
||||
print '</td>';
|
||||
@@ -1036,7 +1036,7 @@ if ($resql)
|
||||
// Type ent
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
||||
print $typenArray[$obj->typent_code];
|
||||
print '</td>';
|
||||
@@ -1046,7 +1046,7 @@ if ($resql)
|
||||
// Order date
|
||||
if (! empty($arrayfields['cf.date_commande']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($obj->date_commande) print dol_print_date($db->jdate($obj->date_commande), 'day');
|
||||
else print '';
|
||||
print '</td>';
|
||||
@@ -1055,7 +1055,7 @@ if ($resql)
|
||||
// Plannned date of delivery
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_delivery), 'day');
|
||||
if ($objectstatic->hasDelay() && ! empty($objectstatic->date_delivery)) {
|
||||
print ' '.img_picto($langs->trans("Late").' : '.$objectstatic->showDelay(), "warning");
|
||||
@@ -1066,7 +1066,7 @@ if ($resql)
|
||||
// Amount HT
|
||||
if (! empty($arrayfields['cf.total_ht']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ht)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ht)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalht'] += $obj->total_ht;
|
||||
@@ -1074,7 +1074,7 @@ if ($resql)
|
||||
// Amount VAT
|
||||
if (! empty($arrayfields['cf.total_vat']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_tva)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_tva)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalvat'] += $obj->total_tva;
|
||||
@@ -1082,7 +1082,7 @@ if ($resql)
|
||||
// Amount TTC
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalttc'] += $obj->total_ttc;
|
||||
@@ -1097,7 +1097,7 @@ if ($resql)
|
||||
// Date creation
|
||||
if (! empty($arrayfields['cf.datec']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@@ -1105,7 +1105,7 @@ if ($resql)
|
||||
// Date modification
|
||||
if (! empty($arrayfields['cf.tms']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@@ -1113,18 +1113,18 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked']))
|
||||
{
|
||||
print '<td align="right" class="nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
|
||||
print '<td class="right nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Billed
|
||||
if (! empty($arrayfields['cf.billed']['checked']))
|
||||
{
|
||||
print '<td align="center">'.yn($obj->billed).'</td>';
|
||||
print '<td class="center">'.yn($obj->billed).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
@@ -1151,9 +1151,9 @@ if ($resql)
|
||||
if ($num < $limit) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@@ -500,10 +500,10 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre('Ref', 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('RefSupplier', 'orderstoinvoice.php', 'c.ref_supplier', '', '&socid=' . $socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('OrderDate', 'orderstoinvoice.php', 'c.date_commande', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('DeliveryDate', 'orderstoinvoice.php', 'c.date_livraison', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('Status', '', '', '', '', 'align="right"');
|
||||
print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre('OrderDate', 'orderstoinvoice.php', 'c.date_commande', '', '&socid=' . $socid, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre('DeliveryDate', 'orderstoinvoice.php', 'c.date_livraison', '', '&socid=' . $socid, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre('Status', '', '', '', '', '', '', '', 'right ');
|
||||
print_liste_field_titre('GenerateBill', '', '', '', '', '', '', '', 'center ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@@ -513,27 +513,27 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print '<input class="flat" size="10" type="text" name="sref" value="' . $sref . '">';
|
||||
print '</td>';
|
||||
// print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="10" name="sref_client" value="' . $sref_client . '">';
|
||||
print '</td>';
|
||||
|
||||
// DATE ORDER
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $period;
|
||||
print '</td>';
|
||||
|
||||
// DATE DELIVERY
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $periodely;
|
||||
print '</td>';
|
||||
|
||||
// SEARCH BUTTON
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<td class="right liste_titre">';
|
||||
print '<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 '</td>';
|
||||
|
||||
// ALL/NONE
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
if ($conf->use_javascript_ajax)
|
||||
print '<a href="#" id="checkall">' . $langs->trans("All") . '</a> / <a href="#" id="checknone">' . $langs->trans("None") . '</a>';
|
||||
print '</td>';
|
||||
@@ -556,7 +556,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print $generic_commande->getNomUrl(1, $objp->fk_statut);
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename = dol_sanitizeFileName($objp->ref);
|
||||
$filedir = $conf->fournisseur->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $objp->rowid;
|
||||
@@ -567,17 +567,17 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print '<td>' . $objp->ref_supplier . '</td>';
|
||||
|
||||
// Order date
|
||||
print '<td align="center" nowrap>';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($objp->date_commande), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Delivery date
|
||||
print '<td align="center" nowrap>';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($objp->date_livraison), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Statut
|
||||
print '<td align="right" class="nowrap">' . $generic_commande->LibStatut($objp->fk_statut, 5) . '</td>';
|
||||
print '<td class="right nowrap">' . $generic_commande->LibStatut($objp->fk_statut, 5) . '</td>';
|
||||
|
||||
// Checkbox
|
||||
print '<td class="center">';
|
||||
|
||||
@@ -49,14 +49,14 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td><?php echo $langs->trans("SupplierOrder"); ?></td>
|
||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/commande/card.php?id='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowOrder"), "order").' '.$objectlink->ref; ?></a></td>
|
||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||
<td align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td align="right"><?php
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
if ($user->rights->fournisseur->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></td>
|
||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
@@ -66,11 +66,11 @@ if (count($linkedObjectBlock) > 1)
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td align="right"><?php echo price($total); ?></td>
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -2502,7 +2502,7 @@ else
|
||||
print $langs->trans('PaymentConditions');
|
||||
print '<td>';
|
||||
if ($action != 'editconditions' && $user->rights->fournisseur->facture->creer) {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
@@ -2524,7 +2524,7 @@ else
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
@@ -2548,7 +2548,7 @@ else
|
||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencycode' && ! empty($object->brouillon))
|
||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editmulticurrencycode') {
|
||||
@@ -2565,7 +2565,7 @@ else
|
||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||
@@ -2590,7 +2590,7 @@ else
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if ($action != 'editbankaccount' && $user->rights->fournisseur->facture->creer)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editbankaccount') {
|
||||
@@ -2607,7 +2607,7 @@ else
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
print '<td><td align="right">';
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->fournisseur->facture->creer) print '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
else print ' ';
|
||||
print '</td></tr></table>';
|
||||
@@ -2730,8 +2730,8 @@ else
|
||||
print '<td class="liste_titre">' . ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>';
|
||||
print '<td>'.$langs->trans('Date').'</td>';
|
||||
print '<td>'.$langs->trans('Type').'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td align="right">'.$langs->trans('Amount').'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td class="right">'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td class="right">'.$langs->trans('Amount').'</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -2770,12 +2770,12 @@ else
|
||||
$bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
||||
}
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1, 'transactions');
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="right">' . price($sign * $objp->amount) . '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="right">' . price($sign * $objp->amount) . '</td>';
|
||||
print '<td class="center">';
|
||||
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
|
||||
@@ -2796,13 +2796,13 @@ else
|
||||
/*
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('AlreadyPaid').' :</td><td align="right">'.price($totalpaye).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right">'.price($object->total_ttc).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('AlreadyPaid').' :</td><td class="right">'.price($totalpaye).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("Billed").' :</td><td class="right">'.price($object->total_ttc).'</td><td></td></tr>';
|
||||
|
||||
$resteapayer = $object->total_ttc - $totalpaye;
|
||||
|
||||
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('RemainderToPay').' :</td>';
|
||||
print '<td align="right"'.($resteapayer?' class="amountremaintopay"':'').'>'.price($resteapayer).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('RemainderToPay').' :</td>';
|
||||
print '<td class="right"'.($resteapayer?' class="amountremaintopay"':'').'>'.price($resteapayer).'</td><td></td></tr>';
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -2816,12 +2816,12 @@ else
|
||||
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
// Total already paid
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($object->type != FactureFournisseur::TYPE_DEPOSIT)
|
||||
print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
|
||||
else
|
||||
print $langs->trans('AlreadyPaid');
|
||||
print ' :</td><td align="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>';
|
||||
print ' :</td><td class="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>';
|
||||
|
||||
//$resteapayer = $object->total_ttc - $totalpaye;
|
||||
$resteapayeraffiche = $resteapayer;
|
||||
@@ -2845,15 +2845,15 @@ else
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$invoice->fetch($obj->fk_invoice_supplier_source);
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||
print $langs->trans("CreditNote") . ' ';
|
||||
if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT)
|
||||
print $langs->trans("Deposit") . ' ';
|
||||
print $invoice->getNomUrl(0);
|
||||
print ' :</td>';
|
||||
print '<td align="right">' . price($obj->amount_ttc) . '</td>';
|
||||
print '<td align="right">';
|
||||
print '<td class="right">' . price($obj->amount_ttc) . '</td>';
|
||||
print '<td class="right">';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>';
|
||||
print '</td></tr>';
|
||||
$i ++;
|
||||
@@ -2868,51 +2868,51 @@ else
|
||||
|
||||
// Paye partiellement 'escompte'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1);
|
||||
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
print '</td><td class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
// Paye partiellement ou Abandon 'badsupplier'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'badsupplier') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1);
|
||||
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
print '</td><td class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
// $resteapayeraffiche=0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
// Paye partiellement ou Abandon 'product_returned'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1);
|
||||
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
print '</td><td class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
// Paye partiellement ou Abandon 'abandon'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'abandon') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
$text = $langs->trans("HelpAbandonOther");
|
||||
if ($object->close_note)
|
||||
$text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note;
|
||||
print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1);
|
||||
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
print '</td><td class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
|
||||
// Billed
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($object->total_ttc) . '</td><td> </td></tr>';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">' . $langs->trans("Billed") . ' :</td><td class="right">' . price($object->total_ttc) . '</td><td> </td></tr>';
|
||||
|
||||
// Remainder to pay
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($resteapayeraffiche >= 0)
|
||||
print $langs->trans('RemainderToPay');
|
||||
else
|
||||
print $langs->trans('ExcessPaid');
|
||||
print ' :</td>';
|
||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>';
|
||||
print '<td class="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>';
|
||||
print '<td class="nowrap"> </td></tr>';
|
||||
}
|
||||
else // Credit note
|
||||
@@ -2920,26 +2920,26 @@ else
|
||||
$cssforamountpaymentcomplete='amountpaymentneutral';
|
||||
|
||||
// Total already paid back
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
print $langs->trans('AlreadyPaidBack');
|
||||
print ' :</td><td align="right">' . price($sign * $totalpaye) . '</td><td> </td></tr>';
|
||||
print ' :</td><td class="right">' . price($sign * $totalpaye) . '</td><td> </td></tr>';
|
||||
|
||||
// Billed
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($sign * $object->total_ttc) . '</td><td> </td></tr>';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">' . $langs->trans("Billed") . ' :</td><td class="right">' . price($sign * $object->total_ttc) . '</td><td> </td></tr>';
|
||||
|
||||
// Remainder to pay back
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($resteapayeraffiche <= 0)
|
||||
print $langs->trans('RemainderToPayBack');
|
||||
else
|
||||
print $langs->trans('ExcessPaid');
|
||||
print ' :</td>';
|
||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
||||
print '<td class="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
||||
print '<td class="nowrap"> </td></tr>';
|
||||
|
||||
// Sold credit note
|
||||
// print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>';
|
||||
// print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign *
|
||||
// print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('TotalTTC').' :</td>';
|
||||
// print '<td class="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign *
|
||||
// $object->total_ttc).'</b></td><td> </td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -189,13 +189,13 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "f.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("RefSupplier", $_SERVER["PHP_SELF"], "f.ref_supplier", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateDue", $_SERVER["PHP_SELF"], "f.date_lim_reglement", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateDue", $_SERVER["PHP_SELF"], "f.date_lim_reglement", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountTTC", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AlreadyPaid", $_SERVER["PHP_SELF"], "am", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "fk_statut,paye,am", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("AmountTTC", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("AlreadyPaid", $_SERVER["PHP_SELF"], "am", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "fk_statut,paye,am", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lines with filter fields
|
||||
@@ -206,14 +206,14 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print '<input class="flat" size="8" type="text" name="search_ref_supplier" value="'.$search_ref_supplier.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">';
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '</td><td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_amount_no_tax" value="'.$search_amount_no_tax.'">';
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '</td><td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@@ -245,8 +245,8 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
|
||||
print '<td class="nowrap">'.dol_trunc($objp->ref_supplier, 12).'</td>';
|
||||
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df), 'day')."</td>\n";
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite), 'day');
|
||||
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->df), 'day')."</td>\n";
|
||||
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->datelimite), 'day');
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
@@ -258,12 +258,12 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print $companystatic->getNomUrl(1, 'supplier', 32);
|
||||
print '</td>';
|
||||
|
||||
print "<td align=\"right\">".price($objp->total_ht)."</td>";
|
||||
print "<td align=\"right\">".price($objp->total_ttc)."</td>";
|
||||
print "<td align=\"right\">".price($objp->am)."</td>";
|
||||
print "<td class=\"right\">".price($objp->total_ht)."</td>";
|
||||
print "<td class=\"right\">".price($objp->total_ttc)."</td>";
|
||||
print "<td class=\"right\">".price($objp->am)."</td>";
|
||||
|
||||
// Show invoice status
|
||||
print '<td align="right" class="nowrap">';
|
||||
print '<td class="right nowrap">';
|
||||
print $facturestatic->LibStatut($objp->paye, $objp->fk_statut, 5, $objp->am);
|
||||
print '</td>';
|
||||
|
||||
@@ -276,11 +276,11 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
}
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print "<td colspan=\"5\" align=\"left\">".$langs->trans("Total").": </td>";
|
||||
print "<td align=\"right\"><b>".price($total_ht)."</b></td>";
|
||||
print "<td align=\"right\"><b>".price($total_ttc)."</b></td>";
|
||||
print "<td align=\"right\"><b>".price($total_paid)."</b></td>";
|
||||
print '<td align="center"> </td>';
|
||||
print "<td colspan=\"5\" class=\"left\">".$langs->trans("Total").": </td>";
|
||||
print "<td class=\"right\"><b>".price($total_ht)."</b></td>";
|
||||
print "<td class=\"right\"><b>".price($total_ttc)."</b></td>";
|
||||
print "<td class=\"right\"><b>".price($total_paid)."</b></td>";
|
||||
print '<td class="center"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ if ($resql)
|
||||
// Ref
|
||||
if (! empty($arrayfields['f.ref']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -630,7 +630,7 @@ if ($resql)
|
||||
// Date invoice
|
||||
if (! empty($arrayfields['f.datef']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.dol_escape_htmltag($day).'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
$formother->select_year($year?$year:-1, 'year', 1, 20, 5);
|
||||
@@ -639,7 +639,7 @@ if ($resql)
|
||||
// Date due
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day_lim" value="'.dol_escape_htmltag($day_lim).'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month_lim" value="'.$month_lim.'">';
|
||||
$formother->select_year($year_lim?$year_lim:-1, 'year_lim', 1, 20, 5);
|
||||
@@ -670,67 +670,67 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
// Company type
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
|
||||
print '</td>';
|
||||
}
|
||||
// Payment mode
|
||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10);
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_ht']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_vat']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.$search_montant_localtax1.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.$search_montant_localtax2.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['dynamount_payed']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['rtp']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '</td>';
|
||||
}
|
||||
// Extra fields
|
||||
@@ -755,13 +755,13 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone right">';
|
||||
$liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid"));
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
print '<td class="liste_titre middle">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@@ -773,33 +773,33 @@ if ($resql)
|
||||
if (! empty($arrayfields['f.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['f.ref_supplier']['label'], $_SERVER["PHP_SELF"], 'f.ref_supplier', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.label']['checked'])) print_liste_field_titre($arrayfields['f.label']['label'], $_SERVER['PHP_SELF'], "f.libelle,f.rowid", '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
$facturestatic=new FactureFournisseur($db);
|
||||
@@ -853,7 +853,7 @@ if ($resql)
|
||||
//print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
//print '</td>';
|
||||
// Other picto tool
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref);
|
||||
$subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref);
|
||||
@@ -894,7 +894,7 @@ if ($resql)
|
||||
// Date
|
||||
if (! empty($arrayfields['f.datef']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->datef), 'day');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@@ -903,7 +903,7 @@ if ($resql)
|
||||
// Date limit
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($datelimit, 'day');
|
||||
print '<td class="center nowrap">'.dol_print_date($datelimit, 'day');
|
||||
if ($facturestatic->hasDelay())
|
||||
{
|
||||
print img_warning($langs->trans('Late'));
|
||||
@@ -960,7 +960,7 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
$tmparray=getCountry($obj->fk_pays, 'all');
|
||||
print $tmparray['label'];
|
||||
print '</td>';
|
||||
@@ -969,7 +969,7 @@ if ($resql)
|
||||
// Type ent
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
||||
print $typenArray[$obj->typent_code];
|
||||
print '</td>';
|
||||
@@ -988,7 +988,7 @@ if ($resql)
|
||||
// Amount HT
|
||||
if (! empty($arrayfields['f.total_ht']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ht)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ht)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalht'] += $obj->total_ht;
|
||||
@@ -996,7 +996,7 @@ if ($resql)
|
||||
// Amount VAT
|
||||
if (! empty($arrayfields['f.total_vat']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_vat)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_vat)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalvat'] += $obj->total_vat;
|
||||
@@ -1004,7 +1004,7 @@ if ($resql)
|
||||
// Amount LocalTax1
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_localtax1)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_localtax1)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield'];
|
||||
$totalarray['totallocaltax1'] += $obj->total_localtax1;
|
||||
@@ -1012,7 +1012,7 @@ if ($resql)
|
||||
// Amount LocalTax2
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_localtax2)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_localtax2)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield'];
|
||||
$totalarray['totallocaltax2'] += $obj->total_localtax2;
|
||||
@@ -1020,7 +1020,7 @@ if ($resql)
|
||||
// Amount TTC
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalttc'] += $obj->total_ttc;
|
||||
@@ -1028,7 +1028,7 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['dynamount_payed']['checked']))
|
||||
{
|
||||
print '<td align="right">'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
print '<td class="right">'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalam'] += $totalpay;
|
||||
@@ -1036,7 +1036,7 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['rtp']['checked']))
|
||||
{
|
||||
print '<td align="right">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
print '<td class="right">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalrtp'] += $remaintopay;
|
||||
@@ -1052,7 +1052,7 @@ if ($resql)
|
||||
// Date creation
|
||||
if (! empty($arrayfields['f.datec']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@@ -1060,7 +1060,7 @@ if ($resql)
|
||||
// Date modification
|
||||
if (! empty($arrayfields['f.tms']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@@ -1068,7 +1068,7 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td align="right" class="nowrap">';
|
||||
print '<td class="right nowrap">';
|
||||
// TODO $paiement is not yet defined
|
||||
print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type);
|
||||
print "</td>";
|
||||
@@ -1076,7 +1076,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
@@ -1111,13 +1111,13 @@ if ($resql)
|
||||
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td align="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td align="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td class="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td class="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@@ -513,17 +513,17 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Invoice').'</td>';
|
||||
print '<td>'.$langs->trans('RefSupplier').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td align="center">'.$langs->trans('DateMaxPayment').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="center">'.$langs->trans('DateMaxPayment').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td>'.$langs->trans('Currency').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAlreadyPaid').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyRemainderToPay').'</td>';
|
||||
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right">'.$langs->trans('AlreadyPaid').'</td>';
|
||||
print '<td align="right">'.$langs->trans('RemainderToPay').'</td>';
|
||||
print '<td align="center">'.$langs->trans('PaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right">'.$langs->trans('MulticurrencyAlreadyPaid').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right">'.$langs->trans('MulticurrencyRemainderToPay').'</td>';
|
||||
print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td class="right">'.$langs->trans('AlreadyPaid').'</td>';
|
||||
print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
|
||||
print '<td class="center">'.$langs->trans('PaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$total=0;
|
||||
@@ -566,18 +566,18 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
// Date
|
||||
if ($objp->df > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->df), 'day').'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>!!!</b></td>';
|
||||
print '<td class="center"><b>!!!</b></td>';
|
||||
}
|
||||
|
||||
// Date Max Payment
|
||||
if ($objp->dlr > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->dlr), 'day');
|
||||
|
||||
if ($invoice->hasDelay())
|
||||
@@ -589,30 +589,30 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>--</b></td>';
|
||||
print '<td class="center"><b>--</b></td>';
|
||||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
// Currency
|
||||
print '<td align="center">'.$objp->multicurrency_code."</td>\n";
|
||||
print '<td class="center">'.$objp->multicurrency_code."</td>\n";
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
print price($objp->multicurrency_total_ttc);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
print price($objp->multicurrency_am);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
print price($objp->multicurrency_total_ttc - $objp->multicurrency_am);
|
||||
@@ -620,17 +620,17 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||
print '<td class="right">'.price($objp->total_ttc).'</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->am);
|
||||
print '<td class="right">'.price($objp->am);
|
||||
if ($creditnotes) print '+'.price($creditnotes);
|
||||
if ($deposits) print '+'.price($deposits);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.price($remaintopay).'</td>';
|
||||
print '<td class="right">'.price($remaintopay).'</td>';
|
||||
|
||||
// Amount
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
|
||||
$namef = 'amount_'.$objp->facid;
|
||||
$nameRemain = 'remain_'.$objp->facid;
|
||||
@@ -652,7 +652,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
// Multicurrency Price
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
|
||||
// Add remind multicurrency amount
|
||||
$namef = 'multicurrency_amount_'.$objp->facid;
|
||||
@@ -688,19 +688,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
// Print total
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="4" align="left">'.$langs->trans('TotalTTC').':</td>';
|
||||
print '<td colspan="4" class="left">'.$langs->trans('TotalTTC').':</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
print '<td align="right"><b>'.price($total_ttc).'</b></td>';
|
||||
print '<td align="right"><b>'.price($totalrecu);
|
||||
print '<td class="right"><b>'.price($total_ttc).'</b></td>';
|
||||
print '<td class="right"><b>'.price($totalrecu);
|
||||
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
|
||||
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
|
||||
print '</b></td>';
|
||||
print '<td align="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
||||
print '<td align="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
print '<td class="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
||||
print '<td class="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
@@ -874,30 +874,30 @@ if (empty($action))
|
||||
|
||||
// Lines for filters fields
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.dol_escape_htmltag($day).'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month" value="'.dol_escape_htmltag($month).'">';
|
||||
$formother->select_year($year?$year:-1, 'year', 1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_comptes($search_account, 'search_account', 0, '', 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@@ -905,12 +905,12 @@ if (empty($action))
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], 'p.rowid', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], 'dp', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], 'dp', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], 'c.libelle', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "p.num_paiement", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], 'ba.label', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'p.amount', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'p.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
//print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
@@ -927,7 +927,7 @@ if (empty($action))
|
||||
// Date
|
||||
$dateformatforpayment = 'day';
|
||||
if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour';
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."</td>\n";
|
||||
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."</td>\n";
|
||||
|
||||
// Thirdparty
|
||||
print '<td>';
|
||||
@@ -947,7 +947,7 @@ if (empty($action))
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->pamount).'</td>';
|
||||
print '<td class="right">'.price($objp->pamount).'</td>';
|
||||
|
||||
// Ref invoice
|
||||
/*$invoicesupplierstatic->ref=$objp->ref_supplier;
|
||||
|
||||
@@ -143,8 +143,8 @@ if ($year)
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Reporting").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Date").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Date").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (is_resource($handle))
|
||||
@@ -156,8 +156,8 @@ if ($year)
|
||||
$tfile = $dir . '/'.$year.'/'.$file;
|
||||
$relativepath = $year.'/'.$file;
|
||||
print '<tr class="oddeven">'.'<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_fournisseur&file=payments/'.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
|
||||
print '<td align="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
|
||||
print '<td align="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td></tr>';
|
||||
print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
|
||||
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td></tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
@@ -51,8 +51,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td><?php echo $langs->trans("SupplierInvoice"); ?></td>
|
||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowBill"), "bill").' '.$objectlink->ref; ?></a></td>
|
||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||
<td align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td align="right"><?php
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
if ($user->rights->fournisseur->facture->lire) {
|
||||
$sign = 1;
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
@@ -66,8 +66,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
} ?></td>
|
||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
@@ -77,11 +77,11 @@ if (count($linkedObjectBlock) > 1)
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td align="right"><?php echo price($total); ?></td>
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ if ($resql)
|
||||
$i = 0;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Orders").'</td><td align="center">'.$langs->trans("Nb").'</td><td> </td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Orders").'</td><td class="center">'.$langs->trans("Nb").'</td><td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < $num)
|
||||
@@ -80,8 +80,8 @@ if ($resql)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($row[1]).'</td>';
|
||||
print '<td align="center">'.$row[0].'</td>';
|
||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/fourn/commande/list.php?statut='.$row[1].'">'.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
print '<td class="center">'.$row[0].'</td>';
|
||||
print '<td class="center"><a href="'.DOL_URL_ROOT.'/fourn/commande/list.php?statut='.$row[1].'">'.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
@@ -139,14 +139,14 @@ if (! empty($conf->fournisseur->enabled))
|
||||
$companystatic->client=0;
|
||||
print $companystatic->getNomUrl(1, '', 16);
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||
print '<td class="right nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||
$i++;
|
||||
$total += $obj->total_ttc;
|
||||
}
|
||||
if ($total>0)
|
||||
{
|
||||
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
|
||||
}
|
||||
print "</table>";
|
||||
print "<br>\n";
|
||||
@@ -197,14 +197,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
$companystatic->client=0;
|
||||
print $companystatic->getNomUrl(1, '', 16);
|
||||
print '</td>';
|
||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
$tot_ttc+=$obj->total_ttc;
|
||||
$i++;
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>';
|
||||
print '<td colspan="2" align="right">'.price($tot_ttc).'</td>';
|
||||
print '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>";
|
||||
@@ -250,7 +250,7 @@ if ($resql)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("BoxTitleLastSuppliers", min($max, $num))."</td>\n";
|
||||
print '<td align="right">'.$langs->trans("DateModification")."</td>\n";
|
||||
print '<td class="right">'.$langs->trans("DateModification")."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
while ($obj = $db->fetch_object($resql) )
|
||||
@@ -259,7 +259,7 @@ if ($resql)
|
||||
print '<td><a href="card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"), "company").'</a>';
|
||||
print " <a href=\"card.php?socid=".$obj->socid."\">".$obj->name."</a></td>\n";
|
||||
print '<td class="left">'.$obj->code_fournisseur.' </td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
||||
print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
@@ -298,7 +298,7 @@ if (count($companystatic->SupplierCategories))
|
||||
print '</td>'."\n";
|
||||
// TODO this page not exist
|
||||
/*
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '<a href="stats.php?cat='.$rowid.'">('.$langs->trans("Stats").')</a>';
|
||||
print "</tr>\n";
|
||||
*/
|
||||
|
||||
@@ -243,7 +243,7 @@ if ($resql)
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@@ -255,9 +255,9 @@ if ($resql)
|
||||
print_liste_field_titre("RefSupplierShort", $_SERVER["PHP_SELF"], "ppf.ref_fourn", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Supplier", $_SERVER["PHP_SELF"], "ppf.fk_soc", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "ppf.price", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "ppf.quantity", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("UnitPrice", $_SERVER["PHP_SELF"], "ppf.unitprice", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "ppf.price", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "ppf.quantity", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("UnitPrice", $_SERVER["PHP_SELF"], "ppf.unitprice", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"]);
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -287,13 +287,13 @@ if ($resql)
|
||||
if ($companystatic->id > 0) print $companystatic->getNomUrl(1, 'supplier');
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.(isset($objp->price) ? price($objp->price) : '').'</td>';
|
||||
print '<td class="right">'.(isset($objp->price) ? price($objp->price) : '').'</td>';
|
||||
|
||||
print '<td align="right">'.$objp->qty.'</td>';
|
||||
print '<td class="right">'.$objp->qty.'</td>';
|
||||
|
||||
print '<td align="right">'.(isset($objp->unitprice) ? price($objp->unitprice) : '').'</td>';
|
||||
print '<td class="right">'.(isset($objp->unitprice) ? price($objp->unitprice) : '').'</td>';
|
||||
|
||||
print '<td align="right"></td>';
|
||||
print '<td class="right"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
||||
@@ -87,12 +87,12 @@ if ($socid > 0)
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100" align="center">'.$langs->trans("Date").'</td>';
|
||||
print '<td width="100" class="center">'.$langs->trans("Date").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>'.$langs->trans("Status").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Debit").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Credit").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Balance").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Debit").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Credit").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Balance").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -119,15 +119,15 @@ if ($socid > 0)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print "<td align=\"center\">".dol_print_date($fac->date)."</td>\n";
|
||||
print "<td class=\"center\">".dol_print_date($fac->date)."</td>\n";
|
||||
print "<td><a href=\"facture/card.php?facid=$fac->id\">".img_object($langs->trans("ShowBill"), "bill")." ".$fac->ref."</a></td>\n";
|
||||
|
||||
print '<td aling="left">'.$fac->getLibStatut(2, $totalpaye).'</td>';
|
||||
print '<td align="right">'.price($fac->total_ttc)."</td>\n";
|
||||
print '<td class="left">'.$fac->getLibStatut(2, $totalpaye).'</td>';
|
||||
print '<td class="right">'.price($fac->total_ttc)."</td>\n";
|
||||
$solde = $solde + $fac->total_ttc;
|
||||
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right">'.price($solde)."</td>\n";
|
||||
print '<td class="right"> </td>';
|
||||
print '<td class="right">'.price($solde)."</td>\n";
|
||||
|
||||
// Author
|
||||
print '<td class="nowrap" width="50"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objf->userid.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$objf->login.'</a></td>';
|
||||
@@ -154,15 +154,15 @@ if ($socid > 0)
|
||||
$objp = $db->fetch_object($resqlp);
|
||||
//
|
||||
print '<tr class="oddeven">';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dp))."</td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->dp))."</td>\n";
|
||||
print '<td>';
|
||||
print ' '; // Decalage
|
||||
print '<a href="paiement/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"), "payment").' '.$langs->trans("Payment").' '.$objp->rowid.'</td>';
|
||||
print "<td> </td>\n";
|
||||
print "<td> </td>\n";
|
||||
print '<td align="right">'.price($objp->amount).'</td>';
|
||||
print '<td class="right">'.price($objp->amount).'</td>';
|
||||
$solde = $solde - $objp->amount;
|
||||
print '<td align="right">'.price($solde)."</td>\n";
|
||||
print '<td class="right">'.price($solde)."</td>\n";
|
||||
|
||||
// Auteur
|
||||
print '<td class="nowrap" width="50"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->userid.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$objp->login.'</a></td>';
|
||||
|
||||
@@ -240,5 +240,5 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN fk_user_author integer;
|
||||
ALTER TABLE llx_facturedet_rec ADD COLUMN fk_user_modif integer;
|
||||
|
||||
ALTER TABLE llx_expensereport_det MODIFY COLUMN value_unit double(24,8) NOT NULL;
|
||||
ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) NOT NULL after qty;
|
||||
ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) DEFAULT 0 NOT NULL after qty;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ CREATE TABLE llx_expensereport_det
|
||||
comments text NOT NULL,
|
||||
product_type integer DEFAULT -1,
|
||||
qty real NOT NULL,
|
||||
subprice double(24,8), -- P.U. HT (example 100)
|
||||
subprice double(24,8) DEFAULT 0 NOT NULL, -- P.U. HT (example 100)
|
||||
value_unit double(24,8) NOT NULL, -- P.U. TTC (example 120)
|
||||
remise_percent real,
|
||||
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
|
||||
|
||||
@@ -1858,3 +1858,4 @@ MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person
|
||||
MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or if you use the application from a text browser like Lynx or Links.
|
||||
ThisValueCanOverwrittenOnUserLevel=This value can be overwritten by each user from its user page - tab '%s'
|
||||
DefaultCustomerType=Default thirdparty type for "New customer" creation form
|
||||
ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working.
|
||||
|
||||
@@ -338,3 +338,4 @@ CloneDestinationReference=Destination product reference
|
||||
ErrorCopyProductCombinations=There was an error while copying the product variants
|
||||
ErrorDestinationProductNotFound=Destination product not found
|
||||
ErrorProductCombinationNotFound=Product variant not found
|
||||
ActionAvailableOnVariantProductOnly=Action only available on the variant of product
|
||||
@@ -154,12 +154,12 @@ print '</th>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
|
||||
print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="15%" class="center">'.$langs->trans("Insurance");
|
||||
Print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
Print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
|
||||
Print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
|
||||
print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
|
||||
print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
|
||||
print ' ('.price2num($object->capital).')';
|
||||
print '<input type="hidden" name="hi_capital0" id ="hi_capital0" value="'.$object->capital.'">';
|
||||
print '</th>';
|
||||
|
||||
@@ -160,12 +160,12 @@ print '</th>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
|
||||
print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="15%" class="center">'.$langs->trans("Insurance");
|
||||
Print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
Print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
|
||||
Print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
|
||||
print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
|
||||
print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
|
||||
print ' ('.price2num($object->capital).')';
|
||||
print '<input type="hidden" name="hi_capital0" id ="hi_capital0" value="'.$object->capital.'">';
|
||||
print '</th>';
|
||||
|
||||
@@ -316,8 +316,6 @@ class FormProduct
|
||||
|
||||
$return = '';
|
||||
|
||||
$measuring_units = array();
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php';
|
||||
$measuringUnits = new CUnits($db);
|
||||
$result = $measuringUnits->fetchAll(
|
||||
@@ -340,7 +338,7 @@ class FormProduct
|
||||
|
||||
foreach ($measuringUnits->records as $lines) {
|
||||
$return .= '<option value="' . $lines->code . '"';
|
||||
if ($key == $default) {
|
||||
if ($lines->code == $default) {
|
||||
$return .= ' selected';
|
||||
}
|
||||
// $return.= '>'.$value.'</option>';
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
|
||||
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017 Gustavo Novaro
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -271,7 +272,7 @@ class Product extends CommonObject
|
||||
* Main barcode
|
||||
* barcode value
|
||||
*
|
||||
* @var
|
||||
* @var string
|
||||
*/
|
||||
public $barcode;
|
||||
|
||||
@@ -554,7 +555,8 @@ class Product extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
// For automatic creation during create action (not used by Dolibarr GUI, can be used by scripts)
|
||||
if ($this->barcode == -1) { $this->barcode = $this->get_barcode($this, $this->barcode_type_code);
|
||||
if ($this->barcode == -1) {
|
||||
$this->barcode = $this->get_barcode($this, $this->barcode_type_code);
|
||||
}
|
||||
|
||||
// Check more parameters
|
||||
@@ -1001,9 +1003,10 @@ class Product extends CommonObject
|
||||
}
|
||||
|
||||
if (! $error && ! $notrigger) {
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PRODUCT_MODIFY', $user);
|
||||
if ($result < 0) { $error++;
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PRODUCT_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
@@ -1014,10 +1017,10 @@ class Product extends CommonObject
|
||||
$olddir = $conf->product->dir_output . "/" . dol_sanitizeFileName($this->oldcopy->ref);
|
||||
$newdir = $conf->product->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||
if (file_exists($olddir)) {
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
//$res = dol_move($olddir, $newdir);
|
||||
// do not use dol_move with directory
|
||||
$res = @rename($olddir, $newdir);
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
//$res = dol_move($olddir, $newdir);
|
||||
// do not use dol_move with directory
|
||||
$res = @rename($olddir, $newdir);
|
||||
if (! $res) {
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorFailToRenameDir', $olddir, $newdir);
|
||||
@@ -1052,8 +1055,10 @@ class Product extends CommonObject
|
||||
{
|
||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
if (empty($conf->barcode->enabled) || empty($this->barcode)) { $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists", $this->ref);
|
||||
} else { $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductBarCodeAlreadyExists", $this->barcode);
|
||||
if (empty($conf->barcode->enabled) || empty($this->barcode)) {
|
||||
$this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists", $this->ref);
|
||||
} else {
|
||||
$this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductBarCodeAlreadyExists", $this->barcode);
|
||||
}
|
||||
$this->errors[]=$this->error;
|
||||
$this->db->rollback();
|
||||
@@ -1096,8 +1101,10 @@ class Product extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($id)) { $id=$this->id;
|
||||
} else { $this->fetch($id);
|
||||
if (empty($id)) {
|
||||
$id=$this->id;
|
||||
} else {
|
||||
$this->fetch($id);
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
@@ -1501,7 +1508,8 @@ class Product extends CommonObject
|
||||
$now=dol_now();
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->price_by_qty)) { $this->price_by_qty=0;
|
||||
if (empty($this->price_by_qty)) {
|
||||
$this->price_by_qty=0;
|
||||
}
|
||||
|
||||
// Add new price
|
||||
@@ -1834,13 +1842,16 @@ class Product extends CommonObject
|
||||
dol_syslog(get_class($this)."::update_price id=".$id." newprice=".$newprice." newpricebase=".$newpricebase." newminprice=".$newminprice." level=".$level." npr=".$newnpr." newdefaultvatcode=".$newdefaultvatcode);
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->tva_tx)) { $this->tva_tx=0;
|
||||
if (empty($this->tva_tx)) {
|
||||
$this->tva_tx=0;
|
||||
}
|
||||
if (empty($newnpr)) { $newnpr=0;
|
||||
if (empty($newnpr)) {
|
||||
$newnpr=0;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ($newvat == '') { $newvat=$this->tva_tx;
|
||||
if ($newvat == '') {
|
||||
$newvat=$this->tva_tx;
|
||||
}
|
||||
|
||||
// If multiprices are enabled, then we check if the current product is subject to price autogeneration
|
||||
@@ -1904,9 +1915,11 @@ class Product extends CommonObject
|
||||
$localtaxtype2='0';
|
||||
$localtax2=get_localtax($newvat, 2);
|
||||
}
|
||||
if (empty($localtax1)) { $localtax1=0; // If = '' then = 0
|
||||
if (empty($localtax1)) {
|
||||
$localtax1=0; // If = '' then = 0
|
||||
}
|
||||
if (empty($localtax2)) { $localtax2=0; // If = '' then = 0
|
||||
if (empty($localtax2)) {
|
||||
$localtax2=0; // If = '' then = 0
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
@@ -2132,7 +2145,8 @@ class Product extends CommonObject
|
||||
$this->fetch_optionals();
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) { $this->getMultiLangs();
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||
$this->getMultiLangs();
|
||||
}
|
||||
|
||||
// Load multiprices array
|
||||
@@ -2361,7 +2375,7 @@ class Product extends CommonObject
|
||||
* Charge tableau des stats propale pour le produit/service
|
||||
*
|
||||
* @param int $socid Id societe
|
||||
* @return array Tableau des stats
|
||||
* @return integer Tableau des stats dans $this->stats_propale, <0 if ko >0 if ok
|
||||
*/
|
||||
public function load_stats_propale($socid = 0)
|
||||
{
|
||||
@@ -2374,16 +2388,19 @@ class Product extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE p.rowid = pd.fk_propal";
|
||||
$sql.= " AND p.fk_soc = s.rowid";
|
||||
$sql.= " AND p.entity IN (".getEntity('propal').")";
|
||||
$sql.= " AND pd.fk_product = ".$this->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
//$sql.= " AND pr.fk_statut != 0";
|
||||
if ($socid > 0) { $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND p.fk_soc = ".$socid;
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2457,7 +2474,7 @@ class Product extends CommonObject
|
||||
* @param int $socid Id societe pour filtrer sur une societe
|
||||
* @param string $filtrestatut Id statut pour filtrer sur un statut
|
||||
* @param int $forVirtualStock Ignore rights filter for virtual stock calculation.
|
||||
* @return array Array of stats (nb=nb of order, qty=qty ordered)
|
||||
* @return integer Array of stats in $this->stats_commande (nb=nb of order, qty=qty ordered), <0 if ko or >0 if ok
|
||||
*/
|
||||
public function load_stats_commande($socid = 0, $filtrestatut = '', $forVirtualStock = 0)
|
||||
{
|
||||
@@ -2469,17 +2486,21 @@ class Product extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE c.rowid = cd.fk_commande";
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity IN (".getEntity('commande').")";
|
||||
$sql.= " AND cd.fk_product = ".$this->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
||||
$sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND c.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND c.fk_soc = ".$socid;
|
||||
}
|
||||
if ($filtrestatut <> '') { $sql.= " AND c.fk_statut in (".$filtrestatut.")";
|
||||
if ($filtrestatut <> '') {
|
||||
$sql.= " AND c.fk_statut in (".$filtrestatut.")";
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2564,17 +2585,21 @@ class Product extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE c.rowid = cd.fk_commande";
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity IN (".getEntity('supplier_order').")";
|
||||
$sql.= " AND cd.fk_product = ".$this->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
||||
$sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND c.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND c.fk_soc = ".$socid;
|
||||
}
|
||||
if ($filtrestatut != '') { $sql.= " AND c.fk_statut in (".$filtrestatut.")"; // Peut valoir 0
|
||||
if ($filtrestatut != '') {
|
||||
$sql.= " AND c.fk_statut in (".$filtrestatut.")"; // Peut valoir 0
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2614,7 +2639,8 @@ class Product extends CommonObject
|
||||
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE e.rowid = ed.fk_expedition";
|
||||
$sql.= " AND c.rowid = cd.fk_commande";
|
||||
@@ -2622,11 +2648,14 @@ class Product extends CommonObject
|
||||
$sql.= " AND e.entity IN (".getEntity('expedition').")";
|
||||
$sql.= " AND ed.fk_origin_line = cd.rowid";
|
||||
$sql.= " AND cd.fk_product = ".$this->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql.= " AND e.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
||||
$sql.= " AND e.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND e.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND e.fk_soc = ".$socid;
|
||||
}
|
||||
if ($filtrestatut <> '') { $sql.= " AND c.fk_statut in (".$filtrestatut.")";
|
||||
if ($filtrestatut <> '') {
|
||||
$sql.= " AND c.fk_statut in (".$filtrestatut.")";
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2711,16 +2740,19 @@ class Product extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE c.rowid = cd.fk_contrat";
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract').")";
|
||||
$sql.= " AND cd.fk_product = ".$this->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
//$sql.= " AND c.statut != 0";
|
||||
if ($socid > 0) { $sql.= " AND c.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND c.fk_soc = ".$socid;
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2757,16 +2789,19 @@ class Product extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE f.rowid = fd.fk_facture";
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " AND fd.fk_product = ".$this->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
//$sql.= " AND f.fk_statut != 0";
|
||||
if ($socid > 0) { $sql .= " AND f.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND f.fk_soc = ".$socid;
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2803,16 +2838,19 @@ class Product extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as fd";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE f.rowid = fd.fk_facture_fourn";
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('facture_fourn').")";
|
||||
$sql.= " AND fd.fk_product = ".$this->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
//$sql.= " AND f.fk_statut != 0";
|
||||
if ($socid > 0) { $sql .= " AND f.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND f.fk_soc = ".$socid;
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2850,9 +2888,11 @@ class Product extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$arr = $this->db->fetch_array($resql);
|
||||
if ($mode == 'byunit') { $tab[$arr[1]] = $arr[0]; // 1st field
|
||||
if ($mode == 'byunit') {
|
||||
$tab[$arr[1]] = $arr[0]; // 1st field
|
||||
}
|
||||
if ($mode == 'bynumber') { $tab[$arr[1]] = $arr[2]; // 3rd field
|
||||
if ($mode == 'bynumber') {
|
||||
$tab[$arr[1]] = $arr[2]; // 3rd field
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -2913,24 +2953,32 @@ class Product extends CommonObject
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT sum(d.qty), date_format(f.datef, '%Y%m')";
|
||||
if ($mode == 'bynumber') { $sql.= ", count(DISTINCT f.rowid)";
|
||||
if ($mode == 'bynumber') {
|
||||
$sql.= ", count(DISTINCT f.rowid)";
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet as d, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($filteronproducttype >= 0) { $sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE f.rowid = d.fk_facture";
|
||||
if ($this->id > 0) { $sql.= " AND d.fk_product =".$this->id;
|
||||
} else { $sql.=" AND d.fk_product > 0";
|
||||
if ($this->id > 0) {
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
} else {
|
||||
$sql.=" AND d.fk_product > 0";
|
||||
}
|
||||
if ($filteronproducttype >= 0) { $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
}
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND f.fk_soc = $socid";
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND f.fk_soc = $socid";
|
||||
}
|
||||
$sql.=$morefilter;
|
||||
$sql.= " GROUP BY date_format(f.datef,'%Y%m')";
|
||||
@@ -2958,24 +3006,32 @@ class Product extends CommonObject
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT sum(d.qty), date_format(f.datef, '%Y%m')";
|
||||
if ($mode == 'bynumber') { $sql.= ", count(DISTINCT f.rowid)";
|
||||
if ($mode == 'bynumber') {
|
||||
$sql.= ", count(DISTINCT f.rowid)";
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as d, ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($filteronproducttype >= 0) { $sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE f.rowid = d.fk_facture_fourn";
|
||||
if ($this->id > 0) { $sql.= " AND d.fk_product =".$this->id;
|
||||
} else { $sql.=" AND d.fk_product > 0";
|
||||
if ($this->id > 0) {
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
} else {
|
||||
$sql.=" AND d.fk_product > 0";
|
||||
}
|
||||
if ($filteronproducttype >= 0) { $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
}
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('facture_fourn').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND f.fk_soc = $socid";
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND f.fk_soc = $socid";
|
||||
}
|
||||
$sql.=$morefilter;
|
||||
$sql.= " GROUP BY date_format(f.datef,'%Y%m')";
|
||||
@@ -3002,24 +3058,32 @@ class Product extends CommonObject
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT sum(d.qty), date_format(p.datep, '%Y%m')";
|
||||
if ($mode == 'bynumber') { $sql.= ", count(DISTINCT p.rowid)";
|
||||
if ($mode == 'bynumber') {
|
||||
$sql.= ", count(DISTINCT p.rowid)";
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($filteronproducttype >= 0) { $sql.=", ".MAIN_DB_PREFIX."product as prod";
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.=", ".MAIN_DB_PREFIX."product as prod";
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE p.rowid = d.fk_propal";
|
||||
if ($this->id > 0) { $sql.= " AND d.fk_product =".$this->id;
|
||||
} else { $sql.=" AND d.fk_product > 0";
|
||||
if ($this->id > 0) {
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
} else {
|
||||
$sql.=" AND d.fk_product > 0";
|
||||
}
|
||||
if ($filteronproducttype >= 0) { $sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype;
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype;
|
||||
}
|
||||
$sql.= " AND p.fk_soc = s.rowid";
|
||||
$sql.= " AND p.entity IN (".getEntity('propal').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND p.fk_soc = ".$socid;
|
||||
}
|
||||
$sql.=$morefilter;
|
||||
$sql.= " GROUP BY date_format(p.datep,'%Y%m')";
|
||||
@@ -3046,24 +3110,32 @@ class Product extends CommonObject
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT sum(d.qty), date_format(p.date_valid, '%Y%m')";
|
||||
if ($mode == 'bynumber') { $sql.= ", count(DISTINCT p.rowid)";
|
||||
if ($mode == 'bynumber') {
|
||||
$sql.= ", count(DISTINCT p.rowid)";
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposaldet as d, ".MAIN_DB_PREFIX."supplier_proposal as p, ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($filteronproducttype >= 0) { $sql.=", ".MAIN_DB_PREFIX."product as prod";
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.=", ".MAIN_DB_PREFIX."product as prod";
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE p.rowid = d.fk_supplier_proposal";
|
||||
if ($this->id > 0) { $sql.= " AND d.fk_product =".$this->id;
|
||||
} else { $sql.=" AND d.fk_product > 0";
|
||||
if ($this->id > 0) {
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
} else {
|
||||
$sql.=" AND d.fk_product > 0";
|
||||
}
|
||||
if ($filteronproducttype >= 0) { $sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype;
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype;
|
||||
}
|
||||
$sql.= " AND p.fk_soc = s.rowid";
|
||||
$sql.= " AND p.entity IN (".getEntity('supplier_proposal').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND p.fk_soc = ".$socid;
|
||||
}
|
||||
$sql.=$morefilter;
|
||||
$sql.= " GROUP BY date_format(p.date_valid,'%Y%m')";
|
||||
@@ -3089,24 +3161,32 @@ class Product extends CommonObject
|
||||
global $conf, $user;
|
||||
|
||||
$sql = "SELECT sum(d.qty), date_format(c.date_commande, '%Y%m')";
|
||||
if ($mode == 'bynumber') { $sql.= ", count(DISTINCT c.rowid)";
|
||||
if ($mode == 'bynumber') {
|
||||
$sql.= ", count(DISTINCT c.rowid)";
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as d, ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($filteronproducttype >= 0) { $sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE c.rowid = d.fk_commande";
|
||||
if ($this->id > 0) { $sql.= " AND d.fk_product =".$this->id;
|
||||
} else { $sql.=" AND d.fk_product > 0";
|
||||
if ($this->id > 0) {
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
} else {
|
||||
$sql.=" AND d.fk_product > 0";
|
||||
}
|
||||
if ($filteronproducttype >= 0) { $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
}
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity IN (".getEntity('commande').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND c.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND c.fk_soc = ".$socid;
|
||||
}
|
||||
$sql.=$morefilter;
|
||||
$sql.= " GROUP BY date_format(c.date_commande,'%Y%m')";
|
||||
@@ -3136,21 +3216,28 @@ class Product extends CommonObject
|
||||
$sql.= ", count(DISTINCT c.rowid)";
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as d, ".MAIN_DB_PREFIX."commande_fournisseur as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($filteronproducttype >= 0) { $sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.=", ".MAIN_DB_PREFIX."product as p";
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " WHERE c.rowid = d.fk_commande";
|
||||
if ($this->id > 0) { $sql.= " AND d.fk_product =".$this->id;
|
||||
} else { $sql.=" AND d.fk_product > 0";
|
||||
if ($this->id > 0) {
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
} else {
|
||||
$sql.=" AND d.fk_product > 0";
|
||||
}
|
||||
if ($filteronproducttype >= 0) { $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
if ($filteronproducttype >= 0) {
|
||||
$sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
|
||||
}
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity IN (".getEntity('supplier_order').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid > 0) { $sql.= " AND c.fk_soc = ".$socid;
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND c.fk_soc = ".$socid;
|
||||
}
|
||||
$sql.=$morefilter;
|
||||
$sql.= " GROUP BY date_format(c.date_commande,'%Y%m')";
|
||||
@@ -3173,15 +3260,19 @@ class Product extends CommonObject
|
||||
{
|
||||
// phpcs:enable
|
||||
// Clean parameters
|
||||
if (! is_numeric($id_pere)) { $id_pere=0;
|
||||
if (! is_numeric($id_pere)) {
|
||||
$id_pere=0;
|
||||
}
|
||||
if (! is_numeric($id_fils)) { $id_fils=0;
|
||||
if (! is_numeric($id_fils)) {
|
||||
$id_fils=0;
|
||||
}
|
||||
if (! is_numeric($incdec)) { $incdec=0;
|
||||
if (! is_numeric($incdec)) {
|
||||
$incdec=0;
|
||||
}
|
||||
|
||||
$result=$this->del_sousproduit($id_pere, $id_fils);
|
||||
if ($result < 0) { return $result;
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Check not already father of id_pere (to avoid father -> child -> father links)
|
||||
@@ -3231,13 +3322,17 @@ class Product extends CommonObject
|
||||
{
|
||||
// phpcs:enable
|
||||
// Clean parameters
|
||||
if (! is_numeric($id_pere)) { $id_pere=0;
|
||||
if (! is_numeric($id_pere)) {
|
||||
$id_pere=0;
|
||||
}
|
||||
if (! is_numeric($id_fils)) { $id_fils=0;
|
||||
if (! is_numeric($id_fils)) {
|
||||
$id_fils=0;
|
||||
}
|
||||
if (! is_numeric($incdec)) { $incdec=1;
|
||||
if (! is_numeric($incdec)) {
|
||||
$incdec=1;
|
||||
}
|
||||
if (! is_numeric($qty)) { $qty=1;
|
||||
if (! is_numeric($qty)) {
|
||||
$qty=1;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'product_association SET ';
|
||||
@@ -3266,9 +3361,11 @@ class Product extends CommonObject
|
||||
public function del_sousproduit($fk_parent, $fk_child)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! is_numeric($fk_parent)) { $fk_parent=0;
|
||||
if (! is_numeric($fk_parent)) {
|
||||
$fk_parent=0;
|
||||
}
|
||||
if (! is_numeric($fk_child)) { $fk_child=0;
|
||||
if (! is_numeric($fk_child)) {
|
||||
$fk_child=0;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association";
|
||||
@@ -4062,23 +4159,23 @@ class Product extends CommonObject
|
||||
if ($type == 2) {
|
||||
switch ($mode)
|
||||
{
|
||||
case 0:
|
||||
return ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : $langs->trans('ProductStatusOnBatch'));
|
||||
case 1:
|
||||
return ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : $langs->trans('ProductStatusOnBatchShort'));
|
||||
case 2:
|
||||
return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2);
|
||||
case 3:
|
||||
if ($status == 0) {
|
||||
return img_picto($langs->trans('ProductStatusNotOnBatch'), 'statut5');
|
||||
}
|
||||
return img_picto($langs->trans('ProductStatusOnBatch'), 'statut4');
|
||||
case 4:
|
||||
return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2);
|
||||
case 5:
|
||||
return $this->LibStatut($status, 1, 2).' '.$this->LibStatut($status, 3, 2);
|
||||
default:
|
||||
return $langs->trans('Unknown');
|
||||
case 0:
|
||||
return ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : $langs->trans('ProductStatusOnBatch'));
|
||||
case 1:
|
||||
return ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : $langs->trans('ProductStatusOnBatchShort'));
|
||||
case 2:
|
||||
return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2);
|
||||
case 3:
|
||||
if ($status == 0) {
|
||||
return img_picto($langs->trans('ProductStatusNotOnBatch'), 'statut5');
|
||||
}
|
||||
return img_picto($langs->trans('ProductStatusOnBatch'), 'statut4');
|
||||
case 4:
|
||||
return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2);
|
||||
case 5:
|
||||
return $this->LibStatut($status, 1, 2).' '.$this->LibStatut($status, 3, 2);
|
||||
default:
|
||||
return $langs->trans('Unknown');
|
||||
}
|
||||
}
|
||||
if ($mode == 0) {
|
||||
|
||||
@@ -281,7 +281,7 @@ class ProjectStats extends Stats
|
||||
{
|
||||
$foundintocache=1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -332,7 +332,7 @@ class ProjectStats extends Stats
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
}
|
||||
else dol_syslog("Failed to write cache file", LOG_ERR);
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
return $data;
|
||||
@@ -401,7 +401,7 @@ class ProjectStats extends Stats
|
||||
if ($filedate >= ($nowgmt - $cachedelay)) {
|
||||
$foundintocache = 1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this) . '_' . __FUNCTION__] = $filedate;
|
||||
$this->lastfetchdate[get_class($this) . '_' . __FUNCTION__] = $filedate;
|
||||
} else {
|
||||
dol_syslog(get_class($this) . '::' . __FUNCTION__ . " cache file " . $newpathofdestfile . " is not found or older than now - cachedelay (" . $nowgmt . " - " . $cachedelay . ") so we can't use it.");
|
||||
}
|
||||
@@ -443,7 +443,7 @@ class ProjectStats extends Stats
|
||||
$newmask = $conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
|
||||
$this->_lastfetchdate[get_class($this) . '_' . __FUNCTION__] = $nowgmt;
|
||||
$this->lastfetchdate[get_class($this) . '_' . __FUNCTION__] = $nowgmt;
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -436,7 +436,7 @@ $listofreferent=array(
|
||||
'table'=>'projet_task',
|
||||
'datefieldname'=>'task_date',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/projet/tasks.php?id='.$id,
|
||||
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?id='.$id,
|
||||
'buttonnew'=>'AddTimeSpent',
|
||||
'testnew'=>$user->rights->projet->creer,
|
||||
'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
|
||||
|
||||
@@ -2132,7 +2132,14 @@ if (! GETPOST('hide_websitemenu'))
|
||||
if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha'))
|
||||
{
|
||||
$htmltext=$langs->transnoentitiesnoconv("YouCanEditHtmlSource").'<br>';
|
||||
print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
|
||||
if ($conf->browser->layout == 'phone')
|
||||
{
|
||||
print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
|
||||
}
|
||||
}
|
||||
print '</div>'; // end websitehelp
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ class CodingPhpTest extends PHPUnit_Framework_TestCase
|
||||
$ok=false;
|
||||
break;
|
||||
}
|
||||
$this->assertTrue($ok, 'Found a use of print_liste_field_titre with fist parameter that is a translated value instead of just the translation key in file '.$file['fullname'].'. Bad.');
|
||||
$this->assertTrue($ok, 'Found a use of print_liste_field_titre with first parameter that is a translated value instead of just the translation key in file '.$file['fullname'].'. Bad.');
|
||||
|
||||
|
||||
// Test we don't have <br />
|
||||
|
||||
@@ -131,32 +131,29 @@ class ExpenseReportTest extends PHPUnit_Framework_TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
// Set supplier and product to use
|
||||
$socid=1;
|
||||
|
||||
// Create supplier order with a too low quantity
|
||||
$localobject=new ExpenseReport($db);
|
||||
$localobject->initAsSpecimen(); // Init a speciment with lines
|
||||
$localobject->initAsSpecimen(); // Init a specimen with lines
|
||||
$localobject->status = 0;
|
||||
$localobject->fk_statut = 0;
|
||||
$localobject->date_fin = null; // Force bad value
|
||||
|
||||
$result=$localobject->create($user);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(-1, $result); // must be -1 because of missing mandatory fields
|
||||
$this->assertEquals(-1, $result, "Error on test ExpenseReport create 1 : ".$localobject->error); // must be -1 because of missing mandatory fields
|
||||
|
||||
$sql="DELETE FROM ".MAIN_DB_PREFIX."expensereport where ref=''";
|
||||
$db->query($sql);
|
||||
|
||||
// Create supplier order
|
||||
$localobject2=new ExpenseReport($db);
|
||||
$localobject2->initAsSpecimen(); // Init a speciment with lines
|
||||
$localobject2->initAsSpecimen(); // Init a specimen with lines
|
||||
$localobject2->status = 0;
|
||||
$localobject2->fk_statut = 0;
|
||||
|
||||
$result=$localobject2->create($user);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertGreaterThanOrEqual(0, $result);
|
||||
$this->assertGreaterThanOrEqual(0, $result, "Error on test ExpenseReport create 2 : ".$localobject2->error);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user