Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
1396ed8f03
@ -106,7 +106,7 @@ llxHeader('', $langs->trans("ListAccounts"));
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa, " . MAIN_DB_PREFIX . "accounting_system as asy";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa, " . MAIN_DB_PREFIX . "accounting_system as asy";
|
||||
$sql .= " WHERE aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $pcgver;
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* 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>
|
||||
*
|
||||
* 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
|
||||
@ -43,8 +43,12 @@ if (!$user->admin)
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
// Other parameters ACCOUNTING_EXPORT_*
|
||||
$list = array (
|
||||
// Parameters ACCOUNTING_EXPORT_*
|
||||
$main_option = array (
|
||||
'ACCOUNTING_EXPORT_PREFIX_SPEC'
|
||||
);
|
||||
|
||||
$model_option = array (
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV',
|
||||
'ACCOUNTING_EXPORT_DATE',
|
||||
'ACCOUNTING_EXPORT_PIECE',
|
||||
@ -60,10 +64,18 @@ $list = array (
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
$format = GETPOST('format', 'alpha');
|
||||
$modelcsv = GETPOST('modelcsv', 'int');
|
||||
|
||||
if (! empty($format)) {
|
||||
if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', $format, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
}
|
||||
|
||||
if (! empty($modelcsv)) {
|
||||
|
||||
if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
@ -71,7 +83,15 @@ if ($action == 'update') {
|
||||
$error ++;
|
||||
}
|
||||
|
||||
foreach ( $list as $constname ) {
|
||||
foreach ($main_option as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($model_option as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
@ -106,9 +126,67 @@ print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
$var = true;
|
||||
|
||||
/*
|
||||
* Main Options
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('MainOptions') . '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td width="50%">' . $langs->trans("Selectformat") . '</td>';
|
||||
if (! $conf->use_javascript_ajax)
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
$listformat=array(
|
||||
'csv'=>$langs->trans("csv"),
|
||||
'txt'=>$langs->trans("txt")
|
||||
);
|
||||
print $form->selectarray("format",$listformat,$conf->global->ACCOUNTING_EXPORT_FORMAT,0);
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
$num = count($main_option);
|
||||
if ($num)
|
||||
{
|
||||
foreach ($main_option as $key) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td width="50%">' . $label . '</td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
/*
|
||||
* Export model
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">' . $langs->trans("Modelcsv") . '</td>';
|
||||
print '</tr>';
|
||||
@ -143,8 +221,8 @@ print "<br>\n";
|
||||
* Parameters
|
||||
*/
|
||||
|
||||
$num = count($list);
|
||||
if ($num)
|
||||
$num2 = count($model_option);
|
||||
if ($num2)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -152,7 +230,7 @@ if ($num)
|
||||
print "</tr>\n";
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > 1) print '<tr><td colspan="2" bgcolor="red"><b>' . $langs->trans('OptionsDeactivatedForThisExportModel') . '</b></td></tr>';
|
||||
|
||||
foreach ( $list as $key ) {
|
||||
foreach ($model_option as $key) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
@ -124,7 +124,7 @@ if ($result) {
|
||||
print '<input type="hidden" name="action" value="import">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>' . $langs->trans("accountingaccount") . '</td>';
|
||||
print '<tr class="liste_titre"><td>' . $langs->trans("AccountAccouting") . '</td>';
|
||||
print '<td>' . $langs->trans("label") . '</td>';
|
||||
print '<td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
|
||||
@ -212,11 +212,11 @@ $pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
|
||||
$sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL";
|
||||
$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN
|
||||
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
||||
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
||||
} else {
|
||||
$sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL ";
|
||||
$sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN
|
||||
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
||||
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
||||
}
|
||||
|
||||
$sql .= ")";
|
||||
|
||||
@ -72,7 +72,7 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
if ($rowid || $account_number) {
|
||||
$sql = "SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, fk_user_author, fk_user_modif, active";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "accounting_account WHERE";
|
||||
if ($rowid) {
|
||||
$sql .= " rowid = '" . $rowid . "'";
|
||||
} elseif ($account_number) {
|
||||
@ -114,7 +114,7 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert line in accountingaccount
|
||||
* Insert line in accounting_account
|
||||
*
|
||||
* @param User $user Use making action
|
||||
* @param int $notrigger Disable triggers
|
||||
@ -148,7 +148,7 @@ class AccountingAccount extends CommonObject
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accountingaccount(";
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account(";
|
||||
|
||||
$sql .= "datec";
|
||||
$sql .= ", entity";
|
||||
@ -186,7 +186,7 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount");
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account");
|
||||
|
||||
// if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
@ -225,7 +225,7 @@ class AccountingAccount extends CommonObject
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||
$sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null");
|
||||
$sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null");
|
||||
$sql .= " , pcg_subtype = " . ($this->pcg_subtype ? "'" . $this->db->escape($this->pcg_subtype) . "'" : "null");
|
||||
@ -313,7 +313,7 @@ class AccountingAccount extends CommonObject
|
||||
// }
|
||||
|
||||
if (! $error) {
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount";
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account";
|
||||
$sql .= " WHERE rowid=" . $this->id;
|
||||
|
||||
dol_syslog(get_class($this) . "::delete sql=" . $sql);
|
||||
@ -375,7 +375,7 @@ class AccountingAccount extends CommonObject
|
||||
function info($id)
|
||||
{
|
||||
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accountingaccount as a';
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
|
||||
$sql .= ' WHERE a.rowid = ' . $id;
|
||||
|
||||
dol_syslog(get_class($this) . '::info sql=' . $sql);
|
||||
@ -417,7 +417,7 @@ class AccountingAccount extends CommonObject
|
||||
if ($result > 0) {
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||
$sql .= "SET active = '0'";
|
||||
$sql .= " WHERE rowid = ".$this->db->escape($id);
|
||||
|
||||
@ -447,7 +447,7 @@ class AccountingAccount extends CommonObject
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||
$sql .= "SET active = '1'";
|
||||
$sql .= " WHERE rowid = ".$this->db->escape($id);
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ class FormVentilation extends Form
|
||||
* @param array $event Event options
|
||||
* @param int $select_in $selectid value is a aa.rowid (0 default) or aa.account_number (1)
|
||||
* @param int $select_out set value returned by select 0=rowid (default), 1=account_number
|
||||
* @param int $aabase set accountingaccount base class to display empty=all or from 1 to 8 will display only account beginning by
|
||||
* @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
@ -105,7 +105,7 @@ class FormVentilation extends Form
|
||||
$out = '';
|
||||
|
||||
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " AND aa.active = 1";
|
||||
@ -132,7 +132,7 @@ class FormVentilation extends Form
|
||||
if ($select_in == 1 ) $select_value_in = $obj->account_number;
|
||||
if ($select_out == 0 ) $select_value_out = $obj->rowid;
|
||||
if ($select_out == 1 ) $select_value_out = $obj->account_number;
|
||||
// Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number
|
||||
// Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number
|
||||
// Because same account_number can be share between different accounting_system and do have the same meaning
|
||||
if (($selectid != '') && $selectid == $select_value_in) {
|
||||
// $out .= '<option value="' . $obj->account_number . '" selected>' . $label . '</option>';
|
||||
@ -171,7 +171,7 @@ class FormVentilation extends Form
|
||||
$out = '';
|
||||
|
||||
$sql = "SELECT DISTINCT pcg_type ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " ORDER BY pcg_type";
|
||||
@ -227,7 +227,7 @@ class FormVentilation extends Form
|
||||
$out = '';
|
||||
|
||||
$sql = "SELECT DISTINCT pcg_subtype ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " ORDER BY pcg_subtype";
|
||||
|
||||
@ -85,7 +85,7 @@ if (! empty($id)) {
|
||||
$sql .= " l.fk_code_ventilation, aa.account_number, aa.label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
|
||||
|
||||
|
||||
@ -65,12 +65,12 @@ if ($action == 'validatehistory') {
|
||||
if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount 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 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||
} else {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount 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 .= " WHERE fd.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";
|
||||
@ -154,7 +154,7 @@ $sql .= " ROUND(SUM(IF(MONTH(f.datef)=12,fd.total_ht,0)),2) AS 'Decembre',";
|
||||
$sql .= " ROUND(SUM(fd.total_ht),2) as 'Total'";
|
||||
$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 . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ print '<script type="text/javascript">
|
||||
$sql = "SELECT l.rowid , f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.qty, l.tva_tx, l.fk_code_ventilation, aa.label, aa.account_number,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql .= " , " . MAIN_DB_PREFIX . "accountingaccount as aa";
|
||||
$sql .= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " , " . MAIN_DB_PREFIX . "facturedet as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||
@ -184,6 +184,14 @@ if (strlen(trim($search_vat)))
|
||||
if (! empty($conf->multicompany->enabled)) {
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
|
||||
}
|
||||
// Count total nb of records with no order and no limits
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) $nbtotalofrecords = $db->num_rows($resql);
|
||||
else dol_print_error($db);
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
|
||||
@ -192,9 +200,16 @@ $result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||
|
||||
|
||||
$param="";
|
||||
if ($search_facture) $param.="&search_facture=".$search_facture;
|
||||
if ($search_ref) $param.="&search_ref=".$search_ref;
|
||||
if ($search_label) $param.="&search_label=".$search_label;
|
||||
if ($search_desc) $param.="&search_desc=".$search_desc;
|
||||
if ($search_account) $param.="&search_account=".$search_account;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines,$nbtotalofrecords);
|
||||
print '<td align="left"><b>' . $langs->trans("DescVentilDoneCustomer") . '</b></td>';
|
||||
|
||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
@ -277,5 +292,10 @@ if ($result) {
|
||||
|
||||
print "</table></form>";
|
||||
|
||||
if ($num_lines > $conf->liste_limit)
|
||||
{
|
||||
print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num_lines,$nbtotalofrecords,'');
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -72,7 +72,7 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $sortfield)
|
||||
$sortfield = "f.datef, f.facnumber, l.rowid";
|
||||
$sortfield = "f.facnumber";
|
||||
|
||||
if (! $sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||
@ -136,12 +136,13 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
print '<div><font color="red">' . count($mesCasesCochees) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
|
||||
$mesCodesVentilChoisis = $codeventil;
|
||||
$cpt = 0;
|
||||
|
||||
foreach ( $mesCasesCochees as $maLigneCochee ) {
|
||||
$maLigneCourante = explode("_", $maLigneCochee);
|
||||
$monId = $maLigneCourante[0];
|
||||
$monNumLigne = $maLigneCourante[1];
|
||||
$monCompte = $mesCodesVentilChoisis[$monNumLigne];
|
||||
|
||||
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
||||
$sql .= " WHERE rowid = " . $monId;
|
||||
@ -172,7 +173,7 @@ $sql .= " , l.product_type as type_l, l.tva_tx as tva_tx_line";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount 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 .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
|
||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
|
||||
@ -216,10 +217,7 @@ if ($result) {
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef", "", $param, '', $sortfield, $sortorder);
|
||||
print ' ';
|
||||
print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
|
||||
@ -231,7 +229,7 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>', '', '', '', '', 'align="center"');
|
||||
@ -322,7 +320,7 @@ if ($result) {
|
||||
if ($objp->code_sell_l == $objp->code_sell_p) {
|
||||
print $objp->code_sell_l;
|
||||
} else {
|
||||
print 'lines=' . $objp->code_sell_l . '<br />product=' . $objp->code_sell_p;
|
||||
print $langs->trans("Purchase") . ' = ' . $objp->code_sell_l . '<br />' . $langs->trans("Sell") . ' = ' . $objp->code_sell_p;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* GNU General Public License fr more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
@ -25,7 +25,7 @@
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/bankjournal.php
|
||||
* \ingroup Accounting Expert
|
||||
* \brief Page with sells journal
|
||||
* \brief Page with bank journal
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -66,6 +66,8 @@ $date_endday = GETPOST('date_endday');
|
||||
$date_endyear = GETPOST('date_endyear');
|
||||
$action = GETPOST('action');
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
@ -421,10 +423,9 @@ if ($action == 'writeBookKeeping')
|
||||
if ($action == 'export_csv')
|
||||
{
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$bank_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
||||
$journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
header('Content-Disposition: attachment;filename=journal_banque.csv');
|
||||
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
$companystatic = new Client($db);
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@ -52,6 +52,8 @@ $date_endmonth = GETPOST('date_endmonth');
|
||||
$date_endday = GETPOST('date_endday');
|
||||
$date_endyear = GETPOST('date_endyear');
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
@ -91,7 +93,7 @@ $sql .= " s.code_compta_fournisseur, p.accountancy_code_buy , ct.accountancy_cod
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " WHERE f.fk_statut > 0 ";
|
||||
@ -156,7 +158,6 @@ if ($result) {
|
||||
|
||||
// Bookkeeping Write
|
||||
if ($action == 'writebookkeeping') {
|
||||
$now = dol_now();
|
||||
|
||||
foreach ( $tabfac as $key => $val ) {
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
@ -246,15 +247,10 @@ $companystatic = new Fournisseur($db);
|
||||
if ($action == 'export_csv')
|
||||
{
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$purchase_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
if ($conf->global->EXPORT_PREFIX_SPEC)
|
||||
$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_achats.csv";
|
||||
else
|
||||
$filename="journal_achats.csv";
|
||||
header('Content-Disposition: attachment;filename='.$filename);
|
||||
|
||||
$journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
|
||||
{
|
||||
$sep = ";";
|
||||
|
||||
@ -54,6 +54,8 @@ $date_endmonth = GETPOST('date_endmonth');
|
||||
$date_endday = GETPOST('date_endday');
|
||||
$date_endyear = GETPOST('date_endyear');
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
@ -93,7 +95,7 @@ $sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk
|
||||
$sql .= " fd.situation_percent,ct.accountancy_code_sell as account_tva";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
|
||||
@ -191,7 +193,6 @@ if ($result) {
|
||||
// Bookkeeping Write
|
||||
if ($action == 'writebookkeeping')
|
||||
{
|
||||
$now = dol_now();
|
||||
|
||||
foreach ($tabfac as $key => $val)
|
||||
{
|
||||
@ -275,14 +276,9 @@ if ($action == 'writebookkeeping')
|
||||
if ($action == 'export_csv')
|
||||
{
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
|
||||
$journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
if ($conf->global->EXPORT_PREFIX_SPEC)
|
||||
$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_ventes.csv";
|
||||
else
|
||||
$filename="journal_ventes.csv";
|
||||
header('Content-Disposition: attachment;filename='.$filename);
|
||||
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
$companystatic = new Client($db);
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ if (! empty($id)) {
|
||||
$sql .= ", aa.account_number, aa.label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
|
||||
|
||||
|
||||
@ -63,12 +63,12 @@ if ($action == 'validatehistory') {
|
||||
if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount 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 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||
} else {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount 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 .= " WHERE fd.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";
|
||||
@ -138,7 +138,7 @@ $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 .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount 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";
|
||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND ff.fk_statut > 0 ";
|
||||
|
||||
@ -156,7 +156,7 @@ print '<script type="text/javascript">
|
||||
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht , l.qty, l.rowid, l.tva_tx, aa.label, aa.account_number, ";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql .= " , " . MAIN_DB_PREFIX . "accountingaccount as aa";
|
||||
$sql .= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " , " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||
|
||||
@ -179,7 +179,7 @@ $sql .= " , l.product_type as type_l";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
|
||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
|
||||
|
||||
28
htdocs/accountancy/tpl/export_journal.tpl.php
Normal file
28
htdocs/accountancy/tpl/export_journal.tpl.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||
|
||||
$date_export = dol_print_date($now, '%Y%m%d%H%M%S');
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
if ($prefix)
|
||||
$filename = $prefix . "_" . "journal_" . $journal . $date_export . "." . $format;
|
||||
else
|
||||
$filename = "journal_" . $journal . $date_export . "." . $format;
|
||||
header('Content-Disposition: attachment;filename='.$filename);
|
||||
0
htdocs/accountancy/tpl/index.html
Normal file
0
htdocs/accountancy/tpl/index.html
Normal file
@ -621,7 +621,9 @@ if ($rowid > 0)
|
||||
if ($object->datefin)
|
||||
{
|
||||
print dol_print_date($object->datefin,'day');
|
||||
if ($object->datefin < ($now - $conf->adherent->cotisation->warning_delay) && $object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie
|
||||
if ($object->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1741,7 +1741,7 @@ class Adherent extends CommonObject
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "SELECT a.rowid, a.datefin";
|
||||
$sql = "SELECT a.rowid, a.datefin, a.statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= " WHERE a.statut = 1";
|
||||
$sql.= " AND a.entity IN (".getEntity('adherent', 1).")";
|
||||
@ -1758,11 +1758,16 @@ class Adherent extends CommonObject
|
||||
$response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=1';
|
||||
$response->img=img_object($langs->trans("Members"),"user");
|
||||
|
||||
$adherentstatic = new Adherent($this->db);
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
|
||||
if ($this->db->jdate($obj->datefin) < ($now - $conf->adherent->cotisation->warning_delay)) {
|
||||
$adherentstatic->datefin = $this->db->jdate($obj->datefin);
|
||||
$adherentstatic->statut = $obj->statut;
|
||||
|
||||
if ($adherentstatic->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -1974,4 +1979,18 @@ class Adherent extends CommonObject
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
public function hasDelay()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
//Only valid members
|
||||
if ($this->statut <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
return $this->datefin < ($now - $conf->adherent->cotisation->warning_delay);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -271,6 +271,8 @@ if ($resql)
|
||||
$memberstatic->ref=$objp->rowid;
|
||||
$memberstatic->lastname=$objp->lastname;
|
||||
$memberstatic->firstname=$objp->firstname;
|
||||
$memberstatic->statut=$objp->statut;
|
||||
$memberstatic->datefin= $datefin;
|
||||
|
||||
if (! empty($objp->fk_soc)) {
|
||||
$memberstatic->socid = $objp->fk_soc;
|
||||
@ -325,7 +327,9 @@ if ($resql)
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($datefin,'day');
|
||||
if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate"));
|
||||
if ($memberstatic->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("SubscriptionLate"));
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -28,6 +29,7 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("errors");
|
||||
$langs->load("admin");
|
||||
@ -76,28 +78,7 @@ llxHeader('',$langs->trans("Setup"),$help_url);
|
||||
|
||||
|
||||
// Search modules dirs
|
||||
$modulesdir = array();
|
||||
foreach ($conf->file->dol_document_root as $type => $dirroot)
|
||||
{
|
||||
$modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/';
|
||||
|
||||
$handle=@opendir($dirroot);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
|
||||
{
|
||||
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
|
||||
{
|
||||
$modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
//var_dump($modulesdir);
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
|
||||
$filename = array();
|
||||
|
||||
@ -882,7 +882,7 @@ class ActionComm extends CommonObject
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$now = dol_now();
|
||||
$agenda_static = new ActionComm($this->db);
|
||||
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay = $conf->actions->warning_delay/60/60/24;
|
||||
@ -895,7 +895,9 @@ class ActionComm extends CommonObject
|
||||
{
|
||||
$response->nbtodo++;
|
||||
|
||||
if (isset($obj->dp) && $this->db->jdate($obj->dp) < ($now - $conf->actions->warning_delay)) {
|
||||
$agenda_static->datep = $this->db->jdate($obj->dp);
|
||||
|
||||
if ($agenda_static->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -1361,5 +1363,19 @@ class ActionComm extends CommonObject
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the action delayed?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasDelay()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
return $this->datep && ($this->datep < ($now - $conf->actions->warning_delay));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2846,7 +2846,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$clause = " WHERE";
|
||||
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut";
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
{
|
||||
@ -2862,21 +2862,22 @@ class Commande extends CommonOrder
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$now=dol_now();
|
||||
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->commande->client->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("OrdersToProcess");
|
||||
$response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3';
|
||||
$response->img=img_object($langs->trans("Orders"),"order");
|
||||
|
||||
$generic_commande = new Commande($this->db);
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
$response->nbtodo++;
|
||||
|
||||
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
|
||||
$generic_commande->statut = $obj->fk_statut;
|
||||
$generic_commande->date_livraison = $obj->delivery_date;
|
||||
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) {
|
||||
if ($generic_commande->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -3341,6 +3342,24 @@ class Commande extends CommonOrder
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the customer order delayed?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasDelay()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (!($this->statut > Commande::STATUS_DRAFT) && ($this->statut < Commande::STATUS_CLOSED)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
return max($this->date_commande, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -357,9 +357,11 @@ if ($resql)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td class="nowrap">';
|
||||
|
||||
$generic_commande->id=$objp->rowid;
|
||||
$generic_commande->ref=$objp->ref;
|
||||
$generic_commande->statut = $objp->fk_statut;
|
||||
$generic_commande->date_commande = $db->jdate($objp->date_commande);
|
||||
$generic_commande->date_livraison = $db->jdate($objp->date_delivery);
|
||||
$generic_commande->ref_client = $objp->ref_client;
|
||||
$generic_commande->total_ht = $objp->total_ht;
|
||||
$generic_commande->total_tva = $objp->total_tva;
|
||||
@ -444,8 +446,9 @@ if ($resql)
|
||||
|
||||
// warning late icon
|
||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_delivery)) < ($now - $conf->commande->client->warning_delay))
|
||||
print img_picto($langs->trans("Late"),"warning");
|
||||
if ($generic_commande->hasDelay()) {
|
||||
print img_picto($langs->trans("Late"), "warning");
|
||||
}
|
||||
if(!empty($objp->note_private))
|
||||
{
|
||||
print ' <span class="note">';
|
||||
|
||||
@ -640,6 +640,9 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
||||
|
||||
$generic_commande->id=$objp->rowid;
|
||||
$generic_commande->ref=$objp->ref;
|
||||
$generic_commande->statut = $objp->fk_statut;
|
||||
$generic_commande->date_commande = $db->jdate($objp->date_commande);
|
||||
$generic_commande->date_livraison = $db->jdate($objp->date_livraison);
|
||||
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
print '<td class="nobordernopadding nowrap">';
|
||||
@ -647,7 +650,9 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
||||
print '</td>';
|
||||
|
||||
print '<td width="20" class="nobordernopadding nowrap">';
|
||||
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
||||
if ($generic_commande->hasDelay()) {
|
||||
print img_picto($langs->trans("Late"),"warning");
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
|
||||
@ -1148,6 +1148,10 @@ class AccountLine extends CommonObject
|
||||
var $ref;
|
||||
var $datec;
|
||||
var $dateo;
|
||||
|
||||
/**
|
||||
* Value date
|
||||
*/
|
||||
var $datev;
|
||||
var $amount;
|
||||
var $label;
|
||||
|
||||
@ -3223,8 +3223,9 @@ else if ($id > 0 || ! empty($ref))
|
||||
$form->form_date($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date_lim_reglement, 'paymentterm');
|
||||
} else {
|
||||
print dol_print_date($object->date_lim_reglement, 'daytext');
|
||||
if ($object->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $object->paye && $object->statut == 1 && ! isset($object->am))
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print ' ';
|
||||
|
||||
@ -3246,11 +3246,15 @@ class Facture extends CommonInvoice
|
||||
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1';
|
||||
$response->img=img_object($langs->trans("Bills"),"bill");
|
||||
|
||||
$generic_facture = new Facture($this->db);
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$generic_facture->date_lim_reglement = $this->db->jdate($obj->datefin);
|
||||
|
||||
$response->nbtodo++;
|
||||
|
||||
if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) {
|
||||
if ($generic_facture->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -3707,6 +3711,25 @@ class Facture extends CommonInvoice
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the customer invoice delayed?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasDelay()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
//Paid invoices have status STATUS_CLOSED
|
||||
if (!$this->statut != Facture::STATUS_VALIDATED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -379,6 +379,8 @@ if ($resql)
|
||||
$facturestatic->id=$objp->facid;
|
||||
$facturestatic->ref=$objp->facnumber;
|
||||
$facturestatic->type=$objp->type;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($objp->datelimite);
|
||||
$notetoshow=dol_string_nohtmltag(($user->societe_id>0?$objp->note_public:$objp->note),1);
|
||||
$paiement = $facturestatic->getSommePaiement();
|
||||
|
||||
@ -418,7 +420,7 @@ if ($resql)
|
||||
|
||||
// Date limit
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($datelimit,'day');
|
||||
if ($datelimit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1 && ! $paiement)
|
||||
if ($facturestatic->hasDelay())
|
||||
{
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
|
||||
@ -734,6 +734,8 @@ if ($resql)
|
||||
$facturestatic->id=$objp->facid;
|
||||
$facturestatic->ref=$objp->facnumber;
|
||||
$facturestatic->type=$objp->type;
|
||||
$facturestatic->statut=$objp->fk_statut;
|
||||
$facturestatic->date_lim_reglement= $db->jdate($objp->datelimite);
|
||||
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
|
||||
@ -744,7 +746,9 @@ if ($resql)
|
||||
|
||||
// Warning picto
|
||||
print '<td width="20" class="nobordernopadding nowrap">';
|
||||
if ($date_limit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// PDF Picto
|
||||
|
||||
@ -356,7 +356,9 @@ if ($object->id > 0)
|
||||
else
|
||||
{
|
||||
print dol_print_date($object->date_lim_reglement,'daytext');
|
||||
if ($object->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $object->paye && $object->statut == Facture::STATUS_VALIDATED && ! isset($object->am)) print img_warning($langs->trans('Late'));
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -359,11 +359,15 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$facturestatic->total_ht=$obj->total_ht;
|
||||
$facturestatic->total_tva=$obj->total_tva;
|
||||
$facturestatic->total_ttc=$obj->total_ttc;
|
||||
$facturestatic->statut = $obj->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
||||
$facturestatic->type=$obj->type;
|
||||
print $facturestatic->getNomUrl(1,'');
|
||||
print '</td>';
|
||||
print '<td width="20" class="nobordernopadding nowrap">';
|
||||
if ($obj->fk_statut == 1 && ! $obj->paye && $db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late"));
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
print '</td>';
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||
@ -801,10 +805,14 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$facturestatic->total_tva=$obj->total_tva;
|
||||
$facturestatic->total_ttc=$obj->total_ttc;
|
||||
$facturestatic->type=$obj->type;
|
||||
$facturestatic->statut = $obj->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
||||
print $facturestatic->getNomUrl(1,'');
|
||||
print '</td>';
|
||||
print '<td width="20" class="nobordernopadding nowrap">';
|
||||
if ($db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late"));
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
print '</td>';
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -44,6 +44,13 @@ class RemiseCheque extends CommonObject
|
||||
var $errno;
|
||||
|
||||
public $statut;
|
||||
public $amount;
|
||||
public $date_bordereau;
|
||||
public $account_id;
|
||||
public $account_label;
|
||||
public $author_id;
|
||||
public $nbcheque;
|
||||
public $number;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -819,7 +826,6 @@ class RemiseCheque extends CommonObject
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->date_bordereau = $date;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -33,7 +33,9 @@ $langs->load("banks");
|
||||
$langs->load("bills");
|
||||
|
||||
$id=GETPOST("id",'int');
|
||||
$action=GETPOST('action');
|
||||
$action=GETPOST("action","alpha");
|
||||
$refund=GETPOST("refund","int");
|
||||
if (empty($refund)) $refund=0;
|
||||
|
||||
// Security check
|
||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||
@ -46,7 +48,6 @@ $tva = new Tva($db);
|
||||
$hookmanager->initHooks(array('taxvatcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
@ -69,7 +70,12 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
$tva->num_payment=GETPOST("num_payment");
|
||||
$tva->datev=$datev;
|
||||
$tva->datep=$datep;
|
||||
$tva->amount=GETPOST("amount");
|
||||
|
||||
$amount = GETPOST("amount");
|
||||
if ($refund == 1) {
|
||||
$amount= -$amount;
|
||||
}
|
||||
$tva->amount= $amount;
|
||||
$tva->label=GETPOST("label");
|
||||
$tva->note=GETPOST("note");
|
||||
|
||||
@ -161,8 +167,8 @@ if ($action == 'delete')
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
@ -182,12 +188,46 @@ if ($id)
|
||||
// Formulaire saisie tva
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<form name='add' action=\"card.php\" method=\"post\">\n";
|
||||
print_fiche_titre($langs->trans("VAT") . ' - ' . $langs->trans("New"));
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#radiopayment").click(function() {
|
||||
$("#label").val($(this).data("label"));
|
||||
|
||||
});
|
||||
$("#radiorefund").click(function() {
|
||||
$("#label").val($(this).data("label"));
|
||||
|
||||
});
|
||||
});';
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" name="formvat" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print_fiche_titre($langs->trans("NewVATPayment"));
|
||||
|
||||
print '<div id="selectmethod">';
|
||||
print '<div class="hideonsmartphone float">';
|
||||
print $langs->trans("Type").': ';
|
||||
print '</div>';
|
||||
print '<label for="radiopayment">';
|
||||
print '<input type="radio" id="radiopayment" data-label="'.$langs->trans('VATPayment').'" class="flat" name="refund" value="0"'.($refund?'':' checked="checked"').'>';
|
||||
print ' ';
|
||||
print $langs->trans("Payment");
|
||||
print '</label>';
|
||||
print ' ';
|
||||
print '<label for="radiorefund">';
|
||||
print '<input type="radio" id="radiorefund" data-label="'.$langs->trans('VATRefund').'" class="flat" name="refund" value="1"'.($refund?' checked="checked"':'').'>';
|
||||
print ' ';
|
||||
print $langs->trans("Refund");
|
||||
print '</label>';
|
||||
print '</div>';
|
||||
print "<br>\n";
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
@ -202,7 +242,12 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" size="40" value="'.($_POST["label"]?$_POST["label"]:$langs->trans("VATPayment")).'"></td></tr>';
|
||||
if ($refund == 1) {
|
||||
$label = $langs->trans("VATRefund");
|
||||
} else {
|
||||
$label = $langs->trans("VATPayment");
|
||||
}
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" id="label" size="40" value="'.($_POST["label"]?$_POST["label"]:$label).'"></td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@ -508,7 +508,7 @@ class Tva extends CommonObject
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
|
||||
return -3;
|
||||
}
|
||||
if ($this->amount < 0 || $this->amount == '')
|
||||
if ($this->amount == '')
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
||||
return -4;
|
||||
@ -577,8 +577,12 @@ class Tva extends CommonObject
|
||||
$result=$acc->fetch($this->accountid);
|
||||
if ($result <= 0) dol_print_error($this->db);
|
||||
|
||||
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user);
|
||||
|
||||
if ($this->amount > 0) {
|
||||
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user);
|
||||
} else {
|
||||
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs($this->amount), '', '', $user);
|
||||
}
|
||||
|
||||
// Update fk_bank into llx_tva. So we know vat line used to generate bank transaction
|
||||
if ($bank_line_id > 0)
|
||||
{
|
||||
|
||||
@ -108,12 +108,18 @@ class box_factures extends ModeleBoxes
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($objp->datelimite);
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
|
||||
|
||||
$late = '';
|
||||
if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));}
|
||||
if ($facturestatic->hasDelay()) {
|
||||
$late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
|
||||
@ -93,7 +93,6 @@ class box_factures_fourn extends ModeleBoxes
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$now=dol_now();
|
||||
|
||||
$line = 0;
|
||||
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)';
|
||||
@ -108,6 +107,8 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->date_echeance = $datelimite;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->fournisseur = 1;
|
||||
@ -115,7 +116,10 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
|
||||
$late = '';
|
||||
if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
|
||||
|
||||
if ($facturestatic->hasDelay()) {
|
||||
$late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
|
||||
@ -86,11 +86,12 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$now=dol_now();
|
||||
|
||||
$line = 0;
|
||||
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)';
|
||||
|
||||
$facturestatic = new FactureFournisseur($db);
|
||||
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
@ -99,9 +100,13 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->code_client = $objp->code_client;
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
$facturestatic->date_echeance = $datelimite;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
|
||||
$late='';
|
||||
if ($datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
|
||||
if ($facturestatic->hasDelay()) {
|
||||
$late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
|
||||
}
|
||||
|
||||
$tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '<br>' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier;
|
||||
$this->info_box_contents[$line][] = array(
|
||||
|
||||
@ -108,6 +108,8 @@ class box_factures_imp extends ModeleBoxes
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($objp->datelimite);
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
$societestatic->client = 1;
|
||||
@ -115,7 +117,9 @@ class box_factures_imp extends ModeleBoxes
|
||||
$societestatic->logo = $objp->logo;
|
||||
|
||||
$late='';
|
||||
if ($datelimite < ($now - $conf->facture->client->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
|
||||
if ($facturestatic->hasDelay()) {
|
||||
$late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,6 +24,7 @@
|
||||
* \brief Library of admin functions
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
|
||||
/**
|
||||
* Renvoi une version en chaine depuis une version en tableau
|
||||
@ -676,29 +678,7 @@ function activateModule($value,$withdeps=1)
|
||||
$ret='';
|
||||
$modName = $value;
|
||||
$modFile = $modName . ".class.php";
|
||||
|
||||
// Loop on each directory to fill $modulesdir
|
||||
$modulesdir = array();
|
||||
foreach ($conf->file->dol_document_root as $type => $dirroot)
|
||||
{
|
||||
$modulesdir[] = $dirroot."/core/modules/";
|
||||
|
||||
$handle=@opendir(dol_osencode($dirroot));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
|
||||
{
|
||||
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
|
||||
{
|
||||
$modulesdir[] = $dirroot . '/' . $file . '/core/modules/';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
// Loop on each directory
|
||||
$found=false;
|
||||
@ -795,29 +775,7 @@ function unActivateModule($value, $requiredby=1)
|
||||
$ret='';
|
||||
$modName = $value;
|
||||
$modFile = $modName . ".class.php";
|
||||
|
||||
// Loop on each directory to fill $modulesdir
|
||||
$modulesdir = array();
|
||||
foreach ($conf->file->dol_document_root as $type => $dirroot)
|
||||
{
|
||||
$modulesdir[] = $dirroot."/core/modules/";
|
||||
|
||||
$handle=@opendir(dol_osencode($dirroot));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
|
||||
{
|
||||
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
|
||||
{
|
||||
$modulesdir[] = $dirroot . '/' . $file . '/core/modules/';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
// Loop on each directory
|
||||
$found=false;
|
||||
@ -853,7 +811,7 @@ function unActivateModule($value, $requiredby=1)
|
||||
$countrb=count($objMod->requiredby);
|
||||
for ($i = 0; $i < $countrb; $i++)
|
||||
{
|
||||
var_dump($objMod->requiredby[$i]);
|
||||
//var_dump($objMod->requiredby[$i]);
|
||||
unActivateModule($objMod->requiredby[$i]);
|
||||
}
|
||||
}
|
||||
@ -884,36 +842,10 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql
|
||||
global $db, $modules, $conf, $langs;
|
||||
|
||||
// Search modules
|
||||
$filename = array();
|
||||
$modules = array();
|
||||
$orders = array();
|
||||
$categ = array();
|
||||
$dirmod = array();
|
||||
$modulesdir = array();
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
$i = 0; // is a sequencer of modules found
|
||||
$j = 0; // j is module number. Automatically affected if module number not defined.
|
||||
|
||||
foreach ($conf->file->dol_document_root as $type => $dirroot)
|
||||
{
|
||||
$modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/';
|
||||
|
||||
$handle=@opendir($dirroot);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
|
||||
{
|
||||
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
|
||||
{
|
||||
$modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
||||
@ -963,14 +895,6 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql
|
||||
}
|
||||
}
|
||||
|
||||
$modules[$i] = $objMod;
|
||||
$filename[$i]= $modName;
|
||||
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
|
||||
//print "x".$modName." ".$orders[$i]."\n<br>";
|
||||
if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories
|
||||
else $categ[$objMod->special]=1;
|
||||
$dirmod[$i] = $dirroot;
|
||||
|
||||
// Complete arrays
|
||||
//&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond
|
||||
if (empty($objMod->dictionaries) && ! empty($objMod->dictionnaries)) $objMod->dictionaries=$objMod->dictionnaries; // For backward compatibility
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -104,7 +105,9 @@ function dolGetModulesDirs($subdir='')
|
||||
foreach ($conf->file->dol_document_root as $type => $dirroot)
|
||||
{
|
||||
// Default core/modules dir
|
||||
$modulesdir[$dirroot . '/core/modules'.$subdir.'/'] = $dirroot . '/core/modules'.$subdir.'/';
|
||||
if ($type === 'main') {
|
||||
$modulesdir[$dirroot . '/core/modules' . $subdir . '/'] = $dirroot . '/core/modules' . $subdir . '/';
|
||||
}
|
||||
|
||||
// Scan dir from external modules
|
||||
$handle=@opendir($dirroot);
|
||||
|
||||
@ -200,8 +200,8 @@ 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->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/charges.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 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->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'accountancy', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'NewPayment', 2, 'companies', '$user->rights->tax->charges->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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'Payments', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__);
|
||||
-- Ventilation (accounting)
|
||||
|
||||
@ -866,8 +866,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
|
||||
{
|
||||
$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
||||
if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
|
||||
if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer);
|
||||
if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
||||
global $mysoc;
|
||||
|
||||
@ -196,6 +196,11 @@ class modAccounting extends DolibarrModules
|
||||
"chaine",
|
||||
"ER"
|
||||
);
|
||||
$this->const[23] = array(
|
||||
"ACCOUNTING_EXPORT_FORMAT",
|
||||
"chaine",
|
||||
"csv"
|
||||
);
|
||||
|
||||
// Tabs
|
||||
$this->tabs = array();
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Adherent
|
||||
* Class to describe and enable module Adherent
|
||||
*/
|
||||
class modAdherent extends DolibarrModules
|
||||
{
|
||||
@ -64,33 +64,136 @@ class modAdherent extends DolibarrModules
|
||||
//-------------
|
||||
$this->config_page_url = array("adherent.php@adherents");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
//------------
|
||||
$this->depends = array();
|
||||
$this->requiredby = array('modMailmanSpip');
|
||||
$this->langfiles = array("members","companies");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
//-----------
|
||||
$this->const = array();
|
||||
$this->const[2] = array("MAIN_SEARCHFORM_ADHERENT","yesno","1","Show form for quick member search");
|
||||
$this->const[3] = array("ADHERENT_MAIL_RESIL","texte","Votre adhésion vient d'être résiliée.\r\nNous espérons vous revoir très bientôt","Mail de résiliation");
|
||||
$this->const[4] = array("ADHERENT_MAIL_VALID","texte","Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\n","Mail de validation");
|
||||
$this->const[5] = array("ADHERENT_MAIL_VALID_SUBJECT","chaine","Votre adhésion a été validée","Sujet du mail de validation");
|
||||
$this->const[6] = array("ADHERENT_MAIL_RESIL_SUBJECT","chaine","Résiliation de votre adhésion","Sujet du mail de résiliation");
|
||||
$this->const[21] = array("ADHERENT_MAIL_FROM","chaine","","From des mails");
|
||||
$this->const[22] = array("ADHERENT_MAIL_COTIS","texte","Bonjour %FIRSTNAME%,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée","Mail de validation de cotisation");
|
||||
$this->const[23] = array("ADHERENT_MAIL_COTIS_SUBJECT","chaine","Reçu de votre cotisation","Sujet du mail de validation de cotisation");
|
||||
$this->const[25] = array("ADHERENT_CARD_HEADER_TEXT","chaine","%YEAR%","Texte imprimé sur le haut de la carte adhérent");
|
||||
$this->const[26] = array("ADHERENT_CARD_FOOTER_TEXT","chaine","%COMPANY%","Texte imprimé sur le bas de la carte adhérent");
|
||||
$this->const[27] = array("ADHERENT_CARD_TEXT","texte","%FULLNAME%\r\nID: %ID%\r\n%EMAIL%\r\n%ADDRESS%\r\n%ZIP% %TOWN%\r\n%COUNTRY%","Text to print on member cards");
|
||||
$this->const[28] = array("ADHERENT_MAILMAN_ADMINPW","chaine","","Mot de passe Admin des liste mailman");
|
||||
$this->const[31] = array("ADHERENT_BANK_USE_AUTO","yesno","","Insertion automatique des cotisations dans le compte banquaire");
|
||||
$this->const[32] = array("ADHERENT_BANK_ACCOUNT","chaine","","ID du Compte banquaire utilise");
|
||||
$this->const[33] = array("ADHERENT_BANK_CATEGORIE","chaine","","ID de la catégorie banquaire des cotisations");
|
||||
$this->const[34] = array("ADHERENT_ETIQUETTE_TYPE","chaine","L7163","Type of address sheets");
|
||||
$this->const[35] = array("ADHERENT_ETIQUETTE_TEXT",'texte',"%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%","Text to print on member address sheets");
|
||||
|
||||
$r=0;
|
||||
|
||||
$this->const[$r][0] = "MAIN_SEARCHFORM_ADHERENT";
|
||||
$this->const[$r][1] = "yesno";
|
||||
$this->const[$r][2] = "1";
|
||||
$this->const[$r][3] = "Show form for quick member search";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAIL_RESIL";
|
||||
$this->const[$r][1] = "texte";
|
||||
$this->const[$r][2] = "Votre adhésion vient d'être résiliée.\r\nNous espérons vous revoir très bientôt";
|
||||
$this->const[$r][3] = "Mail de résiliation";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAIL_VALID";
|
||||
$this->const[$r][1] = "texte";
|
||||
$this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\n";
|
||||
$this->const[$r][3] = "Mail de validation";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAIL_VALID_SUBJECT";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "Votre adhésion a été validée";
|
||||
$this->const[$r][3] = "Sujet du mail de validation";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAIL_RESIL_SUBJECT";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "Résiliation de votre adhésion";
|
||||
$this->const[$r][3] = "Sujet du mail de résiliation";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAIL_FROM";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "";
|
||||
$this->const[$r][3] = "From des mails";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAIL_COTIS";
|
||||
$this->const[$r][1] = "texte";
|
||||
$this->const[$r][2] = "Bonjour %FIRSTNAME%,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée";
|
||||
$this->const[$r][3] = "Mail de validation de cotisation";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAIL_COTIS_SUBJECT";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "Reçu de votre cotisation";
|
||||
$this->const[$r][3] = "Sujet du mail de validation de cotisation";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_CARD_HEADER_TEXT";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "%YEAR%";
|
||||
$this->const[$r][3] = "Texte imprimé sur le haut de la carte adhérent";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_CARD_FOOTER_TEXT";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "%COMPANY%";
|
||||
$this->const[$r][3] = "Texte imprimé sur le bas de la carte adhérent";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_CARD_TEXT";
|
||||
$this->const[$r][1] = "texte";
|
||||
$this->const[$r][2] = "%FULLNAME%\r\nID: %ID%\r\n%EMAIL%\r\n%ADDRESS%\r\n%ZIP% %TOWN%\r\n%COUNTRY%";
|
||||
$this->const[$r][3] = "Text to print on member cards";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_MAILMAN_ADMINPW";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "";
|
||||
$this->const[$r][3] = "Mot de passe Admin des liste mailman";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_BANK_USE_AUTO";
|
||||
$this->const[$r][1] = "yesno";
|
||||
$this->const[$r][2] = "";
|
||||
$this->const[$r][3] = "Insertion automatique des cotisations dans le compte banquaire";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_BANK_ACCOUNT";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "";
|
||||
$this->const[$r][3] = "ID du Compte banquaire utilise";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_BANK_CATEGORIE";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "";
|
||||
$this->const[$r][3] = "ID de la catégorie banquaire des cotisations";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_ETIQUETTE_TYPE";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "L7163";
|
||||
$this->const[$r][3] = "Type of address sheets";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "ADHERENT_ETIQUETTE_TEXT";
|
||||
$this->const[$r][1] = "texte";
|
||||
$this->const[$r][2] = "%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%";
|
||||
$this->const[$r][3] = "Text to print on member address sheets";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
// Boxes
|
||||
//-------
|
||||
$this->boxes = array(0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home'));
|
||||
|
||||
@ -72,7 +72,7 @@ class modAgenda extends DolibarrModules
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array("companies");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
//-----------
|
||||
$this->const = array();
|
||||
$this->const[15] = array("MAIN_AGENDA_ACTIONAUTO_COMPANY_SENTBYMAIL","chaine","1");
|
||||
|
||||
@ -31,7 +31,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module AskPriceSupllier
|
||||
* Class to describe and enable module AskPriceSupllier
|
||||
*/
|
||||
class modAskPriceSupplier extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Banque
|
||||
* Class to describe and enable module Banque
|
||||
*/
|
||||
class modBanque extends DolibarrModules
|
||||
{
|
||||
@ -76,7 +76,7 @@ class modBanque extends DolibarrModules
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array(0=>array('file'=>'box_comptes.php','enabledbydefaulton'=>'Home'));
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -56,7 +56,7 @@ class modBarcode extends DolibarrModules
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/barcode/temp");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array(); // May be used for product or service or third party module
|
||||
$this->requiredby = array();
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Bookmark
|
||||
* Class to describe and enable module Bookmark
|
||||
*/
|
||||
class modBookmark extends DolibarrModules
|
||||
{
|
||||
@ -66,10 +66,10 @@ class modBookmark extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array('bookmark.php@bookmarks');
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array(0=>array('file'=>'box_bookmarks.php','enabledbydefaulton'=>'Home'));
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -70,7 +70,7 @@ class modCashDesk extends DolibarrModules
|
||||
$this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module
|
||||
$this->langfiles = array("cashdesk");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Categorie
|
||||
* Class to describe and enable module Categorie
|
||||
*/
|
||||
class modCategorie extends DolibarrModules
|
||||
{
|
||||
@ -66,7 +66,7 @@ class modCategorie extends DolibarrModules
|
||||
$this->config_page_url = array('categorie.php@categories');
|
||||
$this->langfiles = array("products","companies","categories");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
$this->const[$r][0] = "CATEGORIE_RECURSIV_ADD";
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module de Click to Dial
|
||||
* Class to describe and enable module Click to Dial
|
||||
*/
|
||||
class modClickToDial extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -73,7 +73,7 @@ class modCommande extends DolibarrModules
|
||||
$this->conflictwith = array();
|
||||
$this->langfiles = array('orders', 'bills', 'companies','products', 'deliveries');
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Comptabilite
|
||||
* Class to describe and enable module Comptabilite
|
||||
*/
|
||||
class modComptabilite extends DolibarrModules
|
||||
{
|
||||
@ -62,13 +62,13 @@ class modComptabilite extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("compta.php");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array("modFacture","modBanque");
|
||||
$this->requiredby = array();
|
||||
$this->conflictwith = array("modAccounting");
|
||||
$this->langfiles = array("compta");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Data directories to create when module is enabled
|
||||
@ -78,7 +78,7 @@ class modComptabilite extends DolibarrModules
|
||||
"/comptabilite/bordereau"
|
||||
);
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -29,7 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Contrat
|
||||
* Class to describe and enable module Contrat
|
||||
*/
|
||||
class modContrat extends DolibarrModules
|
||||
{
|
||||
@ -61,14 +61,14 @@ class modContrat extends DolibarrModules
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/contract/temp");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array("modSociete");
|
||||
$this->requiredby = array();
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array("contract.php");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$this->const[0][0] = "CONTRACT_ADDON";
|
||||
$this->const[0][1] = "chaine";
|
||||
|
||||
@ -73,7 +73,7 @@ class modCron extends DolibarrModules
|
||||
$this->conflictwith = array(); // List of modules id this module is in conflict with
|
||||
$this->langfiles = array("cron");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
//-----------
|
||||
$this->const = array(
|
||||
0=>array(
|
||||
|
||||
@ -27,7 +27,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Deplacement
|
||||
* Class to describe and enable module Deplacement
|
||||
*/
|
||||
class modDeplacement extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Document
|
||||
* Class to describe and enable module Document
|
||||
*/
|
||||
class modDocumentGeneration extends DolibarrModules
|
||||
{
|
||||
@ -67,11 +67,11 @@ class modDocumentGeneration extends DolibarrModules
|
||||
$this->conflictwith = array();
|
||||
$this->langfiles = array("orders","bills","companies","mails");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -66,7 +66,7 @@ class modDynamicPrices extends DolibarrModules
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array("other");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
//-----------
|
||||
$this->const = array();
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Expedition
|
||||
* Class to describe and enable module Expedition
|
||||
*/
|
||||
class modExpedition extends DolibarrModules
|
||||
{
|
||||
@ -73,13 +73,13 @@ class modExpedition extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("confexped.php");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array("modCommande");
|
||||
$this->requiredby = array();
|
||||
$this->conflictwith = array();
|
||||
$this->langfiles = array('deliveries','sendings');
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module export
|
||||
* Class to describe and enable module export
|
||||
*/
|
||||
class modExport extends DolibarrModules
|
||||
{
|
||||
@ -58,13 +58,13 @@ class modExport extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array();
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->phpmin = array(4,2,0);
|
||||
$this->phpmax = array();
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module externalrss
|
||||
* Class to describe and enable module externalrss
|
||||
*/
|
||||
class modExternalRss extends DolibarrModules
|
||||
{
|
||||
@ -60,13 +60,13 @@ class modExternalRss extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("external_rss.php");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->phpmin = array(4,2,0);
|
||||
$this->phpmax = array();
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
|
||||
@ -71,7 +71,7 @@ class modFacture extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("facture.php");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Fckeditor
|
||||
* Class to describe and enable module Fckeditor
|
||||
*/
|
||||
|
||||
class modFckeditor extends DolibarrModules
|
||||
@ -61,12 +61,12 @@ class modFckeditor extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("fckeditor.php");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->disabled = (in_array(constant('JS_CKEDITOR'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE","yesno","1","WYSIWIG for description and note (except products/services)");
|
||||
$this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC","yesno","1","WYSIWIG for products/services description and note");
|
||||
@ -75,7 +75,7 @@ class modFckeditor extends DolibarrModules
|
||||
$this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN","yesno","1","WYSIWIG for user signature");
|
||||
$this->const[5] = array("FCKEDITOR_ENABLE_MAIL","yesno","1","WYSIWIG for products details lines for all entities");
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -32,7 +32,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Ficheinter
|
||||
* Class to describe and enable module Ficheinter
|
||||
*/
|
||||
class modFicheinter extends DolibarrModules
|
||||
{
|
||||
@ -73,7 +73,7 @@ class modFicheinter extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("fichinter.php");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Import
|
||||
* Class to describe and enable module Import
|
||||
*/
|
||||
class modGeoIPMaxmind extends DolibarrModules
|
||||
{
|
||||
@ -66,7 +66,7 @@ class modGeoIPMaxmind extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("geoipmaxmind.php");
|
||||
|
||||
// D<EFBFBD>pendances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->phpmin = array(4,2,0);
|
||||
@ -74,7 +74,7 @@ class modGeoIPMaxmind extends DolibarrModules
|
||||
$this->need_dolibarr_version = array(2,7,-1); // Minimum version of Dolibarr required by module
|
||||
$this->need_javascript_ajax = 1;
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Import
|
||||
* Class to describe and enable module Import
|
||||
*/
|
||||
class modImport extends DolibarrModules
|
||||
{
|
||||
@ -59,7 +59,7 @@ class modImport extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array();
|
||||
|
||||
// D<EFBFBD>pendances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->phpmin = array(4,3,0); // Need auto_detect_line_endings php option to solve MAC pbs.
|
||||
@ -67,7 +67,7 @@ class modImport extends DolibarrModules
|
||||
$this->need_dolibarr_version = array(2,7,-1); // Minimum version of Dolibarr required by module
|
||||
$this->need_javascript_ajax = 1;
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Label
|
||||
* Class to describe and enable module Label
|
||||
*/
|
||||
class modLabel extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Ldap
|
||||
* Class to describe and enable module Ldap
|
||||
*/
|
||||
class modLdap extends DolibarrModules
|
||||
{
|
||||
@ -83,7 +83,7 @@ class modLdap extends DolibarrModules
|
||||
13=>array('LDAP_FIELD_MOBILE','chaine','mobile','',0),
|
||||
);
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -63,7 +63,7 @@ class modLoan extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array('loan.php');
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->conflictwith = array();
|
||||
|
||||
@ -29,7 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Mailing
|
||||
* Class to describe and enable module Mailing
|
||||
*/
|
||||
class modMailing extends DolibarrModules
|
||||
{
|
||||
@ -56,7 +56,7 @@ class modMailing extends DolibarrModules
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/mailing/temp");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array("mails");
|
||||
@ -64,10 +64,10 @@ class modMailing extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("mailing.php");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module de Click to Dial
|
||||
* Class to describe and enable module Click to Dial
|
||||
*/
|
||||
class modMailmanSpip extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Mailing
|
||||
* Class to describe and enable module Mailing
|
||||
*/
|
||||
class modNotification extends DolibarrModules
|
||||
{
|
||||
@ -53,7 +53,7 @@ class modNotification extends DolibarrModules
|
||||
// Data directories to create when module is enabled.
|
||||
$this->dirs = array();
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array("mails");
|
||||
@ -61,10 +61,10 @@ class modNotification extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("notification.php");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Prelevement
|
||||
* Class to describe and enable module Prelevement
|
||||
*/
|
||||
class modPrelevement extends DolibarrModules
|
||||
{
|
||||
@ -70,10 +70,10 @@ class modPrelevement extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("prelevement.php");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -66,7 +66,7 @@ class modPrinting extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("printing.php@printing");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->phpmin = array(5,1); // Minimum version of PHP required by module
|
||||
@ -74,7 +74,7 @@ class modPrinting extends DolibarrModules
|
||||
$this->conflictwith = array();
|
||||
$this->langfiles = array("printing");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
|
||||
@ -32,7 +32,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Projet
|
||||
* Class to describe and enable module Projet
|
||||
*/
|
||||
class modProjet extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Propale
|
||||
* Class to describe and enable module Propale
|
||||
*/
|
||||
class modPropale extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -69,7 +69,7 @@ class modSalaries extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array('salaries.php');
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->conflictwith = array();
|
||||
|
||||
@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Service
|
||||
* Class to describe and enable module Service
|
||||
*/
|
||||
class modService extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -71,7 +71,7 @@ class modSkype extends DolibarrModules
|
||||
$this->conflictwith = array(); // List of modules id this module is in conflict with
|
||||
$this->langfiles = array();
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
//-----------
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Societe
|
||||
* Class to describe and enable module Societe
|
||||
*/
|
||||
class modSociete extends DolibarrModules
|
||||
{
|
||||
@ -65,12 +65,12 @@ class modSociete extends DolibarrModules
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/societe/temp");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array("modExpedition","modFacture","modFournisseur","modFicheinter","modPropale","modContrat","modCommande");
|
||||
$this->langfiles = array("companies");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Stock
|
||||
* Class to describe and enable module Stock
|
||||
*/
|
||||
class modStock extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -65,7 +65,7 @@ class modSyncSupplierWebServices extends DolibarrModules
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array("other");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
//-----------
|
||||
$this->const = array();
|
||||
|
||||
|
||||
@ -66,14 +66,14 @@ class modSyslog extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("syslog.php");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -31,7 +31,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Tax
|
||||
* Class to describe and enable module Tax
|
||||
*/
|
||||
class modTax extends DolibarrModules
|
||||
{
|
||||
@ -67,16 +67,16 @@ class modTax extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("taxes.php");
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->conflictwith = array();
|
||||
$this->langfiles = array("compta","bills");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
|
||||
// Boites
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module User
|
||||
* Class to describe and enable module User
|
||||
*/
|
||||
class modUser extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -65,7 +65,7 @@ class modWebServices extends DolibarrModules
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array("other");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
//-----------
|
||||
$this->const = array();
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Workflow
|
||||
* Class to describe and enable module Workflow
|
||||
*/
|
||||
class modWorkflow extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/syslog/logHandler.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/includes/raven/raven/lib/Raven/Autoloader.php';
|
||||
Raven_Autoloader::register();
|
||||
|
||||
/**
|
||||
* Class to manage logging to Sentry
|
||||
|
||||
@ -72,7 +72,11 @@ class CommandeFournisseur extends CommonOrder
|
||||
var $date_approve;
|
||||
var $date_approve2; // Used when SUPPLIER_ORDER_DOUBLE_APPROVAL is set
|
||||
var $date_commande;
|
||||
var $date_livraison; // Date livraison souhaitee
|
||||
|
||||
/**
|
||||
* Delivery date
|
||||
*/
|
||||
var $date_livraison;
|
||||
var $total_ht;
|
||||
var $total_tva;
|
||||
var $total_localtax1; // Total Local tax 1
|
||||
@ -2292,7 +2296,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$now=dol_now();
|
||||
$commandestatic = new CommandeFournisseur($this->db);
|
||||
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->commande->fournisseur->warning_delay/60/60/24;
|
||||
@ -2304,8 +2308,11 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
$response->nbtodo++;
|
||||
|
||||
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->fournisseur->warning_delay)) {
|
||||
$commandestatic->date_livraison = $this->db->jdate($obj->delivery_date);
|
||||
$commandestatic->date_commande = $this->db->jdate($obj->datec);
|
||||
$commandestatic->statut = $obj->fk_statut;
|
||||
|
||||
if ($commandestatic->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -2447,6 +2454,21 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the supplier order delayed?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasDelay()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$now = dol_now();
|
||||
$date_to_test = empty($this->date_livraison) ? $this->date_commande : $this->date_livraison;
|
||||
|
||||
return ($this->statut != 3) && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -63,7 +63,12 @@ class FactureFournisseur extends CommonInvoice
|
||||
* @see FactureFournisseur::STATUS_DRAFT, FactureFournisseur::STATUS_VALIDATED, FactureFournisseur::STATUS_PAID, FactureFournisseur::STATUS_ABANDONED
|
||||
*/
|
||||
var $statut;
|
||||
//! 1 si facture payee COMPLETEMENT, 0 sinon (ce champ ne devrait plus servir car insuffisant)
|
||||
|
||||
/**
|
||||
* Set to 1 if the invoice is completely paid, otherwise is 0
|
||||
* @var int
|
||||
* @deprecated Use statuses stored in self::statut
|
||||
*/
|
||||
var $paye;
|
||||
|
||||
var $author;
|
||||
@ -1409,7 +1414,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin';
|
||||
$sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin, ff.fk_statut';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as ff';
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ' WHERE ff.paye=0';
|
||||
@ -1430,10 +1435,16 @@ class FactureFournisseur extends CommonInvoice
|
||||
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=paye:0';
|
||||
$response->img=img_object($langs->trans("Bills"),"bill");
|
||||
|
||||
$facturestatic = new FactureFournisseur($this->db);
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
if (! empty($obj->datefin) && $this->db->jdate($obj->datefin) < ($now - $conf->facture->fournisseur->warning_delay)) {
|
||||
|
||||
$facturestatic->date_echeance = $this->db->jdate($obj->datefin);
|
||||
$facturestatic->statut = $obj->fk_statut;
|
||||
|
||||
if ($facturestatic->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -1822,6 +1833,24 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the payment of the supplier invoice having a delay?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasDelay()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
if (!$this->date_echeance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ($this->statut == self::STATUS_VALIDATED) && ($this->date_echeance < ($now - $conf->facture->fournisseur->warning_delay));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1905,7 +1905,9 @@ else
|
||||
// Due date
|
||||
print '<tr><td>'.$form->editfieldkey("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker').'</td><td colspan="3">';
|
||||
print $form->editfieldval("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker');
|
||||
if ($action != 'editdate_lim_reglement' && $object->statut < FactureFournisseur::STATUS_CLOSED && $object->date_echeance && $object->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_warning($langs->trans('Late'));
|
||||
if ($action != 'editdate_lim_reglement' && $object->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Conditions de reglement par defaut
|
||||
|
||||
@ -230,6 +230,9 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->date_echeance = $db->jdate($objp->datelimite);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
@ -245,7 +248,9 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df),'day')."</td>\n";
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite),'day');
|
||||
if ($objp->datelimite && $db->jdate($objp->datelimite) < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
print '<td>';
|
||||
|
||||
@ -323,6 +323,10 @@ if ($resql)
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$facturestatic->date_echeance = $db->jdate($obj->date_echeance);
|
||||
$facturestatic->statut = $obj->fk_statut;
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
@ -342,7 +346,9 @@ if ($resql)
|
||||
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datef),'day').'</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->date_echeance),'day');
|
||||
if (($obj->paye == 0) && ($obj->fk_statut > 0) && $obj->date_echeance && $db->jdate($obj->date_echeance) < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_picto($langs->trans("Late"),"warning");
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.dol_trunc($obj->libelle,36).'</td>';
|
||||
print '<td>';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -24,5 +24,8 @@ INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXP
|
||||
ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
|
||||
ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN model_pdf varchar(255);
|
||||
UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_PREFIX_SPEC')__ WHERE __DECRYPT('name')__ = 'EXPORT_PREFIX_SPEC';
|
||||
|
||||
ALTER TABLE llx_accountingaccount RENAME TO llx_accounting_account;
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN model_pdf varchar(255);
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
-- ===========================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_accountingaccount ADD INDEX idx_accountingaccount_fk_pcg_version (fk_pcg_version);
|
||||
ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_fk_pcg_version (fk_pcg_version);
|
||||
|
||||
ALTER TABLE llx_accountingaccount ADD CONSTRAINT fk_accountingaccount_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version);
|
||||
ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version);
|
||||
|
||||
--ALTER TABLE llx_accountingaccount ADD CONSTRAINT fk_accountingaccount_fk_account_number FOREIGN KEY (fk_account_number) REFERENCES llx_accountingaccount (account_number);
|
||||
--ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_account_number FOREIGN KEY (fk_account_number) REFERENCES llx_accounting_account (account_number);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user