This commit is contained in:
Philippe 2017-11-23 21:52:11 +01:00
commit 2f2b0630e2
93 changed files with 589 additions and 419 deletions

View File

@ -3,8 +3,33 @@ English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 6.0.2 compared to 6.0.1 ***** ***** ChangeLog for 6.0.3 compared to 6.0.2 *****
FIX: #7211 Update qty dispatched on qty change
FIX: #7458
FIX: #7593
FIX: #7616
FIX: #7619
FIX: #7626
FIX: #7648
FIX: #7675
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: API to get object does not return data of linked objects
FIX: Bad localtax apply
FIX: Bad ressource list in popup in gantt view
FIX: bankentries search conciliated if val 0
FIX: hook formObjectOptions() must use $expe and not $object
FIX: make of link to other object during creation
FIX: Missing function getLinesArray
FIX: old batch not shown in multi shipping
FIX: paid supplier invoices are shown as abandoned
FIX: selection of thirdparty was lost on stats page of invoices
FIX: sql syntax error because of old field accountancy_journal
FIX: Stats on invoices show nothing
FIX: substitution in ODT of thirdparties documents
FIX: wrong key in selectarray
FIX: wrong personnal project time spent
***** ChangeLog for 6.0.2 compared to 6.0.1 *****
FIX: #7148 FIX: #7148
FIX: #7288 FIX: #7288
FIX: #7366 renaming table with pgsql FIX: #7366 renaming table with pgsql
@ -38,7 +63,6 @@ FIX: wrong basePath in the swagger view
FIX: Implementation of a Luracast recommandation for the REST api server FIX: Implementation of a Luracast recommandation for the REST api server
***** ChangeLog for 6.0.1 compared to 6.0.* ***** ***** ChangeLog for 6.0.1 compared to 6.0.* *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7325 Default VAT rate when editing template invoices is 0% FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7330 FIX: #7330
@ -80,7 +104,6 @@ FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-142
CVE-2017-14242 CVE-2017-14242
***** ChangeLog for 6.0.0 compared to 5.0.* ***** ***** ChangeLog for 6.0.0 compared to 5.0.* *****
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file). NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
NEW: Add a payment module for Stripe. NEW: Add a payment module for Stripe.
NEW: Add module "Product variant" (like red, blue for the product shoes) NEW: Add module "Product variant" (like red, blue for the product shoes)
@ -229,6 +252,23 @@ Following changes may create regression for some external modules, but were nece
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
hook specifications so you must return output into "resprint". hook specifications so you must return output into "resprint".
***** ChangeLog for 5.0.7 compared to 5.0.6 *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7148
FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7366 renaming table with pgsql
FIX: #7391
FIX: #7510 Bug: extrafield content disappear when generate pdf within intervention
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: Bad link to unpayed suppliers invoices
FIX: bankentries search conciliated if val 0
FIX: multicompany better accuracy in rounding and with revenue stamp.
FIX: PDF output was sharing 2 different currencies in same total
FIX: Upgrade missing on field
FIX: wrong key in selectarray
FIX: wrong personnal project time spent
***** ChangeLog for 5.0.6 compared to 5.0.5 ***** ***** ChangeLog for 5.0.6 compared to 5.0.5 *****
FIX: Removed a bad symbolic link into custom directory. FIX: Removed a bad symbolic link into custom directory.
FIX: Renaming a resource ref rename also the directory of attached files. FIX: Renaming a resource ref rename also the directory of attached files.

View File

@ -353,7 +353,7 @@ begin
begin begin
// TODO Copy file or ask to install package ? // TODO Copy file or ask to install package ?
//CustomMessage('YouWillInstallDoliWamp')+#13#13 //CustomMessage('YouWillInstallDoliWamp')+#13#13
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK); MsgBox('The Visual C++ Redistributable package should be installed, it seems it is not. Please install the 32-bit version from http://www.microsoft.com/en-us/download/details.aspx?id=30679, then restart the DoliWAMP installation/upgrade.',mbInformation,MB_OK);
end; end;
// Pb seems similar with msvcp110.dll // Pb seems similar with msvcp110.dll
//vcredist_x64.exe //vcredist_x64.exe

View File

@ -571,6 +571,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
@ -579,6 +580,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
@ -590,6 +592,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
print "Remove subdir of custom dir\n"; print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n"; print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";

View File

@ -99,7 +99,7 @@ JQUERYFILETREE:
RESTLER: RESTLER:
-------- --------
* Add 2 lines into function * Add 2 lines into file AutoLoader.php to complete function
private function alias($className, $currentClass) private function alias($className, $currentClass)
{ {
... ...

View File

@ -631,7 +631,7 @@ if ($action == 'create') {
print "</tr>\n"; print "</tr>\n";
} }
if ($total_debit != $total_credit) if (price2num($total_debit) != price2num($total_credit))
{ {
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings'); setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings');
} }

View File

@ -85,6 +85,9 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->bind->write) if (! $user->rights->accounting->bind->write)
accessforbidden(); accessforbidden();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('accountancycustomerlist'));
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
$accounting = new AccountingAccount($db); $accounting = new AccountingAccount($db);
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1); $aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
@ -98,26 +101,33 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOU
if (GETPOST('cancel')) { $action='list'; $massaction=''; } if (GETPOST('cancel')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
// Purge search criteria $parameters=array();
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers $reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{ {
$search_lineid = ''; // Purge search criteria
$search_ref = ''; if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
$search_invoice = ''; {
$search_label = ''; $search_lineid = '';
$search_desc = ''; $search_ref = '';
$search_amount = ''; $search_invoice = '';
$search_account = ''; $search_label = '';
$search_vat = ''; $search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
// Mass actions
$objectclass='AccountingAccount';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
} }
// Mass actions
$objectclass='Skeleton';
$objectlabel='Skeleton';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
if ($massaction == 'ventil') { if ($massaction == 'ventil') {
$msg=''; $msg='';
@ -182,6 +192,9 @@ $sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,";
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,"; $sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
$sql .= " aa.rowid as aarowid"; $sql .= " aa.rowid as aarowid";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture"; $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 . "product as p ON p.rowid = l.fk_product";
@ -223,6 +236,11 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
} }
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
// Count total nb of records // Count total nb of records

View File

@ -85,6 +85,9 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->bind->write) if (! $user->rights->accounting->bind->write)
accessforbidden(); accessforbidden();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('accountancysupplierlist'));
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
$accounting = new AccountingAccount($db); $accounting = new AccountingAccount($db);
// TODO: we should need to check if result is a really exist accountaccount rowid..... // TODO: we should need to check if result is a really exist accountaccount rowid.....
@ -99,26 +102,32 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUN
if (GETPOST('cancel')) { $action='list'; $massaction=''; } if (GETPOST('cancel')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
// Purge search criteria $parameters=array();
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers $reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
{ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$search_lineid = '';
$search_ref = '';
$search_invoice = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
// Mass actions if (empty($reshook))
$objectclass='Skeleton'; {
$objectlabel='Skeleton'; // Purge search criteria
$permtoread = $user->rights->accounting->read; if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
$permtodelete = $user->rights->accounting->delete; {
$uploaddir = $conf->accounting->dir_output; $search_lineid = '';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; $search_ref = '';
$search_invoice = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
// Mass actions
$objectclass='AccountingAccount';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
if ($massaction == 'ventil') { if ($massaction == 'ventil') {
$msg=''; $msg='';
@ -184,6 +193,9 @@ $sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_lab
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,"; $sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,"; $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
$sql.= " aa.rowid as aarowid"; $sql.= " aa.rowid as aarowid";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; $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.= " 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 . "product as p ON p.rowid = l.fk_product";
@ -220,6 +232,11 @@ if (strlen(trim($search_vat))) {
} }
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
// Count total nb of records // Count total nb of records

View File

@ -338,6 +338,9 @@ if ($mode == 'searchkey')
$recordtoshow=array(); $recordtoshow=array();
// Search modules dirs
$modulesdir = dolGetModulesDirs();
$nbempty=0; $nbempty=0;
/*var_dump($langcode); /*var_dump($langcode);
var_dump($transkey); var_dump($transkey);
@ -351,29 +354,30 @@ if ($mode == 'searchkey')
} }
else else
{ {
// Load all translations keys // Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
foreach($conf->file->dol_document_root as $keydir => $searchdir) foreach($modulesdir as $keydir => $tmpsearchdir)
{ {
// Directory of translation files $searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/'
$dir_lang = $searchdir."/langs/".$langcode;
$dir_lang_osencoded=dol_osencode($dir_lang);
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1); // Directory of translation files
$dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels
$dir_lang_osencoded=dol_osencode($dir_lang);
foreach($filearray as $file) $filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
{ foreach($filearray as $file)
$tmpfile=preg_replace('/.lang/i', '', basename($file['name'])); {
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite $tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only $newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n"; $newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
} //print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
}
} }
// Now search into translation array // Now search into translation array
foreach($newlang->tab_translate as $key => $val) foreach($newlang->tab_translate as $key => $val)
{ {
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/', $key)) continue; if ($transkey && ! preg_match('/'.preg_quote($transkey).'/i', $key)) continue;
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/', $val)) continue; if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/i', $val)) continue;
$recordtoshow[$key]=$val; $recordtoshow[$key]=$val;
} }
} }

View File

@ -36,7 +36,7 @@ class Login
* *
* Request the API token for a couple username / password. * Request the API token for a couple username / password.
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file). * Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page). * Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: Tha API key (DOLAPIKEY) can be found/set on the user page.
* *
* @param string $login User login * @param string $login User login
* @param string $password User password * @param string $password User password

View File

@ -128,7 +128,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
foreach ($modulesdir as $dir) foreach ($modulesdir as $dir)
{ {
// Search available module // Search available module
dol_syslog("Scan directory ".$dir." for module descriptor to after search for API files"); dol_syslog("Scan directory ".$dir." for module descriptor files, then search for API files");
$handle=@opendir(dol_osencode($dir)); $handle=@opendir(dol_osencode($dir));
if (is_resource($handle)) if (is_resource($handle))
@ -139,14 +139,14 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
{ {
$module = strtolower($regmod[1]); $module = strtolower($regmod[1]);
$moduledirforclass = getModuleDirForApiClass($module); $moduledirforclass = getModuleDirForApiClass($module);
$moduleforperm = $module; $modulenameforenabled = $module;
if ($module == 'propale') { $moduleforperm='propal'; } if ($module == 'propale') { $modulenameforenabled='propal'; }
//dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass); dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
// Defined if module is enabled // Defined if module is enabled
$enabled=true; $enabled=true;
if (empty($conf->$moduleforperm->enabled)) $enabled=false; if (empty($conf->$modulenameforenabled->enabled)) $enabled=false;
if ($enabled) if ($enabled)
{ {
@ -235,7 +235,13 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
if ($module == 'order') { $classname='Commande'; } if ($module == 'order') { $classname='Commande'; }
//var_dump($classfile);var_dump($classname);exit; //var_dump($classfile);var_dump($classname);exit;
require_once $dir_part_file; $res = include_once $dir_part_file;
if (! $res)
{
print 'API not found (failed to include API file)';
header('HTTP/1.1 501 API not found (failed to include API file)');
exit(0);
}
if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/'); if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/');
} }
else else
@ -246,7 +252,14 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php'); $dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php');
$classname=ucwords($module); $classname=ucwords($module);
require_once $dir_part_file; $res = include_once $dir_part_file;
if (! $res)
{
print 'API not found (failed to include API file)';
header('HTTP/1.1 501 API not found (failed to include API file)');
exit(0);
}
if (class_exists($classname)) $api->r->addAPIClass($classname); if (class_exists($classname)) $api->r->addAPIClass($classname);
} }
} }

View File

@ -108,6 +108,17 @@ class BlockedLog
$this->error++; $this->error++;
} }
} }
if($this->element === 'invoice_supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$object = new FactureFournisseur($this->db);
if($object->fetch($this->fk_object)>0) {
return $object->getNomUrl(1);
}
else{
$this->error++;
}
}
else if($this->element === 'payment') { else if($this->element === 'payment') {
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
@ -119,6 +130,17 @@ class BlockedLog
$this->error++; $this->error++;
} }
} }
else if($this->element === 'payment_supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
$object = new PaiementFourn($this->db);
if($object->fetch($this->fk_object)>0) {
return $object->getNomUrl(1);
}
else{
$this->error++;
}
}
return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object); return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object);
@ -153,7 +175,7 @@ class BlockedLog
*/ */
public function setObjectData(&$object) { public function setObjectData(&$object) {
if($object->element=='payment') { if($object->element=='payment' || $object->element=='payment_supplier') {
$this->date_object = $object->datepaye; $this->date_object = $object->datepaye;
} }
else{ else{
@ -183,13 +205,28 @@ class BlockedLog
$this->object_data->note_private= (double) $object->note_private; $this->object_data->note_private= (double) $object->note_private;
} }
elseif($this->element==='payment'){ if($this->element === 'invoice_supplier') {
if(empty($object->thirdparty))$object->fetch_thirdparty();
$this->object_data->thirdparty = new stdClass();
foreach($object->thirdparty as $key=>$value) {
if(!is_object($value)) $this->object_data->thirdparty->{$key} = $value;
}
$this->object_data->total_ht = (double) $object->total_ht;
$this->object_data->total_tva = (double) $object->total_tva;
$this->object_data->total_ttc = (double) $object->total_ttc;
$this->object_data->total_localtax1= (double) $object->total_localtax1;
$this->object_data->total_localtax2= (double) $object->total_localtax2;
$this->object_data->note_public = (double) $object->note_public;
$this->object_data->note_private= (double) $object->note_private;
}
elseif($this->element==='payment'|| $object->element=='payment_supplier'){
$this->object_data->amounts = $object->amounts; $this->object_data->amounts = $object->amounts;
} }
} }
/** /**
@ -511,6 +548,15 @@ class BlockedLog
$this->amounts = (double) $obj->amount; $this->amounts = (double) $obj->amount;
} }
} }
if($this->element === 'payment_supplier') {
$sql="SELECT amount FROM ".MAIN_DB_PREFIX."paiementfourn WHERE rowid=".$this->fk_object;
$res = $this->db->query($sql);
if($res && $obj = $this->db->fetch_object($res)) {
$this->amounts = (double) $obj->amount;
}
}
elseif($this->element === 'facture') { elseif($this->element === 'facture') {
$sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object; $sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object;

View File

@ -114,10 +114,13 @@ switch($action)
{ {
if (count($prodcustprice->lines) > 0) if (count($prodcustprice->lines) > 0)
{ {
$pu_ht = price($prodcustprice->lines [0]->price); $pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx; $tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
else else

View File

@ -1329,6 +1329,8 @@ if ($id > 0)
print '</div>'; print '</div>';
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid))) if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
{ {
//var_dump($object->userassigned);
//var_dump($listofuserid);
print '<div class="myavailability">'; print '<div class="myavailability">';
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
print '</div>'; print '</div>';

View File

@ -2,8 +2,8 @@
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -225,11 +225,11 @@ class ActionComm extends CommonObject
if ($this->elementtype=='commande') $this->elementtype='order'; if ($this->elementtype=='commande') $this->elementtype='order';
if ($this->elementtype=='contrat') $this->elementtype='contract'; if ($this->elementtype=='contrat') $this->elementtype='contract';
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility when userassigned was an int instead fo array
{ {
$tmpid=$this->userassigned; $tmpid=$this->userassigned;
$this->userassigned=array(); $this->userassigned=array();
$this->userassigned[$tmpid]=array('id'=>$tmpid); $this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency);
} }
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
@ -240,7 +240,7 @@ class ActionComm extends CommonObject
// Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...). // Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...).
if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned)) if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned))
$this->userassigned = array($userownerid=>array('id'=>$userownerid)); $this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency));
if (! $this->type_id || ! $this->type_code) if (! $this->type_id || ! $this->type_code)
{ {
@ -1333,6 +1333,7 @@ class ActionComm extends CommonObject
{ {
// Note: Output of sql request is encoded in $conf->file->character_set_client // Note: Output of sql request is encoded in $conf->file->character_set_client
// This assignment in condition is not a bug. It allows walking the results. // This assignment in condition is not a bug. It allows walking the results.
$diff = 0;
while ($obj=$this->db->fetch_object($resql)) while ($obj=$this->db->fetch_object($resql))
{ {
$qualified=true; $qualified=true;
@ -1367,8 +1368,9 @@ class ActionComm extends CommonObject
if ($qualified && $datestart) if ($qualified && $datestart)
{ {
$eventarray[$datestart]=$event; $eventarray[$datestart+$diff]=$event;
} }
$diff++;
} }
} }
else else

View File

@ -297,7 +297,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
if ($status == 'todo') $title=$langs->trans("ToDoActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param=''; $param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
@ -482,7 +486,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
else else
{ {
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; if (is_array($actioncode))
{
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
} }
} }
} }

View File

@ -169,7 +169,11 @@ $listofextcals=array();
$param=''; $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($actioncode != '') $param.="&actioncode=".$actioncode; if ($actioncode != '') {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status != '' && $status > -1) $param.="&status=".$status; if ($status != '' && $status > -1) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
@ -227,7 +231,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
else else
{ {
$sql.=" AND c.code IN ('".implode("','", explode(',',$actioncode))."')"; if (is_array($actioncode))
{
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
} }
} }
} }

View File

@ -203,7 +203,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
if ($status == 'todo') $title=$langs->trans("ToDoActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param=''; $param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
@ -394,7 +398,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
else else
{ {
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; if (is_array($actioncode))
{
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
} }
} }
} }

View File

@ -805,6 +805,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); $tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
} }
@ -2173,7 +2176,7 @@ if ($action == 'create')
// Show object lines // Show object lines
$result = $object->getLinesArray(); $result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST"> print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '"> <input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">

View File

@ -371,12 +371,12 @@ class Propal extends CommonObject
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product) * by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
* and desc must already have the right value (it's up to the caller to manage multilanguage) * and desc must already have the right value (it's up to the caller to manage multilanguage)
* *
* @param string $desc Description de la ligne * @param string $desc Description of line
* @param float $pu_ht Prix unitaire * @param float $pu_ht Unit price
* @param float $qty Quantite * @param float $qty Quantity
* @param float $txtva Taux de tva * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id du produit/service predefini * @param int $fk_product Id du produit/service predefini
* @param float $remise_percent Pourcentage de remise de la ligne * @param float $remise_percent Pourcentage de remise de la ligne
* @param string $price_base_type HT or TTC * @param string $price_base_type HT or TTC
@ -836,8 +836,9 @@ class Propal extends CommonObject
if (empty($this->availability_id)) $this->availability_id=0; if (empty($this->availability_id)) $this->availability_id=0;
if (empty($this->demand_reason_id)) $this->demand_reason_id=0; if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
// Multicurrency // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))
{ {
$this->multicurrency_code = $conf->currency; $this->multicurrency_code = $conf->currency;
@ -1017,11 +1018,15 @@ class Propal extends CommonObject
$fk_parent_line = 0; $fk_parent_line = 0;
} }
// Complete vat rate with code
$vatrate = $this->lines[$i]->tva_tx;
if ($this->lines[$i]->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$this->lines[$i]->vat_src_code.')';
$result = $this->addline( $result = $this->addline(
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,
$this->lines[$i]->tva_tx, $vatrate,
$this->lines[$i]->localtax1_tx, $this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx, $this->lines[$i]->localtax2_tx,
$this->lines[$i]->fk_product, $this->lines[$i]->fk_product,
@ -1226,7 +1231,6 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = ''; if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
// Create clone // Create clone
$result=$clonedObj->create($user); $result=$clonedObj->create($user);
if ($result < 0) $error++; if ($result < 0) $error++;
else else

View File

@ -766,10 +766,13 @@ if (empty($reshook))
{ {
if (count($prodcustprice->lines) > 0) if (count($prodcustprice->lines) > 0)
{ {
$pu_ht = price($prodcustprice->lines [0]->price); $pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx; $tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
else else
@ -2389,7 +2392,7 @@ if ($action == 'create' && $user->rights->commande->creer)
*/ */
$result = $object->getLinesArray(); $result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST"> print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '"> <input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">

View File

@ -709,7 +709,7 @@ class Commande extends CommonOrder
// $date_commande is deprecated // $date_commande is deprecated
$date = ($this->date_commande ? $this->date_commande : $this->date); $date = ($this->date_commande ? $this->date_commande : $this->date);
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))
@ -821,11 +821,15 @@ class Commande extends CommonOrder
$fk_parent_line = 0; $fk_parent_line = 0;
} }
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline( $result = $this->addline(
$line->desc, $line->desc,
$line->subprice, $line->subprice,
$line->qty, $line->qty,
$line->tva_tx, $vatrate,
$line->localtax1_tx, $line->localtax1_tx,
$line->localtax2_tx, $line->localtax2_tx,
$line->fk_product, $line->fk_product,
@ -1211,9 +1215,9 @@ class Commande extends CommonOrder
* @param string $desc Description of line * @param string $desc Description of line
* @param float $pu_ht Unit price (without tax) * @param float $pu_ht Unit price (without tax)
* @param float $qty Quantite * @param float $qty Quantite
* @param float $txtva Taux de tva force, sinon -1 * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of product * @param int $fk_product Id of product
* @param float $remise_percent Pourcentage de remise de la ligne * @param float $remise_percent Pourcentage de remise de la ligne
* @param int $info_bits Bits de type de lignes * @param int $info_bits Bits de type de lignes

View File

@ -99,7 +99,7 @@ if ($action == 'add')
$object->owner_address = trim($_POST["owner_address"]); $object->owner_address = trim($_POST["owner_address"]);
$account_number = GETPOST('account_number','alpha'); $account_number = GETPOST('account_number','alpha');
if ($account_number <= 0) { $object->account_number = ''; } else { $object->account_number = $account_number; } if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; } else { $object->account_number = $account_number; }
$fk_accountancy_journal = GETPOST('fk_accountancy_journal','int'); $fk_accountancy_journal = GETPOST('fk_accountancy_journal','int');
if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; } if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
@ -656,7 +656,7 @@ else
print '<td>'; print '<td>';
if (! empty($conf->accounting->enabled)) { if (! empty($conf->accounting->enabled)) {
$accountingaccount = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('',$object->account_number); $accountingaccount->fetch('',$object->account_number, 1);
print $accountingaccount->getNomUrl(0,1,1,'',1); print $accountingaccount->getNomUrl(0,1,1,'',1);
} else { } else {

View File

@ -83,6 +83,11 @@ if ($action == 'add_confirm')
$accountto=new Account($db); $accountto=new Account($db);
$accountto->fetch(GETPOST('account_to','int')); $accountto->fetch(GETPOST('account_to','int'));
if ($accountto->currency_code != $accountfrom->currency_code) {
$error++;
setEventMessages($langs->trans("ErrorTransferBetweenDifferentCurrencyNotPossible"), null, 'errors');
}
if ($accountto->id != $accountfrom->id) if ($accountto->id != $accountfrom->id)
{ {
$db->begin(); $db->begin();

View File

@ -1075,6 +1075,7 @@ if (empty($reshook))
$TTotalByTva = array(); $TTotalByTva = array();
foreach ($srcobject->lines as &$line) foreach ($srcobject->lines as &$line)
{ {
if(! empty($line->special_code)) continue;
$TTotalByTva[$line->tva_tx] += $line->total_ttc ; $TTotalByTva[$line->tva_tx] += $line->total_ttc ;
} }
@ -1588,6 +1589,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx; $tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
} }
@ -4010,7 +4014,7 @@ else if ($id > 0 || ! empty($ref))
} }
} }
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST"> print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '"> <input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">

View File

@ -244,7 +244,7 @@ class Facture extends CommonInvoice
$this->brouillon = 1; $this->brouillon = 1;
if (empty($this->entity)) $this->entity = $conf->entity; if (empty($this->entity)) $this->entity = $conf->entity;
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))
@ -575,11 +575,15 @@ class Facture extends CommonInvoice
$fk_parent_line = 0; $fk_parent_line = 0;
} }
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline( $result = $this->addline(
$line->desc, $line->desc,
$line->subprice, $line->subprice,
$line->qty, $line->qty,
$line->tva_tx, $vatrate,
$line->localtax1_tx, $line->localtax1_tx,
$line->localtax2_tx, $line->localtax2_tx,
$line->fk_product, $line->fk_product,
@ -935,7 +939,8 @@ class Facture extends CommonInvoice
{ {
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
}
}
else else
{ {
$this->db->rollback(); $this->db->rollback();
@ -985,6 +990,8 @@ class Facture extends CommonInvoice
$line->special_code = $object->lines[$i]->special_code; $line->special_code = $object->lines[$i]->special_code;
$line->fk_parent_line = $object->lines[$i]->fk_parent_line; $line->fk_parent_line = $object->lines[$i]->fk_parent_line;
$line->fk_unit = $object->lines[$i]->fk_unit; $line->fk_unit = $object->lines[$i]->fk_unit;
$line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end;
$line->fk_fournprice = $object->lines[$i]->fk_fournprice; $line->fk_fournprice = $object->lines[$i]->fk_fournprice;
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
@ -2427,8 +2434,8 @@ class Facture extends CommonInvoice
* @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $pu_ht Unit price without tax (> 0 even for credit note)
* @param double $qty Quantity * @param double $qty Quantity
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param double $txlocaltax1 Local tax 1 rate (deprecated) * @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param double $txlocaltax2 Local tax 2 rate (deprecated) * @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of predefined product/service * @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line * @param double $remise_percent Percent of discount on line
* @param int $date_start Date start of service * @param int $date_start Date start of service

View File

@ -530,6 +530,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx; $tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
} }

View File

@ -326,13 +326,21 @@ if (empty($reshook))
{ {
$label = $lines[$i]->product_label; $label = $lines[$i]->product_label;
} }
$desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
$desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
} }
else { else {
$desc = dol_htmlentitiesbr($lines[$i]->desc); $desc = dol_htmlentitiesbr($lines[$i]->desc);
} }
// Extrafields
$array_options = array();
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
// trigger used
{
$lines[$i]->fetch_optionals($lines[$i]->rowid);
$array_options = $lines[$i]->array_options;
}
$txtva = $lines[$i]->vat_src_code ? $lines[$i]->tva_tx . ' (' . $lines[$i]->vat_src_code . ')' : $lines[$i]->tva_tx; $txtva = $lines[$i]->vat_src_code ? $lines[$i]->tva_tx . ' (' . $lines[$i]->vat_src_code . ')' : $lines[$i]->tva_tx;
// View third's localtaxes for now // View third's localtaxes for now
@ -355,7 +363,7 @@ if (empty($reshook))
$lines[$i]->info_bits, $lines[$i]->info_bits,
$lines[$i]->fk_fournprice, $lines[$i]->fk_fournprice,
$lines[$i]->pa_ht, $lines[$i]->pa_ht,
array(), $array_options,
$lines[$i]->fk_unit $lines[$i]->fk_unit
); );
@ -501,6 +509,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines [0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx; $tva_tx = $prodcustprice->lines [0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
} }

View File

@ -56,7 +56,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
{ {
if ($object->id) if ($object->id)
{ {
$urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir if (GETPOST('section', 'alpha')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
{ {

View File

@ -3748,6 +3748,7 @@ abstract class CommonObject
// VAT Rate // VAT Rate
$this->tpl['vat_rate'] = vatrate($line->tva_tx, true); $this->tpl['vat_rate'] = vatrate($line->tva_tx, true);
$this->tpl['vat_rate'] .= (($line->info_bits & 1) == 1) ? '*' : '';
if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')'; if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')';
$this->tpl['price'] = price($line->subprice); $this->tpl['price'] = price($line->subprice);

View File

@ -968,7 +968,11 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
$file_name_osencoded=dol_osencode($file_name); $file_name_osencoded=dol_osencode($file_name);
// Check if destination dir is writable // Check if destination dir is writable
// TODO if (! is_writable(dirname($file_name_osencoded)))
{
dol_syslog("Files.lib::dol_move_uploaded_file Dir ".dirname($file_name_osencoded)." is not writable. Return 'ErrorDirNotWritable'", LOG_WARNING);
return 'ErrorDirNotWritable';
}
// Check if destination file already exists // Check if destination file already exists
if (! $allowoverwrite) if (! $allowoverwrite)

View File

@ -257,12 +257,13 @@ function dol_shutdown()
* 'custom'= custom filter specify $filter and $options) * 'custom'= custom filter specify $filter and $options)
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
* @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'. * @param mixed $options Options to pass to filter_var when $check is set to 'custom'
* @param string $noreplace Force disable of replacement of __xxx__ strings.
* @return string|string[] Value found (string or array), or '' if check fails * @return string|string[] Value found (string or array), or '' if check fails
* *
* @TODO Set default value for check to alpha. Check all WYSIWYG edition (email and description...) is still ok with rich text. * @TODO Set default value for check to alpha. Check all WYSIWYG edition (email and description...) is still ok with rich text.
*/ */
function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
{ {
global $mysoc,$user,$conf; global $mysoc,$user,$conf;
@ -366,7 +367,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters) // Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ... // Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ...
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
if (! is_array($out) && empty($_POST[$paramname])) if (! is_array($out) && empty($_POST[$paramname]) && empty($noreplace))
{ {
$maxloop=20; $loopnb=0; // Protection against infinite loop $maxloop=20; $loopnb=0; // Protection against infinite loop
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side. while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
@ -4305,6 +4306,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
{ {
$product->get_buyprice($idprodfournprice,0,0,0); $product->get_buyprice($idprodfournprice,0,0,0);
$ret=$product->vatrate_supplier; $ret=$product->vatrate_supplier;
if ($product->default_vat_code) $ret.=' ('.$product->default_vat_code.')';
} }
else else
{ {

View File

@ -1822,7 +1822,7 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null) function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
{ {
if (empty($hookmanager)) global $hookmanager; if (empty($hookmanager)) global $hookmanager;
$reshook=0; $reshook=0;
$result=''; $result='';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
@ -1841,10 +1841,14 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
if ($object->lines[$i]->special_code == 3) return ''; if ($object->lines[$i]->special_code == 3) return '';
if (empty($hidedetails) || $hidedetails > 1) if (empty($hidedetails) || $hidedetails > 1)
{ {
if($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF) if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
{ {
$prev_progress = $object->lines[$i]->get_prev_progress($object->id); $prev_progress = 0;
$result = ( $object->lines[$i]->situation_percent - $prev_progress) . '%'; if (method_exists($object, 'get_prev_progress'))
{
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
}
$result = ($object->lines[$i]->situation_percent - $prev_progress) . '%';
} }
else else
$result = $object->lines[$i]->situation_percent . '%'; $result = $object->lines[$i]->situation_percent . '%';
@ -1891,12 +1895,17 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
if (empty($hidedetails) || $hidedetails > 1) if (empty($hidedetails) || $hidedetails > 1)
{ {
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht); $total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
if ($object->lines[$i]->situation_percent > 0 ) if ($object->lines[$i]->situation_percent > 0)
{ {
$prev_progress = $object->lines[$i]->get_prev_progress($object->id); $prev_progress = 0;
$progress = ( $object->lines[$i]->situation_percent - $prev_progress) /100; $progress = 1;
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs); if (method_exists($object, 'get_prev_progress'))
} {
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
$progress = ($object->lines[$i]->situation_percent - $prev_progress) / 100;
}
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
}
else else
$result.=price($sign * $total_ht, 0, $outputlangs); $result.=price($sign * $total_ht, 0, $outputlangs);
} }

View File

@ -589,6 +589,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
} }
//dol_syslog('projectLinesPerDay inc='.$inc.' preselectedday='.$preselectedday.' task parent id='.$parent.' level='.$level." count(lines)=".$numlines." count(lineswithoutlevel0)=".count($lineswithoutlevel0)); //dol_syslog('projectLinesPerDay inc='.$inc.' preselectedday='.$preselectedday.' task parent id='.$parent.' level='.$level." count(lines)=".$numlines." count(lineswithoutlevel0)=".count($lineswithoutlevel0));
for ($i = 0 ; $i < $numlines ; $i++) for ($i = 0 ; $i < $numlines ; $i++)
{ {
if ($parent == 0) $level = 0; if ($parent == 0) $level = 0;

View File

@ -667,13 +667,13 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':'; $titre = $outputlangs->transnoentities("PaymentConditions").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(43, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); $pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
$posy=$pdf->GetY()+3; $posy=$pdf->GetY()+3;
} }

View File

@ -892,13 +892,13 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':'; $titre = $outputlangs->transnoentities("PaymentConditions").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(43, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); $pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
$posy=$pdf->GetY()+3; $posy=$pdf->GetY()+3;
} }

View File

@ -20,9 +20,9 @@
*/ */
/** /**
* \file htdocs/core/modules/import/import_csv.modules.php * \file htdocs/core/modules/import/import_xlsx.modules.php
* \ingroup import * \ingroup import
* \brief File to load import files with CSV format * \brief File to load import files with Excel format
*/ */
require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php'; require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php';
@ -54,10 +54,10 @@ class ImportXlsx extends ModeleImports
var $cacheconvert=array(); // Array to cache list of value found after a convertion var $cacheconvert=array(); // Array to cache list of value found after a convertion
var $cachefieldtable=array(); // Array to cache list of value found into fields@tables var $cachefieldtable=array(); // Array to cache list of value found into fields@tables
var $workbook; // temporary import file var $workbook; // temporary import file
var $record; // current record var $record; // current record
var $headers; var $headers;
/** /**
@ -95,7 +95,7 @@ class ImportXlsx extends ModeleImports
if (preg_match('/^societe_/',$datatoimport)) $this->thirpartyobject=new Societe($this->db); if (preg_match('/^societe_/',$datatoimport)) $this->thirpartyobject=new Societe($this->db);
} }
/** /**
* Output header of an example file for this format * Output header of an example file for this format
* *
@ -144,7 +144,7 @@ class ImportXlsx extends ModeleImports
foreach($headerlinefields as $field) { foreach($headerlinefields as $field) {
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, 1, $outputlangs->transnoentities($field)); $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, 1, $outputlangs->transnoentities($field));
// set autowidth // set autowidth
//$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true); //$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true);
$col++; $col++;
} }
return ''; // final output will be generated in footer return ''; // final output will be generated in footer
@ -211,10 +211,10 @@ class ImportXlsx extends ModeleImports
return $ret; return $ret;
} }
/** /**
* Return nb of records. File must be closed. * Return nb of records. File must be closed.
* *
* @param string $file Path of filename * @param string $file Path of filename
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
@ -222,15 +222,15 @@ class ImportXlsx extends ModeleImports
{ {
$reader = new PHPExcel_Reader_Excel2007(); $reader = new PHPExcel_Reader_Excel2007();
$this->workbook = $reader->load($file); $this->workbook = $reader->load($file);
$rowcount = $this->workbook->getActiveSheet()->getHighestDataRow(); $rowcount = $this->workbook->getActiveSheet()->getHighestDataRow();
$this->workbook->disconnectWorksheets(); $this->workbook->disconnectWorksheets();
unset($this->workbook); unset($this->workbook);
return $rowcount; return $rowcount;
} }
/** /**
* Input header line from file * Input header line from file
@ -399,7 +399,7 @@ class ImportXlsx extends ModeleImports
if (! is_numeric($newval) && $newval != '' && ! preg_match('/^id:/i',$newval)) $isidorref='ref'; if (! is_numeric($newval) && $newval != '' && ! preg_match('/^id:/i',$newval)) $isidorref='ref';
$newval=preg_replace('/^(id|ref):/i','',$newval); // Remove id: or ref: that was used to force if field is id or ref $newval=preg_replace('/^(id|ref):/i','',$newval); // Remove id: or ref: that was used to force if field is id or ref
//print 'Val is now '.$newval.' and is type '.$isidorref."<br>\n"; //print 'Val is now '.$newval.' and is type '.$isidorref."<br>\n";
if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor
{ {
$file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']); $file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);
@ -502,9 +502,9 @@ class ImportXlsx extends ModeleImports
} }
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
$newval=$defaultref; $newval=$defaultref;
} }
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric') elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{ {
$newval = price2num($newval); $newval = price2num($newval);
@ -616,7 +616,7 @@ class ImportXlsx extends ModeleImports
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
if (empty($lastinsertid)) { if (empty($lastinsertid)) {
$sqlSelect = 'SELECT rowid FROM '.$tablename; $sqlSelect = 'SELECT rowid FROM '.$tablename;
$data = array_combine($listfields, $listvalues); $data = array_combine($listfields, $listvalues);
$where = array(); $where = array();
$filters = array(); $filters = array();
@ -627,7 +627,7 @@ class ImportXlsx extends ModeleImports
$filters[] = $col.' = '.$data[$key]; $filters[] = $col.' = '.$data[$key];
} }
$sqlSelect.= ' WHERE '.implode(' AND ', $where); $sqlSelect.= ' WHERE '.implode(' AND ', $where);
$resql=$this->db->query($sqlSelect); $resql=$this->db->query($sqlSelect);
if($resql) { if($resql) {
$res = $this->db->fetch_object($resql); $res = $this->db->fetch_object($resql);
@ -650,23 +650,23 @@ class ImportXlsx extends ModeleImports
$error++; $error++;
} }
} }
if (!empty($lastinsertid)) { if (!empty($lastinsertid)) {
// Build SQL UPDATE request // Build SQL UPDATE request
$sqlstart = 'UPDATE '.$tablename; $sqlstart = 'UPDATE '.$tablename;
$data = array_combine($listfields, $listvalues); $data = array_combine($listfields, $listvalues);
$set = array(); $set = array();
foreach ($data as $key => $val) { foreach ($data as $key => $val) {
$set[] = $key.' = '.$val; $set[] = $key.' = '.$val;
} }
$sqlstart.= ' SET '.implode(', ', $set); $sqlstart.= ' SET '.implode(', ', $set);
if(empty($keyfield)) $keyfield = 'rowid'; if(empty($keyfield)) $keyfield = 'rowid';
$sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid; $sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid;
$sql = $sqlstart.$sqlend; $sql = $sqlstart.$sqlend;
// Run update request // Run update request
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if($resql) { if($resql) {
@ -691,14 +691,14 @@ class ImportXlsx extends ModeleImports
if (! empty($tablewithentity_cache[$tablename])) { if (! empty($tablewithentity_cache[$tablename])) {
$sqlstart.= ', entity'; $sqlstart.= ', entity';
$sqlend.= ', '.$conf->entity; $sqlend.= ', '.$conf->entity;
} }
if (! empty($objimport->array_import_tables_creator[0][$alias])) { if (! empty($objimport->array_import_tables_creator[0][$alias])) {
$sqlstart.= ', '.$objimport->array_import_tables_creator[0][$alias]; $sqlstart.= ', '.$objimport->array_import_tables_creator[0][$alias];
$sqlend.=', '.$user->id; $sqlend.=', '.$user->id;
} }
$sql = $sqlstart.$sqlend.')'; $sql = $sqlstart.$sqlend.')';
dol_syslog("import_xlsx.modules", LOG_DEBUG); dol_syslog("import_xlsx.modules", LOG_DEBUG);
// Run insert request // Run insert request
if ($sql) if ($sql)
{ {

View File

@ -854,13 +854,13 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':'; $titre = $outputlangs->transnoentities("PaymentConditions").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(43, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); $pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
$posy=$pdf->GetY()+3; $posy=$pdf->GetY()+3;
} }

View File

@ -49,10 +49,11 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
if($action==='BILL_VALIDATE' || $action === 'BILL_PAYED' || $action==='BILL_UNPAYED' if($action==='BILL_VALIDATE' || $action === 'BILL_PAYED' || $action==='BILL_UNPAYED'
|| $action === 'BILL_SENTBYMAIL' || $action === 'DOC_DOWNLOAD' || $action === 'DOC_PREVIEW') { || $action === 'BILL_SENTBYMAIL' || $action === 'DOC_DOWNLOAD' || $action === 'DOC_PREVIEW'
|| $action === 'BILL_SUPPLIER_PAYED') {
$amounts= (double) $object->total_ttc; $amounts= (double) $object->total_ttc;
} }
else if($action === 'PAYMENT_CUSTOMER_CREATE' || $action === 'PAYMENT_ADD_TO_BANK') { else if($action === 'PAYMENT_CUSTOMER_CREATE' || $action === 'PAYMENT_ADD_TO_BANK' || $action === 'PAYMENT_SUPPLIER_CREATE') {
$amounts = 0; $amounts = 0;
if(!empty($object->amounts)) { if(!empty($object->amounts)) {
foreach($object->amounts as $amount) { foreach($object->amounts as $amount) {

View File

@ -89,7 +89,7 @@ $sql = "SELECT d.rowid, d.datedon, d.firstname, d.lastname, d.societe,";
$sql.= " d.amount, d.fk_statut as statut, "; $sql.= " d.amount, d.fk_statut as statut, ";
$sql.= " p.rowid as pid, p.ref, p.title, p.public"; $sql.= " p.rowid as pid, p.ref, p.title, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p";
$sql.= " ON p.rowid = d.fk_projet WHERE 1 = 1"; $sql.= " ON p.rowid = d.fk_projet WHERE d.entity IN (".getEntity('donation').")";
if ($statut != '' && $statut != '-1') if ($statut != '' && $statut != '-1')
{ {
$sql .= " AND d.fk_statut IN (".$db->escape($statut).")"; $sql .= " AND d.fk_statut IN (".$db->escape($statut).")";

View File

@ -212,15 +212,15 @@ if (empty($reshook))
$objectsrc->fetch($object->origin_id); $objectsrc->fetch($object->origin_id);
$object->socid = $objectsrc->socid; $object->socid = $objectsrc->socid;
$object->ref_customer = ''; // We don't use $objectsrc->ref_client, this is ref or order not shipment $object->ref_customer = GETPOST('ref_customer','alpha');
$object->model_pdf = GETPOST('model','alpha'); $object->model_pdf = GETPOST('model');
$object->date_delivery = $date_delivery; // Date delivery planed $object->date_delivery = $date_delivery; // Date delivery planed
$object->fk_delivery_address = $objectsrc->fk_delivery_address; $object->fk_delivery_address = $objectsrc->fk_delivery_address;
$object->shipping_method_id = GETPOST('shipping_method_id','int'); $object->shipping_method_id = GETPOST('shipping_method_id','int');
$object->tracking_number = GETPOST('tracking_number','alpha'); $object->tracking_number = GETPOST('tracking_number','alpha');
$object->ref_int = GETPOST('ref_int','alpha'); $object->ref_int = GETPOST('ref_int','alpha');
$object->note_private = GETPOST('note_private'); $object->note_private = GETPOST('note_private','none');
$object->note_public = GETPOST('note_public'); $object->note_public = GETPOST('note_public','none');
$object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha');
@ -691,7 +691,7 @@ if ($action == 'create')
else if ($origin == 'propal') print $langs->trans('RefCustomerOrder'); else if ($origin == 'propal') print $langs->trans('RefCustomerOrder');
else print $langs->trans('RefCustomer'); else print $langs->trans('RefCustomer');
print '</td><td colspan="3">'; print '</td><td colspan="3">';
print $object->ref_client; print '<input type="text" name="ref_customer" value="'.$object->ref_client.'" />';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -777,7 +777,7 @@ if ($action == 'create')
// Other attributes // Other attributes
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid); $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label)) { if (empty($reshook) && ! empty($extrafields->attribute_label)) {
@ -1240,6 +1240,7 @@ if ($action == 'create')
print '<!-- Show details of lot -->'; print '<!-- Show details of lot -->';
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">'; print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
//print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); //print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
//print $line->fk_product.' - '.$dbatch->batch; //print $line->fk_product.' - '.$dbatch->batch;
print $langs->trans("Batch").': '; print $langs->trans("Batch").': ';

View File

@ -1321,7 +1321,7 @@ class Expedition extends CommonObject
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type"; $sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type";
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva"; $sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
$sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht"; $sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.info_bits, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
$sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc"; $sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc";
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot"; $sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type"; $sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
@ -1418,6 +1418,7 @@ class Expedition extends CommonObject
$line->tva_tx = $obj->tva_tx; $line->tva_tx = $obj->tva_tx;
$line->localtax1_tx = $obj->localtax1_tx; $line->localtax1_tx = $obj->localtax1_tx;
$line->localtax2_tx = $obj->localtax2_tx; $line->localtax2_tx = $obj->localtax2_tx;
$line->info_bits = $obj->info_bits;
$line->price = $obj->price; $line->price = $obj->price;
$line->subprice = $obj->subprice; $line->subprice = $obj->subprice;
$line->remise_percent = $obj->remise_percent; $line->remise_percent = $obj->remise_percent;

View File

@ -228,8 +228,12 @@ if (empty($reshook))
$db->begin(); $db->begin();
$id = $object->create($user); $id = $object->create($user);
if ($id <= 0)
{
$error++;
}
if ($id > 0) if (! $error)
{ {
$db->commit(); $db->commit();
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);

View File

@ -187,7 +187,8 @@ class ExpenseReport extends CommonObject
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if (!$resql) $error++; if (!$resql) $error++;
if (is_array($this->lines) && count($this->lines)>0) { if (is_array($this->lines) && count($this->lines)>0)
{
foreach ($this->lines as $i => $val) foreach ($this->lines as $i => $val)
{ {
$newndfline=new ExpenseReportLine($this->db); $newndfline=new ExpenseReportLine($this->db);
@ -205,6 +206,12 @@ class ExpenseReport extends CommonObject
} }
} }
if (! $error)
{
$result=$this->insertExtraFields();
if ($result < 0) $error++;
}
if (! $error) if (! $error)
{ {
$result=$this->update_price(); $result=$this->update_price();

View File

@ -31,7 +31,7 @@
*/ */
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (! defined('EURO')) define('EURO',chr(128)); if (! defined('EURO')) define('EURO',chr(128));

View File

@ -1090,7 +1090,7 @@ class CommandeFournisseur extends CommonOrder
// Clean parameters // Clean parameters
if (empty($this->source)) $this->source = 0; if (empty($this->source)) $this->source = 0;
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))

View File

@ -229,7 +229,7 @@ class FactureFournisseur extends CommonInvoice
$amount = $this->amount; $amount = $this->amount;
$remise = $this->remise; $remise = $this->remise;
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))

View File

@ -2100,7 +2100,7 @@ elseif (! empty($object->id))
//$result = $object->getLinesArray(); //$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline')?'#add':'#line_'.GETPOST('lineid')).'" method="POST"> print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline')?'#addline':'#line_'.GETPOST('lineid')).'" method="POST">
<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'"> <input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">

View File

@ -2651,7 +2651,7 @@ else
/* /*
* Lines * Lines
*/ */
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline')?'#add':'#line_'.GETPOST('lineid')).'" method="POST">'; print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline')?'#addline':'#line_'.GETPOST('lineid')).'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">'; print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">';
print '<input type="hidden" name="mode" value="">'; print '<input type="hidden" name="mode" value="">';

View File

@ -51,9 +51,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$page = 0;
}
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

0
htdocs/includes/stripe/build.php Normal file → Executable file
View File

View File

@ -382,6 +382,8 @@ ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_tx d
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL; ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL; ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_customer_price_log ADD COLUMN default_vat_code varchar(10);
UPDATE llx_contrat SET ref = rowid WHERE ref IS NULL OR ref = ''; UPDATE llx_contrat SET ref = rowid WHERE ref IS NULL OR ref = '';
ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT ''; ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT '';

View File

@ -895,9 +895,9 @@ if ($ok && GETPOST('force_disable_of_modules_not_found','alpha'))
// clean_linked_elements: Check and clean linked elements // clean_linked_elements: Check and clean linked elements
if ($ok && GETPOST('force_utf8_on_tables','alpha')) if ($ok && GETPOST('force_utf8_on_tables','alpha'))
{ {
print '<tr><td colspan="2"><br>*** Force page code and collation with utf8 (for mysql/mariadb only)</td></tr>'; print '<tr><td colspan="2"><br>*** Force page code and collation with utf8/utf8_unicode_ci (for mysql/mariadb only)</td></tr>';
if ($db->type == "mysql") if ($db->type == "mysql" || $db->type == "mysqli")
{ {
$listoftables = $db->DDLListTables($db->database_name); $listoftables = $db->DDLListTables($db->database_name);

View File

@ -77,7 +77,7 @@ BoxTitleLastModifiedSupplierBills=Latest %s modified supplier bills
BoxTitleLatestModifiedSupplierOrders=Latest %s modified supplier orders BoxTitleLatestModifiedSupplierOrders=Latest %s modified supplier orders
BoxTitleLastModifiedCustomerBills=Latest %s modified customer bills BoxTitleLastModifiedCustomerBills=Latest %s modified customer bills
BoxTitleLastModifiedCustomerOrders=Latest %s modified customer orders BoxTitleLastModifiedCustomerOrders=Latest %s modified customer orders
BoxTitleLastModifiedPropals=Latest %s modified propals BoxTitleLastModifiedPropals=Latest %s modified proposals
ForCustomersInvoices=Customers invoices ForCustomersInvoices=Customers invoices
ForCustomersOrders=Customers orders ForCustomersOrders=Customers orders
ForProposals=Proposals ForProposals=Proposals

View File

@ -366,6 +366,7 @@ TotalLT1IN=Total CGST
TotalLT2IN=Total SGST TotalLT2IN=Total SGST
HT=Net of tax HT=Net of tax
TTC=Inc. tax TTC=Inc. tax
INCVATONLY=Inc. VAT
INCT=Inc. all taxes INCT=Inc. all taxes
VAT=Sales tax VAT=Sales tax
VATIN=IGST VATIN=IGST

View File

@ -133,7 +133,7 @@ MovementLabel=Label of movement
InventoryCode=Movement or inventory code InventoryCode=Movement or inventory code
IsInPackage=Contained into package IsInPackage=Contained into package
WarehouseAllowNegativeTransfer=Stock can be negative WarehouseAllowNegativeTransfer=Stock can be negative
qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse and your setup does not allow negative stocks.
ShowWarehouse=Show warehouse ShowWarehouse=Show warehouse
MovementCorrectStock=Stock correction for product %s MovementCorrectStock=Stock correction for product %s
MovementTransferStock=Stock transfer of product %s into another warehouse MovementTransferStock=Stock transfer of product %s into another warehouse

View File

@ -109,7 +109,7 @@ if ($socid > 0)
print '</td></tr>'; print '</td></tr>';
} }
if ($object->fournisseur) if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire))
{ {
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
print $langs->trans('SupplierCode').'</td><td colspan="3">'; print $langs->trans('SupplierCode').'</td><td colspan="3">';

View File

@ -13,7 +13,7 @@
*.lang text eol=lf *.lang text eol=lf
*.txt text eol=lf *.txt text eol=lf
*.md text eol=lf *.md text eol=lf
*.bat text eol=crlf *.bat text eol=lf
# Denote all files that are truly binary and should not be modified. # Denote all files that are truly binary and should not be modified.
*.ico binary *.ico binary

View File

@ -1,87 +0,0 @@
Dolistore
=========
[Dolistore](https://dolistore.com) is the marketplace for Dolibarr modules.
This directory contains templates assets that may be useful for publication.
Images
------
### Logo
See [img folder README](../img/README.md).
### Screenshots
Texts
-----
All texts needs 5 languages versions for:
- en (English)
- fr (Français)
- es (Español)
- it (Italiano)
- de (Deutsch)
### Name
The module's marketed name.
### Price
Expressed in Euro (€).
Keep in mind that Dolistore will keep a 20% markup.
### Categories
- [x] Modules/Plugins
- [ ] Skins and Templates
- [ ] Tools and documentation
- [ ] Skins
- [ ] Document templates
- [ ] System tools
- [ ] CRM
- [ ] ECM
- [ ] Human Relationship
- [ ] Products, Services or Stock
- [ ] Project or collaborative
- [ ] Interfaces
- [ ] Other
- [ ] Reporting or search
- [ ] User's interface
- [ ] 2Report sub-modules
- [ ] Accountancy
*The list may change. Check [Dolistore](https://dolistore.com) for up-to-date information.*
### Short description
A short description of the modules main features.
400 characters max.
### Keywords
Comma separated lists.
eg: ```template,dev,module```
### Long description
The long description of your module.
Suggested technical data:
Version: 1.0.0
Publisher: MyCompany
Licence: GPLv3+
User interface language(s): English
Help/Support: None / Forum www.dolibarr.org / Mail at contact@example.com
Prerequisites:
- Dolibarr min version: 3.8
- Dolibarr max version: 3.9.*
- PHP: ≥5.3
Install:
- Download the module's archive file (.zip file) from DoliStore.com.
- Put the file into the custom directory of Dolibarr.
- Uncompress the zip file, for example with ```unzip modulefile_version.zip``` command.
- Module is then available and can be activated.

View File

@ -1 +0,0 @@
Mein modul

View File

@ -1 +0,0 @@
My module

View File

@ -1 +0,0 @@
My módulo

View File

@ -1 +0,0 @@
Mon module

View File

@ -1 +0,0 @@
Il mio modulo

View File

0
htdocs/modulebuilder/template/dev/git-hooks/pre-commit Normal file → Executable file
View File

0
htdocs/modulebuilder/template/dev/git-hooks/pre-push Normal file → Executable file
View File

View File

@ -1,68 +0,0 @@
#!/bin/sh
# Copyright (C) 2014 Raphaël Doursenaud
#
# 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/>.
VERSION=0.0.1
USAGE="Usage: newmodule.sh NewName"
# TODO: check depedencies presence (find, sed and rename)
# TODO: allow execution from build directory
# TODO: validate parameter
# TODO: use multiple word parameter, for example "My module is awesome" which should lead to "MyModuleIsAwesome" and "mymoduleisawesome" so we can also fix language strings
# TODO: add module ID management (language files…)
# TODO: add oneliner description management
# TODO: add copyright management
if [ $# == 0 ] ; then
echo ${USAGE}
exit 1;
fi
ToLower () {
echo $(echo $1 | tr '[:upper:]' '[:lower:]')
}
ToUpper () {
echo $(echo $1 | tr '[:lower:]' '[:upper:]')
}
CAMELORIG="MyModule"
LOWERORIG=$(ToLower ${CAMELORIG})
UPPERORIG=$(ToUpper ${CAMELORIG})
cameltarget=$(echo $1)
lowertarget=$(ToLower $1)
uppertarget=$(ToUpper $1)
thisscript=`basename $0`
# Rewrite occurences
find . -not -iwholename '*.git*' -not -name "${thisscript}" -type f -print0 | xargs -0 sed -i'' -e"s/${CAMELORIG}/${cameltarget}/g"
find . -not -iwholename '*.git*' -not -name "${thisscript}" -type f -print0 | xargs -0 sed -i'' -e"s/${LOWERORIG}/${lowertarget}/g"
find . -not -iwholename '*.git*' -not -name "${thisscript}" -type f -print0 | xargs -0 sed -i'' -e"s/${UPPERORIG}/${uppertarget}/g"
# Rename files
for file in $(find . -not -iwholename '*.git*' -name "*${CAMELORIG}*" -type f)
do
rename ${CAMELORIG} ${cameltarget} ${file}
done
for file in $(find . -not -iwholename '*.git*' -name "*${LOWERORIG}*" -type f)
do
rename ${LOWERORIG} ${lowertarget} ${file}
done
for file in $(find . -not -iwholename '*.git*' -name "*${UPPERORIG}*" -type f)
do
rename ${UPPERORIG} ${uppertarget} ${file}
done
# TODO: add instructions about renaming vars (ack --php -i my)
# TODO: add instructions about renaming files (ls -R|grep -i my)

0
htdocs/modulebuilder/template/scripts/myobject.php Normal file → Executable file
View File

View File

@ -1505,6 +1505,7 @@ class Product extends CommonObject
// We do a first seach with a select by searching with couple prodfournprice and qty only (later we will search on triplet qty/product_id/fourn_ref) // We do a first seach with a select by searching with couple prodfournprice and qty only (later we will search on triplet qty/product_id/fourn_ref)
$sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.remise_percent,"; $sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.remise_percent,";
$sql.= " pfp.fk_product, pfp.ref_fourn, pfp.fk_soc, pfp.tva_tx, pfp.fk_supplier_price_expression"; $sql.= " pfp.fk_product, pfp.ref_fourn, pfp.fk_soc, pfp.tva_tx, pfp.fk_supplier_price_expression";
$sql.= " ,pfp.default_vat_code";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " WHERE pfp.rowid = ".$prodfournprice; $sql.= " WHERE pfp.rowid = ".$prodfournprice;
if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty; if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty;
@ -1540,6 +1541,7 @@ class Product extends CommonObject
$this->ref_supplier = $obj->ref_fourn; // Ref supplier $this->ref_supplier = $obj->ref_fourn; // Ref supplier
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed $this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
$this->default_vat_code = $obj->default_vat_code; // Vat code supplier
$result=$obj->fk_product; $result=$obj->fk_product;
return $result; return $result;
} }
@ -1548,6 +1550,7 @@ class Product extends CommonObject
// We do a second search by doing a select again but searching with less reliable criteria: couple qty/id product, and if set fourn_ref or fk_soc. // We do a second search by doing a select again but searching with less reliable criteria: couple qty/id product, and if set fourn_ref or fk_soc.
$sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.fk_soc,"; $sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.fk_soc,";
$sql.= " pfp.fk_product, pfp.ref_fourn as ref_supplier, pfp.tva_tx, pfp.fk_supplier_price_expression"; $sql.= " pfp.fk_product, pfp.ref_fourn as ref_supplier, pfp.tva_tx, pfp.fk_supplier_price_expression";
$sql.= " ,pfp.default_vat_code";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " WHERE pfp.fk_product = ".$product_id; $sql.= " WHERE pfp.fk_product = ".$product_id;
if ($fourn_ref != 'none') $sql.= " AND pfp.ref_fourn = '".$fourn_ref."'"; if ($fourn_ref != 'none') $sql.= " AND pfp.ref_fourn = '".$fourn_ref."'";
@ -1587,6 +1590,7 @@ class Product extends CommonObject
$this->ref_supplier = $obj->ref_supplier; // Ref supplier $this->ref_supplier = $obj->ref_supplier; // Ref supplier
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed $this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
$this->default_vat_code = $obj->default_vat_code; // Vat code supplier
$result=$obj->fk_product; $result=$obj->fk_product;
return $result; return $result;
} }

View File

@ -66,7 +66,7 @@ $search_tobatch = GETPOST("search_tobatch",'int');
$search_accountancy_code_sell = GETPOST("search_accountancy_code_sell",'alpha'); $search_accountancy_code_sell = GETPOST("search_accountancy_code_sell",'alpha');
$search_accountancy_code_buy = GETPOST("search_accountancy_code_buy",'alpha'); $search_accountancy_code_buy = GETPOST("search_accountancy_code_buy",'alpha');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
$type=(int) GETPOST("type","int"); $type=GETPOST("type","int");
//Show/hide child products. Hidden by default //Show/hide child products. Hidden by default
if (!$_POST) { if (!$_POST) {
@ -251,7 +251,7 @@ else
if ($search_type != '' && $search_type != '-1') if ($search_type != '' && $search_type != '-1')
{ {
if ($search_type==1) if ($search_type == 1)
{ {
$texte = $langs->trans("Services"); $texte = $langs->trans("Services");
} }
@ -495,13 +495,15 @@ else
$moreforfilter.='</div>'; $moreforfilter.='</div>';
} }
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter.=$hookmanager->resPrint;
else $moreforfilter=$hookmanager->resPrint;
if ($moreforfilter) if ($moreforfilter)
{ {
print '<div class="liste_titre liste_titre_bydiv centpercent">'; print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter; print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>'; print '</div>';
} }

View File

@ -1800,8 +1800,15 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print '<td align="center">' . $langs->trans("PriceBase") . '</td>'; print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
print '<td align="right">' . $langs->trans("VATRate") . '</td>'; print '<td align="right">' . $langs->trans("VATRate") . '</td>';
print '<td align="right">' . $langs->trans("HT") . '</td>'; print '<td align="right">' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("TTC") . '</td>'; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . $langs->trans("INCT") . '</td>'; {
//print '<td align="right">' . $langs->trans("INCVATONLY") . '</td>';
print '<td align="right">' . $langs->trans("INCT") . '</td>';
}
else
{
print '<td align="right">' . $langs->trans("TTC") . '</td>';
}
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>'; print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>'; print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>';
print '<td align="right">' . $langs->trans("ChangedBy") . '</td>'; print '<td align="right">' . $langs->trans("ChangedBy") . '</td>';
@ -1843,20 +1850,28 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>"; print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>";
print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>"; print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>";
print '<td align="right">'; print '<td align="right">';
var_dump($prodcustprice);exit;
$positiverates=''; $positiverates='';
if (price2num($objp->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($objp->tva_tx); if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx);
if (price2num($objp->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax1_tx); if (price2num($line->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
if (price2num($objp->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax2_tx); if (price2num($line->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx);
if (empty($positiverates)) $positiverates='0'; if (empty($positiverates)) $positiverates='0';
echo vatrate($positiverates.($objp->default_vat_code?' ('.$objp->default_vat_code.')':''), '%', $objp->tva_npr);
echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', ($line->tva_npr?$line->tva_npr:$line->recuperableonly));
//. vatrate($tva_tx, true, $line->recuperableonly) . //. vatrate($tva_tx, true, $line->recuperableonly) .
print "</td>"; print "</td>";
print '<td align="right">' . price($line->price) . "</td>"; print '<td align="right">' . price($line->price) . "</td>";
print '<td align="right">' . price($line->price_ttc) . "</td>";
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . price($resultarray[2]) . '</td>'; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . price($line->price_ttc) . "</td>";
print '<td align="right">' . price($resultarray[2]) . '</td>';
}
else
{
print '<td align="right">' . price($line->price_ttc) . "</td>";
}
print '<td align="right">' . price($line->price_min) . '</td>'; print '<td align="right">' . price($line->price_min) . '</td>';
print '<td align="right">' . price($line->price_min_ttc) . '</td>'; print '<td align="right">' . price($line->price_min_ttc) . '</td>';
@ -1902,7 +1917,7 @@ var_dump($prodcustprice);exit;
if (count($prodcustprice->lines) > 0 || $search_soc) if (count($prodcustprice->lines) > 0 || $search_soc)
{ {
$colspan=8; $colspan=8;
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++; //if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++;
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>'; print '<td class="liste_titre"><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
@ -1921,8 +1936,16 @@ var_dump($prodcustprice);exit;
print '<td align="center">' . $langs->trans("PriceBase") . '</td>'; print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
print '<td align="right">' . $langs->trans("VATRate") . '</td>'; print '<td align="right">' . $langs->trans("VATRate") . '</td>';
print '<td align="right">' . $langs->trans("HT") . '</td>'; print '<td align="right">' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("TTC") . '</td>'; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . $langs->trans("INCT") . '</td>'; {
//print '<td align="right">' . $langs->trans("INCVATONLY") . '</td>';
print '<td align="right">' . $langs->trans("INCT") . '</td>';
}
else
{
print '<td align="right">' . $langs->trans("TTC") . '</td>';
}
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>'; print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>'; print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>';
print '<td align="right">' . $langs->trans("ChangedBy") . '</td>'; print '<td align="right">' . $langs->trans("ChangedBy") . '</td>';
@ -1969,9 +1992,17 @@ var_dump($prodcustprice);exit;
print "</td>"; print "</td>";
print '<td align="right">' . price($object->price) . "</td>"; print '<td align="right">' . price($object->price) . "</td>";
print '<td align="right">' . price($object->price_ttc) . "</td>";
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . price($resultarray[2]) . '</td>'; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . price($object->price_ttc) . "</td>";
print '<td align="right">' . price($resultarray[2]) . '</td>';
}
else
{
print '<td align="right">' . price($object->price_ttc) . "</td>";
}
print '<td align="right">' . price($object->price_min) . '</td>'; print '<td align="right">' . price($object->price_min) . '</td>';
print '<td align="right">' . price($object->price_min_ttc) . '</td>'; print '<td align="right">' . price($object->price_min_ttc) . '</td>';
@ -1992,7 +2023,6 @@ var_dump($prodcustprice);exit;
} }
print "</tr>\n"; print "</tr>\n";
if (count($prodcustprice->lines) > 0) if (count($prodcustprice->lines) > 0)
{ {
foreach ($prodcustprice->lines as $line) foreach ($prodcustprice->lines as $line)
@ -2037,13 +2067,20 @@ var_dump($prodcustprice);exit;
if (price2num($line->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); if (price2num($line->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
if (price2num($line->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (price2num($line->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx);
if (empty($positiverates)) $positiverates='0'; if (empty($positiverates)) $positiverates='0';
echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', $line->tva_npr); echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', ($line->tva_npr?$line->tva_npr:$line->recuperableonly));
print "</td>"; print "</td>";
print '<td align="right">' . price($line->price) . "</td>"; print '<td align="right">' . price($line->price) . "</td>";
print '<td align="right">' . price($line->price_ttc) . "</td>";
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . price($resultarray[2]) . '</td>'; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . price($line->price_ttc) . "</td>";
print '<td align="right">' . price($resultarray[2]) . '</td>';
}
else
{
print '<td align="right">' . price($line->price_ttc) . "</td>";
}
print '<td align="right">' . price($line->price_min) . '</td>'; print '<td align="right">' . price($line->price_min) . '</td>';
print '<td align="right">' . price($line->price_min_ttc) . '</td>'; print '<td align="right">' . price($line->price_min_ttc) . '</td>';

View File

@ -29,7 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once './lib/replenishment.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/lib/replenishment.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("products"); $langs->load("products");
$langs->load("stocks"); $langs->load("stocks");
@ -44,9 +45,12 @@ $sref = GETPOST('search_ref', 'alpha');
$snom = GETPOST('search_nom', 'alpha'); $snom = GETPOST('search_nom', 'alpha');
$suser = GETPOST('search_user', 'alpha'); $suser = GETPOST('search_user', 'alpha');
$sttc = GETPOST('search_ttc', 'alpha'); $sttc = GETPOST('search_ttc', 'alpha');
$sdate = GETPOST('search_date', 'alpha');
$page = GETPOST('page', 'int'); $page = GETPOST('page', 'int');
$sproduct = GETPOST('sproduct', 'int'); $sproduct = GETPOST('sproduct', 'int');
$search_dateyear = GETPOST('search_dateyear', 'int');
$search_datemonth = GETPOST('search_datemonth', 'int');
$search_dateday = GETPOST('search_dateday', 'int');
$search_date = dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear);
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST("sortfield");
@ -58,7 +62,6 @@ if ($page < 0) $page = 0;
$offset = $limit * $page; $offset = $limit * $page;
/* /*
* Actions * Actions
*/ */
@ -70,7 +73,10 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$snom=""; $snom="";
$suser=""; $suser="";
$sttc=""; $sttc="";
$sdate=''; $search_date='';
$search_datemonth='';
$search_dateday='';
$search_dateyear='';
$sproduct=0; $sproduct=0;
} }
@ -125,17 +131,19 @@ if ($sref) $sql .= natural_search('cf.ref', $sref);
if ($snom) $sql .= natural_search('s.nom', $snom); if ($snom) $sql .= natural_search('s.nom', $snom);
if ($suser) $sql .= natural_search('u.login', $suser); if ($suser) $sql .= natural_search('u.login', $suser);
if ($sttc) $sql .= natural_search('cf.total_ttc', $sttc, 1); if ($sttc) $sql .= natural_search('cf.total_ttc', $sttc, 1);
if ($sdate)
if ($search_datemonth > 0)
{ {
if (GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int') && GETPOST('search_dateyear', 'int')) if ($search_dateyear > 0 && empty($search_dateday))
{ $sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_get_first_day($search_dateyear,$search_datemonth,false))."' AND '".$db->idate(dol_get_last_day($search_dateyear,$search_datemonth,false))."'";
$date = dol_mktime(0, 0, 0, GETPOST('search_datemonth', 'int'), GETPOST('search_dateday', 'int'), GETPOST('search_dateyear', 'int')); else if ($search_dateyear > 0 && ! empty($search_dateday))
} $sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_datemonth, $search_dateday, $search_dateyear))."'";
else else
{ $sql.= " AND date_format(cf.date_creation, '%m') = '".$search_datemonth."'";
$date = dol_stringtotime($sdate); }
} else if ($search_dateyear > 0)
$sql .= " AND cf.date_creation = '" . $db->idate($date) . "'"; {
$sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_get_first_day($search_dateyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_dateyear,12,false))."'";
} }
if ($sall) $sql .= natural_search(array('cf.ref','cf.note'), $sall); if ($sall) $sql .= natural_search(array('cf.ref','cf.note'), $sall);
if (!empty($socid)) $sql .= ' AND s.rowid = ' . $socid; if (!empty($socid)) $sql .= ' AND s.rowid = ' . $socid;
@ -146,7 +154,6 @@ $sql .= ' GROUP BY cf.rowid, cf.ref, cf.date_creation, cf.fk_statut';
$sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom'; $sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom';
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit+1, $offset); $sql .= $db->plimit($limit+1, $offset);
//print $sql;
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
@ -158,25 +165,38 @@ if ($resql)
print_barre_liste('', $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, 0, ''); print_barre_liste('', $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, 0, '');
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($sref) $param.='&search_ref='.urlencode($sref);
if ($snom) $param.='&search_nom='.urlencode($snom);
if ($suser) $param.='&search_user='.urlencode($suser);
if ($sttc) $param.='&search_ttc='.urlencode($sttc);
if ($search_dateyear) $param.='&search_dateyear='.urlencode($search_dateyear);
if ($search_datemonth) $param.='&search_datemonth='.urlencode($search_datemonth);
if ($search_dateday) $param.='&search_dateday='.urlencode($search_dateday);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre_filter">'. print '<tr class="liste_titre_filter">';
'<td class="liste_titre">'. print '<td class="liste_titre">'.
'<input type="text" class="flat" name="search_ref" value="' . $sref . '">'. '<input type="text" class="flat" name="search_ref" value="' . dol_escape_htmltag($sref) . '">'.
'</td>'. '</td>'.
'<td class="liste_titre">'. '<td class="liste_titre">'.
'<input type="text" class="flat" name="search_nom" value="' . $snom . '">'. '<input type="text" class="flat" name="search_nom" value="' . dol_escape_htmltag($snom) . '">'.
'</td>'. '</td>'.
'<td class="liste_titre">'. '<td class="liste_titre">'.
'<input type="text" class="flat" name="search_user" value="' . $suser . '">'. '<input type="text" class="flat" name="search_user" value="' . dol_escape_htmltag($suser) . '">'.
'</td>'. '</td>'.
'<td class="liste_titre">'. '<td class="liste_titre">'.
'<input type="text" class="flat" name="search_ttc" value="' . $sttc . '">'. '<input type="text" class="flat" name="search_ttc" value="' . dol_escape_htmltag($sttc) . '">'.
'</td>'. '</td>'.
'<td class="liste_titre">'. '<td class="liste_titre">'.
$form->select_date('', 'search_date', 0, 0, 1, '', 1, 0, 1, 0, ''). $form->select_date($search_date, 'search_date', 0, 0, 1, '', 1, 0, 1, 0, '').
'</td>'. '</td>'.
'<td class="liste_titre" align="right">'; '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
@ -190,7 +210,7 @@ if ($resql)
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
'cf.ref', 'cf.ref',
'', '',
'', $param,
'', '',
$sortfield, $sortfield,
$sortorder $sortorder
@ -200,7 +220,7 @@ if ($resql)
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
's.nom', 's.nom',
'', '',
'', $param,
'', '',
$sortfield, $sortfield,
$sortorder $sortorder
@ -220,7 +240,7 @@ if ($resql)
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
'cf.total_ttc', 'cf.total_ttc',
'', '',
'', $param,
'', '',
$sortfield, $sortfield,
$sortorder $sortorder
@ -230,7 +250,7 @@ if ($resql)
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
'cf.date_creation', 'cf.date_creation',
'', '',
'', $param,
'', '',
$sortfield, $sortfield,
$sortorder $sortorder
@ -240,7 +260,7 @@ if ($resql)
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
'cf.fk_statut', 'cf.fk_statut',
'', '',
'', $param,
'align="right"', 'align="right"',
$sortfield, $sortfield,
$sortorder $sortorder

View File

@ -237,7 +237,7 @@ if ($action == 'addtime' && $user->rights->projet->lire)
$object->fetch($key); $object->fetch($key);
$object->progress = GETPOST($key.'progress', 'int'); $object->progress = GETPOST($key.'progress', 'int');
$object->timespent_duration = $val; $object->timespent_duration = $val;
$object->timespent_fk_user = $user->id; $object->timespent_fk_user = $usertoprocess->id;
$object->timespent_note = GETPOST($key.'note'); $object->timespent_note = GETPOST($key.'note');
if (GETPOST($key."hour") != '' && GETPOST($key."hour") >= 0) // If hour was entered if (GETPOST($key."hour") != '' && GETPOST($key."hour") >= 0) // If hour was entered
{ {

View File

@ -975,19 +975,19 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '<br>'; print '<br>';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
} }
else if ($user->rights->projet->lire) // Read project and enter time consumed on assigned tasks else if ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks
{ {
if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids)) if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer)
{ {
print '&nbsp;'; print '&nbsp;';
print '<a href="'.$_SERVER["PHP_SELF"].'?'.($projectidforalltimes?'projectid='.$projectidforalltimes.'&amp;':'').'id='.$task_time->fk_task.'&amp;action=editline&amp;lineid='.$task_time->rowid.($withproject?'&amp;withproject=1':'').'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?'.($projectidforalltimes?'projectid='.$projectidforalltimes.'&amp;':'').'id='.$task_time->fk_task.'&amp;action=editline&amp;lineid='.$task_time->rowid.($withproject?'&amp;withproject=1':'').'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
print '&nbsp;'; print '&nbsp;';
print '<a href="'.$_SERVER["PHP_SELF"].'?'.($projectidforalltimes?'projectid='.$projectidforalltimes.'&amp;':'').'id='.$task_time->fk_task.'&amp;action=deleteline&amp;lineid='.$task_time->rowid.($withproject?'&amp;withproject=1':'').'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?'.($projectidforalltimes?'projectid='.$projectidforalltimes.'&amp;':'').'id='.$task_time->fk_task.'&amp;action=deleteline&amp;lineid='.$task_time->rowid.($withproject?'&amp;withproject=1':'').'">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }
} }
print '</td>'; print '</td>';

View File

@ -2021,10 +2021,13 @@ else
print $object->getLibCustProspStatut(); print $object->getLibCustProspStatut();
print '</td></tr>'; print '</td></tr>';
// Prospect/Customer // Supplier
print '<tr><td>'.$langs->trans('Supplier').'</td><td>'; if (! empty($conf->fournisseur->enabled))
print yn($object->fournisseur); {
print '</td></tr>'; print '<tr><td>'.$langs->trans('Supplier').'</td><td>';
print yn($object->fournisseur);
print '</td></tr>';
}
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015-2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -245,7 +245,7 @@ if ($type_element == 'supplier_invoice')
{ // Supplier : Show products from invoices. { // Supplier : Show products from invoices.
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$documentstatic=new FactureFournisseur($db); $documentstatic=new FactureFournisseur($db);
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, '; $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, ';
$tables_from = MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."facture_fourn_det as d"; $tables_from = MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."facture_fourn_det as d";
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
$where.= " AND d.fk_facture_fourn = f.rowid"; $where.= " AND d.fk_facture_fourn = f.rowid";

View File

@ -180,7 +180,7 @@ if ($result > 0)
print '</td></tr>'; print '</td></tr>';
} }
if ($object->fournisseur) if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire))
{ {
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
print $langs->trans('SupplierCode').'</td><td colspan="3">'; print $langs->trans('SupplierCode').'</td><td colspan="3">';

View File

@ -2868,6 +2868,12 @@ span.boxstatstext {
opacity: 0.8; opacity: 0.8;
line-height: 18px; line-height: 18px;
} }
span.boxstatstext img, a.dashboardlineindicatorlate img {
border: 0;
}
a img {
border: 0;
}
span.boxstatsindicator { span.boxstatsindicator {
font-size: 130%; font-size: 130%;
font-weight: normal; font-weight: normal;
@ -3401,7 +3407,7 @@ table.cal_month td:last-child { border-right: 0px; }
.cal_today_peruser { background: #FDFDF0; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_today_peruser { background: #FDFDF0; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today_peruser_peruserleft { background: #FDFDF0; border-left: solid 2px #6C7C7B; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_today_peruser_peruserleft { background: #FDFDF0; border-left: solid 2px #6C7C7B; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_past { } .cal_past { }
.cal_peruser { padding: 0px; } .cal_peruser { padding-top: 0 !important; padding-bottom: 0 !important; padding-<?php print $left; ?>: 1px !important; padding-<?php print $right; ?>: 1px !important; }
.cal_impair { background: #F8F8F8; } .cal_impair { background: #F8F8F8; }
.cal_today_peruser_impair { background: #F8F8F0; } .cal_today_peruser_impair { background: #F8F8F0; }
.peruser_busy { background: #CC8888; } .peruser_busy { background: #CC8888; }