Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop_multicompany
This commit is contained in:
commit
93d5c818c5
@ -39,6 +39,7 @@ $mesg = '';
|
||||
$action = GETPOST('action','aZ09');
|
||||
$backtopage = GETPOST('backtopage','alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
|
||||
@ -261,8 +262,10 @@ if ($action == 'create') {
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
} else if ($id) {
|
||||
$result = $object->fetch($id);
|
||||
}
|
||||
else if ($id > 0 || $ref) {
|
||||
|
||||
$result = $object->fetch($id, $ref, 1);
|
||||
|
||||
if ($result > 0) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
@ -329,17 +332,18 @@ if ($action == 'create') {
|
||||
// View mode
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
||||
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr');
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'account_number', 'ref');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Account number
|
||||
print '<tr><td class="titlefield">' . $langs->trans("AccountNumber") . '</td>';
|
||||
print '<td>' . $object->account_number . '</td>';
|
||||
print '<td align="right" width="25%">' . $linkback . '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
||||
print '<tr><td class="titlefield">' . $langs->trans("Label") . '</td>';
|
||||
print '<td colspan="2">' . $object->label . '</td></tr>';
|
||||
|
||||
// Account parent
|
||||
@ -361,20 +365,10 @@ if ($action == 'create') {
|
||||
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||
print '<td colspan="2">' . $object->pcg_subtype . '</td></tr>';
|
||||
|
||||
// Active
|
||||
print '<tr><td>' . $langs->trans("Status") . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print $object->getLibStatut(4);
|
||||
/*if (empty($object->active)) {
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
} else {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
}*/
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
/*
|
||||
@ -397,7 +391,7 @@ if ($action == 'create') {
|
||||
print '</div>';
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -30,6 +30,21 @@
|
||||
*/
|
||||
class AccountingAccount extends CommonObject
|
||||
{
|
||||
public $element='accounting_account';
|
||||
public $table_element='accounting_account';
|
||||
public $picto = 'billr';
|
||||
|
||||
/**
|
||||
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
* @var int
|
||||
*/
|
||||
public $ismultientitymanaged = 1;
|
||||
/**
|
||||
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
|
||||
* @var integer
|
||||
*/
|
||||
public $restrictiononfksoc = 1;
|
||||
|
||||
var $db;
|
||||
var $error;
|
||||
var $errors;
|
||||
@ -48,13 +63,17 @@ class AccountingAccount extends CommonObject
|
||||
var $active; // duplicate with status
|
||||
var $status;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handle
|
||||
*/
|
||||
function __construct($db) {
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
$this->next_prev_filter='fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; // Used to add a filter in Form::showrefnav method
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,6 +110,7 @@ class AccountingAccount extends CommonObject
|
||||
if ($obj) {
|
||||
$this->id = $obj->rowid;
|
||||
$this->rowid = $obj->rowid;
|
||||
$this->ref = $obj->account_number;
|
||||
$this->datec = $obj->datec;
|
||||
$this->tms = $obj->tms;
|
||||
$this->fk_pcg_version = $obj->fk_pcg_version;
|
||||
|
||||
@ -250,14 +250,14 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
// Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched
|
||||
$replacedinvoice = 0;
|
||||
if ($invoicestatic->close_code == 'replaced')
|
||||
if ($invoicestatic->close_code == FactureFournisseur::CLOSECODE_REPLACED)
|
||||
{
|
||||
$replacedinvoice = 1;
|
||||
$alreadydispatched = $invoicestatic->getVentilExportCompta(); // Test if replaced invoice already into bookkeeping.
|
||||
if ($alreadydispatched) $replacedinvoice = 2;
|
||||
}
|
||||
|
||||
// If not already into bookkeeping, we won't add it, if yes, we will also add the counterpart.
|
||||
// If not already into bookkeeping, we won't add it, if yes, add the counterpart ???.
|
||||
if ($replacedinvoice == 1)
|
||||
{
|
||||
continue;
|
||||
@ -560,14 +560,14 @@ if ($action == 'exportcsv') {
|
||||
|
||||
// Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched
|
||||
$replacedinvoice = 0;
|
||||
if ($invoicestatic->close_code == 'replaced')
|
||||
if ($invoicestatic->close_code == FactureFournisseur::CLOSECODE_REPLACED)
|
||||
{
|
||||
$replacedinvoice = 1;
|
||||
$alreadydispatched = $invoicestatic->getVentilExportCompta(); // Test if replaced invoice already into bookkeeping.
|
||||
if ($alreadydispatched) $replacedinvoice = 2;
|
||||
}
|
||||
|
||||
// If not already into bookkeeping, we won't add it, if yes, we will also add the counterpart.
|
||||
// If not already into bookkeeping, we won't add it, if yes, add the counterpart ???.
|
||||
if ($replacedinvoice == 1)
|
||||
{
|
||||
continue;
|
||||
@ -760,14 +760,14 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched
|
||||
$replacedinvoice = 0;
|
||||
if ($invoicestatic->close_code == 'replaced')
|
||||
if ($invoicestatic->close_code == FactureFournisseur::CLOSECODE_REPLACED)
|
||||
{
|
||||
$replacedinvoice = 1;
|
||||
$alreadydispatched = $invoicestatic->getVentilExportCompta(); // Test if replaced invoice already into bookkeeping.
|
||||
if ($alreadydispatched) $replacedinvoice = 2;
|
||||
}
|
||||
|
||||
// If no, we won't add it, if yes, we will also add the counterpart.
|
||||
// If not already into bookkeeping, we won't add it, if yes, add the counterpart ???.
|
||||
if ($replacedinvoice == 1)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -252,14 +252,14 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
// Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched
|
||||
$replacedinvoice = 0;
|
||||
if ($invoicestatic->close_code == 'replaced')
|
||||
if ($invoicestatic->close_code == Facture::CLOSECODE_REPLACED)
|
||||
{
|
||||
$replacedinvoice = 1;
|
||||
$alreadydispatched = $invoicestatic->getVentilExportCompta(); // Test if replaced invoice already into bookkeeping.
|
||||
if ($alreadydispatched) $replacedinvoice = 2;
|
||||
}
|
||||
|
||||
// If not already into bookkeeping, we won't add it, if yes, we will also add the counterpart.
|
||||
// If not already into bookkeeping, we won't add it, if yes, add the counterpart ???.
|
||||
if ($replacedinvoice == 1)
|
||||
{
|
||||
continue;
|
||||
@ -515,14 +515,14 @@ if ($action == 'exportcsv') {
|
||||
|
||||
// Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched
|
||||
$replacedinvoice = 0;
|
||||
if ($invoicestatic->close_code == 'replaced')
|
||||
if ($invoicestatic->close_code == Facture::CLOSECODE_REPLACED)
|
||||
{
|
||||
$replacedinvoice = 1;
|
||||
$alreadydispatched = $invoicestatic->getVentilExportCompta(); // Test if replaced invoice already into bookkeeping.
|
||||
if ($alreadydispatched) $replacedinvoice = 2;
|
||||
}
|
||||
|
||||
// If not already into bookkeeping, we won't add it, if yes, we will also add the counterpart.
|
||||
// If not already into bookkeeping, we won't add it, if yes, add the counterpart ???.
|
||||
if ($replacedinvoice == 1)
|
||||
{
|
||||
continue;
|
||||
@ -692,14 +692,14 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched
|
||||
$replacedinvoice = 0;
|
||||
if ($invoicestatic->close_code == 'replaced')
|
||||
if ($invoicestatic->close_code == Facture::CLOSECODE_REPLACED)
|
||||
{
|
||||
$replacedinvoice = 1;
|
||||
$alreadydispatched = $invoicestatic->getVentilExportCompta(); // Test if replaced invoice already into bookkeeping.
|
||||
if ($alreadydispatched) $replacedinvoice = 2;
|
||||
}
|
||||
|
||||
// If not already into bookkeeping, we won't add it, if yes, we will also add the counterpart.
|
||||
// If not already into bookkeeping, we won't add it, if yes, add the counterpart ???.
|
||||
if ($replacedinvoice == 1)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -80,8 +80,8 @@ print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'
|
||||
if (! empty($setupcompanynotcomplete))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit').'">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
|
||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"');
|
||||
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit').'">'.$warnpicto.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
|
||||
}
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
@ -92,8 +92,8 @@ print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'
|
||||
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
|
||||
{
|
||||
$langs->load("errors");
|
||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
|
||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"');
|
||||
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
|
||||
}
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
@ -3167,7 +3167,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$i ++;
|
||||
// Texte
|
||||
$i = 0;
|
||||
$close [$i] ['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscountVat", $resteapayer, $langs->trans("Currency" . $conf->currency)), $close [$i] ['label'], 1);
|
||||
$close [$i] ['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscount", $resteapayer, $langs->trans("Currency" . $conf->currency)), $close [$i] ['label'], 1);
|
||||
$i ++;
|
||||
$close [$i] ['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency" . $conf->currency)), $close [$i] ['label'], 1);
|
||||
$i ++;
|
||||
|
||||
@ -214,10 +214,10 @@ class Facture extends CommonInvoice
|
||||
*/
|
||||
const STATUS_ABANDONED = 3;
|
||||
|
||||
const CLOSECODE_DISCOUNTVAT = 'discount_vat';
|
||||
const CLOSECODE_BADDEBT = 'badcustomer';
|
||||
const CLOSECODE_ABANDONED = 'abandon';
|
||||
const CLOSECODE_REPLACED = 'replaced';
|
||||
const CLOSECODE_DISCOUNTVAT = 'discount_vat'; // Abandonned remain - escompte
|
||||
const CLOSECODE_BADDEBT = 'badcustomer'; // Abandonned - bad
|
||||
const CLOSECODE_ABANDONED = 'abandon'; // Abandonned - other
|
||||
const CLOSECODE_REPLACED = 'replaced'; // Closed after doing a replacement invoice
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -2053,11 +2053,11 @@ class Facture extends CommonInvoice
|
||||
* of no payment even if merchandises were sent).
|
||||
*
|
||||
* @param User $user Object user making change
|
||||
* @param string $close_code Code de fermeture
|
||||
* @param string $close_code Code of closing invoice (CLOSECODE_REPLACED, CLOSECODE_...)
|
||||
* @param string $close_note Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_canceled($user,$close_code='',$close_note='')
|
||||
function set_canceled($user, $close_code='', $close_note='')
|
||||
{
|
||||
|
||||
dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG);
|
||||
@ -2187,7 +2187,7 @@ class Facture extends CommonInvoice
|
||||
return -12;
|
||||
}
|
||||
|
||||
$result=$facreplaced->set_canceled($user,'replaced','');
|
||||
$result=$facreplaced->set_canceled($user, self::CLOSECODE_REPLACED, '');
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$facreplaced->error;
|
||||
|
||||
@ -1133,31 +1133,30 @@ class Paiement extends CommonObject
|
||||
}*/
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load the third party of object, from id into this->thirdparty
|
||||
*
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
* Load the third party of object, from id into this->thirdparty
|
||||
*
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
|
||||
if (empty($force_thirdparty_id))
|
||||
{
|
||||
$billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first invoice to get him
|
||||
$billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first supplier invoice to get him
|
||||
if (!empty($billsarray))
|
||||
{
|
||||
$supplier_invoice = new FactureFournisseur($this->db);
|
||||
if ($supplier_invoice->fetch($billsarray[0]) > 0)
|
||||
$invoice = new Facture($this->db);
|
||||
if ($invoice->fetch($billsarray[0]) > 0)
|
||||
{
|
||||
$force_thirdparty_id = $supplier_invoice->fk_soc;
|
||||
$force_thirdparty_id = $invoice->fk_soc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return parent::fetch_thirdparty($force_thirdparty_id);
|
||||
}
|
||||
|
||||
return parent::fetch_thirdparty($force_thirdparty_id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
$langs->load("accountancy");
|
||||
|
||||
$socid = GETPOST('socid','int');
|
||||
|
||||
// Security check
|
||||
|
||||
@ -76,17 +76,17 @@ class Contact extends CommonObject
|
||||
public $email;
|
||||
public $skype;
|
||||
public $photo;
|
||||
public $jabberid;
|
||||
public $jabberid;
|
||||
public $phone_pro;
|
||||
public $phone_perso;
|
||||
public $phone_mobile;
|
||||
public $fax;
|
||||
public $fax;
|
||||
|
||||
public $priv;
|
||||
public $priv;
|
||||
|
||||
public $birthday;
|
||||
public $default_lang;
|
||||
public $no_email; // 1=Don't send e-mail to this contact, 0=do
|
||||
public $no_email; // 1=Don't send e-mail to this contact, 0=do
|
||||
|
||||
public $ref_facturation; // Reference number of invoice for which it is contact
|
||||
public $ref_contrat; // Nb de reference contrat pour lequel il est contact
|
||||
@ -178,6 +178,8 @@ class Contact extends CommonObject
|
||||
if (empty($this->statut)) $this->statut = 0; // This is to convert '' into '0' to avoid bad sql request
|
||||
$entity = (isset($this->entity) && is_numeric($this->entity)?$this->entity:$conf->entity);
|
||||
|
||||
$entity = isset($this->entity)?$this->entity:$conf->entity;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
|
||||
$sql.= " datec";
|
||||
$sql.= ", fk_soc";
|
||||
|
||||
@ -6234,7 +6234,6 @@ class Form
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$object->next_prev_filter.=$hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$previous_ref = $next_ref = '';
|
||||
if ($shownav)
|
||||
{
|
||||
|
||||
@ -3096,7 +3096,7 @@ function img_info($titlealt = 'default')
|
||||
* Show warning logo
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"'). If 1
|
||||
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"'). If 1, add float: right. Can't be "class" attribute.
|
||||
* @return string Return img tag
|
||||
*/
|
||||
function img_warning($titlealt = 'default', $moreatt = '')
|
||||
@ -5479,7 +5479,12 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
||||
$substitutionarray['__MEMBER_PHONEPRO__']=$msgishtml?dol_htmlentitiesbr($object->phone_perso):$object->phone_perso;
|
||||
$substitutionarray['__MEMBER_PHONEMOBILE__']=$msgishtml?dol_htmlentitiesbr($object->phone_mobile):$object->phone_mobile;
|
||||
|
||||
if (is_object($object->thirdparty) && $object->thirdparty->id > 0)
|
||||
if (is_object($object) && $object->element == 'societe')
|
||||
{
|
||||
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object)?$object->id:'');
|
||||
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object)?$object->name:'');
|
||||
}
|
||||
elseif (is_object($object->thirdparty) && $object->thirdparty->id > 0)
|
||||
{
|
||||
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:'');
|
||||
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty)?$object->thirdparty->name:'');
|
||||
|
||||
@ -19,9 +19,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
|
||||
* \file htdocs/core/modules/supplier_invoice/doc/pdf_standard.modules.php
|
||||
* \ingroup fournisseur
|
||||
* \brief Class file to generate the supplier invoices with the canelle model
|
||||
* \brief Class file to generate the supplier invoice payment file with the standard model
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_payment/modules_supplier_payment.php';
|
||||
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to generate the supplier invoices with the canelle model
|
||||
* Class to generate the supplier invoices payment file with the standard model
|
||||
*/
|
||||
class pdf_standard extends ModelePDFSuppliersPayments
|
||||
{
|
||||
@ -97,7 +97,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
$this->posxtotalht=80;
|
||||
$this->posxtva=90;
|
||||
$this->posxtotalttc=180;
|
||||
|
||||
|
||||
//if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
@ -114,6 +114,10 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
$this->localtax2=array();
|
||||
$this->atleastoneratenotnull=0;
|
||||
$this->atleastonediscount=0;
|
||||
|
||||
// Recupere emetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||
}
|
||||
|
||||
|
||||
@ -132,12 +136,6 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||
|
||||
// Get source company
|
||||
if (! is_object($object->thirdparty)) $object->fetch_thirdparty();
|
||||
if (! is_object($object->thirdparty)) $object->thirdparty=$mysoc; // If fetch_thirdparty fails, object has no socid (specimen)
|
||||
$this->emetteur=$object->thirdparty;
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
@ -172,7 +170,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$total = $object->montant;
|
||||
|
||||
// Definition of $dir and $file
|
||||
@ -264,7 +262,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
|
||||
// Incoterm
|
||||
$height_incoterms = 0;
|
||||
|
||||
|
||||
$height_note=0;
|
||||
|
||||
$iniY = $tab_top + 7;
|
||||
@ -332,15 +330,15 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
|
||||
// ref fourn
|
||||
$pdf->SetXY($this->posxreffacturefourn, $curY);
|
||||
$pdf->MultiCell($this->posxreffacturefourn-$this->posxup-0.8, 3, $object->lines[$i]->ref_supplier, 0, 'L', 0);
|
||||
|
||||
|
||||
// ref facture fourn
|
||||
$pdf->SetXY($this->posxreffacture, $curY);
|
||||
$pdf->MultiCell($this->posxreffacture-$this->posxup-0.8, 3, $object->lines[$i]->ref, 0, 'L', 0);
|
||||
|
||||
|
||||
// type
|
||||
$pdf->SetXY($this->posxtype, $curY);
|
||||
$pdf->MultiCell($this->posxtype-$this->posxup-0.8, 3, $object->lines[$i]->type, 0, 'L', 0);
|
||||
@ -348,15 +346,15 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
// Total ht
|
||||
$pdf->SetXY($this->posxtotalht, $curY);
|
||||
$pdf->MultiCell($this->posxtotalht-$this->posxup-0.8, 3, price($object->lines[$i]->total_ht), 0, 'R', 0);
|
||||
|
||||
|
||||
// Total tva
|
||||
$pdf->SetXY($this->posxtva, $curY);
|
||||
$pdf->MultiCell($this->posxtva-$this->posxup-0.8, 3, price($object->lines[$i]->total_tva), 0, 'R', 0);
|
||||
|
||||
|
||||
// Total TTC line
|
||||
$pdf->SetXY($this->posxtotalttc, $curY);
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxtotalttc, 3, price($object->lines[$i]->total_ttc), 0, 'R', 0);
|
||||
|
||||
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
@ -421,7 +419,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
|
||||
// Affiche zone cheèque
|
||||
$posy=$this->_tableau_cheque($pdf, $object, $bottomlasttab, $outputlangs);
|
||||
|
||||
|
||||
// Affiche zone totaux
|
||||
//$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
||||
|
||||
@ -443,7 +441,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
|
||||
|
||||
return 1; // Pas d'erreur
|
||||
}
|
||||
else
|
||||
@ -476,45 +474,45 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFillColor(255,255,255);
|
||||
|
||||
|
||||
// N° payment
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->MultiCell(30, 4, 'N° '.$outputlangs->transnoentities("Payment"), 0, 'L', 1);
|
||||
|
||||
|
||||
// Ref payment
|
||||
$pdf->SetXY($this->marge_gauche + 30, $posy);
|
||||
$pdf->MultiCell(50, 4, $object->ref, 0, 'L', 1);
|
||||
|
||||
|
||||
// Total payments
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 50, $posy);
|
||||
$pdf->MultiCell(50, 4, price($object->montant), 0, 'R', 1);
|
||||
$posy += 20;
|
||||
|
||||
|
||||
// translate amount
|
||||
$currency = $conf->currency;
|
||||
$translateinletter = strtoupper(dol_convertToWord($object->montant,$outputlangs,$currency));
|
||||
$pdf->SetXY($this->marge_gauche + 50, $posy);
|
||||
$pdf->MultiCell(90, 8, $translateinletter, 0, 'L', 1);
|
||||
$posy += 8;
|
||||
|
||||
|
||||
// To
|
||||
$pdf->SetXY($this->marge_gauche + 50, $posy);
|
||||
$pdf->MultiCell(150, 4, $object->thirdparty->nom, 0, 'L', 1);
|
||||
|
||||
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy);
|
||||
$pdf->MultiCell(35, 4, str_pad(price($object->montant). ' '.$currency,18,'*',STR_PAD_LEFT), 0, 'R', 1);
|
||||
$posy += 10;
|
||||
|
||||
|
||||
|
||||
|
||||
// City
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy);
|
||||
$pdf->MultiCell(150, 4, $mysoc->town, 0, 'L', 1);
|
||||
$posy += 4;
|
||||
|
||||
|
||||
// Date
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy);
|
||||
$pdf->MultiCell(150, 4, date("d").' '.$outputlangs->transnoentitiesnoconv(date("F")).' '.date("Y"), 0, 'L', 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -549,7 +547,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
$titre = strtoupper($mysoc->town).', le '.date("d").' '.$outputlangs->transnoentitiesnoconv(date("F")).' '.date("Y");
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3) - 60, $tab_top-6);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
@ -682,17 +680,17 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
// Sender properties
|
||||
$carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
||||
|
||||
// Show sender
|
||||
// Show payer
|
||||
$posy=42;
|
||||
$posx=$this->marge_gauche;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
||||
$hautcadre=40;
|
||||
/*
|
||||
|
||||
// Show sender frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
|
||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("PayedBy").":", 0, 'L');
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFillColor(230,230,230);
|
||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||
@ -709,28 +707,12 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
|
||||
*/
|
||||
|
||||
// If BILLING contact defined on invoice, we use it
|
||||
$usecontact=false;
|
||||
$arrayidcontact=$object->getIdContact('internal','BILLING');
|
||||
if (count($arrayidcontact) > 0)
|
||||
{
|
||||
$usecontact=true;
|
||||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->thirdparty;
|
||||
}
|
||||
// Payed
|
||||
$thirdparty = $object->thirdparty;
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$thirdparty,((!empty($object->contact))?$object->contact:null),$usecontact,'target',$object);
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,((!empty($object->contact))?$object->contact:null),$usecontact,'target',$object);
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=90;
|
||||
@ -743,7 +725,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx+2,$posy-5);
|
||||
$pdf->MultiCell($widthrecbox, 5, "",0,'L');
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("PayedTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
|
||||
@ -738,17 +738,18 @@ class PaiementFourn extends Paiement
|
||||
|
||||
return $way;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Load the third party of object, from id into this->thirdparty
|
||||
*
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
* Load the third party of object, from id into this->thirdparty
|
||||
*
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
|
||||
if (empty($force_thirdparty_id))
|
||||
{
|
||||
$billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first supplier invoice to get him
|
||||
@ -761,7 +762,8 @@ class PaiementFourn extends Paiement
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return parent::fetch_thirdparty($force_thirdparty_id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -686,7 +686,7 @@ if (empty($reshook))
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
}
|
||||
|
||||
|
||||
// Dates
|
||||
// TODO mutualiser
|
||||
$date_start=$lines[$i]->date_debut_prevue;
|
||||
@ -2439,6 +2439,8 @@ else
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder paymenttable" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">' . ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>';
|
||||
@ -2449,7 +2451,6 @@ else
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=false;
|
||||
if ($num > 0)
|
||||
{
|
||||
while ($i < $num)
|
||||
@ -2658,6 +2659,7 @@ else
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
@ -2712,8 +2714,6 @@ else
|
||||
{
|
||||
if ($action != 'editline')
|
||||
{
|
||||
$var = true;
|
||||
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(1, $societe, $mysoc);
|
||||
|
||||
|
||||
@ -370,32 +370,36 @@ if ($result > 0)
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
// Documents generes
|
||||
$ref=dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$genallowed=$user->rights->fournisseur->facture->lire;
|
||||
$delallowed=$user->rights->fournisseur->facture->creer;
|
||||
$modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->SUPPLIER_PAYMENT_ADDON_PDF)?'':$conf->global->SUPPLIER_PAYMENT_ADDON_PDF));
|
||||
|
||||
print $formfile->showdocuments('supplier_payment',$ref,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_payment/modules_supplier_payment.php';
|
||||
$modellist=ModelePDFSuppliersPayments::liste_modeles($db);
|
||||
if (is_array($modellist))
|
||||
{
|
||||
$ref=dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$genallowed=$user->rights->fournisseur->facture->lire;
|
||||
$delallowed=$user->rights->fournisseur->facture->creer;
|
||||
$modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->SUPPLIER_PAYMENT_ADDON_PDF)?'':$conf->global->SUPPLIER_PAYMENT_ADDON_PDF));
|
||||
|
||||
print $formfile->showdocuments('supplier_payment',$ref,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
//print '</td><td valign="top" width="50%">';
|
||||
//print '<br>';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object,'supplier_payment',$socid,1,'listaction'.($genallowed?'largetitle':''));
|
||||
*/
|
||||
|
||||
print '</div></div></div>';
|
||||
//print '</td></tr></table>';
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -25,6 +25,10 @@
|
||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||
|
||||
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY fk_pcg_version VARCHAR(20) CHARACTER SET utf8;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY fk_pcg_version VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_system MODIFY pcg_version VARCHAR(20) CHARACTER SET utf8;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_system MODIFY pcg_version VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8;
|
||||
|
||||
@ -1036,10 +1036,13 @@ if ($ok && GETPOST('force_utf8_on_tables','alpha'))
|
||||
print '<tr><td colspan="2">';
|
||||
print $table;
|
||||
$sql='ALTER TABLE '.$table.' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci';
|
||||
print $sql;
|
||||
if (GETPOST('force_utf8_on_tables','alpha') == 'confirmed')
|
||||
{
|
||||
$db->query($sql);
|
||||
$resql = $db->query($sql);
|
||||
print ' - Done ('.$resql.')';
|
||||
}
|
||||
else print ' - Disabled';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,6 +178,7 @@ ConfirmCancelBillQuestion=Why do you want to classify this invoice 'abandoned'?
|
||||
ConfirmClassifyPaidPartially=Are you sure you want to change invoice <b>%s</b> to status paid?
|
||||
ConfirmClassifyPaidPartiallyQuestion=This invoice has not been paid completely. What are reasons for you to close this invoice?
|
||||
ConfirmClassifyPaidPartiallyReasonAvoir=Remaining unpaid <b>(%s %s)</b> is a discount granted because payment was made before term. I regularise the VAT with a credit note.
|
||||
ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid <b>(%s %s)</b> is a discount granted because payment was made before term.
|
||||
ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remaining unpaid <b>(%s %s)</b> is a discount granted because payment was made before term. I accept to lose the VAT on this discount.
|
||||
ConfirmClassifyPaidPartiallyReasonDiscountVat=Remaining unpaid <b>(%s %s)</b> is a discount granted because payment was made before term. I recover the VAT on this discount without a credit note.
|
||||
ConfirmClassifyPaidPartiallyReasonBadCustomer=Bad customer
|
||||
|
||||
@ -912,3 +912,5 @@ CommentPage=Comments space
|
||||
CommentAdded=Comment added
|
||||
CommentDeleted=Comment deleted
|
||||
Everybody=Everybody
|
||||
PayedBy=Payed by
|
||||
PayedTo=Payed to
|
||||
|
||||
@ -140,14 +140,17 @@ if (!empty($action) && empty($cancel)) {
|
||||
$action = '';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||
|
||||
print load_fiche_titre($langs->trans("DynamicPriceConfiguration"));
|
||||
$form = new Form($db);
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("DynamicPriceConfiguration"), $linkback, 'title_setup');
|
||||
|
||||
print $langs->trans("DynamicPriceDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
@ -326,12 +326,14 @@ if ($id)
|
||||
|
||||
$onlyopenedproject=1; // or -1
|
||||
$morewherefilter='';
|
||||
if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref);
|
||||
if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label);
|
||||
if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty);
|
||||
|
||||
if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_project_ref);
|
||||
if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref);
|
||||
if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label);
|
||||
if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty);
|
||||
|
||||
$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
|
||||
if ($morewherefilter) // Get all task with no filter so we can show total of time spent for not visible tasks
|
||||
if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks
|
||||
{
|
||||
$tasksarraywithoutfilter=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, '', $onlyopenedproject, '', ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
|
||||
}
|
||||
@ -499,7 +501,12 @@ $isavailable[$daytoparse]=$isavailablefordayanduser; // in projectLinesPerWeek
|
||||
|
||||
if (count($tasksarray) > 0)
|
||||
{
|
||||
//var_dump($tasksarray); // contains only selected tasks
|
||||
//var_dump($tasksarraywithoutfilter); // contains all tasks (if there is a filter, not defined if no filter)
|
||||
//var_dump($tasksrole);
|
||||
|
||||
$j=0;
|
||||
$level=0;
|
||||
$totalforvisibletasks = projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse, $isavailable, 0);
|
||||
//var_dump($totalforvisibletasks);
|
||||
|
||||
@ -518,7 +525,6 @@ if (count($tasksarray) > 0)
|
||||
$totalforeachday=array();
|
||||
foreach($listofdistinctprojectid as $tmpprojectid)
|
||||
{
|
||||
$lineother='';
|
||||
$projectstatic->id=$tmpprojectid;
|
||||
$projectstatic->loadTimeSpent($daytoparse, 0, $usertoprocess->id); // Load time spent from table projet_task_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
@ -527,15 +533,25 @@ if (count($tasksarray) > 0)
|
||||
$totalforeachday[$tmpday]+=$projectstatic->weekWorkLoad[$tmpday];
|
||||
}
|
||||
}
|
||||
$lineother='';
|
||||
//var_dump($totalforeachday);
|
||||
|
||||
// Is there a diff between selected/filtered tasks and all tasks ?
|
||||
$isdiff = 0;
|
||||
if (count($totalforeachday))
|
||||
{
|
||||
$timeonothertasks=($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]);
|
||||
if ($timeonothertasks)
|
||||
{
|
||||
$isdiff=1;
|
||||
}
|
||||
}
|
||||
|
||||
$colspan = 8;
|
||||
|
||||
// There is a diff between total shown on screen and total spent by user, so we add a line with all other cumulated time of user
|
||||
if (count($totalforeachday))
|
||||
if ($isdiff)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven othertaskwithtime">';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
print $langs->trans("OtherFilteredTasks");
|
||||
print '</td>';
|
||||
|
||||
@ -41,7 +41,6 @@ $mode=GETPOST("mode",'alpha');
|
||||
$id=GETPOST('id','int');
|
||||
$taskid=GETPOST('taskid','int');
|
||||
|
||||
|
||||
$mine=0;
|
||||
if ($mode == 'mine') $mine=1;
|
||||
|
||||
@ -328,12 +327,14 @@ if ($id)
|
||||
|
||||
$onlyopenedproject=1; // or -1
|
||||
$morewherefilter='';
|
||||
if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref);
|
||||
if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label);
|
||||
if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty);
|
||||
|
||||
if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_project_ref);
|
||||
if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref);
|
||||
if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label);
|
||||
if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty);
|
||||
|
||||
$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
|
||||
if ($morewherefilter) // Get all task with no filter so we can show total of time spent for not visible tasks
|
||||
if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks
|
||||
{
|
||||
$tasksarraywithoutfilter=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, '', $onlyopenedproject, '', ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
|
||||
}
|
||||
@ -514,7 +515,8 @@ $restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED
|
||||
|
||||
if (count($tasksarray) > 0)
|
||||
{
|
||||
//var_dump($tasksarray);
|
||||
//var_dump($tasksarray); // contains only selected tasks
|
||||
//var_dump($tasksarraywithoutfilter); // contains all tasks (if there is a filter, not defined if no filter)
|
||||
//var_dump($tasksrole);
|
||||
|
||||
$j=0;
|
||||
@ -537,7 +539,6 @@ if (count($tasksarray) > 0)
|
||||
$totalforeachday=array();
|
||||
foreach($listofdistinctprojectid as $tmpprojectid)
|
||||
{
|
||||
$lineother='';
|
||||
$projectstatic->id=$tmpprojectid;
|
||||
$projectstatic->loadTimeSpent($firstdaytoshow, 0, $usertoprocess->id); // Load time spent from table projet_task_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
@ -546,15 +547,32 @@ if (count($tasksarray) > 0)
|
||||
$totalforeachday[$tmpday]+=$projectstatic->weekWorkLoad[$tmpday];
|
||||
}
|
||||
}
|
||||
$lineother='';
|
||||
|
||||
//var_dump($totalforeachday);
|
||||
//var_dump($totalforvisibletasks);
|
||||
|
||||
// Is there a diff between selected/filtered tasks and all tasks ?
|
||||
$isdiff = 0;
|
||||
if (count($totalforeachday))
|
||||
{
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
{
|
||||
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
$timeonothertasks=($totalforeachday[$tmpday] - $totalforvisibletasks[$tmpday]);
|
||||
if ($timeonothertasks)
|
||||
{
|
||||
$isdiff=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$colspan=7;
|
||||
|
||||
// There is a diff between total shown on screen and total spent by user, so we add a line with all other cumulated time of user
|
||||
if (count($totalforeachday))
|
||||
if ($isdiff)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven othertaskwithtime">';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
print $langs->trans("OtherFilteredTasks");
|
||||
print '</td>';
|
||||
|
||||
@ -1489,7 +1489,7 @@ div.tmenuleft
|
||||
margin-top: 0px;
|
||||
<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
|
||||
width: 5px;
|
||||
background: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menutab-r.png',1); ?>) 0 -6px no-repeat;
|
||||
/* background: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menutab-r.png',1); ?>) 0 -6px no-repeat; */
|
||||
<?php } ?>
|
||||
<?php if ($disableimages) { ?>
|
||||
height: 26px;
|
||||
@ -3125,15 +3125,29 @@ div.ok {
|
||||
color: #114466;
|
||||
}
|
||||
|
||||
/* Info admin */
|
||||
div.info {
|
||||
border-<?php print $left; ?>: solid 5px #87cfd2;
|
||||
padding-top: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 4px;
|
||||
padding-bottom: 8px;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
background: #eff8fc;
|
||||
}
|
||||
|
||||
/* Warning message */
|
||||
div.warning {
|
||||
color: #302020;
|
||||
padding: 0.3em 0.3em 0.3em 0.3em;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
border: 2px solid #805000;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
border-<?php print $left; ?>: solid 5px #f2cf87;
|
||||
padding-top: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 4px;
|
||||
padding-bottom: 8px;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
background: #fcf8e3;
|
||||
}
|
||||
div.warning a, div.info a, div.error a {
|
||||
color: rgb(<?php echo $colortext; ?>);
|
||||
}
|
||||
|
||||
/* Error message */
|
||||
@ -3141,19 +3155,6 @@ div.error {
|
||||
background: #EFCFCF;
|
||||
}
|
||||
|
||||
/* Info admin */
|
||||
div.info {
|
||||
color: #fff;
|
||||
padding: 0.4em 0.4em 0.4em 0.4em;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background: #798080;
|
||||
}
|
||||
|
||||
div.warning a, div.info a, div.error a {
|
||||
color: rgb(<?php echo $colortext; ?>);
|
||||
}
|
||||
|
||||
/*
|
||||
* Liens Payes/Non payes
|
||||
@ -3323,20 +3324,19 @@ div#card-errors {
|
||||
/* ============================================================================== */
|
||||
|
||||
table.valid {
|
||||
border-top: solid 1px #E6E6E6;
|
||||
border-<?php print $left; ?>: solid 1px #E6E6E6;
|
||||
border-<?php print $right; ?>: solid 1px #444444;
|
||||
border-bottom: solid 1px #555555;
|
||||
padding-top: 0px;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
padding-bottom: 0px;
|
||||
/* border-top: solid 1px #E6E6E6; */
|
||||
border-<?php print $left; ?>: solid 5px #f2cf87;
|
||||
/* border-<?php print $right; ?>: solid 1px #444444;
|
||||
border-bottom: solid 1px #555555; */
|
||||
padding-top: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 4px;
|
||||
padding-bottom: 4px;
|
||||
margin: 0px 0px;
|
||||
background: #D5BAA8;
|
||||
background: #fcf8e3;
|
||||
}
|
||||
|
||||
.validtitre {
|
||||
background: #D5BAA8;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@ -4948,7 +4948,7 @@ div.tabsElem a.tab {
|
||||
|
||||
/* nboftopmenuentries = <?php echo $nbtopmenuentries ?>, fontsize=<?php echo $fontsize ?> */
|
||||
/* rule to reduce top menu - 1st reduction */
|
||||
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 6.9, 0) + 24; ?>px) /* reduction 1 */
|
||||
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 7, 0) + 24; ?>px) /* reduction 1 */
|
||||
{
|
||||
div.tmenucenter {
|
||||
width: <?php echo round($fontsize * 4); ?>px; /* size of viewport */
|
||||
|
||||
@ -3181,17 +3181,29 @@ div.ok {
|
||||
color: #114466;
|
||||
}
|
||||
|
||||
/* Info admin */
|
||||
div.info {
|
||||
border-<?php print $left; ?>: solid 5px #87cfd2;
|
||||
padding-top: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 4px;
|
||||
padding-bottom: 8px;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
background: #eff8fc;
|
||||
}
|
||||
|
||||
/* Warning message */
|
||||
div.warning {
|
||||
color: #302020;
|
||||
padding: 0.3em 0.3em 0.3em 0.3em;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
/* border: 1px solid #e0d0b0; */
|
||||
border: 2px solid #805000
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
/* background: #EFDF9A; */
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
border-<?php print $left; ?>: solid 5px #f2cf87;
|
||||
padding-top: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 4px;
|
||||
padding-bottom: 8px;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
background: #fcf8e3;
|
||||
}
|
||||
div.warning a, div.info a, div.error a {
|
||||
color: rgb(<?php echo $colortext; ?>);
|
||||
}
|
||||
|
||||
/* Error message */
|
||||
@ -3205,19 +3217,6 @@ div.error {
|
||||
background: #EFCFCF;
|
||||
}
|
||||
|
||||
/* Info admin */
|
||||
div.info {
|
||||
color: #fff;
|
||||
padding: 0.4em 0.4em 0.4em 0.4em;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background: #989;
|
||||
}
|
||||
|
||||
div.warning a, div.info a, div.error a {
|
||||
color: rgb(<?php echo $colortext; ?>);
|
||||
}
|
||||
|
||||
/*
|
||||
* Liens Payes/Non payes
|
||||
@ -3378,20 +3377,19 @@ div#card-errors {
|
||||
/* ============================================================================== */
|
||||
|
||||
table.valid {
|
||||
border-top: solid 1px #E6E6E6;
|
||||
border-<?php print $left; ?>: solid 1px #E6E6E6;
|
||||
border-<?php print $right; ?>: solid 1px #444444;
|
||||
border-bottom: solid 1px #555555;
|
||||
padding-top: 0px;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
padding-bottom: 0px;
|
||||
/* border-top: solid 1px #E6E6E6; */
|
||||
border-<?php print $left; ?>: solid 5px #f2cf87;
|
||||
/* border-<?php print $right; ?>: solid 1px #444444;
|
||||
border-bottom: solid 1px #555555; */
|
||||
padding-top: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 4px;
|
||||
padding-bottom: 4px;
|
||||
margin: 0px 0px;
|
||||
background: #D5BAA8;
|
||||
background: #fcf8e3;
|
||||
}
|
||||
|
||||
.validtitre {
|
||||
background: #D5BAA8;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user