Merge remote-tracking branch 'Upstream/develop' into 5.0-p1
This commit is contained in:
commit
31a895dddc
@ -132,6 +132,7 @@ NEW: Use ellipsis truncation on too large left menu text
|
|||||||
NEW: When a new field to show into lists is selected, the form is automatically submited and field added.
|
NEW: When a new field to show into lists is selected, the form is automatically submited and field added.
|
||||||
NEW: When creating a template invoice from a draft invoice, if there is link to contract on draft invoice, link is kept on template invoice.
|
NEW: When creating a template invoice from a draft invoice, if there is link to contract on draft invoice, link is kept on template invoice.
|
||||||
NEW: When emailing is not sent completely, show progression.
|
NEW: When emailing is not sent completely, show progression.
|
||||||
|
NEW: Add entity field in llx_societe_remise_except and llx_societe_remise
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
NEW: Add a css class style called 'reposition', so when clicking on a link with this class will move scrollbarr to be placed at same page location.
|
NEW: Add a css class style called 'reposition', so when clicking on a link with this class will move scrollbarr to be placed at same page location.
|
||||||
|
|||||||
@ -25,7 +25,7 @@ OpenSuse, Mandriva ou Mageia).
|
|||||||
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
|
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
|
||||||
https://www.dolibarr.org/
|
https://www.dolibarr.org/
|
||||||
|
|
||||||
Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (Mysql),
|
Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (MariaDb/MySql/PostgreSql),
|
||||||
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
||||||
|
|
||||||
- Copier le répertoire "dolibarr" et son contenu dans la racine de votre serveur
|
- Copier le répertoire "dolibarr" et son contenu dans la racine de votre serveur
|
||||||
@ -117,8 +117,8 @@ Voir fichier ChangeLog.
|
|||||||
- Application simple à utiliser.
|
- Application simple à utiliser.
|
||||||
- Plusieurs thèmes visuels.
|
- Plusieurs thèmes visuels.
|
||||||
- Code simple et facilement personnalisable.
|
- Code simple et facilement personnalisable.
|
||||||
- Requiert PHP et Mysql ou Postgresql (Voir versions exactes sur http://wiki.dolibarr.org/index.php/Prérequis).
|
- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur http://wiki.dolibarr.org/index.php/Prérequis).
|
||||||
- Compatible avec toutes les offres Cloud du marché respectant les prérequis MySQL et PHP ou Postgresql.
|
- Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP.
|
||||||
- Export PDF de tous les éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
|
- Export PDF de tous les éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM
|
|||||||
|
|
||||||
### Advanced setup
|
### Advanced setup
|
||||||
|
|
||||||
You can use a Web server and a supported database (MySQL recommended) to install the standard version.
|
You can use a Web server and a supported database (MariaDb, MySql or Postgresql) to install the standard version.
|
||||||
|
|
||||||
- Uncompress the downloaded archive
|
- Uncompress the downloaded archive
|
||||||
- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator)
|
- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator)
|
||||||
@ -119,7 +119,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Can manage several currencies by adding external module multi-currency.
|
- Can manage several currencies by adding external module multi-currency.
|
||||||
- Very user friendly and easy to use
|
- Very user friendly and easy to use
|
||||||
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
||||||
- Works with PHP 5.3+ and MySQL 4.1+ or PostgreSQL 8.1. (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite))
|
- Works with PHP 5.3+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite))
|
||||||
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites.
|
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites.
|
||||||
- An easy to understand, maintain and code interfaces with your own information system (PHP with no heavy framework; trigger and hook architecture)
|
- An easy to understand, maintain and code interfaces with your own information system (PHP with no heavy framework; trigger and hook architecture)
|
||||||
- Support for country specific features:
|
- Support for country specific features:
|
||||||
|
|||||||
@ -69,10 +69,10 @@ if ($action == 'add') {
|
|||||||
$account_number = clean_account(GETPOST('account_number'));
|
$account_number = clean_account(GETPOST('account_number'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('account_category') <= 0) {
|
if (GETPOST('account_parent') <= 0) {
|
||||||
$account_parent = '';
|
$account_parent = 0;
|
||||||
} else {
|
} else {
|
||||||
$account_parent = GETPOST('account_category','int');
|
$account_parent = GETPOST('account_parent','int');
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->fk_pcg_version = $obj->pcg_version;
|
$object->fk_pcg_version = $obj->pcg_version;
|
||||||
@ -98,7 +98,7 @@ if ($action == 'add') {
|
|||||||
header("Location: account.php");
|
header("Location: account.php");
|
||||||
exit;
|
exit;
|
||||||
} else if ($action == 'edit') {
|
} else if ($action == 'edit') {
|
||||||
if (! GETPOST('cancel', 'alpha')) {
|
if (! $cancel) {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
||||||
@ -119,10 +119,10 @@ if ($action == 'add') {
|
|||||||
$account_number = clean_account(GETPOST('account_number'));
|
$account_number = clean_account(GETPOST('account_number'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('account_category') <= 0) {
|
if (GETPOST('account_parent') <= 0) {
|
||||||
$account_parent = '';
|
$account_parent = 0;
|
||||||
} else {
|
} else {
|
||||||
$account_parent = GETPOST('account_category','int');
|
$account_parent = GETPOST('account_parent','int');
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->fk_pcg_version = $obj->pcg_version;
|
$object->fk_pcg_version = $obj->pcg_version;
|
||||||
@ -165,7 +165,9 @@ if ($action == 'add') {
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
llxheader('', $langs->trans('AccountAccounting'));
|
$title = $langs->trans('AccountAccounting') ." - ". $langs->trans('Card');
|
||||||
|
$helpurl = '';
|
||||||
|
llxheader('', $title, $helpurl);
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$htmlacc = new FormVentilation($db);
|
$htmlacc = new FormVentilation($db);
|
||||||
@ -184,7 +186,7 @@ if ($action == 'create') {
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||||
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
|
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
@ -247,7 +249,7 @@ if ($action == 'create') {
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||||
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
|
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
@ -299,7 +301,7 @@ if ($action == 'create') {
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
print '<tr><td class="titlefield">' . $langs->trans("AccountNumber") . '</td>';
|
||||||
print '<td>' . $object->account_number . '</td>';
|
print '<td>' . $object->account_number . '</td>';
|
||||||
print '<td align="right" width="25%">' . $linkback . '</td></tr>';
|
print '<td align="right" width="25%">' . $linkback . '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,9 @@ if ($action == 'update') {
|
|||||||
if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
|
if ($modelcsv==AccountancyExport::$EXPORT_TYPE_QUADRATUS || $modelcsv==AccountancyExport::$EXPORT_TYPE_CIEL) {
|
||||||
|
dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', 'txt', 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,6 +168,18 @@ if ($action == 'setmanagezero') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'setdisabledirectinput') {
|
||||||
|
$setdisabledirectinput = GETPOST('value', 'int');
|
||||||
|
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
||||||
|
if (! $res > 0)
|
||||||
|
$error ++;
|
||||||
|
if (! $error) {
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -342,6 +354,20 @@ if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = ! $var;
|
||||||
|
print "<tr " . $bc[$var] . ">";
|
||||||
|
print '<td width="80%">' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||||
|
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||||
|
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@ -295,6 +295,8 @@ class AccountancyExport
|
|||||||
public function exportCiel(&$TData) {
|
public function exportCiel(&$TData) {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
$this->end_line ="\r\n";
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
|
$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
|
||||||
foreach ( $TData as $data ) {
|
foreach ( $TData as $data ) {
|
||||||
@ -333,6 +335,8 @@ class AccountancyExport
|
|||||||
public function exportQuadratus(&$TData) {
|
public function exportQuadratus(&$TData) {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
$this->end_line ="\r\n";
|
||||||
|
|
||||||
$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||||
foreach ( $TData as $data ) {
|
foreach ( $TData as $data ) {
|
||||||
$code_compta = $data->numero_compte;
|
$code_compta = $data->numero_compte;
|
||||||
|
|||||||
@ -62,12 +62,12 @@ if ($action == 'validatehistory') {
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
if ($db->type == 'pgsql') {
|
if ($db->type == 'pgsql') {
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
||||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
$sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
|
||||||
} else {
|
} else {
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
||||||
@ -196,11 +196,10 @@ $sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
|||||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
while ( $i < $num ) {
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
$row = $db->fetch_row($resql);
|
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||||
print '<td align="left">' . $row[1] . '</td>';
|
print '<td align="left">' . $row[1] . '</td>';
|
||||||
@ -210,7 +209,6 @@ if ($resql) {
|
|||||||
print '<td align="right">' . price($row[13]) . '</td>';
|
print '<td align="right">' . price($row[13]) . '</td>';
|
||||||
print '<td align="right"><b>' . price($row[14]) . '</b></td>';
|
print '<td align="right"><b>' . price($row[14]) . '</b></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i ++;
|
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
@ -246,9 +244,7 @@ if ($resql) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
while ( $i < $num ) {
|
while ($row = $db->fetch_row($resql)) {
|
||||||
$row = $db->fetch_row($resql);
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
@ -272,11 +268,11 @@ if (! empty($conf->margin->enabled)) {
|
|||||||
}
|
}
|
||||||
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Marge',";
|
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
}
|
}
|
||||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as 'Total'";
|
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
@ -289,11 +285,9 @@ if (! empty($conf->margin->enabled)) {
|
|||||||
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
while ( $i < $num ) {
|
while ($row = $db->fetch_row($resql)) {
|
||||||
$row = $db->fetch_row($resql);
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
@ -301,7 +295,6 @@ if (! empty($conf->margin->enabled)) {
|
|||||||
}
|
}
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i ++;
|
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -185,7 +185,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product
|
|||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||||
$sql .= " WHERE f.fk_statut > 0";
|
$sql .= " WHERE f.fk_statut > 0";
|
||||||
$sql .= " AND fk_code_ventilation <= 0";
|
$sql .= " AND l.fk_code_ventilation <= 0";
|
||||||
$sql .= " AND product_type <= 2";
|
$sql .= " AND product_type <= 2";
|
||||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
|
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
|
||||||
|
|
||||||
@ -307,6 +307,7 @@ if ($result) {
|
|||||||
// Ref Invoice
|
// Ref Invoice
|
||||||
$facture_static->ref = $objp->facnumber;
|
$facture_static->ref = $objp->facnumber;
|
||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->facid;
|
||||||
|
$facture_static->type = $objp->ftype;
|
||||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||||
// Ref Product
|
// Ref Product
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
|
|||||||
@ -425,7 +425,7 @@ if ($action == 'export_csv') {
|
|||||||
'action' => ''
|
'action' => ''
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 || $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabeld="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabeld="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||||
|
|||||||
@ -443,7 +443,7 @@ if ($action == 'export_csv') {
|
|||||||
'action' => ''
|
'action' => ''
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 || $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabeld="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabeld="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||||
|
|||||||
@ -60,12 +60,12 @@ if ($action == 'validatehistory') {
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
if ($db->type == 'pgsql') {
|
if ($db->type == 'pgsql') {
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
||||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
$sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0";
|
||||||
} else {
|
} else {
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
||||||
@ -154,35 +154,17 @@ $var = true;
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="200" align="left">' . $langs->trans("Account") . '</td>';
|
print '<tr class="liste_titre"><td width="200" align="left">' . $langs->trans("Account") . '</td>';
|
||||||
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
|
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
print '<td width="60" align="center">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>';
|
}
|
||||||
print '<td width="60" align="center">' . $langs->trans("AprilMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("MayMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("JuneMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("JulyMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("AugustMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("SeptemberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("OctoberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("NovemberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("DecemberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
$sql = "SELECT IF(aa.account_number IS NULL, 'Non pointe', aa.account_number) AS 'code comptable',";
|
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||||
$sql .= " IF(aa.label IS NULL, 'Non pointe', aa.label) AS 'Intitulé',";
|
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=1,ffd.total_ht,0)),2) AS 'Janvier',";
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=2,ffd.total_ht,0)),2) AS 'Fevrier',";
|
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=3,ffd.total_ht,0)),2) AS 'Mars',";
|
}
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=4,ffd.total_ht,0)),2) AS 'Avril',";
|
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=5,ffd.total_ht,0)),2) AS 'Mai',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=6,ffd.total_ht,0)),2) AS 'Juin',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=7,ffd.total_ht,0)),2) AS 'Juillet',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=8,ffd.total_ht,0)),2) AS 'Aout',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=9,ffd.total_ht,0)),2) AS 'Septembre',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=10,ffd.total_ht,0)),2) AS 'Octobre',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=11,ffd.total_ht,0)),2) AS 'Novembre',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=12,ffd.total_ht,0)),2) AS 'Decembre',";
|
|
||||||
$sql .= " ROUND(SUM(ffd.total_ht),2) as 'Total'";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation";
|
||||||
@ -194,35 +176,24 @@ if (! empty($conf->multicompany->enabled)) {
|
|||||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 1) . ")";
|
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 1) . ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " GROUP BY ffd.fk_code_ventilation";
|
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
while ( $i < $num ) {
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||||
print '<td align="left">' . $row[1] . '</td>';
|
print '<td align="left">' . $row[1] . '</td>';
|
||||||
print '<td align="right">' . price($row[2]) . '</td>';
|
for($i = 2; $i <= 12; $i ++) {
|
||||||
print '<td align="right">' . price($row[3]) . '</td>';
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
print '<td align="right">' . price($row[4]) . '</td>';
|
}
|
||||||
print '<td align="right">' . price($row[5]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[6]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[7]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[8]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[9]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[10]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[11]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[12]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[13]) . '</td>';
|
print '<td align="right">' . price($row[13]) . '</td>';
|
||||||
print '<td align="right"><b>' . price($row[14]) . '</b></td>';
|
print '<td align="right"><b>' . price($row[14]) . '</b></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i ++;
|
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
@ -233,34 +204,16 @@ print "</table>\n";
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
print '<td width="60" align="center">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>';
|
}
|
||||||
print '<td width="60" align="center">' . $langs->trans("AprilMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("MayMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("JuneMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("JulyMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("AugustMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("SeptemberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("OctoberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("NovemberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center">' . $langs->trans("DecemberMin") . '</td>';
|
|
||||||
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS 'Total',";
|
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=1,ffd.total_ht,0)),2) AS 'Janvier',";
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=2,ffd.total_ht,0)),2) AS 'Fevrier',";
|
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=3,ffd.total_ht,0)),2) AS 'Mars',";
|
}
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=4,ffd.total_ht,0)),2) AS 'Avril',";
|
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=5,ffd.total_ht,0)),2) AS 'Mai',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=6,ffd.total_ht,0)),2) AS 'Juin',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=7,ffd.total_ht,0)),2) AS 'Juillet',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=8,ffd.total_ht,0)),2) AS 'Aout',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=9,ffd.total_ht,0)),2) AS 'Septembre',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=10,ffd.total_ht,0)),2) AS 'Octobre',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=11,ffd.total_ht,0)),2) AS 'Novembre',";
|
|
||||||
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=12,ffd.total_ht,0)),2) AS 'Decembre',";
|
|
||||||
$sql .= " ROUND(SUM(ffd.total_ht),2) as 'Total'";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
@ -274,29 +227,17 @@ if (! empty($conf->multicompany->enabled)) {
|
|||||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
while ( $i < $num ) {
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
$row = $db->fetch_row($resql);
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
print '<td align="right">' . $row[1] . '</td>';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print '<td align="right">' . price($row[2]) . '</td>';
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
print '<td align="right">' . price($row[3]) . '</td>';
|
}
|
||||||
print '<td align="right">' . price($row[4]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[5]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[6]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[7]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[8]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[9]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[10]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[11]) . '</td>';
|
|
||||||
print '<td align="right">' . price($row[12]) . '</td>';
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i ++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|||||||
@ -215,6 +215,7 @@ if ($search_ref)
|
|||||||
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
|
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
|
||||||
else $sql.=" AND 1 = 2"; // Always wrong
|
else $sql.=" AND 1 = 2"; // Always wrong
|
||||||
}
|
}
|
||||||
|
if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname);
|
||||||
if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
|
if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
|
||||||
if ($search_login) $sql.= natural_search("d.login", $search_login);
|
if ($search_login) $sql.= natural_search("d.login", $search_login);
|
||||||
if ($search_email) $sql.= natural_search("d.email", $search_email);
|
if ($search_email) $sql.= natural_search("d.email", $search_email);
|
||||||
@ -421,7 +422,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['d.firstname']['checked']))
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" name="search_ref" value="'.$search_firstname.'" size="6"></td>';
|
print '<input class="flat" type="text" name="search_firstname" value="'.$search_firstname.'" size="6"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['d.lastname']['checked']))
|
if (! empty($arrayfields['d.lastname']['checked']))
|
||||||
@ -611,13 +612,6 @@ if ($resql)
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print $memberstatic->getNomUrl(1);
|
print $memberstatic->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
|
||||||
// Lastname
|
|
||||||
if (! empty($arrayfields['d.lastname']['checked']))
|
|
||||||
{
|
|
||||||
print "<td>";
|
|
||||||
print $obj->lastname;
|
|
||||||
print "</td>\n";
|
|
||||||
}
|
}
|
||||||
// Firstname
|
// Firstname
|
||||||
if (! empty($arrayfields['d.firstname']['checked']))
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
@ -625,6 +619,13 @@ if ($resql)
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->firstname;
|
print $obj->firstname;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
}
|
||||||
|
// Lastname
|
||||||
|
if (! empty($arrayfields['d.lastname']['checked']))
|
||||||
|
{
|
||||||
|
print "<td>";
|
||||||
|
print $obj->lastname;
|
||||||
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
// Company
|
// Company
|
||||||
if (! empty($arrayfields['d.company']['checked']))
|
if (! empty($arrayfields['d.company']['checked']))
|
||||||
|
|||||||
@ -172,7 +172,7 @@ if ($action == 'edit') // Edit
|
|||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Multilangual GUI
|
// Multilingual GUI
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||||
print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
|
print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
|
||||||
@ -186,7 +186,7 @@ if ($action == 'edit') // Edit
|
|||||||
show_theme(null,1);
|
show_theme(null,1);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Liste des zone de recherche permanantes supportees
|
// List of permanent supported search box
|
||||||
if (! empty($searchform))
|
if (! empty($searchform))
|
||||||
{
|
{
|
||||||
print '<table summary="search" class="noborder" width="100%">';
|
print '<table summary="search" class="noborder" width="100%">';
|
||||||
|
|||||||
@ -40,6 +40,17 @@ $langcode=GETPOST('langcode','alpha');
|
|||||||
$transkey=GETPOST('transkey','alpha');
|
$transkey=GETPOST('transkey','alpha');
|
||||||
$transvalue=GETPOST('transvalue','alpha');
|
$transvalue=GETPOST('transvalue','alpha');
|
||||||
|
|
||||||
|
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||||
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
|
$page = GETPOST("page",'int');
|
||||||
|
if ($page == -1) { $page = 0; }
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (! $sortfield) $sortfield='lang,transkey';
|
||||||
|
if (! $sortorder) $sortorder='ASC';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -62,7 +73,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
|||||||
}
|
}
|
||||||
if ($transvalue == '')
|
if ($transvalue == '')
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Value")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -119,28 +130,84 @@ print $langs->trans("TranslationDesc")."<br>\n";
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print $langs->trans("CurrentUserLanguage").': <strong>'.$langs->defaultlang.'</strong><br>';
|
print $langs->trans("CurrentUserLanguage").': <strong>'.$langs->defaultlang.'</strong><br>';
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print img_info().' '.$langs->trans("SomeTranslationAreUncomplete").'<br>';
|
|
||||||
$urlwikitranslatordoc='http://wiki.dolibarr.org/index.php/Translator_documentation';
|
|
||||||
print $langs->trans("SeeAlso").': <a href="'.$urlwikitranslatordoc.'" target="_blank">'.$urlwikitranslatordoc.'</a><br>';
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print $langs->trans("TranslationOverwriteDesc",$langs->transnoentitiesnoconv("Language"),$langs->transnoentitiesnoconv("Key"),$langs->transnoentitiesnoconv("Value"))."<br>\n";
|
print img_info().' '.$langs->trans("SomeTranslationAreUncomplete");
|
||||||
|
$urlwikitranslatordoc='https://wiki.dolibarr.org/index.php/Translator_documentation';
|
||||||
|
print ' ('.$langs->trans("SeeAlso").': <a href="'.$urlwikitranslatordoc.'" target="_blank">'.$urlwikitranslatordoc.'</a>)<br>';
|
||||||
|
print $langs->trans("TranslationOverwriteDesc",$langs->transnoentitiesnoconv("Language"),$langs->transnoentitiesnoconv("Key"),$langs->transnoentitiesnoconv("NewTranslationStringToShow"))."<br>\n";
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
$param='';
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
|
||||||
|
{
|
||||||
|
print '<br>';
|
||||||
|
print load_fiche_titre($langs->trans("TranslationKeySearch"), '', '')."\n";
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" id="action" name="action" value="">';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Language").' (en_US, es_MX, ...)</td>';
|
||||||
|
print '<td>'.$langs->trans("Key").'</td>';
|
||||||
|
print '<td>'.$langs->trans("TranslationString").'</td>';
|
||||||
|
if (! empty($conf->multicompany->enabled) && !$user->entity) print '<td>'.$langs->trans("Entity").'</td>';
|
||||||
|
print '<td align="center"></td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Line to search new record
|
||||||
|
$var=false;
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
print '<tr '.$bc[$var].'><td>';
|
||||||
|
print $formadmin->select_language(GETPOST('langcodesearch'),'langcodesearch',0,null,1,0,0,'',1);
|
||||||
|
//print '<input type="text" class="flat" size="24" name="langcode" value="'.GETPOST('langcode').'">';
|
||||||
|
print '</td>'."\n";
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="text" class="flat maxwidthonsmartphone" name="transkeysearch" value="">';
|
||||||
|
print '</td><td>';
|
||||||
|
print '<input type="text" class="quatrevingtpercent" name="transvaluesearch" value="">';
|
||||||
|
print '</td>';
|
||||||
|
// Limit to superadmin
|
||||||
|
if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="text" class="flat" size="1" name="entitysearch" value="'.$conf->entity.'">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
print '<input type="hidden" name="entitysearch" value="'.$conf->entity.'">';
|
||||||
|
}
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Search").'" name="search">';
|
||||||
|
print "</td>\n";
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("TranslationOverwriteKey"), '', '')."\n";
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" id="action" name="action" value="">';
|
print '<input type="hidden" id="action" name="action" value="">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Language").' (en_US, es_MX, ...)</td>';
|
print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder);
|
||||||
print '<td>'.$langs->trans("Key").'</td>';
|
print_liste_field_titre($langs->trans("Key"),$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder);
|
||||||
print '<td>'.$langs->trans("Value").'</td>';
|
print_liste_field_titre($langs->trans("NewTranslationStringToShow"),$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($conf->multicompany->enabled) && !$user->entity) print '<td>'.$langs->trans("Entity").'</td>';
|
if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);
|
||||||
print '<td align="center"></td>';
|
print '<td align="center"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -154,9 +221,9 @@ print $formadmin->select_language(GETPOST('langcode'),'langcode',0,null,1,0,0,''
|
|||||||
//print '<input type="text" class="flat" size="24" name="langcode" value="'.GETPOST('langcode').'">';
|
//print '<input type="text" class="flat" size="24" name="langcode" value="'.GETPOST('langcode').'">';
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" class="flat" size="30" name="transkey" value="">';
|
print '<input type="text" class="flat maxwidthonsmartphone" name="transkey" value="">';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input type="text" class="flat" size="40" name="transvalue" value="">';
|
print '<input type="text" class="quatrevingtpercent" name="transvalue" value="">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Limit to superadmin
|
// Limit to superadmin
|
||||||
if (! empty($conf->multicompany->enabled) && !$user->entity)
|
if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||||
@ -182,7 +249,6 @@ $sql.= " rowid";
|
|||||||
$sql.= ", lang";
|
$sql.= ", lang";
|
||||||
$sql.= ", transkey";
|
$sql.= ", transkey";
|
||||||
$sql.= ", transvalue";
|
$sql.= ", transvalue";
|
||||||
//$sql.= ", entity";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
|
$sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
|
||||||
$sql.= " WHERE 1 = 1";
|
$sql.= " WHERE 1 = 1";
|
||||||
//$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")";
|
//$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")";
|
||||||
@ -190,7 +256,7 @@ $sql.= " WHERE 1 = 1";
|
|||||||
//else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
//else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||||
//if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
|
//if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
|
||||||
//$sql.= " ORDER BY entity, name ASC";
|
//$sql.= " ORDER BY entity, name ASC";
|
||||||
$sql.= " ORDER BY lang ASC, transkey ASC";
|
$sql.= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
dol_syslog("translation::select from table", LOG_DEBUG);
|
dol_syslog("translation::select from table", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -58,6 +58,7 @@ if ($origin)
|
|||||||
if ($type == Categorie::TYPE_CUSTOMER) $idCompanyOrigin = $origin;
|
if ($type == Categorie::TYPE_CUSTOMER) $idCompanyOrigin = $origin;
|
||||||
if ($type == Categorie::TYPE_MEMBER) $idMemberOrigin = $origin;
|
if ($type == Categorie::TYPE_MEMBER) $idMemberOrigin = $origin;
|
||||||
if ($type == Categorie::TYPE_CONTACT) $idContactOrigin = $origin;
|
if ($type == Categorie::TYPE_CONTACT) $idContactOrigin = $origin;
|
||||||
|
if ($type == Categorie::TYPE_PROJECT) $idProjectOrigin = $origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($catorigin && $type == Categorie::TYPE_PRODUCT) $idCatOrigin = $catorigin;
|
if ($catorigin && $type == Categorie::TYPE_PRODUCT) $idCatOrigin = $catorigin;
|
||||||
@ -116,6 +117,11 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
|||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
else if ($idProjectOrigin)
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
||||||
@ -201,6 +207,11 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr
|
|||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&mesg='.urlencode($langs->trans("CatCreated")));
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
else if ($idProjectOrigin)
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$result.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$result.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
@ -215,7 +226,8 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("Categories"));
|
$helpurl='';
|
||||||
|
llxHeader("",$langs->trans("Categories"),$helpurl);
|
||||||
|
|
||||||
if ($user->rights->categorie->creer)
|
if ($user->rights->categorie->creer)
|
||||||
{
|
{
|
||||||
@ -244,7 +256,7 @@ if ($user->rights->categorie->creer)
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td width="20%" class="fieldrequired">'.$langs->trans("Ref").'</td><td><input id="label" class="flat" name="label" size="25" value="'.$label.'">';
|
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input id="label" class="flat" name="label" size="25" value="'.$label.'">';
|
||||||
print'</td></tr>';
|
print'</td></tr>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
|
|||||||
@ -88,6 +88,13 @@ if ($id || $ref)
|
|||||||
$dbtablename = 'socpeople&societe';
|
$dbtablename = 'socpeople&societe';
|
||||||
$fieldid = ! empty($ref)?'ref':'rowid';
|
$fieldid = ! empty($ref)?'ref':'rowid';
|
||||||
}
|
}
|
||||||
|
elseif ($type == Categorie::TYPE_PROJECT) {
|
||||||
|
$elementtype = 'project';
|
||||||
|
$objecttype = 'project';
|
||||||
|
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
|
||||||
|
$dbtablename = '&project';
|
||||||
|
$fieldid = ! empty($ref)?'ref':'rowid';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -145,6 +152,13 @@ if (empty($reshook))
|
|||||||
$result = $object->fetch($objectid);
|
$result = $object->fetch($objectid);
|
||||||
$elementtype = 'contact';
|
$elementtype = 'contact';
|
||||||
}
|
}
|
||||||
|
if ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
$object = new Project($db);
|
||||||
|
$result = $object->fetch($objectid);
|
||||||
|
$elementtype = 'project';
|
||||||
|
}
|
||||||
$cat = new Categorie($db);
|
$cat = new Categorie($db);
|
||||||
$result=$cat->fetch($removecat);
|
$result=$cat->fetch($removecat);
|
||||||
|
|
||||||
@ -192,6 +206,13 @@ if (empty($reshook))
|
|||||||
$result = $object->fetch($objectid);
|
$result = $object->fetch($objectid);
|
||||||
$elementtype = 'contact';
|
$elementtype = 'contact';
|
||||||
}
|
}
|
||||||
|
if ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
$object = new Project($db);
|
||||||
|
$result = $object->fetch($objectid);
|
||||||
|
$elementtype = 'project';
|
||||||
|
}
|
||||||
$cat = new Categorie($db);
|
$cat = new Categorie($db);
|
||||||
$result=$cat->fetch($parent);
|
$result=$cat->fetch($parent);
|
||||||
|
|
||||||
@ -607,6 +628,75 @@ else if ($id || $ref)
|
|||||||
|
|
||||||
formCategory($db,$object,4,$socid, $user->rights->societe->creer);
|
formCategory($db,$object,4,$socid, $user->rights->societe->creer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($type == Categorie::TYPE_PROJECT)
|
||||||
|
{
|
||||||
|
$langs->load("products");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Category card for product
|
||||||
|
*/
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|
||||||
|
// Product
|
||||||
|
$product = new Product($db);
|
||||||
|
$result = $product->fetch($id, $ref);
|
||||||
|
|
||||||
|
llxHeader("","",$langs->trans("Project"));
|
||||||
|
|
||||||
|
|
||||||
|
$head=project_prepare_head($product);
|
||||||
|
$titre=$langs->trans("Project");
|
||||||
|
$picto=($object->public?'projectpub':'project');
|
||||||
|
dol_fiche_head($head, 'category', $titre,0,$picto);
|
||||||
|
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||||
|
// Define a complementary filter for search of next/prev ref.
|
||||||
|
if (! $user->rights->projet->all->lire)
|
||||||
|
{
|
||||||
|
$objectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
|
||||||
|
$object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
|
||||||
|
}
|
||||||
|
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Label
|
||||||
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->title.'</td></tr>';
|
||||||
|
|
||||||
|
// Third party
|
||||||
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
|
if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project');
|
||||||
|
else print' ';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Visibility
|
||||||
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
|
if ($object->public) print $langs->trans('SharedProject');
|
||||||
|
else print $langs->trans('PrivateProject');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Statut
|
||||||
|
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
|
// Date start
|
||||||
|
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||||
|
print dol_print_date($object->date_start,'day');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Date end
|
||||||
|
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
||||||
|
print dol_print_date($object->date_end,'day');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
formCategory($db,$product,0,$socid,($user->rights->projet->creer));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -630,6 +720,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
|||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersProspectsCategoriesShort");
|
if ($typeid == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersProspectsCategoriesShort");
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoriesShort");
|
if ($typeid == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoriesShort");
|
||||||
if ($typeid == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
|
if ($typeid == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort");
|
||||||
|
|
||||||
$linktocreate='';
|
$linktocreate='';
|
||||||
if ($showclassifyform && $user->rights->categorie->creer)
|
if ($showclassifyform && $user->rights->categorie->creer)
|
||||||
@ -674,6 +765,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
|||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyIsInCustomersCategories");
|
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyIsInCustomersCategories");
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberIsInCategories");
|
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberIsInCategories");
|
||||||
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactIsInCategories");
|
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactIsInCategories");
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectIsInCategories");
|
||||||
print "\n";
|
print "\n";
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$title.':</td></tr>';
|
print '<tr class="liste_titre"><td colspan="2">'.$title.':</td></tr>';
|
||||||
@ -699,6 +791,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
|||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
if ($permission)
|
if ($permission)
|
||||||
{
|
{
|
||||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removecat=".$cat->id."'>";
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removecat=".$cat->id."'>";
|
||||||
@ -727,6 +820,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
|||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyHasNoCategory");
|
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyHasNoCategory");
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberHasNoCategory");
|
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberHasNoCategory");
|
||||||
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactHasNoCategory");
|
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactHasNoCategory");
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectHasNoCategory");
|
||||||
print $title;
|
print $title;
|
||||||
print "<br/>";
|
print "<br/>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,7 @@ class Categorie extends CommonObject
|
|||||||
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
|
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
|
||||||
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
|
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
|
||||||
const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
|
const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
|
||||||
|
const TYPE_PROJECT = 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array ID mapping from type string
|
* @var array ID mapping from type string
|
||||||
@ -64,6 +65,7 @@ class Categorie extends CommonObject
|
|||||||
'contact' => 4,
|
'contact' => 4,
|
||||||
'user' => 4,
|
'user' => 4,
|
||||||
'account' => 5,
|
'account' => 5,
|
||||||
|
'project' => 6,
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* @var array Foreign keys mapping from type string
|
* @var array Foreign keys mapping from type string
|
||||||
@ -78,6 +80,7 @@ class Categorie extends CommonObject
|
|||||||
'contact' => 'socpeople',
|
'contact' => 'socpeople',
|
||||||
'user' => 'user',
|
'user' => 'user',
|
||||||
'account' => 'account',
|
'account' => 'account',
|
||||||
|
'project' => 'project',
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* @var array Category tables mapping from type string
|
* @var array Category tables mapping from type string
|
||||||
@ -92,6 +95,7 @@ class Categorie extends CommonObject
|
|||||||
'contact' => 'contact',
|
'contact' => 'contact',
|
||||||
'user' => 'user',
|
'user' => 'user',
|
||||||
'account' => 'account',
|
'account' => 'account',
|
||||||
|
'project' => 'project',
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* @var array Object class mapping from type string
|
* @var array Object class mapping from type string
|
||||||
@ -106,6 +110,7 @@ class Categorie extends CommonObject
|
|||||||
'contact' => 'Contact',
|
'contact' => 'Contact',
|
||||||
'user' => 'User',
|
'user' => 'User',
|
||||||
'account' => 'Account',
|
'account' => 'Account',
|
||||||
|
'project' => 'Project',
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* @var array Object table mapping from type string
|
* @var array Object table mapping from type string
|
||||||
@ -120,6 +125,7 @@ class Categorie extends CommonObject
|
|||||||
'contact' => 'socpeople',
|
'contact' => 'socpeople',
|
||||||
'user' => 'user',
|
'user' => 'user',
|
||||||
'account' => 'bank_account',
|
'account' => 'bank_account',
|
||||||
|
'project' => 'projet',
|
||||||
);
|
);
|
||||||
|
|
||||||
public $element='category';
|
public $element='category';
|
||||||
@ -146,6 +152,7 @@ class Categorie extends CommonObject
|
|||||||
* @see Categorie::TYPE_CONTACT
|
* @see Categorie::TYPE_CONTACT
|
||||||
* @see Categorie::TYPE_USER
|
* @see Categorie::TYPE_USER
|
||||||
* @see Categorie::TYPE_ACCOUNT
|
* @see Categorie::TYPE_ACCOUNT
|
||||||
|
* @see Categorie::TYPE_PROJECT
|
||||||
*/
|
*/
|
||||||
var $type;
|
var $type;
|
||||||
|
|
||||||
@ -451,7 +458,7 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
/* FIX #1317 : Check for child cat and move up 1 level*/
|
/* FIX #1317 : Check for child category and move up 1 level*/
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
|
||||||
@ -514,6 +521,18 @@ class Categorie extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_project";
|
||||||
|
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||||
|
if (!$this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
|
||||||
|
|||||||
@ -54,6 +54,7 @@ elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCateg
|
|||||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoriesArea");
|
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoriesArea");
|
||||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactsCategoriesArea");
|
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactsCategoriesArea");
|
||||||
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesArea");
|
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesArea");
|
||||||
|
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesArea");
|
||||||
else $title=$langs->trans("CategoriesArea");
|
else $title=$langs->trans("CategoriesArea");
|
||||||
|
|
||||||
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
||||||
|
|||||||
@ -101,6 +101,7 @@ if ($object->id)
|
|||||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
||||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
||||||
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
|
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
|
||||||
|
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort");
|
||||||
else $title=$langs->trans("Category");
|
else $title=$langs->trans("Category");
|
||||||
|
|
||||||
$head = categories_prepare_head($object,$type);
|
$head = categories_prepare_head($object,$type);
|
||||||
|
|||||||
@ -152,6 +152,7 @@ elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCateg
|
|||||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
||||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
||||||
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
|
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
|
||||||
|
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort");
|
||||||
else $title=$langs->trans("Category");
|
else $title=$langs->trans("Category");
|
||||||
|
|
||||||
$head = categories_prepare_head($object,$type);
|
$head = categories_prepare_head($object,$type);
|
||||||
|
|||||||
@ -115,6 +115,13 @@ if ($id > 0 && $removeelem > 0)
|
|||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'account';
|
$elementtype = 'account';
|
||||||
}
|
}
|
||||||
|
else if ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
$tmpobject = new Project($db);
|
||||||
|
$result = $tmpobject->fetch($removeelem);
|
||||||
|
$elementtype = 'project';
|
||||||
|
}
|
||||||
|
|
||||||
$result=$object->del_type($tmpobject,$elementtype);
|
$result=$object->del_type($tmpobject,$elementtype);
|
||||||
if ($result < 0) dol_print_error('',$object->error);
|
if ($result < 0) dol_print_error('',$object->error);
|
||||||
@ -169,7 +176,8 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory'
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("Categories"));
|
$helpurl='';
|
||||||
|
llxHeader("",$langs->trans("Categories"),$helpurl);
|
||||||
|
|
||||||
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
|
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
|
||||||
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
|
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
|
||||||
@ -177,6 +185,7 @@ elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCateg
|
|||||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
||||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
||||||
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
|
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
|
||||||
|
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort");
|
||||||
else $title=$langs->trans("Category");
|
else $title=$langs->trans("Category");
|
||||||
|
|
||||||
$head = categories_prepare_head($object,$type);
|
$head = categories_prepare_head($object,$type);
|
||||||
@ -359,6 +368,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
|
|||||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
if ($permission)
|
if ($permission)
|
||||||
{
|
{
|
||||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$prod->id."'>";
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$prod->id."'>";
|
||||||
@ -409,6 +419,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
|
|||||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
if ($permission)
|
if ($permission)
|
||||||
{
|
{
|
||||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||||
@ -463,6 +474,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
|
|||||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
if ($permission)
|
if ($permission)
|
||||||
{
|
{
|
||||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||||
@ -518,6 +530,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
|||||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
if ($permission)
|
if ($permission)
|
||||||
{
|
{
|
||||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$member->id."'>";
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$member->id."'>";
|
||||||
@ -570,6 +583,7 @@ if($object->type == Categorie::TYPE_CONTACT)
|
|||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
if ($permission)
|
if ($permission)
|
||||||
{
|
{
|
||||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$contact->id."'>";
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$contact->id."'>";
|
||||||
@ -625,6 +639,7 @@ if ($object->type == Categorie::TYPE_ACCOUNT)
|
|||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
if ($typeid == Categorie::TYPE_ACCOUNT) $permission=$user->rights->banque->configurer;
|
if ($typeid == Categorie::TYPE_ACCOUNT) $permission=$user->rights->banque->configurer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
if ($permission)
|
if ($permission)
|
||||||
{
|
{
|
||||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$account->id."'>";
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$account->id."'>";
|
||||||
@ -642,6 +657,61 @@ if ($object->type == Categorie::TYPE_ACCOUNT)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of Project
|
||||||
|
if ($object->type == Categorie::TYPE_PROJECT)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|
||||||
|
$projects = $object->getObjectsInCateg("project");
|
||||||
|
if ($projects < 0)
|
||||||
|
{
|
||||||
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<br>";
|
||||||
|
print "<table class='noborder' width='100%'>\n";
|
||||||
|
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Project")."</td></tr>\n";
|
||||||
|
|
||||||
|
if (count($projects) > 0)
|
||||||
|
{
|
||||||
|
$var=true;
|
||||||
|
foreach ($projects as $key => $project)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "\t<tr ".$bc[$var].">\n";
|
||||||
|
print '<td class="nowrap" valign="top">';
|
||||||
|
print $project->getNomUrl(1,0);
|
||||||
|
print "</td>\n";
|
||||||
|
print '<td valign="top">'.$project->ref."</td>\n";
|
||||||
|
print '<td valign="top">'.$project->title."</td>\n";
|
||||||
|
// Link to delete from category
|
||||||
|
print '<td align="right">';
|
||||||
|
$typeid=$object->type;
|
||||||
|
$permission=0;
|
||||||
|
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||||
|
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||||
|
if ($typeid == Categorie::TYPE_ACCOUNT) $permission=$user->rights->banque->configurer;
|
||||||
|
if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
|
||||||
|
if ($permission)
|
||||||
|
{
|
||||||
|
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$project->id."'>";
|
||||||
|
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||||
|
print $langs->trans("DeleteFromCat")."</a>";
|
||||||
|
}
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr '.$bc[false].'><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoProject").'</td></tr>';
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -513,7 +513,7 @@ class ActionComm extends CommonObject
|
|||||||
$sql.= " a.fk_contact, a.percent as percentage,";
|
$sql.= " a.fk_contact, a.percent as percentage,";
|
||||||
$sql.= " a.fk_element, a.elementtype,";
|
$sql.= " a.fk_element, a.elementtype,";
|
||||||
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
|
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
|
||||||
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
|
$sql.= " c.id as type_id, c.code as type_code, c.libelle, c.color as type_color,";
|
||||||
$sql.= " s.nom as socname,";
|
$sql.= " s.nom as socname,";
|
||||||
$sql.= " u.firstname, u.lastname as lastname";
|
$sql.= " u.firstname, u.lastname as lastname";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a ";
|
||||||
@ -541,6 +541,7 @@ class ActionComm extends CommonObject
|
|||||||
// Properties of parent table llx_c_actioncomm (will be deprecated in future)
|
// Properties of parent table llx_c_actioncomm (will be deprecated in future)
|
||||||
$this->type_id = $obj->type_id;
|
$this->type_id = $obj->type_id;
|
||||||
$this->type_code = $obj->type_code;
|
$this->type_code = $obj->type_code;
|
||||||
|
$this->type_color = $obj->type_color;
|
||||||
$transcode=$langs->trans("Action".$obj->type_code);
|
$transcode=$langs->trans("Action".$obj->type_code);
|
||||||
$type_libelle=($transcode!="Action".$obj->type_code?$transcode:$obj->libelle);
|
$type_libelle=($transcode!="Action".$obj->type_code?$transcode:$obj->libelle);
|
||||||
$this->type = $type_libelle;
|
$this->type = $type_libelle;
|
||||||
@ -1109,7 +1110,11 @@ class ActionComm extends CommonObject
|
|||||||
if (! empty($this->location))
|
if (! empty($this->location))
|
||||||
$tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location;
|
$tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location;
|
||||||
|
|
||||||
$linkclose = ' class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">';
|
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
|
||||||
|
$linkclose = ' style="background-color:#'.$this->type_color.'" class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">';
|
||||||
|
else
|
||||||
|
$linkclose = ' class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">';
|
||||||
|
|
||||||
if (! is_object($hookmanager))
|
if (! is_object($hookmanager))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
|
|||||||
@ -440,7 +440,7 @@ $sql.= ' a.percent,';
|
|||||||
$sql.= ' a.fk_user_author,a.fk_user_action,';
|
$sql.= ' a.fk_user_author,a.fk_user_action,';
|
||||||
$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,';
|
$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,';
|
||||||
$sql.= ' a.fk_soc, a.fk_contact,';
|
$sql.= ' a.fk_soc, a.fk_contact,';
|
||||||
$sql.= ' ca.code as type_code, ca.libelle as type_label';
|
$sql.= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||||
// We must filter on resource table
|
// We must filter on resource table
|
||||||
@ -531,6 +531,8 @@ if ($resql)
|
|||||||
|
|
||||||
$event->type_code=$obj->type_code;
|
$event->type_code=$obj->type_code;
|
||||||
$event->type_label=$obj->type_label;
|
$event->type_label=$obj->type_label;
|
||||||
|
$event->type_color=$obj->type_color;
|
||||||
|
|
||||||
$event->libelle=$obj->label;
|
$event->libelle=$obj->label;
|
||||||
$event->percentage=$obj->percent;
|
$event->percentage=$obj->percent;
|
||||||
$event->authorid=$obj->fk_user_author; // user id of creator
|
$event->authorid=$obj->fk_user_author; // user id of creator
|
||||||
|
|||||||
@ -1082,7 +1082,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
else if ($action == 'setmulticurrencyrate' && $user->rights->propal->creer) {
|
else if ($action == 'setmulticurrencyrate' && $user->rights->propal->creer) {
|
||||||
$result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int'));
|
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// bank account
|
// bank account
|
||||||
@ -1266,6 +1266,8 @@ if ($action == 'create')
|
|||||||
if ($origin != 'project' && $originid) {
|
if ($origin != 'project' && $originid) {
|
||||||
print '<input type="hidden" name="origin" value="' . $origin . '">';
|
print '<input type="hidden" name="origin" value="' . $origin . '">';
|
||||||
print '<input type="hidden" name="originid" value="' . $originid . '">';
|
print '<input type="hidden" name="originid" value="' . $originid . '">';
|
||||||
|
} elseif ($origin == 'project' && !empty($projectid)) {
|
||||||
|
print '<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|||||||
@ -161,7 +161,8 @@ if ($socid > 0)
|
|||||||
$sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,";
|
$sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,";
|
||||||
$sql.= " u.login, u.rowid as user_id";
|
$sql.= " u.login, u.rowid as user_id";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE rc.fk_soc =". $object->id;
|
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
||||||
|
$sql.= " AND rc.entity = " . $conf->entity;
|
||||||
$sql.= " AND u.rowid = rc.fk_user_author";
|
$sql.= " AND u.rowid = rc.fk_user_author";
|
||||||
$sql.= " ORDER BY rc.datec DESC";
|
$sql.= " ORDER BY rc.datec DESC";
|
||||||
|
|
||||||
|
|||||||
@ -248,7 +248,8 @@ if ($socid > 0)
|
|||||||
$remise_all=$remise_user=0;
|
$remise_all=$remise_user=0;
|
||||||
$sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user";
|
$sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
||||||
$sql.= " WHERE rc.fk_soc =". $object->id;
|
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
||||||
|
$sql.= " AND rc.entity = " . $conf->entity;
|
||||||
$sql.= " AND (fk_facture_line IS NULL AND fk_facture IS NULL)";
|
$sql.= " AND (fk_facture_line IS NULL AND fk_facture IS NULL)";
|
||||||
$sql.= " GROUP BY rc.fk_user";
|
$sql.= " GROUP BY rc.fk_user";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
@ -327,7 +328,8 @@ if ($socid > 0)
|
|||||||
$sql.= " fa.facnumber as ref, fa.type as type";
|
$sql.= " fa.facnumber as ref, fa.type as type";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
|
||||||
$sql.= " WHERE rc.fk_soc =". $object->id;
|
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
||||||
|
$sql.= " AND rc.entity = " . $conf->entity;
|
||||||
$sql.= " AND u.rowid = rc.fk_user";
|
$sql.= " AND u.rowid = rc.fk_user";
|
||||||
$sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)";
|
$sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)";
|
||||||
$sql.= " ORDER BY rc.datec DESC";
|
$sql.= " ORDER BY rc.datec DESC";
|
||||||
|
|||||||
@ -376,7 +376,32 @@ if (empty($reshook))
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hooks
|
// Now we create same links to contact than the ones found on origin object
|
||||||
|
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
|
||||||
|
{
|
||||||
|
$originforcontact = $object->origin;
|
||||||
|
$originidforcontact = $object->origin_id;
|
||||||
|
if ($originforcontact == 'shipping') // shipment and order share the same contacts. If creating from shipment we take data of order
|
||||||
|
{
|
||||||
|
$originforcontact=$srcobject->origin;
|
||||||
|
$originidforcontact=$srcobject->origin_id;
|
||||||
|
}
|
||||||
|
$sqlcontact = "SELECT code, fk_socpeople FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as ctc";
|
||||||
|
$sqlcontact.= " WHERE element_id = ".$originidforcontact." AND ec.fk_c_type_contact = ctc.rowid AND ctc.element = '".$originforcontact."'";
|
||||||
|
|
||||||
|
$resqlcontact = $db->query($sqlcontact);
|
||||||
|
if ($resqlcontact)
|
||||||
|
{
|
||||||
|
while($objcontact = $db->fetch_object($resqlcontact))
|
||||||
|
{
|
||||||
|
//print $objcontact->code.'-'.$objcontact->fk_socpeople."\n";
|
||||||
|
$object->add_contact($objcontact->fk_socpeople, $objcontact->code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dol_print_error($resqlcontact);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hooks
|
||||||
$parameters = array('objFrom' => $srcobject);
|
$parameters = array('objFrom' => $srcobject);
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
@ -508,7 +533,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
else if ($action == 'setmulticurrencyrate' && $user->rights->commande->creer) {
|
else if ($action == 'setmulticurrencyrate' && $user->rights->commande->creer) {
|
||||||
$result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int'));
|
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setavailability' && $user->rights->commande->creer) {
|
else if ($action == 'setavailability' && $user->rights->commande->creer) {
|
||||||
|
|||||||
@ -366,16 +366,11 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
|
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
|
||||||
{
|
{
|
||||||
if (empty($conf->accounting->enabled))
|
if ($user->rights->banque->modifier) {
|
||||||
{
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&id='.$object->id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'</a>';
|
||||||
if ($user->rights->banque->modifier) {
|
} else {
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&id='.$object->id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'</a>';
|
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
||||||
} else {
|
}
|
||||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -507,7 +507,11 @@ if ($action == 'create')
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<div class="center"><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></div>';
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" value="' . $langs->trans("CreateAccount") . '">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -45,6 +46,8 @@ $year=GETPOST("year",'int');
|
|||||||
$filtre=GETPOST("filtre",'alpha');
|
$filtre=GETPOST("filtre",'alpha');
|
||||||
if (! $year && $mode != 'sconly') { $year=date("Y", time()); }
|
if (! $year && $mode != 'sconly') { $year=date("Y", time()); }
|
||||||
|
|
||||||
|
$search_account = GETPOST('search_account','int');
|
||||||
|
|
||||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -65,6 +68,7 @@ $tva_static = new Tva($db);
|
|||||||
$socialcontrib=new ChargeSociales($db);
|
$socialcontrib=new ChargeSociales($db);
|
||||||
$payment_sc_static=new PaymentSocialContribution($db);
|
$payment_sc_static=new PaymentSocialContribution($db);
|
||||||
$sal_static = new PaymentSalary($db);
|
$sal_static = new PaymentSalary($db);
|
||||||
|
$accountstatic = new Account($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("SpecialExpensesArea"));
|
llxHeader('',$langs->trans("SpecialExpensesArea"));
|
||||||
|
|
||||||
@ -122,17 +126,21 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$sql = "SELECT c.id, c.libelle as lib,";
|
$sql = "SELECT c.id, c.libelle as lib,";
|
||||||
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
||||||
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment,";
|
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||||
$sql.= " pct.code as payment_code";
|
$sql.= " pct.code as payment_code,";
|
||||||
|
$sql.= " ba.rowid as bid, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
$sql.= " WHERE cs.fk_type = c.id";
|
$sql.= " WHERE cs.fk_type = c.id";
|
||||||
$sql.= " AND cs.entity = ".$conf->entity;
|
$sql.= " AND cs.entity = ".$conf->entity;
|
||||||
if ($year > 0)
|
if ($year > 0)
|
||||||
@ -189,6 +197,20 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||||
print $obj->num_payment.'</td>';
|
print $obj->num_payment.'</td>';
|
||||||
|
// Account
|
||||||
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->fk_bank > 0)
|
||||||
|
{
|
||||||
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->label=$obj->blabel;
|
||||||
|
print $accountstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Paid
|
// Paid
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($obj->totalpaye) print price($obj->totalpaye);
|
if ($obj->totalpaye) print price($obj->totalpaye);
|
||||||
@ -205,6 +227,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
print '<td align="center" class="liste_total"> </td>';
|
print '<td align="center" class="liste_total"> </td>';
|
||||||
print '<td align="center" class="liste_total"> </td>';
|
print '<td align="center" class="liste_total"> </td>';
|
||||||
print '<td align="center" class="liste_total"> </td>';
|
print '<td align="center" class="liste_total"> </td>';
|
||||||
|
if (! empty($conf->banque->enabled)) print '<td></td>';
|
||||||
print '<td align="right" class="liste_total">'.price($totalpaye)."</td>";
|
print '<td align="right" class="liste_total">'.price($totalpaye)."</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -282,7 +282,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
else if ($action == 'setmulticurrencyrate' && $user->rights->facture->creer) {
|
else if ($action == 'setmulticurrencyrate' && $user->rights->facture->creer) {
|
||||||
$result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int'));
|
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
|
else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
|
||||||
@ -1177,6 +1177,31 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now we create same links to contact than the ones found on origin object
|
||||||
|
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
|
||||||
|
{
|
||||||
|
$originforcontact = $object->origin;
|
||||||
|
$originidforcontact = $object->origin_id;
|
||||||
|
if ($originforcontact == 'shipping') // shipment and order share the same contacts. If creating from shipment we take data of order
|
||||||
|
{
|
||||||
|
$originforcontact=$srcobject->origin;
|
||||||
|
$originidforcontact=$srcobject->origin_id;
|
||||||
|
}
|
||||||
|
$sqlcontact = "SELECT code, fk_socpeople FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as ctc";
|
||||||
|
$sqlcontact.= " WHERE element_id = ".$originidforcontact." AND ec.fk_c_type_contact = ctc.rowid AND ctc.element = '".$originforcontact."'";
|
||||||
|
|
||||||
|
$resqlcontact = $db->query($sqlcontact);
|
||||||
|
if ($resqlcontact)
|
||||||
|
{
|
||||||
|
while($objcontact = $db->fetch_object($resqlcontact))
|
||||||
|
{
|
||||||
|
//print $objcontact->code.'-'.$objcontact->fk_socpeople."\n";
|
||||||
|
$object->add_contact($objcontact->fk_socpeople, $objcontact->code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dol_print_error($resqlcontact);
|
||||||
|
}
|
||||||
|
|
||||||
// Hooks
|
// Hooks
|
||||||
$parameters = array('objFrom' => $srcobject);
|
$parameters = array('objFrom' => $srcobject);
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -128,6 +128,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
if (GETPOST('cancel')) $action='';
|
||||||
|
|
||||||
// Create predefined invoice
|
// Create predefined invoice
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
{
|
{
|
||||||
@ -266,6 +268,16 @@ elseif ($action == 'classin' && $user->rights->facture->creer)
|
|||||||
$object->setProject(GETPOST('projectid', 'int'));
|
$object->setProject(GETPOST('projectid', 'int'));
|
||||||
}
|
}
|
||||||
// Set bank account
|
// Set bank account
|
||||||
|
elseif ($action == 'setref' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
|
$result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'));
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
$object->titre = GETPOST('ref', 'alpha');
|
||||||
|
$object->ref = $object->titre;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Set bank account
|
||||||
elseif ($action == 'setbankaccount' && $user->rights->facture->creer)
|
elseif ($action == 'setbankaccount' && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
|
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
|
||||||
@ -840,15 +852,15 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
// Title
|
||||||
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>';
|
||||||
|
print '<input class="flat quatrevingtpercent" type="text" name="titre" value="'.$_POST["titre"].'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1,'customer').'</td>';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1,'customer').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Title
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Title").'</td><td>';
|
|
||||||
print '<input class="flat quatrevingtpercent" type="text" name="titre" value="'.$_POST["titre"].'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Note public
|
// Note public
|
||||||
print '<tr><td>'.$langs->trans("NotePublic").'</td><td valign="top">';
|
print '<tr><td>'.$langs->trans("NotePublic").'</td><td valign="top">';
|
||||||
print '<textarea class="flat centpercent" name="note_public" wrap="soft" rows="'.ROWS_4.'"></textarea>';
|
print '<textarea class="flat centpercent" name="note_public" wrap="soft" rows="'.ROWS_4.'"></textarea>';
|
||||||
@ -951,175 +963,6 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
/*
|
|
||||||
print '<table class="notopnoleftnoright" width="100%">';
|
|
||||||
print '<tr><td colspan="3">';
|
|
||||||
|
|
||||||
$sql = 'SELECT l.fk_product, l.product_type, l.label as custom_label, l.description, l.qty, l.rowid, l.tva_tx,';
|
|
||||||
$sql.= ' l.fk_remise_except,';
|
|
||||||
$sql.= ' l.remise_percent, l.subprice, l.info_bits,';
|
|
||||||
$sql.= ' l.total_ht, l.total_tva as total_vat, l.total_ttc,';
|
|
||||||
$sql.= ' l.date_start,';
|
|
||||||
$sql.= ' l.date_end,';
|
|
||||||
$sql.= ' l.product_type,';
|
|
||||||
$sql.= ' l.fk_unit,';
|
|
||||||
$sql.= ' p.ref, p.fk_product_type, p.label as product_label,';
|
|
||||||
$sql.= ' p.description as product_desc';
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet as l";
|
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
|
|
||||||
$sql.= " WHERE l.fk_facture = ".$object->id;
|
|
||||||
$sql.= " ORDER BY l.rowid";
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$i = 0; $total = 0;
|
|
||||||
|
|
||||||
echo '<table class="noborder" width="100%">';
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td>'.$langs->trans("Description").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("VAT").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("Qty").'</td>';
|
|
||||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
|
||||||
print '<td width="8%" align="left">'.$langs->trans("Unit").'</td>';
|
|
||||||
}
|
|
||||||
print '<td>'.$langs->trans("ReductionShort").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("TotalHT").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("TotalVAT").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("TotalTTC").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("PriceUHT").'</td>';
|
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) print '<td align="right">'.$langs->trans("CurrentProductPrice").'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
$var=true;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
|
|
||||||
if ($objp->fk_product > 0)
|
|
||||||
{
|
|
||||||
$product = New Product($db);
|
|
||||||
$product->fetch($objp->fk_product);
|
|
||||||
}
|
|
||||||
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
|
|
||||||
// Show product and description
|
|
||||||
$type=(isset($objp->product_type)?$objp->product_type:$objp->fk_product_type);
|
|
||||||
$product_static->fk_unit=$objp->fk_unit;
|
|
||||||
|
|
||||||
if ($objp->fk_product > 0)
|
|
||||||
{
|
|
||||||
print '<td>';
|
|
||||||
|
|
||||||
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
|
|
||||||
|
|
||||||
// Show product and description
|
|
||||||
$product_static->fetch($objp->fk_product); // We need all information later
|
|
||||||
$text=$product_static->getNomUrl(1);
|
|
||||||
$text.= ' - '.(! empty($objp->custom_label)?$objp->custom_label:$objp->product_label);
|
|
||||||
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description));
|
|
||||||
print $form->textwithtooltip($text,$description,3,'','',$i);
|
|
||||||
|
|
||||||
// Show range
|
|
||||||
print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end));
|
|
||||||
|
|
||||||
// Add description in form
|
|
||||||
if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
|
|
||||||
print (! empty($objp->description) && $objp->description!=$objp->product_label)?'<br>'.dol_htmlentitiesbr($objp->description):'';
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td>';
|
|
||||||
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
|
|
||||||
|
|
||||||
if ($type==1) $text = img_object($langs->trans('Service'),'service');
|
|
||||||
else $text = img_object($langs->trans('Product'),'product');
|
|
||||||
|
|
||||||
if (! empty($objp->custom_label)) {
|
|
||||||
|
|
||||||
$text.= ' <strong>'.$objp->custom_label.'</strong>';
|
|
||||||
print $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
print $text.' '.nl2br($objp->description);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show range
|
|
||||||
print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end));
|
|
||||||
|
|
||||||
print "</td>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vat rate
|
|
||||||
print '<td align="center">'.vatrate($objp->tva_tx).'%</td>';
|
|
||||||
|
|
||||||
// Qty
|
|
||||||
print '<td align="center">'.$objp->qty.'</td>';
|
|
||||||
|
|
||||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
|
||||||
print '<td align="left">'.$product_static->getLabelOfUnit().'</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Percent
|
|
||||||
if ($objp->remise_percent > 0)
|
|
||||||
{
|
|
||||||
print '<td align="right">'.$objp->remise_percent." %</td>\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Total HT
|
|
||||||
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
|
||||||
|
|
||||||
// Total VAT
|
|
||||||
print '<td align="right">'.price($objp->total_vat)."</td>\n";
|
|
||||||
|
|
||||||
// Total TTC
|
|
||||||
print '<td align="right">'.price($objp->total_ttc)."</td>\n";
|
|
||||||
|
|
||||||
// Total Unit price
|
|
||||||
print '<td align="right">'.price($objp->subprice)."</td>\n";
|
|
||||||
|
|
||||||
// Current price of product
|
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
|
||||||
{
|
|
||||||
if ($objp->fk_product > 0)
|
|
||||||
{
|
|
||||||
$flag_price_may_change++;
|
|
||||||
$prodprice=$product_static->price; // price HT
|
|
||||||
print '<td align="right">'.price($prodprice)."</td>\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($result);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $db->error();
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
*/
|
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if ($flag_price_may_change)
|
if ($flag_price_may_change)
|
||||||
@ -1178,20 +1021,13 @@ else
|
|||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/fiche-rec.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/fiche-rec.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="20%">' . $langs->trans('Ref') . '</td>';
|
print '<tr><td class="titlefield">';
|
||||||
print '<td colspan="5">';
|
//print $langs->trans('Ref');
|
||||||
$morehtmlref = '';
|
print $form->editfieldkey($langs->trans("Ref"), 'ref', $object->ref, $object, $user->rights->facture->creer);
|
||||||
/*
|
print '</td>';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
print '<td colspan="3">';
|
||||||
$discount = new DiscountAbsolute($db);
|
$morehtmlref = $form->editfieldval($langs->trans("Ref"), 'ref', $object->ref, $object, $user->rights->facture->creer, 'string');
|
||||||
$result = $discount->fetch(0, $object->id);
|
print $form->showrefnav($object, 'ref', $linkback, 1, 'titre', 'none', $morehtmlref);
|
||||||
if ($result > 0) {
|
|
||||||
$morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')';
|
|
||||||
}
|
|
||||||
if ($result < 0) {
|
|
||||||
dol_print_error('', $discount->error);
|
|
||||||
}*/
|
|
||||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'titre', 'titre', $morehtmlref);
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -230,7 +230,7 @@ foreach ($tabfac as $key => $val)
|
|||||||
if (isset($line['nomtcheck']) || $mt)
|
if (isset($line['nomtcheck']) || $mt)
|
||||||
{
|
{
|
||||||
print "<tr ".$bc[$var]." >";
|
print "<tr ".$bc[$var]." >";
|
||||||
print "<td>".dol_print_date($val["date"])."</td>";
|
print "<td>".dol_print_date($db->jdate($val["date"]))."</td>";
|
||||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||||
print "<td>".$k."</td><td>".$line['label']."</td>";
|
print "<td>".$k."</td><td>".$line['label']."</td>";
|
||||||
|
|
||||||
|
|||||||
@ -263,7 +263,7 @@ foreach ($tabfac as $key => $val)
|
|||||||
if (isset($line['nomtcheck']) || $mt)
|
if (isset($line['nomtcheck']) || $mt)
|
||||||
{
|
{
|
||||||
print "<tr ".$bc[$var]." >";
|
print "<tr ".$bc[$var]." >";
|
||||||
print "<td>".dol_print_date($val["date"])."</td>";
|
print "<td>".dol_print_date($db->jdate($val["date"]))."</td>";
|
||||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||||
print "<td>".$k."</td><td>".$line['label']."</td>";
|
print "<td>".$k."</td><td>".$line['label']."</td>";
|
||||||
|
|
||||||
|
|||||||
@ -229,7 +229,10 @@ if ($resql)
|
|||||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
//print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
|
||||||
@ -260,9 +263,12 @@ if ($resql)
|
|||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.$search_payment_num.'">';
|
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.$search_payment_num.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
if (! empty($conf->banque->enabled))
|
||||||
$form->select_comptes($search_account,'search_account',0,'',1);
|
{
|
||||||
print '</td>';
|
print '<td>';
|
||||||
|
$form->select_comptes($search_account,'search_account',0,'',1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print '<input class="flat" type="text" size="4" name="search_amount" value="'.$search_amount.'">';
|
print '<input class="flat" type="text" size="4" name="search_amount" value="'.$search_amount.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -310,15 +316,20 @@ if ($resql)
|
|||||||
// Payment number
|
// Payment number
|
||||||
print '<td>'.$objp->num_paiement.'</td>';
|
print '<td>'.$objp->num_paiement.'</td>';
|
||||||
|
|
||||||
print '<td>';
|
// Account
|
||||||
if ($objp->bid)
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
$accountstatic->id=$objp->bid;
|
print '<td>';
|
||||||
$accountstatic->label=$objp->label;
|
if ($objp->bid)
|
||||||
print $accountstatic->getNomUrl(1);
|
{
|
||||||
}
|
$accountstatic->id=$objp->bid;
|
||||||
else print ' ';
|
$accountstatic->label=$objp->label;
|
||||||
print '</td>';
|
print $accountstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Amount
|
||||||
print '<td align="right">'.price($objp->amount).'</td>';
|
print '<td align="right">'.price($objp->amount).'</td>';
|
||||||
|
|
||||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||||
|
|||||||
@ -162,25 +162,25 @@ if ($action == 'valide')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td>';
|
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $form->showrefnav($paiement,'id','',1,'rowid','id');
|
print $form->showrefnav($paiement,'id','',1,'rowid','id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td valign="top" width="120">'.$langs->trans('Date').'</td><td colspan="3">'.dol_print_date($paiement->datep,'day').'</td></tr>';
|
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'.dol_print_date($paiement->datep,'day').'</td></tr>';
|
||||||
|
|
||||||
// Mode
|
// Mode
|
||||||
print '<tr><td valign="top">'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("PaymentType".$paiement->type_code).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("PaymentType".$paiement->type_code).'</td></tr>';
|
||||||
|
|
||||||
// Numero
|
// Numero
|
||||||
print '<tr><td valign="top">'.$langs->trans('Numero').'</td><td colspan="3">'.$paiement->num_paiement.'</td></tr>';
|
print '<tr><td>'.$langs->trans('Numero').'</td><td colspan="3">'.$paiement->num_paiement.'</td></tr>';
|
||||||
|
|
||||||
// Montant
|
// Montant
|
||||||
print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr><td valign="top">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
|
||||||
|
|
||||||
// Bank account
|
// Bank account
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
@ -278,7 +278,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
$langs->load("salaries");
|
$langs->load("salaries");
|
||||||
@ -40,6 +41,8 @@ $search_ref = GETPOST('search_ref','int');
|
|||||||
$search_user = GETPOST('search_user','alpha');
|
$search_user = GETPOST('search_user','alpha');
|
||||||
$search_label = GETPOST('search_label','alpha');
|
$search_label = GETPOST('search_label','alpha');
|
||||||
$search_amount = GETPOST('search_amount','alpha');
|
$search_amount = GETPOST('search_amount','alpha');
|
||||||
|
$search_account = GETPOST('search_account','int');
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
@ -68,11 +71,12 @@ else
|
|||||||
$typeid=$_REQUEST['typeid'];
|
$typeid=$_REQUEST['typeid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_ref="";
|
$search_ref="";
|
||||||
$search_label="";
|
$search_label="";
|
||||||
$search_amount="";
|
$search_amount="";
|
||||||
|
$search_account='';
|
||||||
$typeid="";
|
$typeid="";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,12 +89,16 @@ llxHeader();
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$salstatic = new PaymentSalary($db);
|
$salstatic = new PaymentSalary($db);
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
|
$accountstatic = new Account($db);
|
||||||
|
|
||||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,";
|
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,";
|
||||||
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment,";
|
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
|
||||||
|
$sql.= " ba.rowid as bid, ba.label as blabel,";
|
||||||
$sql.= " pst.code as payment_code";
|
$sql.= " pst.code as payment_code";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id,";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."user as u";
|
$sql.= " ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE u.rowid = s.fk_user";
|
$sql.= " WHERE u.rowid = s.fk_user";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
@ -100,6 +108,7 @@ if ($search_ref) $sql.=" AND s.rowid=".$search_ref;
|
|||||||
if ($search_user) $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $search_user);
|
if ($search_user) $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $search_user);
|
||||||
if ($search_label) $sql.=natural_search(array('s.label'), $search_label);
|
if ($search_label) $sql.=natural_search(array('s.label'), $search_label);
|
||||||
if ($search_amount) $sql.=natural_search("s.amount", $search_amount, 1);
|
if ($search_amount) $sql.=natural_search("s.amount", $search_amount, 1);
|
||||||
|
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
||||||
if ($filtre) {
|
if ($filtre) {
|
||||||
$filtre=str_replace(":","=",$filtre);
|
$filtre=str_replace(":","=",$filtre);
|
||||||
$sql .= " AND ".$filtre;
|
$sql .= " AND ".$filtre;
|
||||||
@ -149,6 +158,7 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -170,6 +180,13 @@ if ($result)
|
|||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
$form->select_types_paiements($typeid,'typeid','',0,0,1,16);
|
$form->select_types_paiements($typeid,'typeid','',0,0,1,16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
// Account
|
||||||
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->select_comptes($search_account,'search_account',0,'',1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Amount
|
// Amount
|
||||||
print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
|
print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
|
||||||
|
|
||||||
@ -205,7 +222,21 @@ if ($result)
|
|||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
|
||||||
// Type
|
// Type
|
||||||
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||||
// Amount
|
// Account
|
||||||
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->fk_bank > 0)
|
||||||
|
{
|
||||||
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->label=$obj->blabel;
|
||||||
|
print $accountstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Amount
|
||||||
print "<td align=\"right\">".price($obj->amount)."</td>";
|
print "<td align=\"right\">".price($obj->amount)."</td>";
|
||||||
print "<td></td>";
|
print "<td></td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -215,7 +246,9 @@ if ($result)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
|
$colspan=5;
|
||||||
|
if (! empty($conf->banque->enabled)) $colspan++;
|
||||||
|
print '<tr class="liste_total"><td colspan="'.$colspan.'" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||||
print '<td class="liste_total" align="right">'.price($total)."</td>";
|
print '<td class="liste_total" align="right">'.price($total)."</td>";
|
||||||
print "<td></td></tr>";
|
print "<td></td></tr>";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
@ -266,18 +266,18 @@ if ($action == 'create')
|
|||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>';
|
||||||
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
|
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Type payment
|
// Type payment
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||||
$form->select_types_paiements(GETPOST("type_payment"), "type_payment");
|
$form->select_types_paiements(GETPOST("type_payment"), "type_payment");
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
print '<tr><td>'.$langs->trans('Numero');
|
print '<tr><td>'.$langs->trans('Numero');
|
||||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||||
print '<td><input name="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
print '<td><input name="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
||||||
}
|
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array('colspan' => ' colspan="1"');
|
$parameters=array('colspan' => ' colspan="1"');
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
|
||||||
@ -40,6 +41,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
|||||||
$search_ref = GETPOST('search_ref','int');
|
$search_ref = GETPOST('search_ref','int');
|
||||||
$search_label = GETPOST('search_label','alpha');
|
$search_label = GETPOST('search_label','alpha');
|
||||||
$search_amount = GETPOST('search_amount','alpha');
|
$search_amount = GETPOST('search_amount','alpha');
|
||||||
|
$search_account = GETPOST('search_account','int');
|
||||||
$month = GETPOST("month","int");
|
$month = GETPOST("month","int");
|
||||||
$year = GETPOST("year","int");
|
$year = GETPOST("year","int");
|
||||||
|
|
||||||
@ -71,16 +73,18 @@ else
|
|||||||
$typeid=$_REQUEST['typeid'];
|
$typeid=$_REQUEST['typeid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_ref="";
|
$search_ref="";
|
||||||
$search_label="";
|
$search_label="";
|
||||||
$search_amount="";
|
$search_amount="";
|
||||||
|
$search_account='';
|
||||||
$year="";
|
$year="";
|
||||||
$month="";
|
$month="";
|
||||||
$typeid="";
|
$typeid="";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -90,14 +94,19 @@ llxHeader();
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother=new FormOther($db);
|
$formother=new FormOther($db);
|
||||||
$tva_static = new Tva($db);
|
$tva_static = new Tva($db);
|
||||||
|
$accountstatic = new Account($db);
|
||||||
|
|
||||||
$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, pst.code as payment_code";
|
$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,";
|
||||||
|
$sql.= " ba.rowid as bid, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
$sql.= " WHERE t.entity = ".$conf->entity;
|
$sql.= " WHERE t.entity = ".$conf->entity;
|
||||||
if ($search_ref) $sql.=" AND t.rowid=".$search_ref;
|
if ($search_ref) $sql.=" AND t.rowid=".$search_ref;
|
||||||
if ($search_label) $sql.=" AND t.label LIKE '%".$db->escape($search_label)."%'";
|
if ($search_label) $sql.=" AND t.label LIKE '%".$db->escape($search_label)."%'";
|
||||||
if ($search_amount) $sql.=" AND t.amount='".$db->escape(price2num(trim($search_amount)))."'";
|
if ($search_amount) $sql.=" AND t.amount='".$db->escape(price2num(trim($search_amount)))."'";
|
||||||
|
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
||||||
if ($month > 0)
|
if ($month > 0)
|
||||||
{
|
{
|
||||||
if ($year > 0)
|
if ($year > 0)
|
||||||
@ -155,8 +164,9 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("DateValue"),$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateValue"),$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -172,8 +182,14 @@ if ($result)
|
|||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
$form->select_types_paiements($typeid,'typeid','',0,0,1,16);
|
$form->select_types_paiements($typeid,'typeid','',0,0,1,16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
// Account
|
||||||
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->select_comptes($search_account,'search_account',0,'',1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
|
print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
|
||||||
|
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
@ -204,15 +220,32 @@ if ($result)
|
|||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
|
||||||
// Type
|
// Type
|
||||||
print $type;
|
print $type;
|
||||||
|
// Account
|
||||||
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->fk_bank > 0)
|
||||||
|
{
|
||||||
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->label=$obj->blabel;
|
||||||
|
print $accountstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Amount
|
// Amount
|
||||||
$total = $total + $obj->amount;
|
$total = $total + $obj->amount;
|
||||||
print "<td align=\"right\">".price($obj->amount)."</td>";
|
print "<td align=\"right\">".price($obj->amount)."</td>";
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total"><td colspan="5">'.$langs->trans("Total").'</td>';
|
|
||||||
|
$colspan=5;
|
||||||
|
if (! empty($conf->banque->enabled)) $colspan++;
|
||||||
|
print '<tr class="liste_total"><td colspan="'.$colspan.'">'.$langs->trans("Total").'</td>';
|
||||||
print "<td align=\"right\"><b>".price($total)."</b></td>";
|
print "<td align=\"right\"><b>".price($total)."</b></td>";
|
||||||
print "<td> </td></tr>";
|
print "<td> </td></tr>";
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
*
|
*
|
||||||
@ -529,10 +529,10 @@ else
|
|||||||
|
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<tr><td width="20%" class="fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
|
print '<tr><td class="titlefieldcreate fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
|
||||||
print '<td width="30%"><input name="lastname" id="lastname" type="text" size="30" maxlength="80" value="'.dol_escape_htmltag(GETPOST("lastname")?GETPOST("lastname"):$object->lastname).'" autofocus="autofocus"></td>';
|
print '<td><input name="lastname" id="lastname" type="text" size="30" maxlength="80" value="'.dol_escape_htmltag(GETPOST("lastname")?GETPOST("lastname"):$object->lastname).'" autofocus="autofocus"></td>';
|
||||||
print '<td width="20%"><label for="firstname">'.$langs->trans("Firstname").'</label></td>';
|
print '<td><label for="firstname">'.$langs->trans("Firstname").'</label></td>';
|
||||||
print '<td width="30%"><input name="firstname" id="firstname"type="text" size="30" maxlength="80" value="'.dol_escape_htmltag(GETPOST("firstname")?GETPOST("firstname"):$object->firstname).'"></td></tr>';
|
print '<td><input name="firstname" id="firstname"type="text" size="30" maxlength="80" value="'.dol_escape_htmltag(GETPOST("firstname")?GETPOST("firstname"):$object->firstname).'"></td></tr>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||||
@ -554,7 +554,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Civility
|
// Civility
|
||||||
print '<tr><td width="15%"><label for="civility_id">'.$langs->trans("UserTitle").'</label></td><td colspan="3">';
|
print '<tr><td><label for="civility_id">'.$langs->trans("UserTitle").'</label></td><td colspan="3">';
|
||||||
print $formcompany->select_civility(GETPOST("civility_id",'alpha')?GETPOST("civility_id",'alpha'):$object->civility_id);
|
print $formcompany->select_civility(GETPOST("civility_id",'alpha')?GETPOST("civility_id",'alpha'):$object->civility_id);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -783,10 +783,10 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lastname
|
// Lastname
|
||||||
print '<tr><td width="20%" class="fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
|
print '<tr><td class="titlefieldcreate fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
|
||||||
print '<td width="30%"><input name="lastname" id="lastname" type="text" size="20" maxlength="80" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'" autofocus="autofocus"></td>';
|
print '<td><input name="lastname" id="lastname" type="text" size="20" maxlength="80" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'" autofocus="autofocus"></td>';
|
||||||
print '<td width="20%"><label for="firstname">'.$langs->trans("Firstname").'</label></td>';
|
print '<td><label for="firstname">'.$langs->trans("Firstname").'</label></td>';
|
||||||
print '<td width="30%"><input name="firstname" id="firstname" type="text" size="20" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
print '<td><input name="firstname" id="firstname" type="text" size="20" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||||
@ -890,7 +890,7 @@ else
|
|||||||
print $form->selectarray('priv',$selectarray,$object->priv,0);
|
print $form->selectarray('priv',$selectarray,$object->priv,0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Note Public
|
// Note Public
|
||||||
print '<tr><td class="tdtop"><label for="note_public">'.$langs->trans("NotePublic").'</label></td><td colspan="3">';
|
print '<tr><td class="tdtop"><label for="note_public">'.$langs->trans("NotePublic").'</label></td><td colspan="3">';
|
||||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
|
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
@ -902,7 +902,7 @@ else
|
|||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Status
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $object->getLibStatut(4);
|
print $object->getLibStatut(4);
|
||||||
@ -1058,7 +1058,7 @@ else
|
|||||||
// Company
|
// Company
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
if ($object->socid > 0)
|
if ($object->socid > 0)
|
||||||
{
|
{
|
||||||
$objsoc->fetch($object->socid);
|
$objsoc->fetch($object->socid);
|
||||||
@ -1074,7 +1074,7 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Civility
|
// Civility
|
||||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td>';
|
||||||
print $object->getCivilityLabel();
|
print $object->getCivilityLabel();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1122,7 +1122,7 @@ else
|
|||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) {
|
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) {
|
||||||
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
|
print '<tr><td class="titlefield">' . $langs->trans("Categories") . '</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $form->showCategories( $object->id, 'contact', 1 );
|
print $form->showCategories( $object->id, 'contact', 1 );
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1141,7 +1141,7 @@ else
|
|||||||
|
|
||||||
if (! empty($conf->propal->enabled))
|
if (! empty($conf->propal->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
print '<tr><td class="titlefield">'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
||||||
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
|
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -151,12 +151,12 @@ if ($action == 'edit')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $object->id;
|
print $object->id;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Photo
|
// Photo
|
||||||
print '<td align="center" class="hideonsmartphone" valign="middle" width="25%" rowspan="5">';
|
print '<td align="center" class="hideonsmartphone" valign="middle" rowspan="6">';
|
||||||
print $form->showphoto('contact',$object)."\n";
|
print $form->showphoto('contact',$object)."\n";
|
||||||
if ($object->photo) print "<br>\n";
|
if ($object->photo) print "<br>\n";
|
||||||
|
|
||||||
@ -170,8 +170,8 @@ if ($action == 'edit')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
|
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td colspan="3">'.$object->lastname.'</td></tr>';
|
||||||
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td>';
|
print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="3">'.$object->firstname.'</td>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||||
|
|||||||
@ -2179,6 +2179,7 @@ class Contrat extends CommonObject
|
|||||||
$this->ref_supplier = 'SPECIMENSUPP';
|
$this->ref_supplier = 'SPECIMENSUPP';
|
||||||
$this->socid = 1;
|
$this->socid = 1;
|
||||||
$this->statut= 0;
|
$this->statut= 0;
|
||||||
|
$this->date_creation = (dol_now() - 3600 * 24 * 7);
|
||||||
$this->date_contrat = dol_now();
|
$this->date_contrat = dol_now();
|
||||||
$this->commercial_signature_id = 1;
|
$this->commercial_signature_id = 1;
|
||||||
$this->commercial_suivi_id = 1;
|
$this->commercial_suivi_id = 1;
|
||||||
|
|||||||
@ -344,7 +344,7 @@ if ($result)
|
|||||||
$staticcompany->name=$obj->name;
|
$staticcompany->name=$obj->name;
|
||||||
print $staticcompany->getNomUrl(1,'',20);
|
print $staticcompany->getNomUrl(1,'',20);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center">'.dol_print_date($obj->tms,'dayhour').'</td>';
|
print '<td align="center">'.dol_print_date($db->jdate($obj->tms),'dayhour').'</td>';
|
||||||
//print '<td align="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>';
|
//print '<td align="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>';
|
||||||
print '<td align="right" width="32">'.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0,3):'').'</td>';
|
print '<td align="right" width="32">'.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0,3):'').'</td>';
|
||||||
print '<td align="right" width="32">'.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4,3,0):'').'</td>';
|
print '<td align="right" width="32">'.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4,3,0):'').'</td>';
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
require ("../main.inc.php");
|
require ("../main.inc.php");
|
||||||
require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
|
require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
@ -45,6 +46,9 @@ $socid=GETPOST('socid');
|
|||||||
$search_user=GETPOST('search_user','int');
|
$search_user=GETPOST('search_user','int');
|
||||||
$search_sale=GETPOST('search_sale','int');
|
$search_sale=GETPOST('search_sale','int');
|
||||||
$search_product_category=GETPOST('search_product_category','int');
|
$search_product_category=GETPOST('search_product_category','int');
|
||||||
|
$day=GETPOST("day","int");
|
||||||
|
$year=GETPOST("year","int");
|
||||||
|
$month=GETPOST("month","int");
|
||||||
|
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
@ -117,6 +121,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
$sall="";
|
$sall="";
|
||||||
$search_status="";
|
$search_status="";
|
||||||
$search_array_options=array();
|
$search_array_options=array();
|
||||||
|
$day='';
|
||||||
|
$month='';
|
||||||
|
$year='';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -154,23 +161,27 @@ $sql.= ' AND c.entity IN ('.getEntity('contract', 1).')';
|
|||||||
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
|
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$db->escape($socid);
|
if ($socid) $sql.= " AND s.rowid = ".$db->escape($socid);
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if ($month > 0)
|
||||||
if ($search_name) {
|
{
|
||||||
$sql .= natural_search('s.nom', $search_name);
|
if ($year > 0 && empty($day))
|
||||||
|
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||||
|
else if ($year > 0 && ! empty($day))
|
||||||
|
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
|
||||||
|
else
|
||||||
|
$sql.= " AND date_format(c.date_contrat, '%m') = '".$month."'";
|
||||||
}
|
}
|
||||||
if ($search_contract) {
|
else if ($year > 0)
|
||||||
$sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
|
{
|
||||||
}
|
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||||
if (!empty($search_ref_supplier)) {
|
|
||||||
$sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
|
||||||
}
|
}
|
||||||
|
if ($search_name) $sql .= natural_search('s.nom', $search_name);
|
||||||
|
if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
|
||||||
|
if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
||||||
if ($search_sale > 0)
|
if ($search_sale > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||||
}
|
}
|
||||||
if ($sall) {
|
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
|
||||||
}
|
|
||||||
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
||||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, s.nom, s.rowid";
|
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, s.nom, s.rowid";
|
||||||
$totalnboflines=0;
|
$totalnboflines=0;
|
||||||
@ -292,8 +303,17 @@ if ($resql)
|
|||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="text" class="flat" size="8" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
|
print '<input type="text" class="flat" size="8" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td></td>';
|
||||||
print '<td class="liste_titre" colspan="5" align="right"></td>';
|
// Date contract
|
||||||
|
print '<td class="liste_titre center">';
|
||||||
|
//print $langs->trans('Month').': ';
|
||||||
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||||
|
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||||
|
//print ' '.$langs->trans('Year').': ';
|
||||||
|
$syear = $year;
|
||||||
|
$formother->select_year($syear,'year',1, 20, 5);
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="liste_titre" colspan="4" align="right"></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
@ -358,7 +378,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>';
|
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day').'</td>';
|
||||||
//print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>';
|
//print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>';
|
||||||
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
|
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
|
||||||
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
|
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
|
||||||
|
|||||||
@ -251,6 +251,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
|
|||||||
$out.= $s;
|
$out.= $s;
|
||||||
}
|
}
|
||||||
$out.= ' ';
|
$out.= ' ';
|
||||||
|
|
||||||
$sublink='';
|
$sublink='';
|
||||||
if (! empty($head['sublink'])) $sublink.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
|
if (! empty($head['sublink'])) $sublink.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
|
||||||
if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
|
if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
|
||||||
|
|||||||
@ -607,7 +607,7 @@ abstract class CommonObject
|
|||||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||||
$sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
|
$sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
|
||||||
$sql.= "'".$this->db->idate($datecreate)."'";
|
$sql.= "'".$this->db->idate($datecreate)."'";
|
||||||
$sql.= ", 4, '". $id_type_contact . "' ";
|
$sql.= ", 4, ". $id_type_contact;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
|
|||||||
@ -66,6 +66,8 @@ class DiscountAbsolute
|
|||||||
*/
|
*/
|
||||||
function fetch($rowid,$fk_facture_source=0)
|
function fetch($rowid,$fk_facture_source=0)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! $rowid && ! $fk_facture_source)
|
if (! $rowid && ! $fk_facture_source)
|
||||||
{
|
{
|
||||||
@ -81,9 +83,9 @@ class DiscountAbsolute
|
|||||||
$sql.= " f.facnumber as ref_facture_source";
|
$sql.= " f.facnumber as ref_facture_source";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
|
||||||
$sql.= " WHERE";
|
$sql.= " WHERE sr.entity = " . $conf->entity;
|
||||||
if ($rowid) $sql.= " sr.rowid=".$rowid;
|
if ($rowid) $sql.= " AND sr.rowid=".$rowid;
|
||||||
if ($fk_facture_source) $sql.= " sr.fk_facture_source=".$fk_facture_source;
|
if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -150,11 +152,11 @@ class DiscountAbsolute
|
|||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
|
||||||
$sql.= " (datec, fk_soc, fk_user, description,";
|
$sql.= " (entity, datec, fk_soc, fk_user, description,";
|
||||||
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
|
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
|
||||||
$sql.= " fk_facture_source";
|
$sql.= " fk_facture_source";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
$sql.= " VALUES ('".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
|
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
|
||||||
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
|
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
|
||||||
$sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null");
|
$sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null");
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
@ -343,10 +345,13 @@ class DiscountAbsolute
|
|||||||
*/
|
*/
|
||||||
function getAvailableDiscounts($company='', $user='',$filter='', $maxvalue=0)
|
function getAvailableDiscounts($company='', $user='',$filter='', $maxvalue=0)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT SUM(rc.amount_ttc) as amount";
|
$sql = "SELECT SUM(rc.amount_ttc) as amount";
|
||||||
// $sql = "SELECT rc.amount_ttc as amount";
|
// $sql = "SELECT rc.amount_ttc as amount";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
||||||
$sql.= " WHERE (rc.fk_facture IS NULL AND rc.fk_facture_line IS NULL)"; // Available
|
$sql.= " WHERE rc.entity = " . $conf->entity;
|
||||||
|
$sql.= " AND (rc.fk_facture IS NULL AND rc.fk_facture_line IS NULL)"; // Available
|
||||||
if (is_object($company)) $sql.= " AND rc.fk_soc = ".$company->id;
|
if (is_object($company)) $sql.= " AND rc.fk_soc = ".$company->id;
|
||||||
if (is_object($user)) $sql.= " AND rc.fk_user = ".$user->id;
|
if (is_object($user)) $sql.= " AND rc.fk_user = ".$user->id;
|
||||||
if ($filter) $sql.=' AND ('.$filter.')';
|
if ($filter) $sql.=' AND ('.$filter.')';
|
||||||
|
|||||||
@ -58,11 +58,12 @@ class ExtraFields
|
|||||||
var $attribute_perms;
|
var $attribute_perms;
|
||||||
// Array to store permission to check
|
// Array to store permission to check
|
||||||
var $attribute_list;
|
var $attribute_list;
|
||||||
|
// Array to store if extra field is hidden
|
||||||
|
var $attribute_hidden; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
|
||||||
|
|
||||||
var $error;
|
var $error;
|
||||||
var $errno;
|
var $errno;
|
||||||
|
|
||||||
var $attribute_hidden;
|
|
||||||
|
|
||||||
public static $type2label=array(
|
public static $type2label=array(
|
||||||
'varchar'=>'String',
|
'varchar'=>'String',
|
||||||
@ -121,7 +122,7 @@ class ExtraFields
|
|||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default
|
||||||
* @param int $ishidden Is hidden extrafield
|
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='', $list=0, $ishidden=0)
|
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='', $list=0, $ishidden=0)
|
||||||
@ -252,7 +253,7 @@ class ExtraFields
|
|||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default
|
||||||
* @param int $ishidden Is hidden extrafield
|
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0)
|
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0)
|
||||||
@ -400,7 +401,7 @@ class ExtraFields
|
|||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default
|
||||||
* @param int $ishidden Is hidden extrafield
|
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
||||||
* @return int >0 if OK, <=0 if KO
|
* @return int >0 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='',$list='',$ishidden=0)
|
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='',$list='',$ishidden=0)
|
||||||
@ -498,7 +499,7 @@ class ExtraFields
|
|||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default
|
||||||
* @param int $ishidden Is hidden extrafield
|
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0)
|
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0)
|
||||||
@ -1188,7 +1189,7 @@ class ExtraFields
|
|||||||
$params=$this->attribute_param[$key];
|
$params=$this->attribute_param[$key];
|
||||||
$perms=$this->attribute_perms[$key];
|
$perms=$this->attribute_perms[$key];
|
||||||
$list=$this->attribute_list[$key];
|
$list=$this->attribute_list[$key];
|
||||||
$hidden=$this->attribute_hidden[$key];
|
$hidden=$this->attribute_hidden[$key]; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
|
||||||
|
|
||||||
$showsize=0;
|
$showsize=0;
|
||||||
if ($type == 'date')
|
if ($type == 'date')
|
||||||
@ -1261,7 +1262,14 @@ class ExtraFields
|
|||||||
{
|
{
|
||||||
$sql.= ' as main';
|
$sql.= ' as main';
|
||||||
}
|
}
|
||||||
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
if ($selectkey=='rowid' && empty($value)) {
|
||||||
|
$sql.= " WHERE ".$selectkey."=0";
|
||||||
|
} elseif ($selectkey=='rowid') {
|
||||||
|
$sql.= " WHERE ".$selectkey."=".$this->db->escape($value);
|
||||||
|
}else {
|
||||||
|
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
||||||
|
}
|
||||||
|
|
||||||
//$sql.= ' AND entity = '.$conf->entity;
|
//$sql.= ' AND entity = '.$conf->entity;
|
||||||
|
|
||||||
dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG);
|
dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG);
|
||||||
|
|||||||
@ -449,7 +449,7 @@ class Form
|
|||||||
* @param string $text Text to show
|
* @param string $text Text to show
|
||||||
* @param string $htmltext Content of tooltip
|
* @param string $htmltext Content of tooltip
|
||||||
* @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon
|
* @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon
|
||||||
* @param string $type Type of picto (info, help, warning, superadmin...)
|
* @param string $type Type of picto (info, help, warning, superadmin...) OR image filepath (mypicto@mymodule)
|
||||||
* @param string $extracss Add a CSS style to td tags
|
* @param string $extracss Add a CSS style to td tags
|
||||||
* @param int $noencodehtmltext Do not encode into html entity the htmltext
|
* @param int $noencodehtmltext Do not encode into html entity the htmltext
|
||||||
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
||||||
@ -487,6 +487,7 @@ class Form
|
|||||||
elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar');
|
elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar');
|
||||||
elseif ($type == 'admin') $img = img_picto($alt, 'star');
|
elseif ($type == 'admin') $img = img_picto($alt, 'star');
|
||||||
elseif ($type == 'warning') $img = img_warning($alt);
|
elseif ($type == 'warning') $img = img_warning($alt);
|
||||||
|
else $img = img_picto($alt, $type);
|
||||||
|
|
||||||
return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext);
|
return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext);
|
||||||
}
|
}
|
||||||
@ -1117,7 +1118,8 @@ class Form
|
|||||||
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
||||||
$sql.= " re.description, re.fk_facture_source";
|
$sql.= " re.description, re.fk_facture_source";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re";
|
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re";
|
||||||
$sql.= " WHERE fk_soc = ".(int) $socid;
|
$sql.= " WHERE re.fk_soc = ".(int) $socid;
|
||||||
|
$sql.= " AND re.entity = " . $conf->entity;
|
||||||
if ($filter) $sql.= " AND ".$filter;
|
if ($filter) $sql.= " AND ".$filter;
|
||||||
$sql.= " ORDER BY re.description ASC";
|
$sql.= " ORDER BY re.description ASC";
|
||||||
|
|
||||||
@ -5474,15 +5476,15 @@ class Form
|
|||||||
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link
|
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link
|
||||||
* @param string $morehtml More html content to output just before the nav bar
|
* @param string $morehtml More html content to output just before the nav bar
|
||||||
* @param int $shownav Show Condition (navigation is shown if value is 1)
|
* @param int $shownav Show Condition (navigation is shown if value is 1)
|
||||||
* @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field)
|
* @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field)
|
||||||
* @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
|
* @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref.
|
||||||
* @param string $morehtmlref More html to show after ref
|
* @param string $morehtmlref More html to show after ref
|
||||||
* @param string $moreparam More param to add in nav link url.
|
* @param string $moreparam More param to add in nav link url.
|
||||||
* @param int $nodbprefix Do not include DB prefix to forge table name
|
* @param int $nodbprefix Do not include DB prefix to forge table name
|
||||||
* @param string $morehtmlleft More html code to show before ref
|
* @param string $morehtmlleft More html code to show before ref
|
||||||
* @param string $morehtmlstatus More html code to show under navigation arrows (status place)
|
* @param string $morehtmlstatus More html code to show under navigation arrows (status place)
|
||||||
* @param string $morehtmlright More html code to show after ref
|
* @param string $morehtmlright More html code to show after ref
|
||||||
* @return string Portion HTML avec ref + boutons nav
|
* @return string Portion HTML with ref + navigation buttons
|
||||||
*/
|
*/
|
||||||
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
|
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
|
||||||
{
|
{
|
||||||
@ -5507,7 +5509,7 @@ class Form
|
|||||||
|
|
||||||
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
||||||
|
|
||||||
// For thirdparty and contact, the ref is the id, so we show something else
|
// For thirdparty, contact, user, member, the ref is the id, so we show something else
|
||||||
if ($object->element == 'societe')
|
if ($object->element == 'societe')
|
||||||
{
|
{
|
||||||
$ret.=dol_htmlentities($object->name);
|
$ret.=dol_htmlentities($object->name);
|
||||||
@ -5516,7 +5518,7 @@ class Form
|
|||||||
{
|
{
|
||||||
$ret.=dol_htmlentities($object->getFullName($langs));
|
$ret.=dol_htmlentities($object->getFullName($langs));
|
||||||
}
|
}
|
||||||
else $ret.=dol_htmlentities($object->$fieldref);
|
else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
|
||||||
if ($morehtmlref)
|
if ($morehtmlref)
|
||||||
{
|
{
|
||||||
$ret.=' '.$morehtmlref;
|
$ret.=' '.$morehtmlref;
|
||||||
|
|||||||
@ -1030,7 +1030,7 @@ class FormOther
|
|||||||
$selectboxlist.='<input type="hidden" name="userid" value="'.$user->id.'">';
|
$selectboxlist.='<input type="hidden" name="userid" value="'.$user->id.'">';
|
||||||
$selectboxlist.='<input type="hidden" name="areacode" value="'.$areacode.'">';
|
$selectboxlist.='<input type="hidden" name="areacode" value="'.$areacode.'">';
|
||||||
$selectboxlist.='<input type="hidden" name="boxorder" value="'.$boxorder.'">';
|
$selectboxlist.='<input type="hidden" name="boxorder" value="'.$boxorder.'">';
|
||||||
$selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel, '', $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth200onsmartphone', 0, ' disabled hidden selected');
|
$selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel, '', $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, ' disabled hidden selected');
|
||||||
if (empty($conf->use_javascript_ajax)) $selectboxlist.=' <input type="submit" class="button" value="'.$langs->trans("AddBox").'">';
|
if (empty($conf->use_javascript_ajax)) $selectboxlist.=' <input type="submit" class="button" value="'.$langs->trans("AddBox").'">';
|
||||||
$selectboxlist.='</form>';
|
$selectboxlist.='</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1102,7 +1102,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
*/
|
*/
|
||||||
function DDLDropField($table,$field_name)
|
function DDLDropField($table,$field_name)
|
||||||
{
|
{
|
||||||
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
$sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
|
||||||
dol_syslog($sql,LOG_DEBUG);
|
dol_syslog($sql,LOG_DEBUG);
|
||||||
if (! $this->query($sql))
|
if (! $this->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1579,6 +1579,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function evaluates a string that should be a valid IPv4
|
* This function evaluates a string that should be a valid IPv4
|
||||||
|
* Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patchs of PHP (5.6.25). See https://github.com/php/php-src/pull/1954.
|
||||||
*
|
*
|
||||||
* @param string $ip IP Address
|
* @param string $ip IP Address
|
||||||
* @return int 0 if not valid or reserved range, 1 if valid and public IP, 2 if valid and private range IP
|
* @return int 0 if not valid or reserved range, 1 if valid and public IP, 2 if valid and private range IP
|
||||||
|
|||||||
@ -59,6 +59,9 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
|||||||
if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders);
|
if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders);
|
||||||
curl_setopt($ch, CURLINFO_HEADER_OUT, true); // To be able to retrieve request header and log it
|
curl_setopt($ch, CURLINFO_HEADER_OUT, true); // To be able to retrieve request header and log it
|
||||||
|
|
||||||
|
// TLSv1 by default or change to TLSv1.2 in module configuration
|
||||||
|
//curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->MAIN_CURL_SSLVERSION)?1:$conf->global->MAIN_CURL_SSLVERSION));
|
||||||
|
|
||||||
//turning off the server and peer verification(TrustManager Concept).
|
//turning off the server and peer verification(TrustManager Concept).
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||||
|
|||||||
@ -285,6 +285,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects&mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects&mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
|
||||||
|
-- Project - Categories
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
|
||||||
-- Tools
|
-- Tools
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__);
|
||||||
|
|||||||
@ -1212,6 +1212,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$newmenu->add("/projet/tasks/list.php", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
|
$newmenu->add("/projet/tasks/list.php", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||||
$newmenu->add("/projet/activity/perweek.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer && $user->rights->projet->lire);
|
$newmenu->add("/projet/activity/perweek.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer && $user->rights->projet->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
if (! empty($conf->categorie->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("categories");
|
||||||
|
$newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||||
|
$newmenu->add("/categories/card.php?action=create&type=6", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||||
|
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -554,7 +554,7 @@ class pdf_strato extends ModelePDFContract
|
|||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_creation,"day",false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_contrat,"day",false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
if ($object->thirdparty->code_client)
|
if ($object->thirdparty->code_client)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -207,6 +207,11 @@ class modAccounting extends DolibarrModules
|
|||||||
"chaine",
|
"chaine",
|
||||||
"csv"
|
"csv"
|
||||||
);
|
);
|
||||||
|
$this->const[24] = array(
|
||||||
|
"BANK_DISABLE_DIRECT_INPUT",
|
||||||
|
"yesno",
|
||||||
|
"1"
|
||||||
|
);
|
||||||
|
|
||||||
// Tabs
|
// Tabs
|
||||||
$this->tabs = array();
|
$this->tabs = array();
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class modCategorie extends DolibarrModules
|
|||||||
|
|
||||||
// Config pages
|
// Config pages
|
||||||
$this->config_page_url = array('categorie.php@categories');
|
$this->config_page_url = array('categorie.php@categories');
|
||||||
$this->langfiles = array("products","companies","categories");
|
$this->langfiles = array("products","companies","categories","members");
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
$this->const = array();
|
$this->const = array();
|
||||||
@ -182,7 +182,7 @@ class modCategorie extends DolibarrModules
|
|||||||
'u.label' => "Label",
|
'u.label' => "Label",
|
||||||
'u.description' => "Description",
|
'u.description' => "Description",
|
||||||
'p.rowid' => 'ContactId',
|
'p.rowid' => 'ContactId',
|
||||||
'p.civility' => 'Civility',
|
'p.civility' => 'UserTitle',
|
||||||
'p.lastname' => 'LastName',
|
'p.lastname' => 'LastName',
|
||||||
'p.firstname' => 'Firstname',
|
'p.firstname' => 'Firstname',
|
||||||
'p.address' => 'Address',
|
'p.address' => 'Address',
|
||||||
|
|||||||
@ -225,7 +225,7 @@ class modFacture extends DolibarrModules
|
|||||||
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||||
$this->export_icon[$r]='bill';
|
$this->export_icon[$r]='bill';
|
||||||
$this->export_permission[$r]=array(array("facture","facture","export"));
|
$this->export_permission[$r]=array(array("facture","facture","export"));
|
||||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','p.rowid'=>'PaymentId','p.ref'=>'PaymentRef','p.amount'=>'AmountPayment','pf.amount'=>'AmountPaymentDistributedOnInvoice','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'IdPaymentMode','pt.libelle'=>'LabelPaiementMode','p.note'=>'PaymentNote','p.fk_bank'=>'IdTransaction','ba.ref'=>'AccountRef');
|
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','p.rowid'=>'PaymentId','p.ref'=>'PaymentRef','p.amount'=>'AmountPayment','pf.amount'=>'AmountPaymentDistributedOnInvoice','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'IdPaymentMode','pt.libelle'=>'LabelPaymentMode','p.note'=>'PaymentNote','p.fk_bank'=>'IdTransaction','ba.ref'=>'AccountRef');
|
||||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Numeric','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric');
|
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Numeric','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric');
|
||||||
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"Numeric",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pj.ref'=>'Text','p.amount'=>'Numeric','pf.amount'=>'Numeric','p.rowid'=>'Numeric','p.ref'=>'Text','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric','p.note'=>'Text','pt.code'=>'Text','pt.libelle'=>'text','ba.ref'=>'Text');
|
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"Numeric",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pj.ref'=>'Text','p.amount'=>'Numeric','pf.amount'=>'Numeric','p.rowid'=>'Numeric','p.ref'=>'Text','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric','p.note'=>'Text','pt.code'=>'Text','pt.libelle'=>'text','ba.ref'=>'Text');
|
||||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'pj.ref'=>'project','p.rowid'=>'payment','p.ref'=>'payment','p.amount'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','pt.code'=>'payment','pt.libelle'=>'payment','p.note'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user','p.fk_bank'=>'account','ba.ref'=>'account');
|
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'pj.ref'=>'project','p.rowid'=>'payment','p.ref'=>'payment','p.amount'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','pt.code'=>'payment','pt.libelle'=>'payment','p.note'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user','p.fk_bank'=>'account','ba.ref'=>'account');
|
||||||
|
|||||||
@ -44,13 +44,13 @@ class modHRM extends DolibarrModules
|
|||||||
|
|
||||||
$this->family = "hr";
|
$this->family = "hr";
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace ( '/^mod/i', '', get_class ( $this ) );
|
$this->name = preg_replace( '/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des ressources humaines";
|
$this->description = "Management of employees carrier and feelings";
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||||
$this->version = 'development';
|
$this->version = 'development';
|
||||||
|
|
||||||
$this->const_name = 'MAIN_MODULE_' . strtoupper ( $this->name );
|
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
|
||||||
$this->special = 0;
|
$this->special = 0;
|
||||||
// $this->picto = '';
|
// $this->picto = '';
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class modSalaries extends DolibarrModules
|
|||||||
$this->depends = array();
|
$this->depends = array();
|
||||||
$this->requiredby = array();
|
$this->requiredby = array();
|
||||||
$this->conflictwith = array();
|
$this->conflictwith = array();
|
||||||
$this->langfiles = array("salaries");
|
$this->langfiles = array("salaries","bills");
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
$this->const = array();
|
$this->const = array();
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class modUser extends DolibarrModules
|
|||||||
// Dependancies
|
// Dependancies
|
||||||
$this->depends = array();
|
$this->depends = array();
|
||||||
$this->requiredby = array();
|
$this->requiredby = array();
|
||||||
$this->langfiles = array("main","users","companies");
|
$this->langfiles = array("main","users","companies","members");
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
$this->const = array();
|
$this->const = array();
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class printing_printgcp extends PrintingDriver
|
|||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $dolibarr_main_url_root;
|
global $conf, $langs, $dolibarr_main_url_root;
|
||||||
|
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||||
@ -66,7 +66,7 @@ class printing_printgcp extends PrintingDriver
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
if (!$conf->oauth->enabled) {
|
if (!$conf->oauth->enabled) {
|
||||||
$this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'ModuleAuthNotActive', 'type'=>'info');
|
$this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>$langs->transnoentitiesnoconv("WarningModuleNotActive", "OAuth"), 'type'=>'info');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$this->google_id = $conf->global->OAUTH_GOOGLE_ID;
|
$this->google_id = $conf->global->OAUTH_GOOGLE_ID;
|
||||||
|
|||||||
@ -1075,19 +1075,21 @@ class Cronjob extends CommonObject
|
|||||||
}
|
}
|
||||||
if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update with result
|
||||||
|
if (is_array($output_arr) && count($output_arr)>0)
|
||||||
|
{
|
||||||
|
foreach($output_arr as $val)
|
||||||
|
{
|
||||||
|
$this->lastoutput.=$val."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->lastresult=$retval;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG);
|
|
||||||
|
|
||||||
// Update with result
|
|
||||||
if (is_array($output_arr) && count($output_arr)>0)
|
|
||||||
{
|
|
||||||
foreach($output_arr as $val)
|
|
||||||
{
|
|
||||||
$this->lastoutput.=$val."\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->lastresult=$retval;
|
|
||||||
$this->datelastresult=dol_now();
|
$this->datelastresult=dol_now();
|
||||||
$result = $this->update($user); // This include begin/commit
|
$result = $this->update($user); // This include begin/commit
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -79,11 +79,32 @@ if ($result)
|
|||||||
print load_fiche_titre($langs->trans("DonationsArea"));
|
print load_fiche_titre($langs->trans("DonationsArea"));
|
||||||
|
|
||||||
|
|
||||||
print '<table width="100%" class="notopnoleftnoright">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
// Left area
|
if (! empty($conf->don->enabled) && $user->rights->don->lire)
|
||||||
print '<tr><td class="notopnoleft" width="30%" valign="top">';
|
{
|
||||||
|
$listofsearchfields['search_donation']=array('text'=>'Donation');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($listofsearchfields))
|
||||||
|
{
|
||||||
|
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="noborder nohover centpercent">';
|
||||||
|
$i=0;
|
||||||
|
foreach($listofsearchfields as $key => $value)
|
||||||
|
{
|
||||||
|
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
|
print '<tr '.$bc[false].'>';
|
||||||
|
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="14"></td>';
|
||||||
|
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
print '</form>';
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -136,8 +157,7 @@ print '</tr>';
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|
||||||
// Right area
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
print '</td><td valign="top">';
|
|
||||||
|
|
||||||
|
|
||||||
$max=10;
|
$max=10;
|
||||||
@ -203,7 +223,7 @@ if ($resql)
|
|||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -969,7 +969,7 @@ if ($action == 'create')
|
|||||||
else
|
else
|
||||||
$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
|
$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
|
||||||
*/
|
*/
|
||||||
$numprojet=$formproject->select_projects($soc->id,GETPOST('projectid','int'),'projectid');
|
$numprojet=$formproject->select_projects($soc->id,$projectid,'projectid');
|
||||||
if ($numprojet==0)
|
if ($numprojet==0)
|
||||||
{
|
{
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||||
@ -1041,6 +1041,8 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">';
|
print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">';
|
||||||
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||||
|
} elseif ($origin == 'project' && !empty($projectid)) {
|
||||||
|
print '<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -1058,6 +1060,13 @@ if ($action == 'create')
|
|||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
|
|
||||||
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||||
|
if (is_object($objectsrc))
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">';
|
||||||
|
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||||
|
} elseif ($origin == 'project' && !empty($projectid)) {
|
||||||
|
print '<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||||
|
}
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
print $form->select_company('','socid','','SelectThirdParty',1);
|
print $form->select_company('','socid','','SelectThirdParty',1);
|
||||||
|
|||||||
@ -120,8 +120,8 @@ if ($id > 0 && empty($object->id))
|
|||||||
|
|
||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$title=$langs->trans("ThirdParty")." - ".$langs->trans('SupplierCard');
|
$title=$langs->trans("ThirdParty")." - ".$langs->trans('Supplier');
|
||||||
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('SupplierCard');
|
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('Supplier');
|
||||||
$help_url='';
|
$help_url='';
|
||||||
llxHeader('',$title, $help_url);
|
llxHeader('',$title, $help_url);
|
||||||
|
|
||||||
|
|||||||
@ -1458,7 +1458,6 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->line->date_start=$date_start;
|
$this->line->date_start=$date_start;
|
||||||
$this->line->date_end=$date_end;
|
$this->line->date_end=$date_end;
|
||||||
|
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency
|
||||||
$this->line->fk_multicurrency = $this->fk_multicurrency;
|
$this->line->fk_multicurrency = $this->fk_multicurrency;
|
||||||
$this->line->multicurrency_code = $this->multicurrency_code;
|
$this->line->multicurrency_code = $this->multicurrency_code;
|
||||||
@ -1987,28 +1986,58 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
*
|
*
|
||||||
* @param User $user Objet user making change
|
* @param User $user Objet user making change
|
||||||
* @param timestamp $date_livraison Planned delivery date
|
* @param timestamp $date_livraison Planned delivery date
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_date_livraison($user, $date_livraison)
|
function set_date_livraison($user, $date_livraison, $notrigger=0)
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
$error=0;
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
||||||
$sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null');
|
$sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null');
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if (!$resql)
|
||||||
{
|
{
|
||||||
$this->date_livraison = $date_livraison;
|
$this->errors[]=$this->db->error();
|
||||||
return 1;
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if (! $error)
|
||||||
$this->error=$this->db->error();
|
{
|
||||||
return -1;
|
$this->oldcopy= clone $this;
|
||||||
}
|
$this->date_livraison = $date_livraison;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $notrigger && empty($error))
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$result=$this->call_trigger('ORDER_SUPPLIER_MODIFY',$user);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach($this->errors as $errmsg)
|
||||||
|
{
|
||||||
|
dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR);
|
||||||
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
|
}
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1*$error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2021,27 +2050,57 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
*
|
*
|
||||||
* @param User $user Objet utilisateur qui modifie
|
* @param User $user Objet utilisateur qui modifie
|
||||||
* @param int $id_projet Date de livraison
|
* @param int $id_projet Date de livraison
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function set_id_projet($user, $id_projet)
|
function set_id_projet($user, $id_projet, $notrigger=0)
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
|
$error=0;
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
|
||||||
$sql.= " SET fk_projet = ".($id_projet > 0 ? (int) $id_projet : 'null');
|
$sql.= " SET fk_projet = ".($id_projet > 0 ? (int) $id_projet : 'null');
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_id_projet", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if (!$resql)
|
||||||
{
|
{
|
||||||
$this->fk_projet = $id_projet;
|
$this->errors[]=$this->db->error();
|
||||||
return 1;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->oldcopy= clone $this;
|
||||||
|
$this->fk_projet = $id_projet;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $notrigger && empty($error))
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$result=$this->call_trigger('ORDER_SUPPLIER_MODIFY',$user);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
foreach($this->errors as $errmsg)
|
||||||
return -1;
|
{
|
||||||
|
dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR);
|
||||||
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
|
}
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1*$error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2972,7 +3031,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$sql.= "'".price2num($this->total_localtax2)."',";
|
$sql.= "'".price2num($this->total_localtax2)."',";
|
||||||
$sql.= "'".price2num($this->total_ttc)."',";
|
$sql.= "'".price2num($this->total_ttc)."',";
|
||||||
$sql.= ($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'":"null");
|
$sql.= ($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'":"null");
|
||||||
$sql.= ", ".$this->fk_multicurrency;
|
$sql.= ", ".($this->fk_multicurrency ? $this->fk_multicurrency : "null");
|
||||||
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
|
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
|
||||||
$sql.= ", ".price2num($this->pu_ht * $this->multicurrency_tx);
|
$sql.= ", ".price2num($this->pu_ht * $this->multicurrency_tx);
|
||||||
$sql.= ", ".$this->multicurrency_total_ht;
|
$sql.= ", ".$this->multicurrency_total_ht;
|
||||||
|
|||||||
@ -173,7 +173,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
else if ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->commande->creer) {
|
else if ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->commande->creer) {
|
||||||
$result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int'));
|
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// bank account
|
// bank account
|
||||||
@ -2831,12 +2831,10 @@ elseif (! empty($object->id))
|
|||||||
print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang);
|
print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang);
|
||||||
$somethingshown=$formfile->numoffiles;
|
$somethingshown=$formfile->numoffiles;
|
||||||
|
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('order_supplier'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('order_supplier'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -273,7 +273,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
else if ($action == 'setmulticurrencyrate' && $user->rights->facture->creer) {
|
else if ($action == 'setmulticurrencyrate' && $user->rights->facture->creer) {
|
||||||
$result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int'));
|
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// bank account
|
// bank account
|
||||||
@ -2218,13 +2218,10 @@ else
|
|||||||
if ($action != 'edit')
|
if ($action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
//print '<table width="100%"><tr><td width="50%" valign="top">';
|
|
||||||
//print '<a name="builddoc"></a>'; // ancre
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$ref=dol_sanitizeFileName($object->ref);
|
$ref=dol_sanitizeFileName($object->ref);
|
||||||
$subdir = get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
|
$subdir = get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
|
||||||
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
|
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
|
||||||
@ -2236,13 +2233,11 @@ else
|
|||||||
print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
|
print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
|
||||||
$somethingshown=$formfile->numoffiles;
|
$somethingshown=$formfile->numoffiles;
|
||||||
|
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice_supplier'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice_supplier'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
|
||||||
//print '</td><td valign="top" width="50%">';
|
//print '</td><td valign="top" width="50%">';
|
||||||
//print '<br>';
|
//print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -329,6 +329,9 @@ ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_amount double(24,8) DE
|
|||||||
ALTER TABLE llx_paiementfourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
|
ALTER TABLE llx_paiementfourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
|
||||||
ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
|
ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe_remise ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe_remise_except ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
|
||||||
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL;
|
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL;
|
||||||
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL;
|
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL;
|
||||||
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL;
|
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL;
|
||||||
|
|||||||
@ -13,10 +13,10 @@
|
|||||||
-- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex
|
-- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex
|
||||||
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
|
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
|
||||||
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
|
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
|
||||||
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||||
-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
|
-- To make pk to be auto increment (postgres): -- VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
|
||||||
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
|
-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
|
||||||
-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
||||||
-- Note: fields with type BLOB/TEXT can't have default value.
|
-- Note: fields with type BLOB/TEXT can't have default value.
|
||||||
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
||||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||||
@ -27,6 +27,8 @@ ALTER TABLE llx_user DROP COLUMN phenix_pass;
|
|||||||
|
|
||||||
ALTER TABLE llx_societe ADD COLUMN fk_account integer;
|
ALTER TABLE llx_societe ADD COLUMN fk_account integer;
|
||||||
|
|
||||||
|
ALTER TABLE llx_commandedet ADD COLUMN fk_commandefourndet integer NOT NULL after import_key; -- link to detail line of commande fourn (resplenish)
|
||||||
|
|
||||||
ALTER TABLE llx_website ADD COLUMN virtualhost varchar(255) after fk_default_home;
|
ALTER TABLE llx_website ADD COLUMN virtualhost varchar(255) after fk_default_home;
|
||||||
|
|
||||||
ALTER TABLE llx_chargesociales ADD COLUMN fk_account integer after fk_type;
|
ALTER TABLE llx_chargesociales ADD COLUMN fk_account integer after fk_type;
|
||||||
@ -43,3 +45,23 @@ ALTER TABLE llx_notify ADD COLUMN type_target varchar(16) NULL;
|
|||||||
|
|
||||||
ALTER TABLE llx_entrepot DROP COLUMN valo_pmp;
|
ALTER TABLE llx_entrepot DROP COLUMN valo_pmp;
|
||||||
|
|
||||||
|
ALTER TABLE llx_notify_def MODIFY COLUMN fk_soc integer NULL;
|
||||||
|
-- VPGSQL8.2 ALTER TABLE llx_notify_def ALTER COLUMN fk_soc SET DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
create table llx_categorie_project
|
||||||
|
(
|
||||||
|
fk_categorie integer NOT NULL,
|
||||||
|
fk_project integer NOT NULL,
|
||||||
|
import_key varchar(14)
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_categorie_project ADD PRIMARY KEY pk_categorie_project (fk_categorie, fk_project);
|
||||||
|
ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_categorie (fk_categorie);
|
||||||
|
ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_project (fk_project);
|
||||||
|
|
||||||
|
ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||||
|
ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_fk_project_rowid FOREIGN KEY (fk_project) REFERENCES llx_projet (rowid);
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe_remise_except ADD COLUMN entity integer DEFAULT 1 NOT NULL after rowid;
|
||||||
|
|
||||||
|
|||||||
@ -57,6 +57,8 @@ create table llx_commandedet
|
|||||||
fk_unit integer DEFAULT NULL, -- lien vers table des unités
|
fk_unit integer DEFAULT NULL, -- lien vers table des unités
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
|
|
||||||
|
fk_commandefourndet integer NOT NULL, -- link to detail line of commande fourn (resplenish)
|
||||||
|
|
||||||
fk_multicurrency integer,
|
fk_multicurrency integer,
|
||||||
multicurrency_code varchar(255),
|
multicurrency_code varchar(255),
|
||||||
multicurrency_subprice double(24,8) DEFAULT 0,
|
multicurrency_subprice double(24,8) DEFAULT 0,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
-- Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
--
|
--
|
||||||
-- 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
|
||||||
@ -22,7 +23,7 @@ create table llx_notify_def
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec date, -- date de creation
|
datec date, -- date de creation
|
||||||
fk_action integer NOT NULL,
|
fk_action integer NOT NULL,
|
||||||
fk_soc integer NOT NULL,
|
fk_soc integer,
|
||||||
fk_contact integer,
|
fk_contact integer,
|
||||||
fk_user integer,
|
fk_user integer,
|
||||||
type varchar(16) DEFAULT 'email'
|
type varchar(16) DEFAULT 'email'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
-- ========================================================================
|
-- ========================================================================
|
||||||
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
-- Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
-- Copyright (C) 2011-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
--
|
--
|
||||||
-- 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
|
||||||
@ -21,13 +21,14 @@
|
|||||||
|
|
||||||
create table llx_societe_remise
|
create table llx_societe_remise
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_soc integer NOT NULL,
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
tms timestamp,
|
fk_soc integer NOT NULL,
|
||||||
datec datetime, -- creation date
|
tms timestamp,
|
||||||
fk_user_author integer, -- creation user
|
datec datetime, -- creation date
|
||||||
remise_client double(6,3) DEFAULT 0 NOT NULL, -- discount
|
fk_user_author integer, -- creation user
|
||||||
note text
|
remise_client double(6,3) DEFAULT 0 NOT NULL, -- discount
|
||||||
|
note text
|
||||||
|
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
|||||||
@ -21,18 +21,19 @@
|
|||||||
|
|
||||||
create table llx_societe_remise_except
|
create table llx_societe_remise_except
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_soc integer NOT NULL, -- client
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
datec datetime,
|
fk_soc integer NOT NULL, -- client
|
||||||
amount_ht double(24,8) NOT NULL,
|
datec datetime,
|
||||||
amount_tva double(24,8) DEFAULT 0 NOT NULL,
|
amount_ht double(24,8) NOT NULL,
|
||||||
amount_ttc double(24,8) DEFAULT 0 NOT NULL,
|
amount_tva double(24,8) DEFAULT 0 NOT NULL,
|
||||||
tva_tx double(6,3) DEFAULT 0 NOT NULL,
|
amount_ttc double(24,8) DEFAULT 0 NOT NULL,
|
||||||
fk_user integer NOT NULL,
|
tva_tx double(6,3) DEFAULT 0 NOT NULL,
|
||||||
fk_facture_line integer,
|
fk_user integer NOT NULL,
|
||||||
fk_facture integer,
|
fk_facture_line integer,
|
||||||
fk_facture_source integer,
|
fk_facture integer,
|
||||||
description text NOT NULL,
|
fk_facture_source integer,
|
||||||
|
description text NOT NULL,
|
||||||
multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL,
|
multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL,
|
||||||
multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL,
|
multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL,
|
||||||
multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL
|
multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL
|
||||||
|
|||||||
@ -403,6 +403,12 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
|||||||
$beforeversionarray=explode('.','4.0.9');
|
$beforeversionarray=explode('.','4.0.9');
|
||||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
||||||
{
|
{
|
||||||
|
// Migrate to add entity value into llx_societe_remise
|
||||||
|
migrate_remise_entity($db,$langs,$conf);
|
||||||
|
|
||||||
|
// Migrate to add entity value into llx_societe_remise_except
|
||||||
|
migrate_remise_except_entity($db,$langs,$conf);
|
||||||
|
|
||||||
migrate_directories($db,$langs,$conf,'/fckeditor','/medias');
|
migrate_directories($db,$langs,$conf,'/fckeditor','/medias');
|
||||||
|
|
||||||
// Reload modules (this must be always and only into last targeted version)
|
// Reload modules (this must be always and only into last targeted version)
|
||||||
@ -3659,6 +3665,196 @@ function migrate_event_assignement($db,$langs,$conf)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate to add entity value into llx_societe_remise
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param Translate $langs Object langs
|
||||||
|
* @param Conf $conf Object conf
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function migrate_remise_entity($db,$langs,$conf)
|
||||||
|
{
|
||||||
|
print '<tr><td colspan="4">';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print '<b>'.$langs->trans('MigrationRemiseEntity')."</b><br>\n";
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
dolibarr_install_syslog("upgrade2::migrate_remise_entity");
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
$sqlSelect = "SELECT sr.rowid, s.entity";
|
||||||
|
$sqlSelect.= " FROM ".MAIN_DB_PREFIX."societe_remise as sr, ".MAIN_DB_PREFIX."societe as s";
|
||||||
|
$sqlSelect.= " WHERE sr.fk_soc = s.rowid";
|
||||||
|
|
||||||
|
//print $sqlSelect;
|
||||||
|
|
||||||
|
$resql = $db->query($sqlSelect);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."societe_remise SET";
|
||||||
|
$sqlUpdate.= " entity = " . $obj->entity;
|
||||||
|
$sqlUpdate.= " WHERE rowid = " . $obj->rowid;
|
||||||
|
|
||||||
|
$result=$db->query($sqlUpdate);
|
||||||
|
if (! $result)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print ". ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans('AlreadyDone')."<br>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate to add entity value into llx_societe_remise_except
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param Translate $langs Object langs
|
||||||
|
* @param Conf $conf Object conf
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function migrate_remise_except_entity($db,$langs,$conf)
|
||||||
|
{
|
||||||
|
print '<tr><td colspan="4">';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print '<b>'.$langs->trans('MigrationRemiseExceptEntity')."</b><br>\n";
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
dolibarr_install_syslog("upgrade2::migrate_remise_except_entity");
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
$sqlSelect = "SELECT sr.rowid, sr.fk_soc, sr.fk_facture_source, sr.fk_facture, sr.fk_facture_line";
|
||||||
|
$sqlSelect.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
|
||||||
|
//print $sqlSelect;
|
||||||
|
|
||||||
|
$resql = $db->query($sqlSelect);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
if (!empty($obj->fk_facture_source) || !empty($obj->fk_facture))
|
||||||
|
{
|
||||||
|
$fk_facture = (!empty($obj->fk_facture_source) ? $obj->fk_facture_source : $obj->fk_facture);
|
||||||
|
|
||||||
|
$sqlSelect2 = "SELECT f.entity";
|
||||||
|
$sqlSelect2.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||||
|
$sqlSelect2.= " WHERE f.rowid = " . $fk_facture;
|
||||||
|
}
|
||||||
|
else if (!empty($obj->fk_facture_line))
|
||||||
|
{
|
||||||
|
$sqlSelect2 = "SELECT f.entity";
|
||||||
|
$sqlSelect2.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
|
||||||
|
$sqlSelect2.= " WHERE fd.rowid = " . $obj->fk_facture_line;
|
||||||
|
$sqlSelect2.= " AND fd.fk_facture = f.rowid";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sqlSelect2 = "SELECT s.entity";
|
||||||
|
$sqlSelect2.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
|
$sqlSelect2.= " WHERE s.rowid = " . $obj->fk_soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
$resql2 = $db->query($sqlSelect2);
|
||||||
|
if ($resql2)
|
||||||
|
{
|
||||||
|
if ($db->num_rows($resql2) > 0)
|
||||||
|
{
|
||||||
|
$obj2 = $db->fetch_object($resql2);
|
||||||
|
|
||||||
|
$sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."societe_remise_except SET";
|
||||||
|
$sqlUpdate.= " entity = " . $obj2->entity;
|
||||||
|
$sqlUpdate.= " WHERE rowid = " . $obj->rowid;
|
||||||
|
|
||||||
|
$result=$db->query($sqlUpdate);
|
||||||
|
if (! $result)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print ". ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans('AlreadyDone')."<br>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migration directory
|
* Migration directory
|
||||||
*
|
*
|
||||||
|
|||||||
@ -56,7 +56,8 @@ ACCOUNTING_LENGTH_DESCRIPTION=Length for displaying product & services descripti
|
|||||||
ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Length for displaying product & services account description form in listings (Best = 50)
|
ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Length for displaying product & services account description form in listings (Best = 50)
|
||||||
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounts
|
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounts
|
||||||
ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts
|
ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts
|
||||||
ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disable by default. Be careful with the function of length of the accounts.
|
ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disable by default. Be careful with the function "length of the accounts".
|
||||||
|
BANK_DISABLE_DIRECT_INPUT=Disable free input of bank transactions. Enable by default with this module.
|
||||||
|
|
||||||
ACCOUNTING_SELL_JOURNAL=Sell journal
|
ACCOUNTING_SELL_JOURNAL=Sell journal
|
||||||
ACCOUNTING_PURCHASE_JOURNAL=Purchase journal
|
ACCOUNTING_PURCHASE_JOURNAL=Purchase journal
|
||||||
@ -158,6 +159,8 @@ OptionModeProductSell=Mode sales
|
|||||||
OptionModeProductBuy=Mode purchases
|
OptionModeProductBuy=Mode purchases
|
||||||
OptionModeProductSellDesc=Show all products with no accounting account defined for sales.
|
OptionModeProductSellDesc=Show all products with no accounting account defined for sales.
|
||||||
OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases.
|
OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases.
|
||||||
|
CleanFixHistory=Remove accountancy code from lines that not exists into charts of account
|
||||||
|
CleanHistory=Reset all accountancy for selected year
|
||||||
|
|
||||||
## Dictionary
|
## Dictionary
|
||||||
Range=Range of accounting account
|
Range=Range of accounting account
|
||||||
|
|||||||
@ -1037,9 +1037,13 @@ SendmailOptionNotComplete=Warning, on some Linux systems, to send email from you
|
|||||||
PathToDocuments=Path to documents
|
PathToDocuments=Path to documents
|
||||||
PathDirectory=Directory
|
PathDirectory=Directory
|
||||||
SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by those bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommended) is to use the method "SMTP socket library" that has no disadvantages.
|
SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by those bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommended) is to use the method "SMTP socket library" that has no disadvantages.
|
||||||
TranslationSetup=Configuration de la traduction
|
TranslationSetup=Setup of translation
|
||||||
TranslationDesc=How to set displayed application language<br>* Systemwide: menu <strong>Home - Setup - Display</strong><br>* Per user: <strong>User display setup</strong> tab of user card (click on username at the top of the screen).
|
TranslationKeySearch=Search a translation key or string
|
||||||
|
TranslationOverwriteKey=Overwrite a translation string
|
||||||
|
TranslationDesc=How to set displayed application language :<br>* Systemwide: menu <strong>Home - Setup - Display</strong><br>* Per user: <strong>User display setup</strong> tab of user card (click on username at the top of the screen).
|
||||||
TranslationOverwriteDesc=You can also override strings filling the following table. Choose your language from "%s" dropdown, insert the key string found in the lang file (langs/xx_XX/somefile.lang) into "%s" and your new translation into "%s".
|
TranslationOverwriteDesc=You can also override strings filling the following table. Choose your language from "%s" dropdown, insert the key string found in the lang file (langs/xx_XX/somefile.lang) into "%s" and your new translation into "%s".
|
||||||
|
TranslationString=Translation string
|
||||||
|
NewTranslationStringToShow=New translation string to show
|
||||||
TotalNumberOfActivatedModules=Total number of activated feature modules: <b>%s</b> / <b>%s</b>
|
TotalNumberOfActivatedModules=Total number of activated feature modules: <b>%s</b> / <b>%s</b>
|
||||||
YouMustEnableOneModule=You must at least enable 1 module
|
YouMustEnableOneModule=You must at least enable 1 module
|
||||||
ClassNotFoundIntoPathWarning=Class %s not found into PHP path
|
ClassNotFoundIntoPathWarning=Class %s not found into PHP path
|
||||||
|
|||||||
@ -381,6 +381,7 @@ ExtraInfos=Extra infos
|
|||||||
RegulatedOn=Regulated on
|
RegulatedOn=Regulated on
|
||||||
ChequeNumber=Check N°
|
ChequeNumber=Check N°
|
||||||
ChequeOrTransferNumber=Check/Transfer N°
|
ChequeOrTransferNumber=Check/Transfer N°
|
||||||
|
ChequeBordereau=Check schedule
|
||||||
ChequeMaker=Check/Transfer transmitter
|
ChequeMaker=Check/Transfer transmitter
|
||||||
ChequeBank=Bank of Check
|
ChequeBank=Bank of Check
|
||||||
CheckBank=Check
|
CheckBank=Check
|
||||||
|
|||||||
@ -81,4 +81,4 @@ ForCustomersInvoices=Customers invoices
|
|||||||
ForCustomersOrders=Customers orders
|
ForCustomersOrders=Customers orders
|
||||||
ForProposals=Proposals
|
ForProposals=Proposals
|
||||||
LastXMonthRolling=The latest %s month rolling
|
LastXMonthRolling=The latest %s month rolling
|
||||||
ChooseBoxToAdd=Add widget to your dashboard...
|
ChooseBoxToAdd=Add widget to your dashboard
|
||||||
|
|||||||
@ -14,6 +14,7 @@ CustomersCategoriesArea=Customers tags/categories area
|
|||||||
MembersCategoriesArea=Members tags/categories area
|
MembersCategoriesArea=Members tags/categories area
|
||||||
ContactsCategoriesArea=Contacts tags/categories area
|
ContactsCategoriesArea=Contacts tags/categories area
|
||||||
AccountsCategoriesArea=Accounts tags/categories area
|
AccountsCategoriesArea=Accounts tags/categories area
|
||||||
|
ProjectsCategoriesArea=Projects tags/categories area
|
||||||
SubCats=Subcategories
|
SubCats=Subcategories
|
||||||
CatList=List of tags/categories
|
CatList=List of tags/categories
|
||||||
NewCategory=New tag/category
|
NewCategory=New tag/category
|
||||||
@ -36,6 +37,7 @@ ProductHasNoCategory=This product/service is not in any tags/categories
|
|||||||
CompanyHasNoCategory=This thirdparty is not in any tags/categories
|
CompanyHasNoCategory=This thirdparty is not in any tags/categories
|
||||||
MemberHasNoCategory=This member is not in any tags/categories
|
MemberHasNoCategory=This member is not in any tags/categories
|
||||||
ContactHasNoCategory=This contact is not in any tags/categories
|
ContactHasNoCategory=This contact is not in any tags/categories
|
||||||
|
ProjectHasNoCategory=This project is not in any tags/categories
|
||||||
ClassifyInCategory=Add to tag/category
|
ClassifyInCategory=Add to tag/category
|
||||||
NotCategorized=Without tag/category
|
NotCategorized=Without tag/category
|
||||||
CategoryExistsAtSameLevel=This category already exists with this ref
|
CategoryExistsAtSameLevel=This category already exists with this ref
|
||||||
@ -56,12 +58,14 @@ ProductsCategoriesShort=Products tags/categories
|
|||||||
MembersCategoriesShort=Members tags/categories
|
MembersCategoriesShort=Members tags/categories
|
||||||
ContactCategoriesShort=Contacts tags/categories
|
ContactCategoriesShort=Contacts tags/categories
|
||||||
AccountsCategoriesShort=Accounts tags/categories
|
AccountsCategoriesShort=Accounts tags/categories
|
||||||
|
ProjectsCategoriesShort=Projects tags/categories
|
||||||
ThisCategoryHasNoProduct=This category does not contain any product.
|
ThisCategoryHasNoProduct=This category does not contain any product.
|
||||||
ThisCategoryHasNoSupplier=This category does not contain any supplier.
|
ThisCategoryHasNoSupplier=This category does not contain any supplier.
|
||||||
ThisCategoryHasNoCustomer=This category does not contain any customer.
|
ThisCategoryHasNoCustomer=This category does not contain any customer.
|
||||||
ThisCategoryHasNoMember=This category does not contain any member.
|
ThisCategoryHasNoMember=This category does not contain any member.
|
||||||
ThisCategoryHasNoContact=This category does not contain any contact.
|
ThisCategoryHasNoContact=This category does not contain any contact.
|
||||||
ThisCategoryHasNoAccount=This category does not contain any account.
|
ThisCategoryHasNoAccount=This category does not contain any account.
|
||||||
|
ThisCategoryHasNoProject=This category does not contain any project.
|
||||||
CategId=Tag/category id
|
CategId=Tag/category id
|
||||||
CatSupList=List of supplier tags/categories
|
CatSupList=List of supplier tags/categories
|
||||||
CatCusList=List of customer/prospect tags/categories
|
CatCusList=List of customer/prospect tags/categories
|
||||||
@ -71,6 +75,7 @@ CatContactList=List of contact tags/categories
|
|||||||
CatSupLinks=Links between suppliers and tags/categories
|
CatSupLinks=Links between suppliers and tags/categories
|
||||||
CatCusLinks=Links between customers/prospects and tags/categories
|
CatCusLinks=Links between customers/prospects and tags/categories
|
||||||
CatProdLinks=Links between products/services and tags/categories
|
CatProdLinks=Links between products/services and tags/categories
|
||||||
|
CatProJectLinks=Links between projects and tags/categories
|
||||||
DeleteFromCat=Remove from tags/category
|
DeleteFromCat=Remove from tags/category
|
||||||
ExtraFieldsCategories=Complementary attributes
|
ExtraFieldsCategories=Complementary attributes
|
||||||
CategoriesSetup=Tags/categories setup
|
CategoriesSetup=Tags/categories setup
|
||||||
|
|||||||
@ -261,6 +261,7 @@ AddContactAddress=Create contact/address
|
|||||||
EditContact=Edit contact
|
EditContact=Edit contact
|
||||||
EditContactAddress=Edit contact/address
|
EditContactAddress=Edit contact/address
|
||||||
Contact=Contact
|
Contact=Contact
|
||||||
|
ContactId=Contact id
|
||||||
ContactsAddresses=Contacts/Addresses
|
ContactsAddresses=Contacts/Addresses
|
||||||
NoContactDefinedForThirdParty=No contact defined for this third party
|
NoContactDefinedForThirdParty=No contact defined for this third party
|
||||||
NoContactDefined=No contact defined
|
NoContactDefined=No contact defined
|
||||||
|
|||||||
@ -191,6 +191,8 @@ MigrationActioncommElement=Update data on actions
|
|||||||
MigrationPaymentMode=Data migration for payment mode
|
MigrationPaymentMode=Data migration for payment mode
|
||||||
MigrationCategorieAssociation=Migration of categories
|
MigrationCategorieAssociation=Migration of categories
|
||||||
MigrationEvents=Migration of events to add event owner into assignement table
|
MigrationEvents=Migration of events to add event owner into assignement table
|
||||||
|
MigrationRemiseEntity=Update entity field value of llx_societe_remise
|
||||||
|
MigrationRemiseExceptEntity=Update entity field value of llx_societe_remise_except
|
||||||
MigrationReloadModule=Reload module %s
|
MigrationReloadModule=Reload module %s
|
||||||
ShowNotAvailableOptions=Show not available options
|
ShowNotAvailableOptions=Show not available options
|
||||||
HideNotAvailableOptions=Hide not available options
|
HideNotAvailableOptions=Hide not available options
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# ADMIN
|
# Dolibarr language file - Source file is en_US - multicurrency
|
||||||
|
MultiCurrency=Multi currency
|
||||||
ErrorAddRateFail=Error in added rate
|
ErrorAddRateFail=Error in added rate
|
||||||
ErrorAddCurrencyFail=Error in added currency
|
ErrorAddCurrencyFail=Error in added currency
|
||||||
ErrorDeleteCurrencyFail=Error delete fail
|
ErrorDeleteCurrencyFail=Error delete fail
|
||||||
|
|||||||
@ -47,6 +47,7 @@ DefaultModelSupplierProposalCreate=Default model creation
|
|||||||
DefaultModelSupplierProposalToBill=Default template when closing a price request (accepted)
|
DefaultModelSupplierProposalToBill=Default template when closing a price request (accepted)
|
||||||
DefaultModelSupplierProposalClosed=Default template when closing a price request (refused)
|
DefaultModelSupplierProposalClosed=Default template when closing a price request (refused)
|
||||||
ListOfSupplierProposal=List of supplier proposal requests
|
ListOfSupplierProposal=List of supplier proposal requests
|
||||||
|
ListSupplierProposalsAssociatedProject=List of supplier proposals associated with project
|
||||||
SupplierProposalsToClose=Supplier proposals to close
|
SupplierProposalsToClose=Supplier proposals to close
|
||||||
SupplierProposalsToProcess=Supplier proposals to process
|
SupplierProposalsToProcess=Supplier proposals to process
|
||||||
LastSupplierProposals=Last price requests
|
LastSupplierProposals=Last price requests
|
||||||
|
|||||||
@ -1940,7 +1940,7 @@ if (! function_exists("llxFooter"))
|
|||||||
//console.log($(this).parent().parent().find(\'dd ul\'));
|
//console.log($(this).parent().parent().find(\'dd ul\'));
|
||||||
$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\');
|
$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\');
|
||||||
// Note: Did not find a way to get exact height (value is update at exit) so i calculate a generic from nb of lines
|
// Note: Did not find a way to get exact height (value is update at exit) so i calculate a generic from nb of lines
|
||||||
heigthofcontent = 19 * $(this).parent().parent().find(\'dd div ul li\').length;
|
heigthofcontent = 21 * $(this).parent().parent().find(\'dd div ul li\').length;
|
||||||
if (heigthofcontent > 300) heigthofcontent = 300; // limited by max-height on css .dropdown dd ul
|
if (heigthofcontent > 300) heigthofcontent = 300; // limited by max-height on css .dropdown dd ul
|
||||||
posbottom = $(this).parent().parent().find(\'dd\').offset().top + heigthofcontent + 8;
|
posbottom = $(this).parent().parent().find(\'dd\').offset().top + heigthofcontent + 8;
|
||||||
//console.log(posbottom);
|
//console.log(posbottom);
|
||||||
|
|||||||
@ -69,11 +69,21 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$result = $object->fetch($id, $ref);
|
$result = $object->fetch($id, $ref);
|
||||||
|
|
||||||
$helpurl='';
|
$title = $langs->trans('ProductServiceCard');
|
||||||
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
$helpurl = '';
|
||||||
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Card');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Card');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader("", $langs->trans("CardProduct".$object->type), $help_url);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* En mode visu
|
* En mode visu
|
||||||
|
|||||||
@ -188,10 +188,11 @@ if ($object->fk_user_creat)
|
|||||||
$userstatic->fetch($object->fk_user_creat);
|
$userstatic->fetch($object->fk_user_creat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$title = $object->titre." - ".$langs->trans('Card');
|
||||||
|
$helpurl = '';
|
||||||
$arrayofjs=array();
|
$arrayofjs=array();
|
||||||
$arrayofcss=array('/opensurvey/css/style.css');
|
$arrayofcss=array('/opensurvey/css/style.css');
|
||||||
llxHeader('',$object->titre, 0, 0, 0, 0, $arrayofjs, $arrayofcss);
|
llxHeader('',$title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
// Define format of choices
|
// Define format of choices
|
||||||
@ -219,7 +220,7 @@ print '<table class="border" width="100%">';
|
|||||||
$linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="titlefieldcreate">'.$langs->trans('Ref').'</td>';
|
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
|
print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -49,7 +49,7 @@ $nblignes=$object->fetch_lines();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Return to the results
|
// Return to the results
|
||||||
if (GETPOST('retoursondage')) {
|
if (GETPOST('retoursondage')) {
|
||||||
header('Location: results.php?id='.$_GET['id']);
|
header('Location: results.php?id='.$_GET['id']);
|
||||||
exit;
|
exit;
|
||||||
@ -403,9 +403,11 @@ if ($result <= 0)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$title = $object->titre." - ".$langs->trans('Card');
|
||||||
|
$helpurl = '';
|
||||||
$arrayofjs=array();
|
$arrayofjs=array();
|
||||||
$arrayofcss=array('/opensurvey/css/style.css');
|
$arrayofcss=array('/opensurvey/css/style.css');
|
||||||
llxHeader('',$object->titre, 0, 0, 0, 0, $arrayofjs, $arrayofcss);
|
llxHeader('',$title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
// Define format of choices
|
// Define format of choices
|
||||||
@ -432,7 +434,7 @@ print '<table class="border" width="100%">';
|
|||||||
$linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="titlefieldcreate">'.$langs->trans('Ref').'</td>';
|
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
|
print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -133,15 +133,15 @@ llxHeader('', $langs->trans("OpenSurvey"), '', "", 0, 0, $arrayofjs, $arrayofcss
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("CreatePoll").' (1 / 2)');
|
print load_fiche_titre($langs->trans("CreatePoll").' (1 / 2)');
|
||||||
|
|
||||||
//debut du formulaire
|
// debut du formulaire
|
||||||
print '<form name="formulaire" action="" method="POST">'."\n";
|
print '<form name="formulaire" action="" method="POST">'."\n";
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
//Affichage des différents champs textes a remplir
|
// Affichage des différents champs textes a remplir
|
||||||
print '<table class="border" width="100%">'."\n";
|
print '<table class="border" width="100%">'."\n";
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'. $langs->trans("PollTitle") .'</td><td><input type="text" name="titre" size="40" maxlength="80" value="'.$_SESSION["titre"].'"></td>'."\n";
|
print '<tr><td class="titlefieldcreate fieldrequired">'. $langs->trans("PollTitle") .'</td><td><input type="text" name="titre" size="40" maxlength="80" value="'.$_SESSION["titre"].'"></td>'."\n";
|
||||||
if (! $_SESSION["titre"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre')))
|
if (! $_SESSION["titre"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre')))
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PollTitle")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PollTitle")), null, 'errors');
|
||||||
@ -180,7 +180,7 @@ if ($_SESSION['allow_comments']) $allow_comments = 'checked';
|
|||||||
if (isset($_POST['allow_comments'])) $allow_comments=GETPOST('allow_comments')?'checked':'';
|
if (isset($_POST['allow_comments'])) $allow_comments=GETPOST('allow_comments')?'checked':'';
|
||||||
print '<input type="checkbox" name="allow_comments" '.$allow_comments.'"> '.$langs->trans('CanComment').'<br />'."\n";
|
print '<input type="checkbox" name="allow_comments" '.$allow_comments.'"> '.$langs->trans('CanComment').'<br />'."\n";
|
||||||
|
|
||||||
if ($_SESSION['allow_spy']) $allow_spy = 'checed';
|
if ($_SESSION['allow_spy']) $allow_spy = 'checked';
|
||||||
if (isset($_POST['allow_spy'])) $allow_spy=GETPOST('allow_spy')?'checked':'';
|
if (isset($_POST['allow_spy'])) $allow_spy=GETPOST('allow_spy')?'checked':'';
|
||||||
print '<input type="checkbox" name="allow_spy" '.$allow_spy.'> '.$langs->trans('CanSeeOthersVote').'<br />'."\n";
|
print '<input type="checkbox" name="allow_spy" '.$allow_spy.'> '.$langs->trans('CanSeeOthersVote').'<br />'."\n";
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ if (GETPOST('choix_sondage'))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//affichage des boutons pour choisir sondage date ou autre
|
// affichage des boutons pour choisir sondage date ou autre
|
||||||
print '<br><table>'."\n";
|
print '<br><table>'."\n";
|
||||||
print '<tr><td>'. $langs->trans("CreateSurveyDate") .'</td><td></td> '."\n";
|
print '<tr><td>'. $langs->trans("CreateSurveyDate") .'</td><td></td> '."\n";
|
||||||
print '<td><input type="image" name="creation_sondage_date" value="'.$langs->trans('CreateSurveyDate').'" src="../img/calendar-32.png"></td></tr>'."\n";
|
print '<td><input type="image" name="creation_sondage_date" value="'.$langs->trans('CreateSurveyDate').'" src="../img/calendar-32.png"></td></tr>'."\n";
|
||||||
|
|||||||
@ -817,12 +817,19 @@ if (empty($reshook))
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$helpurl='';
|
$title = $langs->trans('ProductServiceCard');
|
||||||
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
$helpurl = '';
|
||||||
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
if (isset($_GET['type'])) $title = $langs->trans('CardProduct'.GETPOST('type'));
|
{
|
||||||
else $title = $langs->trans('ProductServiceCard');
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Card');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Card');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader('', $title, $helpurl);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
@ -955,7 +962,7 @@ else
|
|||||||
print '</td><td>'.$langs->trans("BarcodeValue").'</td><td>';
|
print '</td><td>'.$langs->trans("BarcodeValue").'</td><td>';
|
||||||
$tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode;
|
$tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode;
|
||||||
if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type);
|
if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type);
|
||||||
print '<input size="40" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
print '<input size="40" class="maxwidthonsmartphone" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -969,7 +976,7 @@ else
|
|||||||
|
|
||||||
// Public URL
|
// Public URL
|
||||||
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
||||||
print '<input type="text" name="url" size="90" value="'.GETPOST('url').'">';
|
print '<input type="text" name="url" class="quatrevingtpercent" value="'.GETPOST('url').'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Stock min level
|
// Stock min level
|
||||||
@ -1154,7 +1161,11 @@ else
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></div>';
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" value="' . $langs->trans("Create") . '">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
@ -1257,7 +1268,7 @@ else
|
|||||||
print '</td><td>'.$langs->trans("BarcodeValue").'</td><td>';
|
print '</td><td>'.$langs->trans("BarcodeValue").'</td><td>';
|
||||||
$tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode;
|
$tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode;
|
||||||
if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type);
|
if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type);
|
||||||
print '<input size="40" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
print '<input size="40" class="maxwidthonsmartphone" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1273,7 +1284,7 @@ else
|
|||||||
|
|
||||||
// Public Url
|
// Public Url
|
||||||
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
||||||
print '<input type="text" name="url" size="80" value="'.$object->url.'">';
|
print '<input type="text" name="url" class="quatrevingtpercent" value="'.$object->url.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Stock
|
// Stock
|
||||||
@ -1364,7 +1375,7 @@ else
|
|||||||
print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" size="10" value="'.$object->customcode.'"></td>';
|
print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" size="10" value="'.$object->customcode.'"></td>';
|
||||||
// Origin country
|
// Origin country
|
||||||
print '<td>'.$langs->trans("CountryOrigin").'</td><td>';
|
print '<td>'.$langs->trans("CountryOrigin").'</td><td>';
|
||||||
print $form->select_country($object->country_id,'country_id');
|
print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -1515,7 +1526,7 @@ else
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="setbarcode">';
|
print '<input type="hidden" name="action" value="setbarcode">';
|
||||||
print '<input type="hidden" name="barcode_type_code" value="'.$object->barcode_type_code.'">';
|
print '<input type="hidden" name="barcode_type_code" value="'.$object->barcode_type_code.'">';
|
||||||
print '<input size="40" type="text" name="barcode" value="'.$object->barcode.'">';
|
print '<input size="40" class="maxwidthonsmartphone" type="text" name="barcode" value="'.$object->barcode.'">';
|
||||||
print ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -3727,11 +3727,11 @@ class Product extends CommonObject
|
|||||||
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
|
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
|
||||||
{
|
{
|
||||||
$return.= '<!-- Show thumb -->';
|
$return.= '<!-- Show thumb -->';
|
||||||
$return.= '<img class="photo photowithmargin" border="0" '.($conf->dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
|
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$return.= '<!-- Show original file -->';
|
$return.= '<!-- Show original file -->';
|
||||||
$return.= '<img class="photo photowithmargin" border="0" '.($conf->dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">';
|
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($nolink)) $return.= '</a>';
|
if (empty($nolink)) $return.= '</a>';
|
||||||
|
|||||||
@ -133,10 +133,6 @@ else if($action==='save_composed_product')
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$helpurl='';
|
|
||||||
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
|
||||||
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
|
||||||
|
|
||||||
$product_fourn = new ProductFournisseur($db);
|
$product_fourn = new ProductFournisseur($db);
|
||||||
$productstatic = new Product($db);
|
$productstatic = new Product($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
@ -177,10 +173,22 @@ if ($action == 'search')
|
|||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
}
|
}
|
||||||
//print $sql;
|
|
||||||
|
|
||||||
|
$title = $langs->trans('ProductServiceCard');
|
||||||
|
$helpurl = '';
|
||||||
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('AssociatedProducts');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('AssociatedProducts');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader("", $langs->trans("CardProduct".$object->type), $helpurl);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
$head=product_prepare_head($object);
|
$head=product_prepare_head($object);
|
||||||
$titre=$langs->trans("CardProduct".$object->type);
|
$titre=$langs->trans("CardProduct".$object->type);
|
||||||
|
|||||||
@ -166,11 +166,21 @@ if ($action=='filemerge')
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$helpurl='';
|
$title = $langs->trans('ProductServiceCard');
|
||||||
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
$helpurl = '';
|
||||||
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Documents');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Documents');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader("", $langs->trans("CardProduct".$object->type), $help_url);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
|
|
||||||
if ($object->id)
|
if ($object->id)
|
||||||
|
|||||||
@ -274,19 +274,26 @@ if (empty($reshook))
|
|||||||
* view
|
* view
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$helpurl='';
|
$title = $langs->trans('ProductServiceCard');
|
||||||
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
$helpurl = '';
|
||||||
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('BuyingPrices');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('BuyingPrices');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if ($id > 0 || $ref)
|
if ($id > 0 || $ref)
|
||||||
{
|
{
|
||||||
if ($action <> 're-edit')
|
|
||||||
{
|
|
||||||
llxHeader("", $langs->trans("CardProduct".$object->type), $helpurl);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
if ($action == 'ask_remove_pf') {
|
if ($action == 'ask_remove_pf') {
|
||||||
@ -365,7 +372,7 @@ if ($id > 0 || $ref)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Supplier
|
// Supplier
|
||||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("Supplier").'</td><td>';
|
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Supplier").'</td><td>';
|
||||||
if ($rowid)
|
if ($rowid)
|
||||||
{
|
{
|
||||||
$supplier=new Fournisseur($db);
|
$supplier=new Fournisseur($db);
|
||||||
|
|||||||
@ -56,11 +56,21 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$helpurl='';
|
$title = $langs->trans('ProductServiceCard');
|
||||||
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
$helpurl = '';
|
||||||
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Info');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Info');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
$title=$langs->trans("Product");
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
$form=new Form($b);
|
$form=new Form($b);
|
||||||
|
|
||||||
|
|||||||
@ -92,6 +92,14 @@ if (empty($reshook))
|
|||||||
$search_soc = '';
|
$search_soc = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'setlabelsellingprice' && $user->admin)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||||
|
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.GETPOST('pricelevel');
|
||||||
|
dolibarr_set_const($db, $keyforlabel, GETPOST('labelsellingprice','alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
|
||||||
if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer))
|
if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||||
{
|
{
|
||||||
$tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)'
|
$tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)'
|
||||||
@ -619,11 +627,21 @@ if (! empty($id) || ! empty($ref))
|
|||||||
$object->fetch($id, $ref);
|
$object->fetch($id, $ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
$helpurl='';
|
$title = $langs->trans('ProductServiceCard');
|
||||||
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
$helpurl = '';
|
||||||
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('SellingPrices');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('SellingPrices');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader("", $langs->trans("CardProduct" . $object->type), $hepl_url);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
$head = product_prepare_head($object);
|
$head = product_prepare_head($object);
|
||||||
$titre = $langs->trans("CardProduct" . $object->type);
|
$titre = $langs->trans("CardProduct" . $object->type);
|
||||||
@ -651,7 +669,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
|||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
|
|
||||||
// Selling price
|
// Selling price
|
||||||
print '<tr><td class="titlefield">' . $langs->trans("SellingPrice") . '</td>';
|
print '<tr><td class="titlefield">';
|
||||||
|
print $langs->trans("SellingPrice");
|
||||||
|
print '</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
if ($object->multiprices_base_type[$soc->price_level] == 'TTC') {
|
if ($object->multiprices_base_type[$soc->price_level] == 'TTC') {
|
||||||
print price($object->multiprices_ttc[$soc->price_level]);
|
print price($object->multiprices_ttc[$soc->price_level]);
|
||||||
@ -712,16 +732,34 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td style="text-align: center">'.$langs->trans("PriceLevel").'</td><td style="text-align: center">'.$langs->trans("SellingPrice").'</td><td style="text-align: center">'.$langs->trans("MinPrice").'</td></tr>';
|
print '<tr class="liste_titre"><td style="text-align: center">';
|
||||||
|
print $langs->trans("PriceLevel");
|
||||||
|
if ($user->admin) print ' <a href="'.$_SERVER["PHP_SELF"].'?action=editlabelsellingprice&pricelevel='.$i.'&id='.$object->id.'">'.img_edit($langs->trans('EditSellingPriceLabel'),0).'</a>';
|
||||||
|
print '</td><td style="text-align: center">'.$langs->trans("SellingPrice").'</td><td style="text-align: center">'.$langs->trans("MinPrice").'</td></tr>';
|
||||||
|
|
||||||
for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
|
for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|
||||||
// Label of price
|
// Label of price
|
||||||
print '<td>' . $langs->trans("SellingPrice") . ' ' . $i;
|
print '<td>';
|
||||||
$keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$i;
|
$keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$i;
|
||||||
if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel);
|
if (preg_match('/editlabelsellingprice/', $action))
|
||||||
|
{
|
||||||
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="setlabelsellingprice">';
|
||||||
|
print '<input type="hidden" name="pricelevel" value="'.$i.'">';
|
||||||
|
print $langs->trans("SellingPrice") . ' ' . $i.' - ';
|
||||||
|
print '<input size="10" class="maxwidthonsmartphone" type="text" name="labelsellingprice" value="'.$conf->global->$keyforlabel.'">';
|
||||||
|
print ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("SellingPrice") . ' ' . $i;
|
||||||
|
if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel);
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($object->multiprices_base_type [$i] == 'TTC') {
|
if ($object->multiprices_base_type [$i] == 'TTC') {
|
||||||
|
|||||||
@ -95,7 +95,22 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $object->fetch($id,$ref);
|
$result = $object->fetch($id,$ref);
|
||||||
llxHeader("",$langs->trans("CardProduct".$object->type));
|
|
||||||
|
$title = $langs->trans('ProductServiceCard');
|
||||||
|
$helpurl = '';
|
||||||
|
$shortlabel = dol_trunc($object->label,16);
|
||||||
|
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Statistics');
|
||||||
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
|
}
|
||||||
|
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
||||||
|
{
|
||||||
|
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Statistics');
|
||||||
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
|
}
|
||||||
|
|
||||||
|
llxHeader('', $title, $helpurl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user