diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index 5650cce8767..cb8a2ee0517 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -653,6 +653,11 @@ if (preg_match('/^asc/i', $sortorder)) {
$sortorder = "desc";
}
+// Warning to explain why list of record is not consistent with the other list view (missing a lot of lines)
+if ($type == 'sub') {
+ print info_admin($langs->trans("WarningRecordWithoutSubledgerAreExcluded"));
+}
+
$moreforfilter = '';
// Accountancy account
diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php
index 3e878b9398b..8195683c5ab 100644
--- a/htdocs/admin/debugbar.php
+++ b/htdocs/admin/debugbar.php
@@ -93,15 +93,17 @@ print '
';
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? ' '."\n".$langs->trans($constname . 'Tooltip2') : '');
print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).' ';
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 07e041a8fd1..e89f30ce60a 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -831,6 +831,13 @@ if (empty($reshook)) {
foreach ($object->lines as $line) {
$result = $object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
}
+ } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('remiseforalllines', 'alpha') !== '' && $usercancreate) {
+ // Define vat_rate
+ $remise_percent = (GETPOST('remiseforalllines') ? GETPOST('remiseforalllines') : 0);
+ $remise_percent = str_replace('*', '', $remise_percent);
+ foreach ($object->lines as $line) {
+ $result = $object->updateline($line->id, $line->subprice, $line->qty, $remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
+ }
} elseif ($action == 'addline' && $usercancreate) { // Add line
// Set if we used free entry or predefined product
$predef = '';
@@ -1579,19 +1586,19 @@ if ($action == 'create') {
print '';
// Reference
- print ''.$langs->trans('Ref').' '.$langs->trans("Draft").' ';
+ print ''.$langs->trans('Ref').' '.$langs->trans("Draft").' ';
// Ref customer
- print ''.$langs->trans('RefCustomer').' ';
+ print ' '.$langs->trans('RefCustomer').' ';
print ' ';
print ' ';
// Third party
- print '';
- print ''.$langs->trans('Customer').' ';
+ print ' ';
+ print ''.$langs->trans('Customer').' ';
$shipping_method_id = 0;
if ($socid > 0) {
- print '';
+ print ' ';
print $soc->getNomUrl(1);
print ' ';
print ' ';
@@ -1600,7 +1607,7 @@ if ($action == 'create') {
}
//$warehouse_id = $soc->warehouse_id;
} else {
- print '';
+ print ' ';
print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
// reload page to retrieve customer informations
if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
@@ -1623,13 +1630,13 @@ if ($action == 'create') {
if ($socid > 0) {
// Contacts (ask contact only if thirdparty already defined).
- print " ".$langs->trans("DefaultContact").' ';
+ print ' '.$langs->trans("DefaultContact").' ';
print img_picto('', 'contact');
print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300');
print ' ';
// Third party discounts info line
- print ''.$langs->trans('Discounts').' ';
+ print ' '.$langs->trans('Discounts').' ';
$absolute_discount = $soc->getAvailableDiscounts();
@@ -1641,44 +1648,44 @@ if ($action == 'create') {
}
// Date
- print ' '.$langs->trans('DatePropal').' ';
+ print ' '.$langs->trans('DatePropal').' ';
print $form->selectDate('', '', '', '', '', "addprop", 1, 1);
print ' ';
// Validaty duration
- print ''.$langs->trans("ValidityDuration").' '.img_picto('', 'clock', 'class="paddingright"').' '.$langs->trans("days").' ';
+ print ''.$langs->trans("ValidityDuration").' '.img_picto('', 'clock', 'class="paddingright"').' '.$langs->trans("days").' ';
// Terms of payment
- print ''.$langs->trans('PaymentConditionsShort').' ';
+ print ' '.$langs->trans('PaymentConditionsShort').' ';
print img_picto('', 'payment', 'class="pictofixedwidth"');
$form->select_conditions_paiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', -1, 1);
print ' ';
// Mode of payment
- print ''.$langs->trans('PaymentMode').' ';
+ print ' '.$langs->trans('PaymentMode').' ';
print img_picto('', 'bank', 'class="pictofixedwidth"');
$form->select_types_paiements((GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
print ' ';
// Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && !empty($conf->banque->enabled)) {
- print ''.$langs->trans('BankAccount').' ';
+ print ' '.$langs->trans('BankAccount').' ';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print ' ';
}
// Source / Channel - What trigger creation
- print ''.$langs->trans('Source').' ';
+ print ' '.$langs->trans('Source').' ';
print img_picto('', 'question', 'class="pictofixedwidth"');
$form->selectInputReason('', 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
print ' ';
// Delivery delay
- print ''.$langs->trans('AvailabilityPeriod');
+ print ' '.$langs->trans('AvailabilityPeriod');
if (!empty($conf->commande->enabled)) {
print ' ('.$langs->trans('AfterOrder').')';
}
- print ' ';
+ print ' ';
print img_picto('', 'clock', 'class="pictofixedwidth"');
$form->selectAvailabilityDelay('', 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
print ' ';
@@ -1688,7 +1695,7 @@ if ($action == 'create') {
if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($soc->shipping_method_id)) {
$shipping_method_id = $soc->shipping_method_id;
}
- print ''.$langs->trans('SendingMethod').' ';
+ print ' '.$langs->trans('SendingMethod').' ';
print img_picto('', 'object_dollyrevert', 'class="pictofixedwidth"');
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
print ' ';
@@ -1698,14 +1705,14 @@ if ($action == 'create') {
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
- print ''.$langs->trans('Warehouse').' ';
+ print ' '.$langs->trans('Warehouse').' ';
print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
print ' ';
}
// Delivery date (or manufacturing)
- print ''.$langs->trans("DeliveryDate").' ';
- print '';
+ print ' '.$langs->trans("DeliveryDate").' ';
+ print '';
if (isset($conf->global->DATE_LIVRAISON_WEEK_DELAY) && is_numeric($conf->global->DATE_LIVRAISON_WEEK_DELAY)) {
$tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
$syear = date("Y", $tmpdte);
@@ -1720,8 +1727,8 @@ if ($action == 'create') {
// Project
if (!empty($conf->projet->enabled)) {
$langs->load("projects");
- print ' ';
- print ''.$langs->trans("Project").' ';
+ print ' ';
+ print ''.$langs->trans("Project").' ';
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print ' id).'"> ';
print ' ';
@@ -1730,17 +1737,17 @@ if ($action == 'create') {
// Incoterms
if (!empty($conf->incoterm->enabled)) {
- print ' ';
- print ''.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).' ';
- print '';
+ print ' ';
+ print ''.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).' ';
+ print '';
print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
print ' ';
}
// Template to use by default
- print '';
- print ''.$langs->trans("DefaultModel").' ';
- print '';
+ print ' ';
+ print ''.$langs->trans("DefaultModel").' ';
+ print '';
print img_picto('', 'pdf', 'class="pictofixedwidth"');
$liste = ModelePDFPropales::liste_modeles($db);
$preselected = (!empty($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT) ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : getDolGlobalString("PROPALE_ADDON_PDF"));
@@ -1749,26 +1756,26 @@ if ($action == 'create') {
// Multicurrency
if (!empty($conf->multicurrency->enabled)) {
- print ' ';
- print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
- print '';
+ print ' ';
+ print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
+ print '';
print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency($currency_code, 'multicurrency_code', 0);
print ' ';
}
// Public note
- print '';
- print ''.$langs->trans('NotePublic').' ';
- print '';
+ print ' ';
+ print ''.$langs->trans('NotePublic').' ';
+ print '';
$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : null));
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
print $doleditor->Create(1);
// Private note
if (empty($user->socid)) {
- print ' ';
- print ''.$langs->trans('NotePrivate').' ';
- print '';
+ print ' ';
+ print ''.$langs->trans('NotePrivate').' ';
+ print '';
$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null));
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
print $doleditor->Create(1);
@@ -2172,9 +2179,9 @@ if ($action == 'create') {
print ' ';
// Payment mode
- print '';
- print '';
- print '';
+ print ' ';
+ print '';
+ print '';
print $langs->trans('PaymentMode');
print ' ';
if ($action != 'editmode' && $usercancreate && $caneditfield) {
@@ -2193,7 +2200,7 @@ if ($action == 'create') {
$langs->load('deliveries');
print '';
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker');
- print ' ';
+ print ' ';
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker');
print ' ';
print ' ';
@@ -2224,7 +2231,7 @@ if ($action == 'create') {
// Shipping Method
if (!empty($conf->expedition->enabled)) {
print '';
- print '';
+ print '';
print $langs->trans('SendingMethod');
print ' ';
if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
@@ -2246,7 +2253,7 @@ if ($action == 'create') {
$langs->load('stocks');
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
- print '';
+ print ' ';
$editenable = $usercancreate;
print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
print ' ';
@@ -2261,7 +2268,7 @@ if ($action == 'create') {
// Origin of demand
print ' ';
- print '';
+ print '';
print $langs->trans('Source');
print ' ';
if ($action != 'editdemandreason' && $usercancreate) {
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 561682ba02f..0056716972b 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -1043,7 +1043,7 @@ if ($resql) {
$moreforfilter = '';
// If the user can view prospects other than his'
- if ($user->rights->societe->client->voir || $socid) {
+ if ($user->rights->user->user->lire) {
$langs->load("commercial");
$moreforfilter .= '';
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
@@ -1051,9 +1051,9 @@ if ($resql) {
$moreforfilter .= '
';
}
// If the user can view prospects other than his'
- if ($user->rights->societe->client->voir || $socid) {
+ if ($user->rights->user->user->lire) {
$moreforfilter .= '';
- $tmptitle = $langs->trans('LinkedToSpecificUsers');
+ $tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= '
';
}
@@ -2097,7 +2097,7 @@ if ($resql) {
// Note public
if (!empty($arrayfields['p.note_public']['checked'])) {
print '';
- print dol_escape_htmltag($obj->note_public);
+ print dol_string_nohtmltag($obj->note_public);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2106,7 +2106,7 @@ if ($resql) {
// Note private
if (!empty($arrayfields['p.note_private']['checked'])) {
print '';
- print dol_escape_htmltag($obj->note_private);
+ print dol_string_nohtmltag($obj->note_private);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index d33ea387947..ecd647c7206 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -628,6 +628,13 @@ if (empty($reshook)) {
foreach ($object->lines as $line) {
$result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
}
+ } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('remiseforalllines', 'alpha') !== '' && $usercancreate) {
+ // Define remise_percent
+ $remise_percent = (GETPOST('remiseforalllines') ? GETPOST('remiseforalllines') : 0);
+ $remise_percent = str_replace('*', '', $remise_percent);
+ foreach ($object->lines as $line) {
+ $result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
+ }
} elseif ($action == 'addline' && $usercancreate) { // Add a new line
$langs->load('errors');
$error = 0;
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 38d79aa9698..5a85038bddc 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1321,7 +1321,7 @@ if ($resql) {
$moreforfilter = '';
// If the user can view prospects other than his'
- if ($user->rights->societe->client->voir || $socid) {
+ if ($user->rights->user->user->lire) {
$langs->load("commercial");
$moreforfilter .= '';
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 6d7f7f6010e..6300e387067 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -641,7 +641,7 @@ if (empty($reshook)) {
setEventMessages($mesg, null, 'errors');
} else {
// Insert line
- $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, - 1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice);
+ $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, -1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice);
if ($result > 0) {
// Define output language and generate document
@@ -1034,21 +1034,11 @@ if ($action == 'create') {
// Payment mode
print "
".$langs->trans("PaymentMode")." ";
+ print img_picto('', 'payment', 'class="pictofixedwidth"');
print $form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $object->mode_reglement_id, 'mode_reglement_id', '', 0, 1, 0, 0, 1, '', 1);
//$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', '', 1);
print " ";
- // Project
- if (!empty($conf->projet->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
- $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project;
- $langs->load('projects');
- print '
'.$langs->trans('Project').' ';
- print img_picto('', 'project');
- $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
- print ' thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.img_object($langs->trans("AddProject"), 'add').' ';
- print ' ';
- }
-
// Bank account
if ($object->fk_account > 0) {
print "
".$langs->trans('BankAccount')." ";
@@ -1056,10 +1046,22 @@ if ($action == 'create') {
print " ";
}
+ // Project
+ if (!empty($conf->projet->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
+ $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project;
+ $langs->load('projects');
+ print '
'.$langs->trans('Project').' ';
+ print img_picto('', 'project', 'class="pictofixedwidth"');
+ $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
+ print ' thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.img_object($langs->trans("AddProject"), 'add').' ';
+ print ' ';
+ }
+
// Model pdf
print "
".$langs->trans('Model')." ";
include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
$list = ModelePDFFactures::liste_modeles($db);
+ print img_picto('', 'generic', 'class="pictofixedwidth"');
print $form->selectarray('modelpdf', $list, $conf->global->FACTURE_ADDON_PDF);
print " ";
@@ -1605,19 +1607,19 @@ if ($action == 'create') {
// Lines
- print '