Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/compta/facture/prelevement.php htdocs/core/class/rssparser.class.php
This commit is contained in:
commit
6d25b8630b
10
ChangeLog
10
ChangeLog
@ -230,6 +230,16 @@ Following changes may create regressions for some external modules, but were nec
|
||||
- remove input field in form '<input type="hidden" name="page" value="'.$page.'">';'
|
||||
- add parameter $pagenavastextinput to value 1 when calling print_barre_liste()
|
||||
|
||||
WARNING FOR DOLIWAMP USERS ONLY:
|
||||
|
||||
Only people that installed Dolibarr using the all-in-one autoinstaller for Windows called "DoliWAMP" are concerned by the following warnings:
|
||||
|
||||
* DoliWAMP autoinstaller for Windows is not more available on 32bits systems. Use standard package if you need to use such architecture.
|
||||
* It is not possible to migrate from an installation done with the old DoliWAMP autoinstaller for Windows by using this new one. You must make a backup
|
||||
of your database, make a fresh installation using the new installer and reload.
|
||||
* Don't forget that DoliWAMP is a good solution to make a quick test of Dolibarr on your local computer but was never recommanded as a production
|
||||
solution on a local desktop since a desktop computer has not a backup and security policy as good as on a server (when there is one).
|
||||
DoliWAMP remains a solution for fast test or demo purposes.
|
||||
|
||||
|
||||
***** ChangeLog for 11.0.4 compared to 11.0.3 *****
|
||||
|
||||
@ -32,6 +32,7 @@ PortAlreadyInUse=Port %1 seems to be already in use. You should cancel to go bac
|
||||
|
||||
FirefoxDetected=Firefox has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
||||
ChromeDetected=Chrome has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
||||
MicrosoftEdgeDetected=Microsoft Edge has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
||||
ChooseDefaultBrowser=Please choose your default browser (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). If you are not sure, just click Open :
|
||||
|
||||
LaunchNow=Launch Dolibarr now
|
||||
|
||||
@ -41,7 +41,7 @@ Compression=lzma
|
||||
SolidCompression=yes
|
||||
WizardImageFile=build\exe\doliwamp\doliwamp.bmp
|
||||
WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp
|
||||
SetupIconFile=doc\images\dolibarr.ico
|
||||
SetupIconFile=doc\images\dolibarr_favicon.ico
|
||||
;To say the installer must be ran as admin
|
||||
PrivilegesRequired=admin
|
||||
DisableProgramGroupPage=yes
|
||||
@ -519,7 +519,7 @@ begin
|
||||
// check that we don't try an upgrade (mysql upgrade no supported)
|
||||
//----------------------------------------------
|
||||
|
||||
if FileExists (pathWithSlashes+'/bin/mysql/mysql5.0.45'+phpVersion+'/bin/mysqld-nt.exe') then
|
||||
if FileExists (pathWithSlashes+'/bin/mysql/mysql5.0.45/bin/mysqld-nt.exe') then
|
||||
begin
|
||||
MsgBox('An existing installation using an old version of Mysql exists. Sorry, upgrade with this installer is not possible.', mbInformation, MB_OK);
|
||||
Abort();
|
||||
@ -588,15 +588,26 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
if browser = 'iexplore.exe' then
|
||||
begin
|
||||
if FileExists (winPath+'/SystemApps/Microsoft.MicrosoftEdge_8wekyb3d8bbwe/MicrosoftEdge.exe') then
|
||||
begin
|
||||
if MsgBox(CustomMessage('MicrosoftEdgeDetected'),mbConfirmation,MB_YESNO) = IDYES then
|
||||
begin
|
||||
browser := winPath+'/SystemApps/Microsoft.MicrosoftEdge_8wekyb3d8bbwe/MicrosoftEdge.exe';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if browser = 'iexplore.exe' then
|
||||
begin
|
||||
if FileExists (pfPath+'/Internet Explorer/iexplore.exe') then
|
||||
begin
|
||||
GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, pfPath+'/Internet Explorer','exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
|
||||
GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, pfPath+'/Internet Explorer', 'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
|
||||
end
|
||||
else
|
||||
begin
|
||||
GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
|
||||
GetOpenFileName(CustomMessage('ChooseDefaultBrowser'), browser, winPath, 'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__install} -m 644 build/rpm/install.forced.php.fedora $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php
|
||||
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
||||
%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
|
||||
#desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop
|
||||
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
||||
|
||||
@ -150,7 +150,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%endif
|
||||
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
||||
%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
|
||||
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version}
|
||||
|
||||
@ -89,7 +89,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__install} -m 644 build/rpm/install.forced.php.mandriva $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php
|
||||
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
||||
%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
|
||||
#desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop
|
||||
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
||||
|
||||
@ -90,7 +90,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__install} -m 644 build/rpm/install.forced.php.opensuse $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php
|
||||
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
||||
%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
|
||||
#desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop
|
||||
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
||||
|
||||
@ -889,7 +889,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $object->email).'"></td></tr>';
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
|
||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $object->email).'"></td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||
@ -922,13 +923,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Pro phone
|
||||
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $object->phone).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" size="20" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $object->phone).'"></td></tr>';
|
||||
|
||||
// Personal phone
|
||||
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOSTISSET('phone_perso') ? GETPOST('phone_perso', 'alpha') : $object->phone_perso).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone_perso" size="20" value="'.(GETPOSTISSET('phone_perso') ? GETPOST('phone_perso', 'alpha') : $object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOSTISSET('phone_mobile') ? GETPOST('phone_mobile', 'alpha') : $object->phone_mobile).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile').' <input type="text" name="phone_mobile" size="20" value="'.(GETPOSTISSET('phone_mobile') ? GETPOST('phone_mobile', 'alpha') : $object->phone_mobile).'"></td></tr>';
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
@ -1122,7 +1126,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"]) ?GETPOST("member_email", '', 2) : $object->email).'"></td></tr>';
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
|
||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"]) ?GETPOST("member_email", '', 2) : $object->email).'"></td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||
@ -1151,13 +1156,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Pro phone
|
||||
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOSTISSET("phone") ? GETPOST("phone") : $object->phone).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" value="'.(GETPOSTISSET("phone") ? GETPOST("phone") : $object->phone).'"></td></tr>';
|
||||
|
||||
// Personal phone
|
||||
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOSTISSET("phone_perso") ? GETPOST("phone_perso") : $object->phone_perso).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone_perso" value="'.(GETPOSTISSET("phone_perso") ? GETPOST("phone_perso") : $object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile').' <input type="text" name="phone_mobile" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
|
||||
@ -86,6 +86,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('thirdpartycomm', 'globalcard'));
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
|
||||
/*
|
||||
@ -568,7 +569,7 @@ if ($object->id > 0)
|
||||
// Lien recap
|
||||
$boxstat .= '<div class="box">';
|
||||
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
|
||||
$boxstat .= '<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
||||
$boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
|
||||
|
||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||
{
|
||||
@ -652,7 +653,6 @@ if ($object->id > 0)
|
||||
|
||||
print $boxstat;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
/*
|
||||
* Latest proposals
|
||||
@ -665,7 +665,7 @@ if ($object->id > 0)
|
||||
$sql .= ", p.tva as total_tva";
|
||||
$sql .= ", p.total as total_ttc";
|
||||
$sql .= ", p.ref, p.ref_client, p.remise";
|
||||
$sql .= ", p.datep as dp, p.fin_validite as datelimite";
|
||||
$sql .= ", p.datep as dp, p.fin_validite as date_limit";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||
$sql .= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
$sql .= " AND s.rowid = ".$object->id;
|
||||
@ -704,7 +704,7 @@ if ($object->id > 0)
|
||||
$propal_static->total_tva = $objp->total_tva;
|
||||
$propal_static->total_ttc = $objp->total_ttc;
|
||||
print $propal_static->getNomUrl(1);
|
||||
if (($db->jdate($objp->datelimite) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1) {
|
||||
if (($db->jdate($objp->date_limit) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == $propal_static::STATUS_VALIDATED) {
|
||||
print " ".img_warning();
|
||||
}
|
||||
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
|
||||
@ -882,11 +882,11 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
/*
|
||||
* Latest linked contracts
|
||||
* Latest contracts
|
||||
*/
|
||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||
$sql .= " AND s.rowid = ".$object->id;
|
||||
@ -905,7 +905,7 @@ if ($object->id > 0)
|
||||
print '<table class="noborder centpercent lastrecordtable">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td>';
|
||||
print '<td colspan="5"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td>';
|
||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
//print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/contract/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table></td>';
|
||||
@ -921,15 +921,24 @@ if ($object->id > 0)
|
||||
$contrat->ref = $objp->ref ? $objp->ref : $objp->id;
|
||||
$contrat->ref_customer = $objp->refcus;
|
||||
$contrat->ref_supplier = $objp->refsup;
|
||||
$contrat->statut = $objp->contract_status;
|
||||
$contrat->fetch_lines();
|
||||
|
||||
$late = '';
|
||||
foreach ($contrat->lines as $line) {
|
||||
if ($contrat->statut == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) {
|
||||
if (($line->date_fin_validite + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late"));
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
print $contrat->getNomUrl(1, 12);
|
||||
print $late;
|
||||
print "</td>\n";
|
||||
print '<td class="nowrap">'.dol_trunc($objp->refsup, 12)."</td>\n";
|
||||
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc), 'day')."</td>\n";
|
||||
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dcon), 'day')."</td>\n";
|
||||
//print '<td class="right" width="80px"><span title="'.$langs->trans("DateCreation").'">'.dol_print_date($db->jdate($objp->dc), 'day')."</span></td>\n";
|
||||
print '<td class="right" width="80px"><span title="'.$langs->trans("DateContract").'">'.dol_print_date($db->jdate($objp->dcon), 'day')."</span></td>\n";
|
||||
print '<td width="20"> </td>';
|
||||
print '<td class="nowraponall right">';
|
||||
print $contrat->getLibStatut(4);
|
||||
|
||||
@ -29,11 +29,14 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
if (!$user->rights->facture->lire) accessforbidden();
|
||||
|
||||
@ -44,14 +47,18 @@ $id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); //
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
|
||||
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
|
||||
|
||||
$object = new Facture($db);
|
||||
if ($mode == 'bank-transfer') {
|
||||
$object = new FactureFournisseur($db);
|
||||
} else {
|
||||
$object = new Facture($db);
|
||||
}
|
||||
|
||||
// Load object
|
||||
if ($id > 0 || !empty($ref))
|
||||
@ -122,13 +129,20 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('StandingOrders');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
if ($mode == 'bank-transfer') {
|
||||
$title = $langs->trans('InvoiceSupplier')." - ".$langs->trans('CreditTransfer');
|
||||
$helpurl = "";
|
||||
} else {
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('StandingOrders');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
}
|
||||
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
@ -154,18 +168,33 @@ if ($object->id > 0)
|
||||
if ($object->paye) $resteapayer = 0;
|
||||
$resteapayeraffiche = $resteapayer;
|
||||
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
} else {
|
||||
$filterabsolutediscount = "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')";
|
||||
$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
|
||||
}
|
||||
if ($mode == 'bank-transfer') {
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this
|
||||
$filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
$filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
} else {
|
||||
$filterabsolutediscount = "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')";
|
||||
$filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')";
|
||||
}
|
||||
|
||||
$absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount);
|
||||
$absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote);
|
||||
$absolute_discount = price2num($absolute_discount, 'MT');
|
||||
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
|
||||
$absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount, 0, 1);
|
||||
$absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote, 0, 1);
|
||||
$absolute_discount = price2num($absolute_discount, 'MT');
|
||||
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
|
||||
} else {
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
} else {
|
||||
$filterabsolutediscount = "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')";
|
||||
$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
|
||||
}
|
||||
|
||||
$absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount);
|
||||
$absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote);
|
||||
$absolute_discount = price2num($absolute_discount, 'MT');
|
||||
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
|
||||
}
|
||||
|
||||
$author = new User($db);
|
||||
if ($object->user_author)
|
||||
@ -173,20 +202,37 @@ if ($object->id > 0)
|
||||
$author->fetch($object->user_author);
|
||||
}
|
||||
|
||||
$head = facture_prepare_head($object);
|
||||
if ($mode == 'bank-transfer') {
|
||||
$head = facturefourn_prepare_head($object);
|
||||
} else {
|
||||
$head = facture_prepare_head($object);
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'standingorders', $langs->trans('InvoiceCustomer'), -1, 'bill');
|
||||
dol_fiche_head($head, 'standingorders', $title, -1, 'bill');
|
||||
|
||||
// Invoice content
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
if ($mode == 'bank-transfer') {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
} else {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
}
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
if ($mode == 'bank-transfer') {
|
||||
$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1);
|
||||
} else {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
}
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
if ($mode == 'bank-transfer') {
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->thirdparty->id.'&search_company='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
|
||||
} else {
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'&search_company='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
@ -237,15 +283,26 @@ if ($object->id > 0)
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="3">';
|
||||
print $object->getLibType();
|
||||
if ($object->type == Facture::TYPE_REPLACEMENT)
|
||||
if ($object->module_source) {
|
||||
print ' <span class="opacitymediumbycolor">('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
|
||||
}
|
||||
if ($object->type == $object::TYPE_REPLACEMENT)
|
||||
{
|
||||
$facreplaced = new Facture($db);
|
||||
if ($mode == 'bank-transfer') {
|
||||
$facreplaced = new FactureFournisseur($db);
|
||||
} else {
|
||||
$facreplaced = new Facture($db);
|
||||
}
|
||||
$facreplaced->fetch($object->fk_facture_source);
|
||||
print ' ('.$langs->transnoentities("ReplaceInvoice", $facreplaced->getNomUrl(1)).')';
|
||||
}
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE)
|
||||
if ($object->type == $object::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
$facusing = new Facture($db);
|
||||
if ($mode == 'bank-transfer') {
|
||||
$facusing = new FactureFournisseur($db);
|
||||
} else {
|
||||
$facusing = new Facture($db);
|
||||
}
|
||||
$facusing->fetch($object->fk_facture_source);
|
||||
print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')';
|
||||
}
|
||||
@ -259,7 +316,11 @@ if ($object->id > 0)
|
||||
{
|
||||
if ($i == 0) print ' ';
|
||||
else print ',';
|
||||
$facavoir = new Facture($db);
|
||||
if ($mode == 'bank-transfer') {
|
||||
$facavoir = new FactureFournisseur($db);
|
||||
} else {
|
||||
$facavoir = new Facture($db);
|
||||
}
|
||||
$facavoir->fetch($id);
|
||||
print $facavoir->getNomUrl(1);
|
||||
}
|
||||
@ -278,33 +339,48 @@ if ($object->id > 0)
|
||||
// Discounts
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
|
||||
|
||||
$thirdparty = $object->thirdparty;
|
||||
$discount_type = 0;
|
||||
if ($mode == 'bank-transfer') {
|
||||
//$societe = new Fournisseur($db);
|
||||
//$result = $societe->fetch($object->socid);
|
||||
$thirdparty = $object->thirdparty;
|
||||
$discount_type = 1;
|
||||
} else {
|
||||
$thirdparty = $object->thirdparty;
|
||||
$discount_type = 0;
|
||||
}
|
||||
$backtopage = urlencode($_SERVER["PHP_SELF"].'?facid='.$object->id);
|
||||
$cannotApplyDiscount = 1;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
if ($mode == 'bank-transfer') {
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey("Label", 'label', $object->label, $object, 0).'</td>';
|
||||
print '<td>'.$form->editfieldval("Label", 'label', $object->label, $object, 0).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Date invoice
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('DateInvoice');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
if ($action == 'editinvoicedate')
|
||||
{
|
||||
$form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate');
|
||||
} else {
|
||||
print dol_print_date($object->date, 'daytext');
|
||||
print dol_print_date($object->date, 'day');
|
||||
}
|
||||
} else {
|
||||
print dol_print_date($object->date, 'daytext');
|
||||
print dol_print_date($object->date, 'day');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -314,10 +390,10 @@ if ($object->id > 0)
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
if ($action == 'editconditions')
|
||||
{
|
||||
@ -335,16 +411,21 @@ if ($object->id > 0)
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('DateMaxPayment');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
$duedate = $object->date_lim_reglement;
|
||||
if ($mode == 'bank-transfer') {
|
||||
$duedate = $object->date_echeance;
|
||||
}
|
||||
|
||||
if ($action == 'editpaymentterm')
|
||||
{
|
||||
$form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date_lim_reglement, 'paymentterm');
|
||||
$form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $duedate, 'paymentterm');
|
||||
} else {
|
||||
print dol_print_date($object->date_lim_reglement, 'daytext');
|
||||
print dol_print_date($duedate, 'day');
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
@ -537,8 +618,13 @@ if ($object->id > 0)
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
$buttonlabel = $langs->trans("MakeWithdrawRequest");
|
||||
if ($mode == 'bank-transfer') {
|
||||
$buttonlabel = $langs->trans("MakeBankTransferOrder");
|
||||
}
|
||||
|
||||
// Add a transfer request
|
||||
if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0)
|
||||
if ($object->statut > $object::STATUS_DRAFT && $object->paye == 0 && $num == 0)
|
||||
{
|
||||
if ($resteapayer > 0)
|
||||
{
|
||||
@ -550,29 +636,34 @@ if ($object->id > 0)
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'" />';
|
||||
print '<input type="hidden" name="action" value="new" />';
|
||||
print '<label for="withdraw_request_amount">'.$langs->trans('WithdrawRequestAmount').' </label>';
|
||||
print '<label for="withdraw_request_amount">'.$langs->trans('BankTransferAmount').' </label>';
|
||||
print '<input type="text" id="withdraw_request_amount" name="withdraw_request_amount" value="'.$remaintopaylesspendingdebit.'" size="9" />';
|
||||
print '<input type="submit" class="butAction" value="'.$langs->trans("MakeWithdrawRequest").'" />';
|
||||
print '<input type="submit" class="butAction" value="'.$buttonlabel.'" />';
|
||||
print '</form>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$buttonlabel.'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("AmountMustBePositive")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("AmountMustBePositive")).'">'.$buttonlabel.'</a>';
|
||||
}
|
||||
} else {
|
||||
if ($num == 0)
|
||||
{
|
||||
if ($object->statut > Facture::STATUS_DRAFT) print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPaid")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
else print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("Draft")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
} else print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("RequestAlreadyDone")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
if ($object->statut > $object::STATUS_DRAFT) print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPaid")).'">'.$buttonlabel.'</a>';
|
||||
else print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("Draft")).'">'.$buttonlabel.'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("RequestAlreadyDone")).'">'.$buttonlabel.'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</div><br>\n";
|
||||
|
||||
|
||||
print '<div class="opacitymedium">'.$langs->trans("DoStandingOrdersBeforePayments").'</div><br>';
|
||||
|
||||
if ($mode == 'bank-transfer') {
|
||||
print '<div class="opacitymedium">'.$langs->trans("DoCreditTransferBeforePayments").'</div><br>';
|
||||
} else {
|
||||
print '<div class="opacitymedium">'.$langs->trans("DoStandingOrdersBeforePayments").'</div><br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Withdrawals
|
||||
@ -585,7 +676,11 @@ if ($object->id > 0)
|
||||
print '<td class="left">'.$langs->trans("DateRequest").'</td>';
|
||||
print '<td class="center">'.$langs->trans("User").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Amount").'</td>';
|
||||
print '<td class="center">'.$langs->trans("WithdrawalReceipt").'</td>';
|
||||
if ($mode == 'bank-transfer') {
|
||||
print '<td class="center">'.$langs->trans("BankTransferReceipt").'</td>';
|
||||
} else {
|
||||
print '<td class="center">'.$langs->trans("WithdrawalReceipt").'</td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
print '<td class="center">'.$langs->trans("DateProcess").'</td>';
|
||||
print '<td> </td>';
|
||||
|
||||
@ -101,13 +101,15 @@ class box_external_rss extends ModeleBoxes
|
||||
if ($result < 0 || !empty($rssparser->error))
|
||||
{
|
||||
// Show warning
|
||||
$title .= " ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate", ($rssparser->getLastFetchDate() ?dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown"))));
|
||||
$errormessage = $langs->trans("FailedToRefreshDataInfoNotUpToDate", ($rssparser->getLastFetchDate() ? dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")));
|
||||
if ($rssparser->error) $errormessage .= " - ".$rssparser->error;
|
||||
$title .= " ".img_error($errormessage);
|
||||
$this->info_box_head = array('text' => $title, 'limit' => 0);
|
||||
} else {
|
||||
$this->info_box_head = array(
|
||||
'text' => $title,
|
||||
'sublink' => $link,
|
||||
'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate() ?dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")),
|
||||
'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate() ? dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")),
|
||||
'subpicto'=>'globe',
|
||||
'target'=>'_blank',
|
||||
);
|
||||
|
||||
@ -90,7 +90,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
$sql .= " c.rowid, c.ref, c.statut as contract_status, c.ref_customer, c.ref_supplier,";
|
||||
$sql .= " cd.rowid as cdid, cd.label, cd.description, cd.tms as datem, cd.statut, cd.product_type as type,";
|
||||
$sql .= " cd.rowid as cdid, cd.label, cd.description, cd.tms as datem, cd.statut, cd.product_type as type, cd.date_fin_validite as date_line,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as plabel, p.fk_product_type as ptype, p.entity, p.tobuy, p.tosell";
|
||||
$sql .= " FROM (".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."contrat as c ON s.rowid = c.fk_soc";
|
||||
@ -113,6 +113,8 @@ class box_services_contracts extends ModeleBoxes
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$late = '';
|
||||
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datem = $this->db->jdate($objp->datem);
|
||||
|
||||
@ -124,11 +126,11 @@ class box_services_contracts extends ModeleBoxes
|
||||
$contractlinestatic->product_id = $objp->product_id;
|
||||
$contractlinestatic->product_ref = $objp->product_ref;
|
||||
|
||||
$contractstatic->statut = $objp->contract_status;
|
||||
$contractstatic->id = $objp->rowid;
|
||||
$contractstatic->ref = $objp->ref;
|
||||
$contractstatic->ref_customer = $objp->ref_customer;
|
||||
$contractstatic->ref_supplier = $objp->ref_supplier;
|
||||
$contractstatic->statut = $objp->contract_status;
|
||||
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
@ -140,6 +142,9 @@ class box_services_contracts extends ModeleBoxes
|
||||
$thirdpartytmp->code_compta = $objp->code_compta;
|
||||
$thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
|
||||
$dateline = $this->db->jdate($objp->date_line);
|
||||
if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late"));
|
||||
|
||||
// Multilangs
|
||||
if (!empty($conf->global->MAIN_MULTILANGS) && $objp->product_id > 0) // if option multilang is on
|
||||
{
|
||||
@ -212,6 +217,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => '',
|
||||
'text' => dol_print_date($datem, 'day'),
|
||||
'text2'=> $late,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
|
||||
@ -254,9 +254,15 @@ class RssParser
|
||||
libxml_use_internal_errors(false);
|
||||
$rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
} else {
|
||||
if (! function_exists('xml_parser_create')) {
|
||||
$this->error = 'Function xml_parser_create are not supported by your PHP';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$xmlparser = xml_parser_create('');
|
||||
if (!is_resource($xmlparser)) {
|
||||
$this->error = "ErrorFailedToCreateParser"; return -1;
|
||||
$this->error = "ErrorFailedToCreateParser";
|
||||
return -1;
|
||||
}
|
||||
|
||||
xml_set_object($xmlparser, $this);
|
||||
|
||||
@ -53,6 +53,28 @@ function facturefourn_prepare_head($object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
//if ($fac->mode_reglement_code == 'PRE')
|
||||
if (!empty($conf->paymentbybanktransfer->enabled))
|
||||
{
|
||||
$nbStandingOrders = 0;
|
||||
$sql = "SELECT COUNT(pfd.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " WHERE pfd.fk_facture_fourn = ".$object->id;
|
||||
$sql .= " AND pfd.ext_payment_id IS NULL";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $nbStandingOrders = $obj->nb;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id.'&mode=bank-transfer';
|
||||
$head[$h][1] = $langs->trans('BankTransfer');
|
||||
if ($nbStandingOrders > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbStandingOrders.'</span>';
|
||||
$head[$h][2] = 'standingorders';
|
||||
$h++;
|
||||
}
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
||||
@ -55,7 +55,6 @@ function facture_prepare_head($object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
//if ($fac->mode_reglement_code == 'PRE')
|
||||
if (!empty($conf->prelevement->enabled))
|
||||
{
|
||||
$nbStandingOrders = 0;
|
||||
|
||||
@ -352,7 +352,7 @@ if ($object->id > 0)
|
||||
// Lien recap
|
||||
$boxstat .= '<div class="box">';
|
||||
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
|
||||
$boxstat .= '<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
||||
$boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
|
||||
|
||||
if ($conf->supplier_proposal->enabled)
|
||||
{
|
||||
|
||||
@ -2490,14 +2490,6 @@ if ($action == 'create')
|
||||
// Date
|
||||
print '<tr><td>'.$form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker').'</td><td colspan="3">';
|
||||
print $form->editfieldval("Date", 'datef', $object->datep, $object, $form_permission, 'datepicker');
|
||||
print '</td>';
|
||||
|
||||
// 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->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Default terms of the settlement
|
||||
@ -2520,6 +2512,14 @@ if ($action == 'create')
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// 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->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Mode of payment
|
||||
$langs->load('bills');
|
||||
print '<tr><td class="nowrap">';
|
||||
|
||||
@ -186,7 +186,7 @@ if ($id > 0 || !empty($ref))
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="4">';
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
--
|
||||
-- Actions commerciales
|
||||
-- Table of events and actions (past and to do).
|
||||
-- This is also the table to track events on other Dolibarr objects.
|
||||
-- ========================================================================
|
||||
|
||||
create table llx_actioncomm
|
||||
@ -40,7 +41,7 @@ create table llx_actioncomm
|
||||
fk_soc integer,
|
||||
fk_contact integer,
|
||||
fk_parent integer NOT NULL default 0,
|
||||
fk_user_action integer, -- user id of owner of action (note that users assigned to event are stored into another table)
|
||||
fk_user_action integer, -- user id of owner of action (note that users assigned to event are stored into table 'actioncomm_resources')
|
||||
fk_user_done integer, -- user id of user that has made action (deprecated)
|
||||
|
||||
transparency integer, -- transparency (ical standard). used to say if user assigned to event are busy or not by event. This field may be deprecated if we want to store transparency for each assigned user, moved into table llx_actioncomm_resources.
|
||||
|
||||
@ -105,8 +105,8 @@ SupplierInvoicePayment=Vendor payment
|
||||
SubscriptionPayment=Subscription payment
|
||||
WithdrawalPayment=Debit payment order
|
||||
SocialContributionPayment=Social/fiscal tax payment
|
||||
BankTransfer=Bank transfer
|
||||
BankTransfers=Bank transfers
|
||||
BankTransfer=Credit transfer
|
||||
BankTransfers=Credit transfers
|
||||
MenuBankInternalTransfer=Internal transfer
|
||||
TransferDesc=Transfer from one account to another, Dolibarr will write two records (a debit in source account and a credit in target account). The same amount (except sign), label and date will be used for this transaction)
|
||||
TransferFrom=From
|
||||
|
||||
@ -40,6 +40,7 @@ CreditTransferStatistics=Credit transfer statistics
|
||||
Rejects=Rejects
|
||||
LastWithdrawalReceipt=Latest %s direct debit receipts
|
||||
MakeWithdrawRequest=Make a direct debit payment request
|
||||
MakeBankTransferOrder=Make a credit transfer request
|
||||
WithdrawRequestsDone=%s direct debit payment requests recorded
|
||||
ThirdPartyBankCode=Third-party bank code
|
||||
NoInvoiceCouldBeWithdrawed=No invoice debited successfully. Check that invoices are on companies with a valid IBAN and that IBAN has a UMR (Unique Mandate Reference) with mode <strong>%s</strong>.
|
||||
@ -93,6 +94,7 @@ WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your cou
|
||||
ShowWithdraw=Show Direct Debit Order
|
||||
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management.
|
||||
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null.
|
||||
DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu Bank->Credit transfer orders to manage the credit transfer payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null.
|
||||
WithdrawalFile=Withdrawal file
|
||||
SetToStatusSent=Set to status "File Sent"
|
||||
ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null
|
||||
@ -103,6 +105,7 @@ RUMLong=Unique Mandate Reference
|
||||
RUMWillBeGenerated=If empty, a UMR (Unique Mandate Reference) will be generated once the bank account information is saved.
|
||||
WithdrawMode=Direct debit mode (FRST or RECUR)
|
||||
WithdrawRequestAmount=Amount of Direct debit request:
|
||||
BankTransferAmount=Amount of Credit Transfer request:
|
||||
WithdrawRequestErrorNilAmount=Unable to create direct debit request for empty amount.
|
||||
SepaMandate=SEPA Direct Debit Mandate
|
||||
SepaMandateShort=SEPA Mandate
|
||||
|
||||
@ -3632,6 +3632,11 @@ ul.noborder li:nth-child(even):not(.liste_titre) {
|
||||
padding-bottom: 2px;
|
||||
width: 118px;
|
||||
}
|
||||
|
||||
td.tdboxstats .boxstats {
|
||||
box-shadow: 1px 1px 8px var(--colorboxstatsborder);
|
||||
}
|
||||
|
||||
.tabBar .fichehalfright .boxstats {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 4px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user