diff --git a/dev/resources/iso-normes/barcode_EAN13.txt b/dev/resources/iso-normes/barcode_EAN13.txt
index f4496327ee4..f6b3c5f5ebb 100644
--- a/dev/resources/iso-normes/barcode_EAN13.txt
+++ b/dev/resources/iso-normes/barcode_EAN13.txt
@@ -16,57 +16,57 @@ Voici la liste des codes pays ou systeme :
EN
==
-Meaning of the numbers.
+Meaning of the numbers:
-- 2 digits for the country code or system code
+- first 2-3 digits for the country code or system code
- 5 digits for the company identifier
- 5 digits for item identifier
- 1 digit for checksum
This rule has been twisted many times to improve the use of the available numbers.
-Here is the list of country codes or system:
+Here is the list of country codes or system:
List
====
-00 � 13 UCC (Etats-Unis et Canada)
-20 � 29 Codification interne en magasin
-30 � 37 GENCOD-EAN France
-380 BCCI (Bulgarie)
-383 SANA (Slovenie)
-385 CRO-EAN (Croatie)
-387 EAN-BIH (Bosnie-Herzegovine)
-400 � 440 CCG (Allemagne)
-45 + 49 Distribution Code Center � DCC (Japon)
-460 � 469 UNISCAN - EAN Russie (Federation de Russie)
-471 CAN (Taiwan)
-474 EAN Estonie
-475 EAN Lettonie
-476 EAN Azerba� djan
-477 EAN Lituanie
-478 EAN Ouzbekistan
-479 EAN Sri Lanka
-480 PANC (Philippines)
-481 EAN Bielorussie
-482 EAN Ukraine
-484 EAN Moldavie
-485 EAN Armenie
-486 EAN Georgie
-487 EAN Kazakhstan
-489 HKANA (Hong Kong)
-50 E Centre UK
+00 - 13 UCC (U.S.A / États-Unis & Canada)
+20 - 29 Flag for internal numbering / Codification interne en magasin
+30 - 37 GENCOD-EAN France
+380 BCCI (Bulgaria)
+383 SANA (Slovenia)
+385 CRO-EAN (Croatia)
+387 EAN-BIH (Bosnia-Herzegovina)
+400-440 CCG (Allemagne/Germany)
+45 + 49 Distribution Code Center - DCC (Japan)
+460-469 UNISCAN - EAN Russia (Federation de Russie)
+471 CAN Taiwan
+474 EAN Estonia
+475 EAN Latvia
+476 EAN Azerbaijan
+477 EAN Lithuania
+478 EAN Uzbekistan
+479 EAN Sri Lanka
+480 PANC Philippines
+481 EAN Belarus
+482 EAN Ukraine
+484 EAN Moldova
+485 EAN Armenia
+486 EAN Georgia
+487 EAN Kazakhstan
+489 HKANA Hong Kong
+50 E Centre UK - United Kingdom
520 HELLCAN-EAN HELLAS (Grece)
528 EAN Liban
529 EAN Chypre
-531 EAN-MAC (FYR Mac�donie)
+531 EAN-MAC (FYR Macedonie)
535 EAN Malte
539 EAN Irlande
-54 ICODIF/EAN Belgique. Luxembourg
+54 ICODIF/EAN Belgique. Luxembourg
560 CODIPOR (Portugal)
569 EAN Islande
-57 EAN Danemark
+57 EAN Danemark
590 EAN Pologne
594 EAN Roumanie
599 H.A.P.M.H. (Hongrie)
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 2530454d056..4841b8bf171 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -117,7 +117,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
}
-$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
+$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.amount_main_currency, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
$sql .= " soc.rowid as socid, soc.nom as name, soc.email as email, bu1.type as typeop_company,";
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
@@ -142,7 +142,7 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
$sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal);
-$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
+$sql .= ' AND b.amount <> 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
if ($date_start && $date_end) {
$sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'";
}
@@ -282,6 +282,7 @@ if ($result) {
$tabpay[$obj->rowid]["fk_bank"] = $obj->rowid;
$tabpay[$obj->rowid]["bank_account_ref"] = $obj->baref;
$tabpay[$obj->rowid]["fk_bank_account"] = $obj->fk_account;
+ $reg = array();
if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) {
$tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]);
} else {
@@ -296,6 +297,12 @@ if ($result) {
$tabtype[$obj->rowid] = 'unknown';
$tabmoreinfo[$obj->rowid] = array();
+ $amounttouse = $obj->amount;
+ if (!empty($obj->amount_main_currency)) {
+ // If $obj->amount_main_currency is set, it means that $obj->amount is not in same currency, we must use $obj->amount_main_currency
+ $amounttouse = $obj->amount_main_currency;
+ }
+
// get_url may return -1 which is not traversable
if (is_array($links) && count($links) > 0) {
// Now loop on each link of record in bank (code similar to bankentries_list.php)
@@ -334,7 +341,7 @@ if ($result) {
$societestatic->email = $tabcompany[$obj->rowid]['email'];
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
if ($compta_soc) {
- $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
+ $tabtp[$obj->rowid][$compta_soc] += $amounttouse;
}
} elseif ($links[$key]['type'] == 'user') {
$userstatic->id = $links[$key]['url_id'];
@@ -350,7 +357,7 @@ if ($result) {
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
}
if ($compta_user) {
- $tabtp[$obj->rowid][$compta_user] += $obj->amount;
+ $tabtp[$obj->rowid][$compta_user] += $amounttouse;
}
} elseif ($links[$key]['type'] == 'sc') {
$chargestatic->id = $links[$key]['url_id'];
@@ -383,7 +390,7 @@ if ($result) {
$resultmid = $db->query($sqlmid);
if ($resultmid) {
$objmid = $db->fetch_object($resultmid);
- $tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
+ $tabtp[$obj->rowid][$objmid->accountancy_code] += $amounttouse;
}
} elseif ($links[$key]['type'] == 'payment_donation') {
$paymentdonstatic->id = $links[$key]['url_id'];
@@ -391,7 +398,7 @@ if ($result) {
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentdonstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
- $tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
+ $tabtp[$obj->rowid][$account_pay_donation] += $amounttouse;
} elseif ($links[$key]['type'] == 'member') {
$paymentsubscriptionstatic->id = $links[$key]['url_id'];
$paymentsubscriptionstatic->ref = $links[$key]['url_id'];
@@ -399,14 +406,14 @@ if ($result) {
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsubscriptionstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id;
$paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id);
- $tabtp[$obj->rowid][$account_pay_subscription] += $obj->amount;
+ $tabtp[$obj->rowid][$account_pay_subscription] += $amounttouse;
} elseif ($links[$key]['type'] == 'payment_vat') { // Payment VAT
$paymentvatstatic->id = $links[$key]['url_id'];
$paymentvatstatic->ref = $links[$key]['url_id'];
$paymentvatstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentvatstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
- $tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
+ $tabtp[$obj->rowid][$account_pay_vat] += $amounttouse;
} elseif ($links[$key]['type'] == 'payment_salary') {
$paymentsalstatic->id = $links[$key]['url_id'];
$paymentsalstatic->ref = $links[$key]['url_id'];
@@ -438,7 +445,7 @@ if ($result) {
if (empty($obj->typeop_user)) { // Add test to avoid to add amount twice if a link already exists also on user.
$compta_user = $userstatic->accountancy_code;
if ($compta_user) {
- $tabtp[$obj->rowid][$compta_user] += $obj->amount;
+ $tabtp[$obj->rowid][$compta_user] += $amounttouse;
$tabuser[$obj->rowid] = array(
'id' => $userstatic->id,
'name' => dolGetFirstLastname($userstatic->firstname, $userstatic->lastname),
@@ -465,14 +472,14 @@ if ($result) {
$account_various = (!empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
$account_subledger = (!empty($paymentvariousstatic->subledger_account) ? $paymentvariousstatic->subledger_account : ''); // NotDefined is a reserved word
$tabpay[$obj->rowid]["account_various"] = $account_various;
- $tabtp[$obj->rowid][$account_subledger] += $obj->amount;
+ $tabtp[$obj->rowid][$account_subledger] += $amounttouse;
} elseif ($links[$key]['type'] == 'payment_loan') {
$paymentloanstatic->id = $links[$key]['url_id'];
$paymentloanstatic->ref = $links[$key]['url_id'];
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentloanstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;
- //$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount;
+ //$tabtp[$obj->rowid][$account_pay_loan] += $amounttouse;
$sqlmid = 'SELECT pl.amount_capital, pl.amount_insurance, pl.amount_interest, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest';
$sqlmid .= ' FROM '.MAIN_DB_PREFIX.'payment_loan as pl, '.MAIN_DB_PREFIX.'loan as l';
$sqlmid .= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = '.((int) $obj->rowid);
@@ -488,14 +495,14 @@ if ($result) {
} elseif ($links[$key]['type'] == 'banktransfert') {
$accountLinestatic->fetch($links[$key]['url_id']);
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- '.$accountLinestatic ->getNomUrl(1);
- $tabtp[$obj->rowid][$account_transfer] += $obj->amount;
+ $tabtp[$obj->rowid][$account_transfer] += $amounttouse;
$bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']);
$tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2);
}
}
}
- $tabbq[$obj->rowid][$compta_bank] += $obj->amount;
+ $tabbq[$obj->rowid][$compta_bank] += $amounttouse;
// If no links were found to know the amount on thirdparty, we try to guess it.
// This may happens on bank entries without the links lines to 'company'.
@@ -542,7 +549,7 @@ if ($result) {
}
}*/
- // if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
+ // if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $amounttouse;
$i++;
}
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index e58def3f481..1936d855a7e 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -482,7 +482,7 @@ if (GETPOSTISSET("search_status")) {
$titre = $langs->trans("MembersListToValid");
}
if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') {
- $titre = $langs->trans("MembersValidated");
+ $titre = $langs->trans("MenuMembersValidated");
}
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') {
$titre = $langs->trans("MembersWithSubscriptionToReceive");
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index fd8377b0a27..1e015d69f9c 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -309,7 +309,7 @@ print '
| '.$langs->trans("ShowProfIdInAddress").' - '.$pid.' - '.$langs->trans("ThirdPartyAddress").' | ';
$keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff($keyforconstant);
diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php
index da49e4cbba7..9bf7dd7c117 100644
--- a/htdocs/api/class/api_documents.class.php
+++ b/htdocs/api/class/api_documents.class.php
@@ -458,6 +458,20 @@ class Documents extends DolibarrApi
}
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref);
+ } elseif ($modulepart == 'knowledgemanagement') {
+ require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php';
+
+ if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
+ throw new RestException(401);
+ }
+
+ $object = new KnowledgeRecord($this->db);
+ $result = $object->fetch($id, $ref);
+ if (!$result) {
+ throw new RestException(404, 'KM article not found');
+ }
+
+ $upload_dir = $conf->knowledgemanagement->dir_output.'/knowledgerecord/'.dol_sanitizeFileName($object->ref);
} elseif ($modulepart == 'categorie' || $modulepart == 'category') {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 1b4340276f8..9f6ee0c539f 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -1033,8 +1033,8 @@ if ($resql) {
$event->type = 'holiday';
$event->type_picto = 'holiday';
- $event->datep = $db->jdate($obj->date_start);
- $event->datef = $db->jdate($obj->date_end);
+ $event->datep = $db->jdate($obj->date_start) + (empty($halfday) || $halfday == 1 ? 0 : 12 * 60 * 60 - 1);
+ $event->datef = $db->jdate($obj->date_end) + (empty($halfday) || $halfday == -1 ? 24 : 12) * 60 * 60 - 1;
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 0153f554169..f6989d90d59 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1921,7 +1921,7 @@ if ($action == 'create') {
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
- array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)')),
+ array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', '', 0, 0, null, 0, 'maxwidth300')),
array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans('PuttingPricesUpToDate'), 'value' => (!empty($conf->global->PROPOSAL_CLONE_UPDATE_PRICES) ? 1 : 0)),
);
if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->delivery_date)) {
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 73b4c479b2e..561682ba02f 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -123,6 +123,15 @@ $search_fk_input_reason = GETPOST("search_fk_input_reason", 'int');
$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int');
$search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
+$search_date_signature_startday = GETPOST('search_date_signature_startday', 'int');
+$search_date_signature_startmonth = GETPOST('search_date_signature_startmonth', 'int');
+$search_date_signature_startyear = GETPOST('search_date_signature_startyear', 'int');
+$search_date_signature_endday = GETPOST('search_date_signature_endday', 'int');
+$search_date_signature_endmonth = GETPOST('search_date_signature_endmonth', 'int');
+$search_date_signature_endyear = GETPOST('search_date_signature_endyear', 'int');
+$search_date_signature_start = dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear);
+$search_date_signature_end = dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
+
$search_status = GETPOST('search_status', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
@@ -207,6 +216,7 @@ $arrayfields = array(
'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
+ 'p.date_signature'=>array('label'=>"DateSigning", 'checked'=>0),
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>!empty($conf->expedition->enabled)),
'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1),
@@ -337,6 +347,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_fk_shipping_method = '';
$search_fk_input_reason = '';
$search_fk_mode_reglement = '';
+ $search_date_signature_startday = '';
+ $search_date_signature_startmonth = '';
+ $search_date_signature_startyear = '';
+ $search_date_signature_endday = '';
+ $search_date_signature_endmonth = '';
+ $search_date_signature_endyear = '';
+ $search_date_signature_start = '';
+ $search_date_signature_end = '';
}
if ($object_statut != '') {
$search_status = $object_statut;
@@ -517,6 +535,7 @@ $sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' p.rowid, p.entity as propal_entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
+$sql .= ' p.date_signature as dsignature,';
$sql .= ' p.note_public, p.note_private,';
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
@@ -701,6 +720,12 @@ if ($search_sale > 0) {
if ($search_user > 0) {
$sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user);
}
+if ($search_date_signature_start) {
+ $sql .= " AND p.date_signature >= '".$db->idate($search_date_signature_start)."'";
+}
+if ($search_date_signature_end) {
+ $sql .= " AND p.date_signature <= '".$db->idate($search_date_signature_end)."'";
+}
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
@@ -917,6 +942,24 @@ if ($resql) {
if ($search_country) {
$param .= '&search_country='.urlencode($search_country);
}
+ if ($search_date_signature_startday) {
+ $param .= '&search_date_signature_startday='.urlencode($search_date_signature_startday);
+ }
+ if ($search_date_signature_startmonth) {
+ $param .= '&search_date_signature_startmonth='.urlencode($search_date_signature_startmonth);
+ }
+ if ($search_date_signature_startyear) {
+ $param .= '&search_date_signature_startyear='.urlencode($search_date_signature_startyear);
+ }
+ if ($search_date_signature_endday) {
+ $param .= '&search_date_signature_endday='.urlencode($search_date_signature_endday);
+ }
+ if ($search_date_signature_endmonth) {
+ $param .= '&search_date_signature_endmonth='.urlencode($search_date_signature_endmonth);
+ }
+ if ($search_date_signature_endyear) {
+ $param .= '&search_date_signature_endyear='.urlencode($search_date_signature_endyear);
+ }
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@@ -1148,6 +1191,17 @@ if ($resql) {
print '';
print ' | ';
}
+ // Date Signature
+ if (!empty($arrayfields['p.date_signature']['checked'])) {
+ print '';
+ print ' ';
+ print $form->selectDate($search_date_signature_start ? $search_date_signature_start : -1, 'search_date_signature_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print ' ';
+ print '';
+ print $form->selectDate($search_date_signature_end ? $search_date_signature_end : -1, 'search_date_signature_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print ' ';
+ print ' | ';
+ }
// Availability
if (!empty($arrayfields['ava.rowid']['checked'])) {
print '';
@@ -1361,7 +1415,10 @@ if ($resql) {
print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'align="center"', $sortfield, $sortorder);
}
if (!empty($arrayfields['p.date_livraison']['checked'])) {
- print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'ddelivery', '', $param, 'align="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder);
+ }
+ if (!empty($arrayfields['p.date_signature']['checked'])) {
+ print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'align="center"', $sortfield, $sortorder);
}
if (!empty($arrayfields['ava.rowid']['checked'])) {
print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder);
@@ -1720,6 +1777,18 @@ if ($resql) {
$totalarray['nbfield']++;
}
}
+ // Date Signature
+ if (!empty($arrayfields['p.date_signature']['checked'])) {
+ if ($obj->dsignature) {
+ print ' | '.dol_print_date($db->jdate($obj->dsignature), 'day');
+ print ' | ';
+ } else {
+ print ' | ';
+ }
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
// Availability
if (!empty($arrayfields['ava.rowid']['checked'])) {
print '';
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 3a903e233de..53b6d40d6b0 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2043,7 +2043,7 @@ if ($action == 'create' && $usercancreate) {
if ($action == 'clone') {
// Create an array for form
$formquestion = array(
- array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client = 2 OR s.client=3)'))
+ array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client = 2 OR s.client=3)', '', 0, 0, null, 0, 'maxwidth300'))
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
}
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index 3d2dee9a286..603627ee91e 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -45,8 +45,14 @@ if ($mode == 'customer' && !$user->rights->commande->lire) {
if ($mode == 'supplier' && empty($user->rights->fournisseur->commande->lire)) {
accessforbidden();
}
+if ($mode == 'supplier') {
+ $object_status = GETPOST('object_status', 'array:int');
+ $object_status = implode(',', $object_status);
+} else {
+ $object_status = GETPOST('object_status', 'intcomma');
+}
+
-$object_status = GETPOST('object_status', 'intcomma');
$typent_id = GETPOST('typent_id', 'int');
$categ_id = GETPOST('categ_id', 'categ_id');
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 8893f91c2c2..4d133c50dda 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -276,6 +276,9 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
if ($offset) {
$param .= '&offset='.urlencode($offset);
}
+ if ($limit) {
+ $param .= '&limit='.urlencode($limit);
+ }
if ($search_conciliated != '' && $search_conciliated != '-1') {
$param .= '&search_conciliated='.urlencode($search_conciliated);
}
@@ -980,21 +983,27 @@ if ($resql) {
$moreforfilter = '';
$moreforfilter .= '';
- $moreforfilter .= $langs->trans('DateOperationShort').' ';
+ $moreforfilter .= $langs->trans('DateOperationShort');
$moreforfilter .= ($conf->browser->layout == 'phone' ? ' ' : ' ');
$moreforfilter .= ' ';
- $moreforfilter .= $form->selectDate($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')).' ';
- //$moreforfilter .= ' - ';
- $moreforfilter .= ' '.$form->selectDate($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')).' ';
+ $moreforfilter .= $form->selectDate($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ $moreforfilter .= ' ';
+ $moreforfilter .= ($conf->browser->layout == 'phone' ? '' : ' ');
+ $moreforfilter .= '';
+ $moreforfilter .= $form->selectDate($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
+ $moreforfilter .= ' ';
$moreforfilter .= '';
$moreforfilter .= '';
- $moreforfilter .= $langs->trans('DateValueShort').' ';
+ $moreforfilter .= $langs->trans('DateValueShort');
$moreforfilter .= ($conf->browser->layout == 'phone' ? ' ' : ' ');
$moreforfilter .= ' ';
- $moreforfilter .= $form->selectDate($search_dv_start, 'search_start_dv', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')).' ';
- //$moreforfilter .= ' - ';
- $moreforfilter .= ' '.$form->selectDate($search_dv_end, 'search_end_dv', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')).' ';
+ $moreforfilter .= $form->selectDate($search_dv_start, 'search_start_dv', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ $moreforfilter .= ' ';
+ $moreforfilter .= ($conf->browser->layout == 'phone' ? '' : ' ');
+ $moreforfilter .= '';
+ $moreforfilter .= $form->selectDate($search_dv_end, 'search_end_dv', 0, 0, 1, "search_form", 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
+ $moreforfilter .= ' ';
$moreforfilter .= '';
if (!empty($conf->categorie->enabled)) {
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index f01e74a0cf4..429d7c704c8 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -519,9 +519,10 @@ class Account extends CommonObject
* @param string $accountancycode When we record a free bank entry, we must provide accounting account if accountancy module is on.
* @param int $datev Date value
* @param string $num_releve Label of bank receipt for reconciliation
+ * @param float $amount_main_currency Amount
* @return int Rowid of added entry, <0 if KO
*/
- public function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null, $num_releve = '')
+ public function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null, $num_releve = '', $amount_main_currency = null)
{
// Deprecation warning
if (is_numeric($oper)) {
@@ -579,6 +580,7 @@ class Account extends CommonObject
$accline->datev = $datev;
$accline->label = $label;
$accline->amount = $amount;
+ $accline->amount_main_currency = $amount_main_currency;
$accline->fk_user_author = $user->id;
$accline->fk_account = $this->id;
$accline->fk_type = $oper;
@@ -1801,7 +1803,8 @@ class AccountLine extends CommonObject
*/
public $datev;
- public $amount;
+ public $amount; /* Amount of payment in the bank account currency */
+ public $amount_main_currency; /* Amount in the currency of company if bank account use another currency */
/**
* @var int ID
@@ -1962,6 +1965,7 @@ class AccountLine extends CommonObject
$sql .= ", datev";
$sql .= ", label";
$sql .= ", amount";
+ $sql .= ", amount_main_currency";
$sql .= ", fk_user_author";
$sql .= ", num_chq";
$sql .= ", fk_account";
@@ -1976,7 +1980,8 @@ class AccountLine extends CommonObject
$sql .= ", '".$this->db->idate($this->datev)."'";
$sql .= ", '".$this->db->escape($this->label)."'";
$sql .= ", ".price2num($this->amount);
- $sql .= ", ".($this->fk_user_author > 0 ? $this->fk_user_author : "null");
+ $sql .= ", ".(empty($this->amount_main_currency) ? "NULL" : price2num($this->amount_main_currency));
+ $sql .= ", ".($this->fk_user_author > 0 ? ((int) $this->fk_user_author) : "null");
$sql .= ", ".($this->num_chq ? "'".$this->db->escape($this->num_chq)."'" : "null");
$sql .= ", '".$this->db->escape($this->fk_account)."'";
$sql .= ", '".$this->db->escape($this->fk_type)."'";
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index f91b776c0aa..7ad0a8ed4bc 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -811,6 +811,10 @@ class Facture extends CommonInvoice
$fk_parent_line = 0;
}
+ // Complete vat rate with code
+ $vatrate = $newinvoiceline->tva_tx;
+ if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')';
+
$newinvoiceline->fk_parent_line = $fk_parent_line;
if ($this->type === Facture::TYPE_REPLACEMENT && $newinvoiceline->fk_remise_except) {
@@ -821,7 +825,37 @@ class Facture extends CommonInvoice
$newinvoiceline->fk_remise_except = $discountId;
}
- $result = $newinvoiceline->insert();
+ $result = $this->addline(
+ $newinvoiceline->desc,
+ $newinvoiceline->subprice,
+ $newinvoiceline->qty,
+ $vatrate,
+ $newinvoiceline->localtax1_tx,
+ $newinvoiceline->localtax2_tx,
+ $newinvoiceline->fk_product,
+ $newinvoiceline->remise_percent,
+ $newinvoiceline->date_start,
+ $newinvoiceline->date_end,
+ $newinvoiceline->fk_code_ventilation,
+ $newinvoiceline->info_bits,
+ $newinvoiceline->fk_remise_except,
+ 'HT',
+ 0,
+ $newinvoiceline->product_type,
+ $newinvoiceline->rang,
+ $newinvoiceline->special_code,
+ $newinvoiceline->element,
+ $newinvoiceline->id,
+ $fk_parent_line,
+ $newinvoiceline->fk_fournprice,
+ $newinvoiceline->pa_ht,
+ $newinvoiceline->label,
+ $newinvoiceline->array_options,
+ $newinvoiceline->situation_percent,
+ $newinvoiceline->fk_prev_id,
+ $newinvoiceline->fk_unit,
+ $newinvoiceline->multicurrency_subprice
+ );
// Defined the new fk_parent_line
if ($result > 0) {
@@ -1596,8 +1630,6 @@ class Facture extends CommonInvoice
*/
public function fetch($rowid, $ref = '', $ref_ext = '', $notused = '', $fetch_situation = false)
{
- global $conf;
-
if (empty($rowid) && empty($ref) && empty($ref_ext)) {
return -1;
}
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index cd34a027651..316254b0398 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -912,7 +912,7 @@ if ($object->id > 0) {
}
if (!$numopen && !$numclosed) {
- print ' |