diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index d47de74b4eb..364897615de 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -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 diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 78d2821bf90..af2a8841643 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -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 ''; 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 '
'.$langs->trans("ABankAccountMustBeDefinedOnPaymentModeSetup").'
'; +} print ''; print "\n"; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index e811eaff261..993af489989 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -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 ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index 647348269a2..87efafd3405 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -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 ''; - print ""; + print ""; print dol_print_date($data['date'], 'day'); print "\n"; - print ''.$langs->trans($data['item']).''; - print ''.$data['ref'].''; + print ''.$langs->trans($data['item']).''; + print ''.$data['ref'].''; // File link print '".$data['name']."\n"; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index f7b2ec89008..19ac65cbd4e 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -252,22 +252,22 @@ if ($id > 0) print ''; - print ""; + print ""; 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 "\n"; print ''.$data['link']."\n"; - print ''.$data['status'].''; + print ''.$data['status'].''; print ''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."\n"; - + $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; - + print ''.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."\n"; $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); - + // Balance print ''.price($data['balance'])."\n"; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 0fe747d0a86..a2a6009cd6a 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -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']); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 8c83c342ab4..f083ef59a2d 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -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'; } } diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index 6c86c987d17..b23ea6edf5d 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -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)."'").""; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0618e15afe8..1e76e7d9cf9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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 ''.$text.'''; + //} $img=''; if ($type == 'info') $img = img_help(0, $alt); @@ -6651,7 +6651,7 @@ class Form $objp = $this->db->fetch_object($resqllist); print ''; - print ''; + print ''; print ''; print ''; print '' . $objp->ref . ''; diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index b06f1deb4c3..08025161a0d 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -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; diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index fd13eb2fd26..265504cf3f3 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -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')) { diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 07a47090792..6a16357f6fa 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -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 diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 936e7b87be4..f71a1c19b96 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -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.=''.$langs->trans("Example").':
'; + $tooltip.='020{000000000} (for internal use)
'; + $tooltip.='9771234{00000} (example of ISSN code with prefix 1234)
'; + $tooltip.='9791234{00000} (example of ISMN code with prefix 1234)
'; + //$tooltip.=$langs->trans("GenericMaskCodes5"); // Mask parameter //$texte.= ''.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):'; diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 95278005fb1..1bcf3c6b132 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -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'; } } diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index e096d840864..f0b302d7a29 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -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.')'; diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index ea720e0586f..bf1033084d5 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; /** * Class DataPolicy */ -Class DataPolicy +class DataPolicy { /** * getAllContactNotInformed diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 1bd5244feef..48902b45ca8 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -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; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 945ecc71704..38871f55c0e 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -1,14 +1,14 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2016-2018 Charlie Benke - * Copyright (C) 2018 Frédéric France +/* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016-2018 Charlie Benke + * Copyright (C) 2018-2019 Frédéric France * * 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 ''; print ''.$langs->trans("Description").''; - print ''.$langs->trans("Duration").''; + print ''.$langs->trans("Duration").''; print "\n"; } while ($i < $num) { @@ -413,7 +413,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print $text.' '.nl2br($objp->description); // Qty - print ''.convertSecondToTime($objp->duree).''; + print ''.convertSecondToTime($objp->duree).''; print ""; $i++; @@ -429,7 +429,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( dol_fiche_end(); - print '
'; + print '
'; print '     '; print ''; print '
'; @@ -495,13 +495,13 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( $morehtmlref.='
'; $morehtmlref.=''; $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects( + $morehtmlref.=$formproject->select_projects( $object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1 ); $morehtmlref.=''; $morehtmlref.='
'; } 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 ''; if ($action != 'contrat') { - print 'id.'">'; + print 'id.'">'; print img_edit($langs->trans('SetContract'), 1); print ''; } @@ -560,17 +560,15 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print ''; 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 ''; print ''; @@ -595,7 +593,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print $langs->trans('Frequency'); print ''; if ($action != 'editfrequency' && $user->rights->ficheinter->creer) { - print ''; + print ''; print img_edit($langs->trans('Edit'), 1) . ''; } print ''; @@ -720,7 +718,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print ''; print ''; print ''; - print ''; + print ''; print ''; $num = count($object->lines); @@ -744,7 +742,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print $text.' '.nl2br($object->lines[$i]->desc); print ''; - print ''; + print ''; print "\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").'

'; $i = 0; print '
'.$langs->trans("Description").''.$langs->trans("Duration").''.$langs->trans("Duration").'
'.convertSecondToTime($object->lines[$i]->duree).''.convertSecondToTime($object->lines[$i]->duree).'
'; print ''; -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 ''; print "\n"; @@ -899,36 +869,36 @@ print_liste_field_titre( print ''; } - print ''; + print ''; - print ''; + print ''; - print ''; - print ''; - print ''; } else { print ''.$langs->trans('NA').''; print ''; - print ''; - print ''; } if ($user->rights->ficheinter->creer) { // Action column - print ''; } @@ -1393,8 +1393,8 @@ elseif ($id > 0 || ! empty($ref)) print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -1414,10 +1414,10 @@ elseif ($id > 0 || ! empty($ref)) print dol_htmlentitiesbr($objp->description); // Date - print ''; + print ''; // Duration - print ''; + print ''; print "\n"; @@ -1425,16 +1425,16 @@ elseif ($id > 0 || ! empty($ref)) // Icone d'edition et suppression if ($object->statut == 0 && $user->rights->ficheinter->creer) { - print ''; - print ''; - print ''; // Date d'intervention - print ''; // Duration - print ''; - print ''; print '' . "\n"; @@ -1532,8 +1532,8 @@ elseif ($id > 0 || ! empty($ref)) print ''; - print ''; - print ''; + print ''; + print ''; print ''; print "\n"; } @@ -1549,7 +1549,7 @@ elseif ($id > 0 || ! empty($ref)) print ''; // Date intervention - print ''; // Duration - print ''; - print ''; + print ''; print ''; //Line extrafield diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 49521dff397..d240aadf42d 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -128,7 +128,7 @@ if ($resql) } if ($conf->use_javascript_ajax) { - print ''; print ''; - print ''; @@ -160,8 +160,8 @@ if ($resql) } } //if ($totalinprocess != $total) - //print ''; - print ''; + //print ''; + print ''; print "
'.convertSecondToTime($objp->duree).''.convertSecondToTime($objp->duree).''.yn($objp->frequency?1:0).''.yn($objp->frequency?1:0).''; + print ''; if ($objp->frequency) { print $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') ; print ''; + print ''; print dol_print_date($db->jdate($objp->date_last_gen), 'day') ; print ''; + print ''; print dol_print_date($db->jdate($objp->date_when), 'day'); print ''; + print ''; print ''.$langs->trans('NA').''; print ''; + print ''; print ''.$langs->trans('NA').''; print ''; + print ''; if ($user->rights->ficheinter->creer) { if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { print 'id.'">'; + print 'id.'">'; print img_edit($langs->trans('SetContract'), 1); print '
'.$langs->trans('Description').''.$langs->trans('Date').''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').''.$langs->trans('Date').''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'   '.(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')).''.(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')).''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').''; + print ''; print 'rowid.'#'.$objp->rowid.'">'; print img_edit(); print ''; print ''; + print ''; print 'rowid.'">'; print img_delete(); print ''; + print ''; if ($num > 1) { if ($i > 0) @@ -1484,7 +1484,7 @@ elseif ($id > 0 || ! empty($ref)) print ''; + print ''; 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 ''; + print ''; 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 ''; + print ''; print '
'; print ''; // ancre print $langs->trans('Description').''.$langs->trans('Date').''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').''.$langs->trans('Date').''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').' 
'; + print ''; $now=dol_now(); $timearray=dol_getdate($now); if (! GETPOST('diday', 'int')) { @@ -1565,7 +1565,7 @@ elseif ($id > 0 || ! empty($ref)) print ''; + print ''; 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 '
'; + print '
'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); @@ -150,7 +150,7 @@ if ($resql) { print '
'.$fichinterstatic->LibStatut($status, $bool, 0).''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; + print ''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print $fichinterstatic->LibStatut($status, $bool, 3); print ''; print '
'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'
'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'

"; } else @@ -263,7 +263,7 @@ if ($resql) print ' '; print ''; - print ''; + print ''; $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 ''.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.''; print ''.dol_print_date($db->jdate($obj->datem), 'day').''; - print ''.$fichinterstatic->LibStatut($obj->fk_statut, 5).''; + print ''.$fichinterstatic->LibStatut($obj->fk_statut, 5).''; print ''; $i++; } @@ -331,7 +331,7 @@ if (! empty($conf->ficheinter->enabled)) print ' '; print ''; - print ''; + print ''; $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 ''.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).''; - print ''.$fichinterstatic->LibStatut($obj->fk_statut, 5).''; + print ''.$fichinterstatic->LibStatut($obj->fk_statut, 5).''; print ''; $i++; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 2652787a9c0..c105d06a852 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -383,7 +383,7 @@ if ($resql) // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print ''; + print ''; $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 ' '; } - print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -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 "\n"; $total = 0; @@ -469,7 +469,7 @@ if ($resql) } // Other picto tool - print ''; + print ''; $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 ''; + print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; if (! $i) $totalarray['nbfield']++; @@ -512,7 +512,7 @@ if ($resql) // Date modification if (! empty($arrayfields['f.tms']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; if (! $i) $totalarray['nbfield']++; @@ -520,7 +520,7 @@ if ($resql) // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print ''.$objectstatic->LibStatut($obj->fk_statut, 5).''; + print ''.$objectstatic->LibStatut($obj->fk_statut, 5).''; if (! $i) $totalarray['nbfield']++; } // Fields of detail of line @@ -531,18 +531,18 @@ if ($resql) } if (! empty($arrayfields['fd.date']['checked'])) { - print ''.dol_print_date($db->jdate($obj->dp), 'dayhour')."\n"; + print ''.dol_print_date($db->jdate($obj->dp), 'dayhour')."\n"; if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['fd.duree']['checked'])) { - print ''.convertSecondToTime($obj->duree, 'allhourmin').''; + print ''.convertSecondToTime($obj->duree, 'allhourmin').''; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totaldurationfield']=$totalarray['nbfield']; $totalarray['totalduration']+=$obj->duree; } // Action column - print ''; + print ''; 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 ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; } - elseif ($totalarray['totaldurationfield'] == $i) print ''.convertSecondToTime($totalarray['totalduration'], 'allhourmin').''; + elseif ($totalarray['totaldurationfield'] == $i) print ''.convertSecondToTime($totalarray['totalduration'], 'allhourmin').''; else print ''; } print ''; diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 8d2c465a0cf..824dfff8c84 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -254,7 +254,7 @@ print '
'; arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; - print ''; + print ''; print ''; print ''; print '

'; @@ -263,13 +263,13 @@ print '
'; print '
'; print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; print ''; $oldyear=0; @@ -282,26 +282,26 @@ foreach ($data as $val) $oldyear--; print ''; - print ''; + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; } print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; $oldyear=$year; } @@ -314,7 +314,7 @@ print '
'; // Show graphs -print '
'.$langs->trans("Year").''.$langs->trans("NbOfinterventions").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%'.$langs->trans("Year").''.$langs->trans("NbOfinterventions").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%
0?'&userid='.$userid:'').'">'.$oldyear.'0?'&userid='.$userid:'').'">'.$oldyear.'000000
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.price(price2num($val['total'], 'MT'), 1).''.round($val['total_diff']).''.price(price2num($val['avg'], 'MT'), 1).''.round($val['avg_diff']).'0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.price(price2num($val['total'], 'MT'), 1).''.round($val['total_diff']).''.price(price2num($val['avg'], 'MT'), 1).''.round($val['avg_diff']).'
'; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) - print ''; + print ''; print '
'; +print ' - + - - + + - \ No newline at end of file + diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 3cb2e585db6..ae17cdecd46 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -232,7 +232,7 @@ if ($object->id > 0) print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php b/htdocs/fichinter/tpl/linkedobjectblock.tpl.php index 8825a249431..9f481b6b648 100644 --- a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fichinter/tpl/linkedobjectblock.tpl.php @@ -47,13 +47,13 @@ foreach($linkedObjectBlock as $key => $objectlink) trans("Intervention"); ?> getNomUrl(1); ?> datev, 'day'); ?>datev, 'day'); ?> getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
'; + if (($action != 'editconditions') && $user->rights->societe->creer) print ''; print '
'; print $langs->trans('PaymentConditions'); print ''; - if (($action != 'editconditions') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
'; print '
'; if ($action == 'editconditions') @@ -251,7 +251,7 @@ if ($object->id > 0) print ''; + if (($action != 'editmode') && $user->rights->societe->creer) print ''; print '
'; print $langs->trans('PaymentMode'); print ''; - if (($action != 'editmode') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; print '
'; if ($action == 'editmode') @@ -269,7 +269,7 @@ if ($object->id > 0) print '
'; print ''; if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) { - print ''; + print ''; } print '
'; print $langs->trans("CustomerRelativeDiscountShort"); - print ''; + print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) { print ''.img_edit($langs->trans("Modify")).''; @@ -283,7 +283,7 @@ if ($object->id > 0) print ''; print ''; print ''; print '
'; print $langs->trans("CustomerAbsoluteDiscountShort"); - print ''; + print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) { print ''.img_edit($langs->trans("Modify")).''; @@ -442,7 +442,7 @@ if ($object->id > 0) print ''; print ''; print ''; + print '
'; - print '
'.$langs->trans("Summary").''.$langs->trans("ShowSupplierPreview").'
'.$langs->trans("ShowSupplierPreview").'
'; print '
'; @@ -471,7 +471,7 @@ if ($object->id > 0) print ''; print ''; - print ''; @@ -498,8 +498,8 @@ if ($object->id > 0) print ''; - //print ''; - print ''; + print ''; print ''; } @@ -565,7 +565,7 @@ if ($object->id > 0) $proposalstatic->total_ttc = $obj->total_ttc; print $proposalstatic->getNomUrl(1); print ''; - print ''; - print ''; + print ''; print ''; $i++; } @@ -649,8 +649,8 @@ if ($object->id > 0) print ''; print ''; } @@ -668,7 +668,7 @@ if ($object->id > 0) $orderstatic->total_ttc = $obj->total_ttc; print $orderstatic->getNomUrl(1); print ''; - print ''; - print ''; + print ''; print ''; $i++; } @@ -721,8 +721,8 @@ if ($object->id > 0) print ''; print ''; } @@ -745,9 +745,9 @@ if ($object->id > 0) print $obj->ref_supplier?' - '.$obj->ref_supplier:''; print ($obj->libelle?' - ':'').dol_trunc($obj->libelle, 14); print ''; - print ''; - print ''; - print ''; + print ''; + print ''; print ''; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index fab8aa705de..7a8bb2bcd22 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -523,12 +523,12 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; } - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; print "\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 ''; + print ''; // Qty ordered - print ''; + print ''; // Already dispatched - print ''; + print ''; if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) { $type = 'batch'; - print ''; // Qty to dispatch print ''; // Qty to dispatch print ''; @@ -691,7 +691,7 @@ if ($id > 0 || ! empty($ref)) { print ''; // Warehouse - print ''; print ''; } - print ''; + print ''; print ''; print ''; print ''; if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled)) - print ''; + print ''; print "\n"; @@ -836,7 +836,7 @@ if ($id > 0 || ! empty($ref)) { } // Qty - print ''; + print ''; print ''; // Warehouse @@ -851,14 +851,14 @@ if ($id > 0 || ! empty($ref)) { // Status if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) { - print ''; // Add button to check/uncheck disaptching - print ''; }elseif(!empty($conf->reception->enabled)){ - print ''; - print ''; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index c846ff16b5f..6c2b66bc7f3 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -119,13 +119,13 @@ if ($resql) print ''; print ''; - print ''; + print ''; print "\n"; } } if ($conf->use_javascript_ajax) { - print ''; } //if ($totalinprocess != $total) - //print ''; - print ''; + //print ''; + print ''; print "
'.$langs->trans("ProductsAndServices").''; + print ''.$langs->trans("ProductsAndServices").''; print ''.$langs->trans("AllProductReferencesOfSupplier").' '.$object->nbOfProductRefs().''; print '
'; print dol_trunc(dol_htmlentities($objp->label), 30); print ''.dol_print_date($objp->tms, 'day').''; + //print ''.dol_print_date($objp->tms, 'day').''; //print (isset($objp->unitprice) ? price($objp->unitprice) : ''); if (isset($objp->price)) { @@ -546,8 +546,8 @@ if ($object->id > 0) print '
'; print ''; - print ''; - print ''; + print ''; + print ''; print '
'.$langs->trans("LastSupplierProposals", ($num<$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPriceRequests").' '.$num.''.img_picto($langs->trans("Statistics"), 'stats').''.$langs->trans("AllPriceRequests").' '.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'; print '
'; + print ''; if ($obj->dc) { print dol_print_date($db->jdate($obj->dc), 'day'); @@ -575,7 +575,7 @@ if ($object->id > 0) print "-"; } print ''.$proposalstatic->LibStatut($obj->fk_statut, 5).''.$proposalstatic->LibStatut($obj->fk_statut, 5).'
'; print ''; - print ''; - print ''; + print ''; + print ''; print '
'.$langs->trans("LastSupplierOrders", ($num<$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' '.$num.''.img_picto($langs->trans("Statistics"), 'stats').''.$langs->trans("AllOrders").' '.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'; print '
'; + print ''; if ($obj->dc) { print dol_print_date($db->jdate($obj->dc), 'day'); @@ -678,7 +678,7 @@ if ($object->id > 0) print "-"; } print ''.$orderstatic->LibStatut($obj->fk_statut, 5).''.$orderstatic->LibStatut($obj->fk_statut, 5).'
'; - print ''; - print ''; + print '
'.$langs->trans('LastSuppliersBills', ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' '.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'; + print ''; print '
'.$langs->trans('LastSuppliersBills', ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' '.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'; print '
'.dol_print_date($db->jdate($obj->df), 'day').''.price($obj->amount).''; + print ''.dol_print_date($db->jdate($obj->df), 'day').''.price($obj->amount).''; print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $obj->am); print '
' . $langs->trans("SupplierRef") . '' . $langs->trans("QtyOrdered") . '' . $langs->trans("QtyDispatchedShort") . '' . $langs->trans("QtyToDispatchShort") . '' . $langs->trans("SupplierRef") . '' . $langs->trans("QtyOrdered") . '' . $langs->trans("QtyDispatchedShort") . '' . $langs->trans("QtyToDispatchShort") . '' . $langs->trans("Warehouse") . '' . $langs->trans("Warehouse") . '
'.$objp->sref.''.$objp->sref.'' . $objp->qty . '' . $objp->qty . '' . $products_dispatched[$objp->rowid] . '' . $products_dispatched[$objp->rowid] . ''; + print ''; print ''; //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 ''; + print ''; print ''; //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 ''; + print ''; print ''; print ''; + print ''; 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 '' . $langs->trans("EatByDate") . '' . $langs->trans("SellByDate") . '' . $langs->trans("QtyDispatched") . '' . $langs->trans("QtyDispatched") . '' . $langs->trans("Warehouse") . '' . $langs->trans("Comment") . '' . $langs->trans("Status") . '' . $langs->trans("Status") . '
' . $objp->qty . '' . $objp->qty . ' '; + print ''; $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status); // print $supplierorderdispatch->status; print $supplierorderdispatch->getLibStatut(5); print ''; + print ''; 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 ''; + print ''; if(!empty($reception->id)){ print $reception->getLibStatut(5); } } print ''; + print ''; print '
'.$commandestatic->LibStatut($statut, 0).''.(isset($vals[$statut])?$vals[$statut]:0).''.(isset($vals[$statut])?$vals[$statut]:0).'
'; + print '
'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); @@ -140,8 +140,8 @@ if ($resql) print '
'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'
'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'

"; } @@ -176,7 +176,7 @@ if ($resql) print ''; print ''; - print ''; + print ''; print "\n"; while ($i < $num) @@ -185,7 +185,7 @@ if ($resql) print ''; print ''; - print ''; + print ''; print "\n"; $i++; @@ -341,7 +341,7 @@ if ($resql) print ' '; print ''; - print ''; print ''; - print ''; + print ''; print ''; $i++; } @@ -408,7 +408,7 @@ print ''; -print ''; print ''; -print ''; +print ''; print ''; $i++; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 48d6cd28a1e..a2351dd7d9a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -791,21 +791,21 @@ if ($resql) // Country if (! empty($arrayfields['country.code_iso']['checked'])) { - print ''; } // Company type if (! empty($arrayfields['typent.code']['checked'])) { - print ''; } // Date order if (! empty($arrayfields['cf.date_commande']['checked'])) { - print ''; } if (! empty($arrayfields['cf.total_vat']['checked'])) { // Amount - print ''; } if (! empty($arrayfields['cf.total_ttc']['checked'])) { // Amount - print ''; } @@ -863,19 +863,19 @@ if ($resql) // Status if (! empty($arrayfields['cf.fk_statut']['checked'])) { - print ''; } // Status billed if (! empty($arrayfields['cf.billed']['checked'])) { - print ''; } // Action column - print ''; @@ -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 "\n"; @@ -952,7 +952,7 @@ if ($resql) //print ''; // Other picto tool - print ''; @@ -1036,7 +1036,7 @@ if ($resql) // Type ent if (! empty($arrayfields['typent.code']['checked'])) { - print ''; @@ -1046,7 +1046,7 @@ if ($resql) // Order date if (! empty($arrayfields['cf.date_commande']['checked'])) { - print ''; @@ -1055,7 +1055,7 @@ if ($resql) // Plannned date of delivery if (! empty($arrayfields['cf.date_delivery']['checked'])) { - print '\n"; + print '\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 '\n"; + print '\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 '\n"; + print '\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 ''; if (! $i) $totalarray['nbfield']++; @@ -1105,7 +1105,7 @@ if ($resql) // Date modification if (! empty($arrayfields['cf.tms']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; @@ -1113,18 +1113,18 @@ if ($resql) // Status if (! empty($arrayfields['cf.fk_statut']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Billed if (! empty($arrayfields['cf.billed']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Action column - print ''; else print ''; } - elseif ($totalarray['totalhtfield'] == $i) print ''; - elseif ($totalarray['totalvatfield'] == $i) print ''; - elseif ($totalarray['totalttcfield'] == $i) print ''; + elseif ($totalarray['totalhtfield'] == $i) print ''; + elseif ($totalarray['totalvatfield'] == $i) print ''; + elseif ($totalarray['totalttcfield'] == $i) print ''; else print ''; } print ''; diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 8c8452b51ce..6e3a30507dc 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -500,10 +500,10 @@ if (($action != 'create' && $action != 'add') && !$error) { print ''; 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 "\n"; // Lignes des champs de filtre @@ -513,27 +513,27 @@ if (($action != 'create' && $action != 'add') && !$error) { print ''; print ''; // print ''; // DATE ORDER - print ''; // DATE DELIVERY - print ''; // SEARCH BUTTON - print ''; // ALL/NONE - print ''; @@ -556,7 +556,7 @@ if (($action != 'create' && $action != 'add') && !$error) { print $generic_commande->getNomUrl(1, $objp->fk_statut); print ''; - print ''; // Order date - print ''; // Delivery date - print ''; // Statut - print ''; + print ''; // Checkbox print ' - - + - - + + 1) - - - - - + + + + + trans('PaymentConditions'); print ''; + print ''; } print '
'.$langs->trans("Status").''.$langs->trans("Nb").''.$langs->trans("Nb").'
'.$commandestatic->LibStatut($row[1]).''.$row[0].' '.$commandestatic->LibStatut($row[1], 3).''.$row[0].' '.$commandestatic->LibStatut($row[1], 3).'
'; + print ''; $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 ''.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.''.dol_print_date($db->jdate($obj->tms), 'day').''.$commandestatic->LibStatut($obj->fk_statut, 5).''.$commandestatic->LibStatut($obj->fk_statut, 5).'
'; print ' '; print ''; +print ''; $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 ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'
'; + print ''; print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); print ''; + print ''; 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 ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $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 ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $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 ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; $formorder->selectSupplierOrderStatus((strstr($search_status, ',')?-1:$search_status), 1, 'search_status'); print ''; + print ''; print $form->selectyesno('search_billed', $search_billed, 1, 0, 1); print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'; //print ''; + print ''; $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 ''; + print ''; $tmparray=getCountry($obj->fk_pays, 'all'); print $tmparray['label']; print ''; + print ''; if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); print $typenArray[$obj->typent_code]; print ''; + print ''; if ($obj->date_commande) print dol_print_date($db->jdate($obj->date_commande), 'day'); else print ''; print ''; + print ''; 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 ''.price($obj->total_ht)."'.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($obj->total_ttc)."'; + print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).''.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).''.yn($obj->billed).''.yn($obj->billed).''; + print ''; 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 ''.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
'; - print ''; + print ''; print ''; print ''; + print ''; print $period; print ''; + print ''; print $periodely; print ''; + print ''; print ''; print ''; + print ''; if ($conf->use_javascript_ajax) print '' . $langs->trans("All") . ' / ' . $langs->trans("None") . ''; print ''; + print ''; $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 '' . $objp->ref_supplier . ''; + print ''; print dol_print_date($db->jdate($objp->date_commande), 'day'); print ''; + print ''; print dol_print_date($db->jdate($objp->date_livraison), 'day'); print '' . $generic_commande->LibStatut($objp->fk_statut, 5) . '' . $generic_commande->LibStatut($objp->fk_statut, 5) . ''; diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index 7a7d7d51b80..f46c5d20b81 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -49,14 +49,14 @@ foreach($linkedObjectBlock as $key => $objectlink) trans("SupplierOrder"); ?> trans("ShowOrder"), "order").' '.$objectlink->ref; ?> ref_supplier; ?>date, 'day'); ?>date, 'day'); ?>rights->fournisseur->commande->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
trans("Total"); ?>
'; if ($action != 'editconditions' && $user->rights->fournisseur->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
'; print '
'; @@ -2524,7 +2524,7 @@ else print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; print '
'; @@ -2548,7 +2548,7 @@ else print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; print ''; if ($action == 'editmulticurrencycode') { @@ -2565,7 +2565,7 @@ else print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) - print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ''; + print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ''; print ''; print ''; if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { @@ -2590,7 +2590,7 @@ else print $langs->trans('BankAccount'); print ''; if ($action != 'editbankaccount' && $user->rights->fournisseur->facture->creer) - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; print ''; print ''; if ($action == 'editbankaccount') { @@ -2607,7 +2607,7 @@ else print ''; print '
'; print $langs->trans('IncotermLabel'); - print ''; + print ''; if ($user->rights->fournisseur->facture->creer) print ''.img_edit().''; else print ' '; print '
'; @@ -2730,8 +2730,8 @@ else print '' . ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . ''; print ''.$langs->trans('Date').''; print ''.$langs->trans('Type').''; - if (! empty($conf->banque->enabled)) print ''.$langs->trans('BankAccount').''; - print ''.$langs->trans('Amount').''; + if (! empty($conf->banque->enabled)) print ''.$langs->trans('BankAccount').''; + print ''.$langs->trans('Amount').''; print ' '; print ''; @@ -2770,12 +2770,12 @@ else $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); } - print ''; + print ''; if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1, 'transactions'); print ''; } - print '' . price($sign * $objp->amount) . ''; - print ''; + print '' . price($sign * $objp->amount) . ''; + print ''; if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { print 'rowid.'">'; @@ -2796,13 +2796,13 @@ else /* if ($object->paye == 0) { - print ''.$langs->trans('AlreadyPaid').' :'.price($totalpaye).''; - print ''.$langs->trans("Billed").' :'.price($object->total_ttc).''; + print ''.$langs->trans('AlreadyPaid').' :'.price($totalpaye).''; + print ''.$langs->trans("Billed").' :'.price($object->total_ttc).''; $resteapayer = $object->total_ttc - $totalpaye; - print ''.$langs->trans('RemainderToPay').' :'; - print ''.price($resteapayer).''; + print ''.$langs->trans('RemainderToPay').' :'; + print ''.price($resteapayer).''; } */ @@ -2816,12 +2816,12 @@ else if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE) { // Total already paid - print ''; + print ''; if ($object->type != FactureFournisseur::TYPE_DEPOSIT) print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); else print $langs->trans('AlreadyPaid'); - print ' : 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . ' '; + print ' : 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . ' '; //$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 ''; + print ''; 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 ' :'; - print '' . price($obj->amount_ttc) . ''; - print ''; + print '' . price($obj->amount_ttc) . ''; + print ''; print 'rowid . '">' . img_delete() . ''; print ''; $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 ''; + print ''; print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; $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 ''; + print ''; print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; // $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 ''; + print ''; print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; $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 ''; + print ''; $text = $langs->trans("HelpAbandonOther"); if ($object->close_note) $text .= '

' . $langs->trans("Reason") . ':' . $object->close_note; print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; $resteapayeraffiche = 0; $cssforamountpaymentcomplete = 'amountpaymentneutral'; } // Billed - print '' . $langs->trans("Billed") . ' :' . price($object->total_ttc) . ' '; + print '' . $langs->trans("Billed") . ' :' . price($object->total_ttc) . ' '; // Remainder to pay - print ''; + print ''; if ($resteapayeraffiche >= 0) print $langs->trans('RemainderToPay'); else print $langs->trans('ExcessPaid'); print ' :'; - print '' . price($resteapayeraffiche) . ''; + print '' . price($resteapayeraffiche) . ''; print ' '; } else // Credit note @@ -2920,26 +2920,26 @@ else $cssforamountpaymentcomplete='amountpaymentneutral'; // Total already paid back - print ''; + print ''; print $langs->trans('AlreadyPaidBack'); - print ' :' . price($sign * $totalpaye) . ' '; + print ' :' . price($sign * $totalpaye) . ' '; // Billed - print '' . $langs->trans("Billed") . ' :' . price($sign * $object->total_ttc) . ' '; + print '' . $langs->trans("Billed") . ' :' . price($sign * $object->total_ttc) . ' '; // Remainder to pay back - print ''; + print ''; if ($resteapayeraffiche <= 0) print $langs->trans('RemainderToPayBack'); else print $langs->trans('ExcessPaid'); print ' :'; - print '' . price($sign * $resteapayeraffiche) . ''; + print '' . price($sign * $resteapayeraffiche) . ''; print ' '; // Sold credit note - // print ''.$langs->trans('TotalTTC').' :'; - // print ''.price($sign * + // print ''.$langs->trans('TotalTTC').' :'; + // print ''.price($sign * // $object->total_ttc).' '; } diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 919c5b75663..27a659300cc 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -189,13 +189,13 @@ if ($user->rights->fournisseur->facture->lire) print ''; 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 "\n"; // Lines with filter fields @@ -206,14 +206,14 @@ if ($user->rights->fournisseur->facture->lire) print ''; print ' '; print ' '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -245,8 +245,8 @@ if ($user->rights->fournisseur->facture->lire) print ''.dol_trunc($objp->ref_supplier, 12).''; - print ''.dol_print_date($db->jdate($objp->df), 'day')."\n"; - print ''.dol_print_date($db->jdate($objp->datelimite), 'day'); + print ''.dol_print_date($db->jdate($objp->df), 'day')."\n"; + print ''.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 ''; - print "".price($objp->total_ht).""; - print "".price($objp->total_ttc).""; - print "".price($objp->am).""; + print "".price($objp->total_ht).""; + print "".price($objp->total_ttc).""; + print "".price($objp->am).""; // Show invoice status - print ''; + print ''; print $facturestatic->LibStatut($objp->paye, $objp->fk_statut, 5, $objp->am); print ''; @@ -276,11 +276,11 @@ if ($user->rights->fournisseur->facture->lire) } print ''; - print "".$langs->trans("Total").": "; - print "".price($total_ht).""; - print "".price($total_ttc).""; - print "".price($total_paid).""; - print ' '; + print "".$langs->trans("Total").": "; + print "".price($total_ht).""; + print "".price($total_ttc).""; + print "".price($total_paid).""; + print ' '; print "\n"; } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 73d5a4b3a4d..3a710642b03 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -589,7 +589,7 @@ if ($resql) // Ref if (! empty($arrayfields['f.ref']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -630,7 +630,7 @@ if ($resql) // Date invoice if (! empty($arrayfields['f.datef']['checked'])) { - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $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 ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $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 ''; + print ''; print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); print ''; } // Company type if (! empty($arrayfields['typent.code']['checked'])) { - print ''; + print ''; 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 ''; } // Payment mode if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; + print ''; $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10); print ''; } if (! empty($arrayfields['f.total_ht']['checked'])) { // Amount - print ''; + print ''; print ''; print ''; } if (! empty($arrayfields['f.total_vat']['checked'])) { // Amount - print ''; + print ''; print ''; print ''; } if (! empty($arrayfields['f.total_localtax1']['checked'])) { // Amount - print ''; + print ''; print ''; print ''; } if (! empty($arrayfields['f.total_localtax2']['checked'])) { // Amount - print ''; + print ''; print ''; print ''; } if (! empty($arrayfields['f.total_ttc']['checked'])) { // Amount - print ''; + print ''; print ''; print ''; } if (! empty($arrayfields['dynamount_payed']['checked'])) { - print ''; + print ''; print ''; } if (! empty($arrayfields['rtp']['checked'])) { - print ''; + print ''; print ''; } // Extra fields @@ -755,13 +755,13 @@ if ($resql) // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print ''; + print ''; $liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); print $form->selectarray('search_status', $liststatus, $search_status, 1); print ''; } // Action column - print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -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 "\n"; $facturestatic=new FactureFournisseur($db); @@ -853,7 +853,7 @@ if ($resql) //print ''; //print ''; // Other picto tool - print ''; + print ''; $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 ''; + print ''; print dol_print_date($db->jdate($obj->datef), 'day'); print ''; if (! $i) $totalarray['nbfield']++; @@ -903,7 +903,7 @@ if ($resql) // Date limit if (! empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''.dol_print_date($datelimit, 'day'); + print ''.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 ''; + print ''; $tmparray=getCountry($obj->fk_pays, 'all'); print $tmparray['label']; print ''; @@ -969,7 +969,7 @@ if ($resql) // Type ent if (! empty($arrayfields['typent.code']['checked'])) { - print ''; + print ''; if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); print $typenArray[$obj->typent_code]; print ''; @@ -988,7 +988,7 @@ if ($resql) // Amount HT if (! empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."\n"; + print ''.price($obj->total_ht)."\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 ''.price($obj->total_vat)."\n"; + print ''.price($obj->total_vat)."\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 ''.price($obj->total_localtax1)."\n"; + print ''.price($obj->total_localtax1)."\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 ''.price($obj->total_localtax2)."\n"; + print ''.price($obj->total_localtax2)."\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 ''.price($obj->total_ttc)."\n"; + print ''.price($obj->total_ttc)."\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 ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''; // TODO Use a denormalized field + print ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''; // 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 ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''; // TODO Use a denormalized field + print ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''; // 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 ''; + print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; if (! $i) $totalarray['nbfield']++; @@ -1060,7 +1060,7 @@ if ($resql) // Date modification if (! empty($arrayfields['f.tms']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; if (! $i) $totalarray['nbfield']++; @@ -1068,7 +1068,7 @@ if ($resql) // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print ''; + print ''; // TODO $paiement is not yet defined print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type); print ""; @@ -1076,7 +1076,7 @@ if ($resql) } // Action column - print ''; + print ''; 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 ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; } - elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).''; - elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).''; - elseif ($totalarray['totallocaltax1field'] == $i) print ''.price($totalarray['totallocaltax1']).''; - elseif ($totalarray['totallocaltax2field'] == $i) print ''.price($totalarray['totallocaltax2']).''; - elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).''; - elseif ($totalarray['totalamfield'] == $i) print ''.price($totalarray['totalam']).''; - elseif ($totalarray['totalrtpfield'] == $i) print ''.price($totalarray['totalrtp']).''; + elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).''; + elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).''; + elseif ($totalarray['totallocaltax1field'] == $i) print ''.price($totalarray['totallocaltax1']).''; + elseif ($totalarray['totallocaltax2field'] == $i) print ''.price($totalarray['totallocaltax2']).''; + elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).''; + elseif ($totalarray['totalamfield'] == $i) print ''.price($totalarray['totalam']).''; + elseif ($totalarray['totalrtpfield'] == $i) print ''.price($totalarray['totalrtp']).''; else print ''; } print ''; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 6e307f67b31..fa4500b8c31 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -513,17 +513,17 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''.$langs->trans('Invoice').''; print ''.$langs->trans('RefSupplier').''; - print ''.$langs->trans('Date').''; - print ''.$langs->trans('DateMaxPayment').''; + print ''.$langs->trans('Date').''; + print ''.$langs->trans('DateMaxPayment').''; if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('Currency').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAmountTTC').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAlreadyPaid').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyRemainderToPay').''; - print ''.$langs->trans('AmountTTC').''; - print ''.$langs->trans('AlreadyPaid').''; - print ''.$langs->trans('RemainderToPay').''; - print ''.$langs->trans('PaymentAmount').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyPaymentAmount').''; + if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAmountTTC').''; + if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAlreadyPaid').''; + if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyRemainderToPay').''; + print ''.$langs->trans('AmountTTC').''; + print ''.$langs->trans('AlreadyPaid').''; + print ''.$langs->trans('RemainderToPay').''; + print ''.$langs->trans('PaymentAmount').''; + if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyPaymentAmount').''; print ''; $total=0; @@ -566,18 +566,18 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Date if ($objp->df > 0 ) { - print ''; + print ''; print dol_print_date($db->jdate($objp->df), 'day').''; } else { - print '!!!'; + print '!!!'; } // Date Max Payment if ($objp->dlr > 0 ) { - print ''; + print ''; 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 '--'; + print '--'; } // Multicurrency if (!empty($conf->multicurrency->enabled)) { // Currency - print ''.$objp->multicurrency_code."\n"; + print ''.$objp->multicurrency_code."\n"; - print ''; + print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { print price($objp->multicurrency_total_ttc); } print ''; - print ''; + print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { print price($objp->multicurrency_am); } print ''; - print ''; + print ''; 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 ''; } - print ''.price($objp->total_ttc).''; + print ''.price($objp->total_ttc).''; - print ''.price($objp->am); + print ''.price($objp->am); if ($creditnotes) print '+'.price($creditnotes); if ($deposits) print '+'.price($deposits); print ''; - print ''.price($remaintopay).''; + print ''.price($remaintopay).''; // Amount - print ''; + print ''; $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 ''; + print ''; // 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 ''; - print ''.$langs->trans('TotalTTC').':'; + print ''.$langs->trans('TotalTTC').':'; if (!empty($conf->multicurrency->enabled)) print ' '; if (!empty($conf->multicurrency->enabled)) print ' '; if (!empty($conf->multicurrency->enabled)) print ' '; if (!empty($conf->multicurrency->enabled)) print ' '; - print ''.price($total_ttc).''; - print ''.price($totalrecu); + print ''.price($total_ttc).''; + print ''.price($totalrecu); if ($totalrecucreditnote) print '+'.price($totalrecucreditnote); if ($totalrecudeposits) print '+'.price($totalrecudeposits); print ''; - print ''.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''; - print ''; // Autofilled - if (!empty($conf->multicurrency->enabled)) print ''; + print ''.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''; + print ''; // Autofilled + if (!empty($conf->multicurrency->enabled)) print ''; print "\n"; } print "\n"; @@ -874,30 +874,30 @@ if (empty($action)) // Lines for filters fields print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($year?$year:-1, 'year', 1, 20, 5); print ''; - print ''; + print ''; print ''; print ''; print ''; $form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1); print ''; - print ''; + print ''; print ''; print ''; print ''; $form->select_comptes($search_account, 'search_account', 0, '', 1); print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -905,12 +905,12 @@ if (empty($action)) print ''; 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 "\n"; @@ -927,7 +927,7 @@ if (empty($action)) // Date $dateformatforpayment = 'day'; if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour'; - print ''.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."\n"; + print ''.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."\n"; // Thirdparty print ''; @@ -947,7 +947,7 @@ if (empty($action)) else print ' '; print ''; - print ''.price($objp->pamount).''; + print ''.price($objp->pamount).''; // Ref invoice /*$invoicesupplierstatic->ref=$objp->ref_supplier; diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index bb6297f32d3..26e0884bdd6 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -143,8 +143,8 @@ if ($year) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; if (is_resource($handle)) @@ -156,8 +156,8 @@ if ($year) $tfile = $dir . '/'.$year.'/'.$file; $relativepath = $year.'/'.$file; print ''.''; - print ''; - print ''; + print ''; + print ''; } } closedir($handle); diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 48efee3ddf3..745dd231bd0 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -51,8 +51,8 @@ foreach($linkedObjectBlock as $key => $objectlink) - - + - - + + 1) - - - - - + + + + + '; - print ''; + print ''; print "\n"; while ($i < $num) @@ -80,8 +80,8 @@ if ($resql) print ''; print ''; - print ''; - print ''; + print ''; + print ''; print "\n"; $i++; @@ -139,14 +139,14 @@ if (! empty($conf->fournisseur->enabled)) $companystatic->client=0; print $companystatic->getNomUrl(1, '', 16); print ''; - print ''; + print ''; $i++; $total += $obj->total_ttc; } if ($total>0) { - print '"; + print '"; } print "
'.$langs->trans("Reporting").''.$langs->trans("Size").''.$langs->trans("Date").''.$langs->trans("Size").''.$langs->trans("Date").'
'.img_pdf().' '.$file.''.dol_print_size(dol_filesize($tfile)).''.dol_print_date(dol_filemtime($tfile), "dayhour").'
'.dol_print_size(dol_filesize($tfile)).''.dol_print_date(dol_filemtime($tfile), "dayhour").'
trans("SupplierInvoice"); ?> trans("ShowBill"), "bill").' '.$objectlink->ref; ?> ref_supplier; ?>date, 'day'); ?>date, 'day'); ?>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 ''.price($objectlink->total_ht).''; } } ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
trans("Total"); ?>
'.$langs->trans("Orders").''.$langs->trans("Nb").' 
'.$langs->trans("Orders").''.$langs->trans("Nb").' 
'.$commandestatic->LibStatut($row[1]).''.$row[0].''.$commandestatic->LibStatut($row[1], 3).''.$row[0].''.$commandestatic->LibStatut($row[1], 3).'
'.price($obj->total_ttc).'
'.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("Total").''.price($total)."
"; print "
\n"; @@ -197,14 +197,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $companystatic->client=0; print $companystatic->getNomUrl(1, '', 16); print ''; - print ''.price($obj->total_ttc).''; + print ''.price($obj->total_ttc).''; print ''; $tot_ttc+=$obj->total_ttc; $i++; } print ''.$langs->trans("Total").''; - print ''.price($tot_ttc).''; + print ''.price($tot_ttc).''; print ''; print ""; @@ -250,7 +250,7 @@ if ($resql) print ''; print ''; print '\n"; - print '\n"; + print '\n"; print "\n"; while ($obj = $db->fetch_object($resql) ) @@ -259,7 +259,7 @@ if ($resql) print '\n"; print ''; - print ''; + print ''; print "\n"; } print "
'.$langs->trans("BoxTitleLastSuppliers", min($max, $num))."'.$langs->trans("DateModification")."'.$langs->trans("DateModification")."
'.img_object($langs->trans("ShowSupplier"), "company").''; print " socid."\">".$obj->name."'.$obj->code_fournisseur.' '.dol_print_date($db->jdate($obj->tms), 'day').''.dol_print_date($db->jdate($obj->tms), 'day').'
\n"; @@ -298,7 +298,7 @@ if (count($companystatic->SupplierCategories)) print ''."\n"; // TODO this page not exist /* - print ''; + print ''; print '('.$langs->trans("Stats").')'; print "\n"; */ diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 254bc97c28f..864e590dedb 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -243,7 +243,7 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -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 "\n"; @@ -287,13 +287,13 @@ if ($resql) if ($companystatic->id > 0) print $companystatic->getNomUrl(1, 'supplier'); print ''; - print ''.(isset($objp->price) ? price($objp->price) : '').''; + print ''.(isset($objp->price) ? price($objp->price) : '').''; - print ''.$objp->qty.''; + print ''.$objp->qty.''; - print ''.(isset($objp->unitprice) ? price($objp->unitprice) : '').''; + print ''.(isset($objp->unitprice) ? price($objp->unitprice) : '').''; - print ''; + print ''; print "\n"; $i++; diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index 1d9fdf1721f..f5d862f48e5 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -87,12 +87,12 @@ if ($socid > 0) $num = $db->num_rows($resql); print ''; - print ''.$langs->trans("Date").''; + print ''.$langs->trans("Date").''; print ' '; print ''.$langs->trans("Status").''; - print ''.$langs->trans("Debit").''; - print ''.$langs->trans("Credit").''; - print ''.$langs->trans("Balance").''; + print ''.$langs->trans("Debit").''; + print ''.$langs->trans("Credit").''; + print ''.$langs->trans("Balance").''; print ' '; print ''; @@ -119,15 +119,15 @@ if ($socid > 0) print ''; - print "".dol_print_date($fac->date)."\n"; + print "".dol_print_date($fac->date)."\n"; print "id\">".img_object($langs->trans("ShowBill"), "bill")." ".$fac->ref."\n"; - print ''.$fac->getLibStatut(2, $totalpaye).''; - print ''.price($fac->total_ttc)."\n"; + print ''.$fac->getLibStatut(2, $totalpaye).''; + print ''.price($fac->total_ttc)."\n"; $solde = $solde + $fac->total_ttc; - print ' '; - print ''.price($solde)."\n"; + print ' '; + print ''.price($solde)."\n"; // Author print ''.img_object($langs->trans("ShowUser"), 'user').' '.$objf->login.''; @@ -154,15 +154,15 @@ if ($socid > 0) $objp = $db->fetch_object($resqlp); // print ''; - print ''.dol_print_date($db->jdate($objp->dp))."\n"; + print ''.dol_print_date($db->jdate($objp->dp))."\n"; print ''; print '      '; // Decalage print ''.img_object($langs->trans("ShowPayment"), "payment").' '.$langs->trans("Payment").' '.$objp->rowid.''; print " \n"; print " \n"; - print ''.price($objp->amount).''; + print ''.price($objp->amount).''; $solde = $solde - $objp->amount; - print ''.price($solde)."\n"; + print ''.price($solde)."\n"; // Auteur print ''.img_object($langs->trans("ShowUser"), 'user').' '.$objp->login.''; diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 19c6d2b386c..f877c193750 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -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; diff --git a/htdocs/install/mysql/tables/llx_expensereport_det.sql b/htdocs/install/mysql/tables/llx_expensereport_det.sql index 1000e10955f..59bfd60b0ca 100644 --- a/htdocs/install/mysql/tables/llx_expensereport_det.sql +++ b/htdocs/install/mysql/tables/llx_expensereport_det.sql @@ -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. diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 477f611bf39..6b3568bea31 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1857,4 +1857,5 @@ DisableProspectCustomerType=Disable the "Prospect + Customer" third party type ( 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 \ No newline at end of file +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. diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index bf1d6ae5812..401ccc5462e 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -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 \ No newline at end of file diff --git a/htdocs/loan/createschedule.php b/htdocs/loan/createschedule.php index 96c84b2306a..4fe644e5521 100644 --- a/htdocs/loan/createschedule.php +++ b/htdocs/loan/createschedule.php @@ -154,12 +154,12 @@ print ''; print ''; print ''; -Print ''.$langs->trans("Term").''; -Print ''.$langs->trans("Date").''; +print ''.$langs->trans("Term").''; +print ''.$langs->trans("Date").''; print ''.$langs->trans("Insurance"); -Print ''.$langs->trans("InterestAmount").''; -Print ''.$langs->trans("Amount").''; -Print ''.$langs->trans("CapitalRemain"); +print ''.$langs->trans("InterestAmount").''; +print ''.$langs->trans("Amount").''; +print ''.$langs->trans("CapitalRemain"); print ' ('.price2num($object->capital).')'; print ''; print ''; diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index d422f541b10..1c9cb9d8c3f 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -160,12 +160,12 @@ print ''; print ''; print ''; -Print ''.$langs->trans("Term").''; -Print ''.$langs->trans("Date").''; +print ''.$langs->trans("Term").''; +print ''.$langs->trans("Date").''; print ''.$langs->trans("Insurance"); -Print ''.$langs->trans("InterestAmount").''; -Print ''.$langs->trans("Amount").''; -Print ''.$langs->trans("CapitalRemain"); +print ''.$langs->trans("InterestAmount").''; +print ''.$langs->trans("Amount").''; +print ''.$langs->trans("CapitalRemain"); print ' ('.price2num($object->capital).')'; print ''; print ''; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 1bafd063dec..3070515b020 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -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 .= ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0721016a8aa..51a5d7c72d0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -14,6 +14,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2017 Gustavo Novaro + * Copyright (C) 2019 Frédéric France * * 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) { diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index b3920480729..aa10dd9f538 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -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; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 9b393f8a1bf..8ffb6b38831 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -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))), diff --git a/htdocs/website/index.php b/htdocs/website/index.php index a23385f1083..c6499c40937 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2132,7 +2132,14 @@ if (! GETPOST('hide_websitemenu')) if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) { $htmltext=$langs->transnoentitiesnoconv("YouCanEditHtmlSource").'
'; - 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 '
'; // end websitehelp diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 2a1dad01049..8f6eb2b8d5e 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -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
diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index dc053d8edb3..c4b3e2a707a 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -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; }