Merge branch 'Upstream/develop'
This commit is contained in:
commit
e4f51d8f7a
@ -105,6 +105,8 @@ For users:
|
|||||||
- Fix: debian script syntax error
|
- Fix: debian script syntax error
|
||||||
- Fix: error "menu param is not inside list" into pos module.
|
- Fix: error "menu param is not inside list" into pos module.
|
||||||
- Fix: Salary payments are not reflected on the reporting sheets
|
- Fix: Salary payments are not reflected on the reporting sheets
|
||||||
|
- Fix: Unsubscribe emailing not working
|
||||||
|
- Fix: Trigger on create category call failed because user is not passed on card
|
||||||
|
|
||||||
***** ChangeLog for 3.6 compared to 3.5.* *****
|
***** ChangeLog for 3.6 compared to 3.5.* *****
|
||||||
For users:
|
For users:
|
||||||
@ -236,9 +238,9 @@ Fix: Link product, In list view and label product.
|
|||||||
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
|
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
|
||||||
Fix: When disabled, all fields to add time into task line must be disabled.
|
Fix: When disabled, all fields to add time into task line must be disabled.
|
||||||
Fix: Missing include files.lib.php in some pages that use dol_delete_recursive
|
Fix: Missing include files.lib.php in some pages that use dol_delete_recursive
|
||||||
Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive.
|
|
||||||
Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref.
|
Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref.
|
||||||
Fix: [ bug #1553 ] Saving User displays setup removes menu.
|
Fix: [ bug #1553 ] Saving User displays setup removes menu.
|
||||||
|
Fix: [ bug #1544 ] Can remove date from invoice
|
||||||
|
|
||||||
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
||||||
Fix: Hide title of event when agenda module disabled.
|
Fix: Hide title of event when agenda module disabled.
|
||||||
|
|||||||
@ -115,7 +115,7 @@ if ($resql) {
|
|||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
// Ref produit
|
// Ref produit
|
||||||
$product_static->ref = $objp->p . ref;
|
$product_static->ref = $objp->ref;
|
||||||
$product_static->id = $objp->rowid;
|
$product_static->id = $objp->rowid;
|
||||||
$product_static->type = $objp->type;
|
$product_static->type = $objp->type;
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -24,10 +24,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class AccountancySystem
|
* Class to manage accountancy systems
|
||||||
* \brief Classe to manage accountancy systems
|
|
||||||
*/
|
*/
|
||||||
class AccountancySystem {
|
class AccountancySystem
|
||||||
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
var $rowid;
|
var $rowid;
|
||||||
|
|||||||
@ -24,10 +24,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class AccountingAccount
|
* Classe permettant la gestion des comptes generaux de compta
|
||||||
* \brief Classe permettant la gestion des comptes generaux de compta
|
|
||||||
*/
|
*/
|
||||||
class AccountingAccount {
|
class AccountingAccount
|
||||||
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $id;
|
var $id;
|
||||||
var $rowid;
|
var $rowid;
|
||||||
|
|||||||
@ -215,10 +215,13 @@ class BookKeeping
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Insert line into bookkeeping
|
* Insert line into bookkeeping
|
||||||
* \param user User who inserted operation
|
*
|
||||||
|
* @param User $user User who inserted operation
|
||||||
|
* @return $result Result
|
||||||
*/
|
*/
|
||||||
function create() {
|
function create($user='')
|
||||||
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$this->piece_num = 0;
|
$this->piece_num = 0;
|
||||||
@ -310,7 +313,10 @@ class BookKeeping
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Delete bookkepping by importkey
|
* Delete bookkepping by importkey
|
||||||
|
*
|
||||||
|
* @param string $importkey Import key
|
||||||
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function delete_by_importkey($importkey) {
|
function delete_by_importkey($importkey) {
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -626,7 +632,10 @@ class BookKeeping
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Delete bookkepping by importkey
|
* Delete bookkepping by importkey
|
||||||
|
*
|
||||||
|
* @param string $model Model
|
||||||
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function export_bookkeping($model = 'ebp')
|
function export_bookkeping($model = 'ebp')
|
||||||
{
|
{
|
||||||
@ -679,6 +688,9 @@ class BookKeeping
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class BookKeepingLine
|
||||||
|
*/
|
||||||
class BookKeepingLine
|
class BookKeepingLine
|
||||||
{
|
{
|
||||||
var $id;
|
var $id;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class FormVentilation extends Form
|
|||||||
* @param string $selectedkey Value
|
* @param string $selectedkey Value
|
||||||
* @return string HTML edit field
|
* @return string HTML edit field
|
||||||
*/
|
*/
|
||||||
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey)
|
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
|||||||
@ -274,10 +274,10 @@ if ($action == 'writeBookKeeping') {
|
|||||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
|
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = $compte->intitule;
|
$bookkeeping->label_compte = $compte->intitule;
|
||||||
$bookkeeping->montant = ($mt < 0 ? price - ($mt) : $mt);
|
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||||
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
|
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
||||||
$bookkeeping->credit = ($mt < 0 ? price - ($mt) : 0);
|
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
|
||||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
||||||
|
|
||||||
if ($tabtype[$key] == 'payment') {
|
if ($tabtype[$key] == 'payment') {
|
||||||
@ -324,9 +324,9 @@ if ($action == 'writeBookKeeping') {
|
|||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||||
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->montant = ($mt < 0 ? price - ($mt) : $mt);
|
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
$bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0);
|
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
||||||
|
|
||||||
|
|||||||
@ -254,10 +254,10 @@ if ($action == 'writeBookKeeping') {
|
|||||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
|
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = $compte->intitule;
|
$bookkeeping->label_compte = $compte->intitule;
|
||||||
$bookkeeping->montant = ($mt < 0 ? price - ($mt) : $mt);
|
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||||
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
|
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
||||||
$bookkeeping->credit = ($mt < 0 ? price - ($mt) : 0);
|
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
|
||||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
|
$bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
|
||||||
|
|
||||||
if ($tabtype[$key] == 'payment') {
|
if ($tabtype[$key] == 'payment') {
|
||||||
@ -304,10 +304,10 @@ if ($action == 'writeBookKeeping') {
|
|||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||||
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->montant = ($mt < 0 ? price - ($mt) : $mt);
|
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
$bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0);
|
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
$bookkeeping->credit = ($mt >= 0 ? $mt : 0);
|
||||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
|
$bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
|
||||||
|
|
||||||
if ($tabtype[$key] == 'sc') {
|
if ($tabtype[$key] == 'sc') {
|
||||||
|
|||||||
@ -204,9 +204,9 @@ else
|
|||||||
// Add vat rates examples specific to country
|
// Add vat rates examples specific to country
|
||||||
$vat_rates=array();
|
$vat_rates=array();
|
||||||
|
|
||||||
$sql.="SELECT taux as vat_rate";
|
$sql="SELECT taux as vat_rate";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
||||||
$sql.=" WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$mysoc->country_code."' AND taux != 0";
|
$sql.=" WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$mysoc->country_code."' AND t.taux <> 0";
|
||||||
$sql.=" ORDER BY t.taux ASC";
|
$sql.=" ORDER BY t.taux ASC";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -249,18 +249,23 @@ else if ($action == 'setmode' && $user->rights->facture->creer) {
|
|||||||
dol_print_error($db, $object->error);
|
dol_print_error($db, $object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setinvoicedate' && $user->rights->facture->creer) {
|
else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$old_date_lim_reglement = $object->date_lim_reglement;
|
$old_date_lim_reglement = $object->date_lim_reglement;
|
||||||
$object->date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']);
|
$date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']);
|
||||||
|
if (empty($date))
|
||||||
|
{
|
||||||
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
||||||
|
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$object->date=$date;
|
||||||
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
|
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
|
||||||
if ($new_date_lim_reglement > $old_date_lim_reglement)
|
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
|
||||||
$object->date_lim_reglement = $new_date_lim_reglement;
|
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
|
||||||
if ($object->date_lim_reglement < $object->date)
|
|
||||||
$object->date_lim_reglement = $object->date;
|
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
if ($result < 0)
|
if ($result < 0) dol_print_error($db, $object->error);
|
||||||
dol_print_error($db, $object->error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setconditions' && $user->rights->facture->creer) {
|
else if ($action == 'setconditions' && $user->rights->facture->creer) {
|
||||||
@ -268,18 +273,14 @@ else if ($action == 'setconditions' && $user->rights->facture->creer) {
|
|||||||
$object->cond_reglement_code = 0; // To clean property
|
$object->cond_reglement_code = 0; // To clean property
|
||||||
$object->cond_reglement_id = 0; // To clean property
|
$object->cond_reglement_id = 0; // To clean property
|
||||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||||
if ($result < 0)
|
if ($result < 0) dol_print_error($db, $object->error);
|
||||||
dol_print_error($db, $object->error);
|
|
||||||
|
|
||||||
$old_date_lim_reglement = $object->date_lim_reglement;
|
$old_date_lim_reglement = $object->date_lim_reglement;
|
||||||
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
|
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
|
||||||
if ($new_date_lim_reglement > $old_date_lim_reglement)
|
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
|
||||||
$object->date_lim_reglement = $new_date_lim_reglement;
|
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
|
||||||
if ($object->date_lim_reglement < $object->date)
|
|
||||||
$object->date_lim_reglement = $object->date;
|
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
if ($result < 0)
|
if ($result < 0) dol_print_error($db, $object->error);
|
||||||
dol_print_error($db, $object->error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setpaymentterm' && $user->rights->facture->creer) {
|
else if ($action == 'setpaymentterm' && $user->rights->facture->creer) {
|
||||||
@ -1159,12 +1160,12 @@ else if ($action == 'addline' && $user->rights->facture->creer)
|
|||||||
// We define price for product
|
// We define price for product
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
|
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
|
||||||
{
|
{
|
||||||
$pu_ht = $prod->multiprices [$object->thirdparty->price_level];
|
$pu_ht = $prod->multiprices[$object->thirdparty->price_level];
|
||||||
$pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
||||||
$price_min = $prod->multiprices_min [$object->thirdparty->price_level];
|
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level];
|
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||||
$tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
//$tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||||
$tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
//$tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||||
}
|
}
|
||||||
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -508,7 +508,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function security_prepare_head()
|
function security_prepare_head()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -360,7 +360,7 @@ function show_array_last_actions_done($max=5)
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function agenda_prepare_head()
|
function agenda_prepare_head()
|
||||||
{
|
{
|
||||||
@ -405,7 +405,7 @@ function agenda_prepare_head()
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param object $object Object related to tabs
|
* @param object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function actions_prepare_head($object)
|
function actions_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
*
|
*
|
||||||
* @param string $selected Preselecte value
|
* @param string $selected Preselecte value
|
||||||
* @param string $htmlname HTML name of input field
|
* @param string $htmlname HTML name of input field
|
||||||
* @param string $url Url for request: /chemin/fichier.php
|
* @param string $url Url for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list)
|
||||||
* @param string $urloption More parameters on URL request
|
* @param string $urloption More parameters on URL request
|
||||||
* @param int $minLength Minimum number of chars to trigger that Ajax search
|
* @param int $minLength Minimum number of chars to trigger that Ajax search
|
||||||
* @param int $autoselect Automatic selection if just one value
|
* @param int $autoselect Automatic selection if just one value
|
||||||
@ -98,26 +98,30 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
|||||||
$("input#search_'.$htmlname.'").autocomplete({
|
$("input#search_'.$htmlname.'").autocomplete({
|
||||||
source: function( request, response ) {
|
source: function( request, response ) {
|
||||||
$.get("'.$url.($urloption?'?'.$urloption:'').'", { '.$htmlname.': request.term }, function(data){
|
$.get("'.$url.($urloption?'?'.$urloption:'').'", { '.$htmlname.': request.term }, function(data){
|
||||||
response($.map( data, function( item ) {
|
if (data != null)
|
||||||
if (autoselect == 1 && data.length == 1) {
|
{
|
||||||
$("#search_'.$htmlname.'").val(item.value);
|
response($.map( data, function(item) {
|
||||||
$("#'.$htmlname.'").val(item.key).trigger("change");
|
if (autoselect == 1 && data.length == 1) {
|
||||||
}
|
$("#search_'.$htmlname.'").val(item.value);
|
||||||
var label = item.label.toString();
|
$("#'.$htmlname.'").val(item.key).trigger("change");
|
||||||
var update = {};
|
}
|
||||||
if (options.update) {
|
var label = item.label.toString();
|
||||||
$.each(options.update, function(key, value) {
|
var update = {};
|
||||||
update[key] = item[value];
|
if (options.update) {
|
||||||
});
|
$.each(options.update, function(key, value) {
|
||||||
}
|
update[key] = item[value];
|
||||||
var textarea = {};
|
});
|
||||||
if (options.update_textarea) {
|
}
|
||||||
$.each(options.update_textarea, function(key, value) {
|
var textarea = {};
|
||||||
textarea[key] = item[value];
|
if (options.update_textarea) {
|
||||||
});
|
$.each(options.update_textarea, function(key, value) {
|
||||||
}
|
textarea[key] = item[value];
|
||||||
return { label: label, value: item.value, id: item.key, update: update, textarea: textarea, disabled: item.disabled }
|
});
|
||||||
}));
|
}
|
||||||
|
return { label: label, value: item.value, id: item.key, update: update, textarea: textarea, disabled: item.disabled }
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else console.error("Error: Ajax url '.$url.($urloption?'?'.$urloption:'').' has returned an empty page. Should be an empty json array.");
|
||||||
}, "json");
|
}, "json");
|
||||||
},
|
},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function bank_prepare_head($object)
|
function bank_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @param string $type Type of category
|
* @param string $type Type of category
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function categories_prepare_head($object,$type)
|
function categories_prepare_head($object,$type)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function contact_prepare_head($object)
|
function contact_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function contract_prepare_head($object)
|
function contract_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
* Prepare array with list of different ecm main dashboard
|
* Prepare array with list of different ecm main dashboard
|
||||||
*
|
*
|
||||||
* @param object $object Object related to tabs
|
* @param object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function ecm_prepare_dasboard_head($object)
|
function ecm_prepare_dasboard_head($object)
|
||||||
{
|
{
|
||||||
@ -64,7 +64,7 @@ function ecm_prepare_dasboard_head($object)
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param object $object Object related to tabs
|
* @param object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function ecm_prepare_head($object)
|
function ecm_prepare_head($object)
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ function ecm_prepare_head($object)
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function ecm_file_prepare_head($object)
|
function ecm_file_prepare_head($object)
|
||||||
{
|
{
|
||||||
@ -104,7 +104,7 @@ function ecm_file_prepare_head($object)
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param object $object Object related to tabs
|
* @param object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function ecm_prepare_head_fm($object)
|
function ecm_prepare_head_fm($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function emailing_prepare_head($object)
|
function emailing_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function fichinter_prepare_head($object)
|
function fichinter_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function fiscalyear_prepare_head($object)
|
function fiscalyear_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function facturefourn_prepare_head($object)
|
function facturefourn_prepare_head($object)
|
||||||
{
|
{
|
||||||
@ -92,7 +92,7 @@ function facturefourn_prepare_head($object)
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function ordersupplier_prepare_head($object)
|
function ordersupplier_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function commande_prepare_head($object)
|
function commande_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -269,7 +269,9 @@ function pdf_getPDFFontSize($outputlangs)
|
|||||||
*/
|
*/
|
||||||
function pdf_getHeightForLogo($logo, $url = false)
|
function pdf_getHeightForLogo($logo, $url = false)
|
||||||
{
|
{
|
||||||
$height=22; $maxwidth=130;
|
global $conf;
|
||||||
|
$height=(empty($conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT)?22:$conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT);
|
||||||
|
$maxwidth=130;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
$tmp=dol_getImageSize($logo, $url);
|
$tmp=dol_getImageSize($logo, $url);
|
||||||
if ($tmp['height'])
|
if ($tmp['height'])
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function prelevement_prepare_head($object)
|
function prelevement_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function product_prepare_head($object, $user)
|
function product_prepare_head($object, $user)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function project_prepare_head($object)
|
function project_prepare_head($object)
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ function project_prepare_head($object)
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function task_prepare_head($object)
|
function task_prepare_head($object)
|
||||||
{
|
{
|
||||||
@ -170,7 +170,7 @@ function task_prepare_head($object)
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function project_admin_prepare_head()
|
function project_admin_prepare_head()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param object $object Object related to tabs
|
* @param object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function propal_prepare_head($object)
|
function propal_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function shipping_prepare_head($object)
|
function shipping_prepare_head($object)
|
||||||
{
|
{
|
||||||
@ -85,7 +85,7 @@ function shipping_prepare_head($object)
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function delivery_prepare_head($object)
|
function delivery_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function stock_prepare_head($object)
|
function stock_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function tax_prepare_head($object)
|
function tax_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function trip_prepare_head($object)
|
function trip_prepare_head($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function user_prepare_head($object)
|
function user_prepare_head($object)
|
||||||
{
|
{
|
||||||
@ -178,7 +178,7 @@ function group_prepare_head($object)
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function user_admin_prepare_head()
|
function user_admin_prepare_head()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,8 +26,8 @@
|
|||||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/propale/modules_propale.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/modules/propale/modules_propale.php';
|
||||||
|
|
||||||
|
|
||||||
/** \class mod_propale_marbre
|
/**
|
||||||
* \brief Class to manage customer order numbering rules Marbre
|
* Class to manage customer order numbering rules Marbre
|
||||||
*/
|
*/
|
||||||
class mod_propale_marbre extends ModeleNumRefPropales
|
class mod_propale_marbre extends ModeleNumRefPropales
|
||||||
{
|
{
|
||||||
@ -124,7 +124,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog("mod_propale_marbre::getNextValue", LOG_DEBUG);
|
dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
|||||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||||
else $num = sprintf("%04s",$max+1);
|
else $num = sprintf("%04s",$max+1);
|
||||||
|
|
||||||
dol_syslog("mod_propale_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
|
dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||||
return $this->prefix.$yymm."-".$num;
|
return $this->prefix.$yymm."-".$num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/propale/modules_propale.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class mod_propale_saphir
|
* Class of file that contains the numbering module rules Saphir
|
||||||
* \brief Class of file that contains the numbering module rules Saphir
|
|
||||||
*/
|
*/
|
||||||
class mod_propale_saphir extends ModeleNumRefPropales
|
class mod_propale_saphir extends ModeleNumRefPropales
|
||||||
{
|
{
|
||||||
|
|||||||
@ -278,7 +278,7 @@ class Fichinter extends CommonObject
|
|||||||
$sql.= " f.datec,";
|
$sql.= " f.datec,";
|
||||||
$sql.= " f.date_valid as datev,";
|
$sql.= " f.date_valid as datev,";
|
||||||
$sql.= " f.tms as datem,";
|
$sql.= " f.tms as datem,";
|
||||||
$sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams";
|
$sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||||
if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'";
|
if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'";
|
||||||
else $sql.= " WHERE f.rowid=".$rowid;
|
else $sql.= " WHERE f.rowid=".$rowid;
|
||||||
@ -304,6 +304,7 @@ class Fichinter extends CommonObject
|
|||||||
$this->note_public = $obj->note_public;
|
$this->note_public = $obj->note_public;
|
||||||
$this->note_private = $obj->note_private;
|
$this->note_private = $obj->note_private;
|
||||||
$this->modelpdf = $obj->model_pdf;
|
$this->modelpdf = $obj->model_pdf;
|
||||||
|
$this->fk_contrat = $obj->fk_contrat;
|
||||||
|
|
||||||
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql.= " l.tva_tx, l.remise_percent, l.subprice,";
|
$sql.= " l.tva_tx, l.remise_percent, l.subprice,";
|
||||||
$sql.= " l.localtax1_tx, l. localtax2_tx, l.total_localtax1, l.total_localtax2,";
|
$sql.= " l.localtax1_tx, l. localtax2_tx, l.total_localtax1, l.total_localtax2,";
|
||||||
$sql.= " l.total_ht, l.total_tva, l.total_ttc,";
|
$sql.= " l.total_ht, l.total_tva, l.total_ttc,";
|
||||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc";
|
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc,";
|
||||||
|
$sql.= " l.date_start, l.date_end";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||||
$sql.= " WHERE l.fk_commande = ".$this->id;
|
$sql.= " WHERE l.fk_commande = ".$this->id;
|
||||||
@ -258,6 +259,9 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$line->ref_fourn = $objp->ref_supplier; // TODO deprecated
|
$line->ref_fourn = $objp->ref_supplier; // TODO deprecated
|
||||||
$line->ref_supplier = $objp->ref_supplier; // Reference supplier
|
$line->ref_supplier = $objp->ref_supplier; // Reference supplier
|
||||||
|
|
||||||
|
$line->date_start = $this->db->jdate($objp->date_start);
|
||||||
|
$line->date_end = $this->db->jdate($objp->date_end);
|
||||||
|
|
||||||
$this->lines[$i] = $line;
|
$this->lines[$i] = $line;
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -1721,9 +1725,11 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @param int $info_bits Miscellaneous informations
|
* @param int $info_bits Miscellaneous informations
|
||||||
* @param int $type Type of line (0=product, 1=service)
|
* @param int $type Type of line (0=product, 1=service)
|
||||||
* @param int $notrigger Disable triggers
|
* @param int $notrigger Disable triggers
|
||||||
|
* @param timestamp $date_start Date start of service
|
||||||
|
* @param timestamp $date_end Date end of service
|
||||||
* @return int < 0 if error, > 0 if ok
|
* @return int < 0 if error, > 0 if ok
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=false)
|
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=false, $date_start='', $date_end='')
|
||||||
{
|
{
|
||||||
global $mysoc;
|
global $mysoc;
|
||||||
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type");
|
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type");
|
||||||
@ -1784,10 +1790,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql.= ",localtax1_type='".$localtax1_type."'";
|
$sql.= ",localtax1_type='".$localtax1_type."'";
|
||||||
$sql.= ",localtax2_type='".$localtax2_type."'";
|
$sql.= ",localtax2_type='".$localtax2_type."'";
|
||||||
$sql.= ",qty='".price2num($qty)."'";
|
$sql.= ",qty='".price2num($qty)."'";
|
||||||
/*if ($date_end) { $sql.= ",date_start='$date_end'"; }
|
$sql.= ",date_start=".(! empty($date_start)?"'".$this->db->idate($date_start)."'":"null");
|
||||||
else { $sql.=',date_start=null'; }
|
$sql.= ",date_end=".(! empty($date_end)?"'".$this->db->idate($date_end)."'":"null");
|
||||||
if ($date_end) { $sql.= ",date_end='$date_end'"; }
|
|
||||||
else { $sql.=',date_end=null'; }*/
|
|
||||||
$sql.= ",info_bits='".$info_bits."'";
|
$sql.= ",info_bits='".$info_bits."'";
|
||||||
$sql.= ",total_ht='".price2num($total_ht)."'";
|
$sql.= ",total_ht='".price2num($total_ht)."'";
|
||||||
$sql.= ",total_tva='".price2num($total_tva)."'";
|
$sql.= ",total_tva='".price2num($total_tva)."'";
|
||||||
@ -2008,7 +2012,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
/**
|
/**
|
||||||
* Classe de gestion des lignes de commande
|
* Classe de gestion des lignes de commande
|
||||||
*/
|
*/
|
||||||
class CommandeFournisseurLigne
|
class CommandeFournisseurLigne extends CommonOrderLine
|
||||||
{
|
{
|
||||||
// From llx_commandedet
|
// From llx_commandedet
|
||||||
var $qty;
|
var $qty;
|
||||||
@ -2029,6 +2033,8 @@ class CommandeFournisseurLigne
|
|||||||
var $total_ttc;
|
var $total_ttc;
|
||||||
var $info_bits;
|
var $info_bits;
|
||||||
var $special_code;
|
var $special_code;
|
||||||
|
var $date_start;
|
||||||
|
var $date_end;
|
||||||
|
|
||||||
// From llx_product
|
// From llx_product
|
||||||
var $libelle; // Label produit
|
var $libelle; // Label produit
|
||||||
@ -2061,7 +2067,8 @@ class CommandeFournisseurLigne
|
|||||||
$sql.= ' cd.remise, cd.remise_percent, cd.subprice,';
|
$sql.= ' cd.remise, cd.remise_percent, cd.subprice,';
|
||||||
$sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,';
|
$sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,';
|
||||||
$sql.= ' cd.total_localtax1, cd.total_localtax2,';
|
$sql.= ' cd.total_localtax1, cd.total_localtax2,';
|
||||||
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
|
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc,';
|
||||||
|
$sql.= ' cd.date_start, cd.date_end';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
||||||
$sql.= ' WHERE cd.rowid = '.$rowid;
|
$sql.= ' WHERE cd.rowid = '.$rowid;
|
||||||
@ -2092,6 +2099,9 @@ class CommandeFournisseurLigne
|
|||||||
$this->product_libelle = $objp->product_libelle;
|
$this->product_libelle = $objp->product_libelle;
|
||||||
$this->product_desc = $objp->product_desc;
|
$this->product_desc = $objp->product_desc;
|
||||||
|
|
||||||
|
$this->date_start = $this->db->jdate($objp->date_start);
|
||||||
|
$this->date_end = $this->db->jdate($objp->date_end);
|
||||||
|
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,6 +80,9 @@ $extrafields = new ExtraFields($db);
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
//Date prefix
|
||||||
|
$date_pf = '';
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
@ -191,6 +194,8 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
$predef='';
|
$predef='';
|
||||||
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
|
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
|
||||||
|
$date_start=dol_mktime(GETPOST('date_start'.$date_pf.'hour'), GETPOST('date_start'.$date_pf.'min'), 0, GETPOST('date_start'.$date_pf.'month'), GETPOST('date_start'.$date_pf.'day'), GETPOST('date_start'.$date_pf.'year'));
|
||||||
|
$date_end=dol_mktime(GETPOST('date_end'.$date_pf.'hour'), GETPOST('date_end'.$date_pf.'min'), 0, GETPOST('date_end'.$date_pf.'month'), GETPOST('date_end'.$date_pf.'day'), GETPOST('date_end'.$date_pf.'year'));
|
||||||
if (GETPOST('prod_entry_mode') == 'free')
|
if (GETPOST('prod_entry_mode') == 'free')
|
||||||
{
|
{
|
||||||
$idprod=0;
|
$idprod=0;
|
||||||
@ -276,7 +281,12 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
$productsupplier->fourn_ref,
|
$productsupplier->fourn_ref,
|
||||||
$remise_percent,
|
$remise_percent,
|
||||||
'HT',
|
'HT',
|
||||||
$type
|
$pu_ttc,
|
||||||
|
$type,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
$date_start,
|
||||||
|
$date_end
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($idprod == -2 || $idprod == 0)
|
if ($idprod == -2 || $idprod == 0)
|
||||||
@ -314,14 +324,14 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
{
|
{
|
||||||
$price_base_type = 'HT';
|
$price_base_type = 'HT';
|
||||||
$ht = price2num($_POST['price_ht']);
|
$ht = price2num($_POST['price_ht']);
|
||||||
$result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, 0, $type);
|
$result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, 0, $type,'','', $date_start, $date_end);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ttc = price2num($_POST['price_ttc']);
|
$ttc = price2num($_POST['price_ttc']);
|
||||||
$ht = $ttc / (1 + ($tauxtva / 100));
|
$ht = $ttc / (1 + ($tauxtva / 100));
|
||||||
$price_base_type = 'HT';
|
$price_base_type = 'HT';
|
||||||
$result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type);
|
$result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,6 +403,9 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
|
|||||||
if (!$res) dol_print_error($db);
|
if (!$res) dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$date_start=dol_mktime(GETPOST('date_start'.$date_pf.'hour'), GETPOST('date_start'.$date_pf.'min'), 0, GETPOST('date_start'.$date_pf.'month'), GETPOST('date_start'.$date_pf.'day'), GETPOST('date_start'.$date_pf.'year'));
|
||||||
|
$date_end=dol_mktime(GETPOST('date_end'.$date_pf.'hour'), GETPOST('date_end'.$date_pf.'min'), 0, GETPOST('date_end'.$date_pf.'month'), GETPOST('date_end'.$date_pf.'day'), GETPOST('date_end'.$date_pf.'year'));
|
||||||
|
|
||||||
$localtax1_tx=get_localtax($_POST['tva_tx'],1,$mysoc,$object->thirdparty);
|
$localtax1_tx=get_localtax($_POST['tva_tx'],1,$mysoc,$object->thirdparty);
|
||||||
$localtax2_tx=get_localtax($_POST['tva_tx'],2,$mysoc,$object->thirdparty);
|
$localtax2_tx=get_localtax($_POST['tva_tx'],2,$mysoc,$object->thirdparty);
|
||||||
|
|
||||||
@ -407,7 +420,10 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
|
|||||||
$localtax2_tx,
|
$localtax2_tx,
|
||||||
'HT',
|
'HT',
|
||||||
0,
|
0,
|
||||||
isset($_POST["type"])?$_POST["type"]:$line->product_type
|
isset($_POST["type"])?$_POST["type"]:$line->product_type,
|
||||||
|
false,
|
||||||
|
$date_start,
|
||||||
|
$date_end
|
||||||
);
|
);
|
||||||
unset($_POST['qty']);
|
unset($_POST['qty']);
|
||||||
unset($_POST['type']);
|
unset($_POST['type']);
|
||||||
@ -417,6 +433,8 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
|
|||||||
unset($_POST['np_desc']);
|
unset($_POST['np_desc']);
|
||||||
unset($_POST['pu']);
|
unset($_POST['pu']);
|
||||||
unset($_POST['tva_tx']);
|
unset($_POST['tva_tx']);
|
||||||
|
unset($_POST['date_start']);
|
||||||
|
unset($_POST['date_end']);
|
||||||
unset($localtax1_tx);
|
unset($localtax1_tx);
|
||||||
unset($localtax2_tx);
|
unset($localtax2_tx);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
@ -1745,6 +1763,12 @@ elseif (! empty($object->id))
|
|||||||
$doleditor=new DolEditor('eldesc',$line->description,'',200,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
|
$doleditor=new DolEditor('eldesc',$line->description,'',200,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
|
||||||
|
print $form->select_date($date_start,'date_start'.$date_pf,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,'');
|
||||||
|
print ' '.$langs->trans('to').' ';
|
||||||
|
print $form->select_date($date_end,'date_end'.$date_pf,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,'');
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->load_tva('tva_tx',$line->tva_tx,$object->thirdparty,$mysoc);
|
print $form->load_tva('tva_tx',$line->tva_tx,$object->thirdparty,$mysoc);
|
||||||
|
|||||||
@ -466,7 +466,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
header('Location: '.DOL_URL_ROOT.'/product/liste.php?delprod='.urlencode($object->ref));
|
header('Location: '.DOL_URL_ROOT.'/product/liste.php?type='.$object->type.'&delprod='.urlencode($object->ref));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -85,7 +86,7 @@ if (! empty($tag) && ($unsuscrib=='1'))
|
|||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
|
|
||||||
//Update status communication of contact prospect
|
//Update status communication of contact prospect
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET no_email=1 WHERE rowid IN (SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$db->escape($tag)."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET no_email=1 WHERE rowid IN (SELECT sc.rowid FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$db->escape($tag)."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
|
||||||
dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe contact : ".$sql, LOG_DEBUG);
|
dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe contact : ".$sql, LOG_DEBUG);
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/product/ajax/products.php
|
* \file htdocs/product/ajax/company.php
|
||||||
* \brief File to return Ajax response on product list request
|
* \brief File to return Ajax response on product list request
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -586,6 +586,10 @@ div.login {
|
|||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#securitycode {
|
||||||
|
min-width: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
img.login, img.printer, img.entity {
|
img.login, img.printer, img.entity {
|
||||||
margin:2px 0px 0px 0px;
|
margin:2px 0px 0px 0px;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
|
|||||||
@ -552,6 +552,9 @@ form#login {
|
|||||||
background-image: -ms-linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
background-image: -ms-linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
||||||
background-image: linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
background-image: linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
||||||
}
|
}
|
||||||
|
#securitycode {
|
||||||
|
min-width: 60px;
|
||||||
|
}
|
||||||
#img_securitycode {
|
#img_securitycode {
|
||||||
border: 1px solid #DDDDDD;
|
border: 1px solid #DDDDDD;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -578,6 +578,9 @@ form#login {
|
|||||||
background-image: -ms-linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
background-image: -ms-linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
||||||
background-image: linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
background-image: linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
||||||
}
|
}
|
||||||
|
#securitycode {
|
||||||
|
min-width: 60px;
|
||||||
|
}
|
||||||
#img_securitycode {
|
#img_securitycode {
|
||||||
border: 1px solid #DDDDDD;
|
border: 1px solid #DDDDDD;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -651,6 +651,9 @@ form#login {
|
|||||||
background-image: -ms-linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
background-image: -ms-linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
||||||
background-image: linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
background-image: linear-gradient(top, rgba(240,240,240,.3) 0%, rgba(192,192,192,.3) 100%);
|
||||||
}
|
}
|
||||||
|
#securitycode {
|
||||||
|
min-width: 60px;
|
||||||
|
}
|
||||||
#img_securitycode {
|
#img_securitycode {
|
||||||
border: 1px solid #DDDDDD;
|
border: 1px solid #DDDDDD;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -861,6 +861,9 @@ div#login_left, div#login_right {
|
|||||||
table.login_table tr td table.none tr td {
|
table.login_table tr td table.none tr td {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
#securitycode {
|
||||||
|
min-width: 60px;
|
||||||
|
}
|
||||||
#img_securitycode {
|
#img_securitycode {
|
||||||
border: 1px solid #DDDDDD;
|
border: 1px solid #DDDDDD;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,9 +105,8 @@ $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) .
|
|||||||
$description = $langs->trans("DescThirdPartyReport");
|
$description = $langs->trans("DescThirdPartyReport");
|
||||||
$builddate = time();
|
$builddate = time();
|
||||||
|
|
||||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
|
$moreparam=array('action' => '');
|
||||||
'action' => ''
|
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam);
|
||||||
));
|
|
||||||
|
|
||||||
print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';
|
print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user