Merge pull request #2 from Dolibarr/develop

Update fork
This commit is contained in:
Damien BENOIT 2020-11-18 14:28:49 +01:00 committed by GitHub
commit 75498c89d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 616 additions and 533 deletions

266
ChangeLog
View File

@ -4,153 +4,155 @@ English Dolibarr ChangeLog
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
For users:
----------
NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
NEW: Several security issues after a private bug bounty campaign.
NEW: #15065 Put the product label in bold in the PDF templates if configured
NEW: Accountancy - Add chart of sub accounts
NEW: Accountancy - Add options to disable binding on sales, purchases & expense reports independently of the modules
NEW: Accountancy balance - Add a menu entry to show subtotal by group
NEW: Accountancy - Move to real ledger, real journals, menu disposition
NEW: Accountancy - On transfers, select the periodicity by default
NEW: New currency rate editor.
NEW: Add 2 rules for emailcollector: Message send/not sent from Dolibarr
NEW: Add a counter of number of words for pages in website module
NEW: add alert before changing thirdparty in takepos
NEW: Add a page to list Stock at a given date in the past.
NEW: Add a start date to begin binding in accountancy
NEW: Add a statistics page to list popularity of products on invoices
NEW: Add calendar selection for agenda view
NEW: Support documents generation for ticket edition (pdf or odt)
NEW: Add column payment term into list of supplier invoices.
NEW: Add column quantity in product margin page
NEW: Add column vat rate in page to define accounting account on product/service
NEW: Add common list function for available app/module page
NEW: Accountancy - add chart of sub accounts
NEW: Accountancy - add options to disable binding on sales, purchases & expense reports independently of the modules
NEW: Accountancy balance - add a menu entry to show subtotal by group
NEW: Accountancy - move to real ledger, real journals, menu disposition
NEW: Accountancy - on transfers, select the periodicity by default
NEW: new currency rate editor
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
NEW: add a counter of number of words for pages in website module
NEW: add alert before changing thirdparty in TakePOS
NEW: add a page to list Stock at a given date in the past
NEW: add a start date to begin binding in accountancy
NEW: add a statistics page to list popularity of products on invoices
NEW: add calendar selection for agenda view
NEW: Support documents generation for ticket edition (PDF or ODT)
NEW: add column payment term into list of supplier invoices
NEW: add column quantity in product margin page
NEW: add column vat rate in page to define accounting account on product/service
NEW: add common list function for available app/module page
NEW: add costprice in fields of products list
NEW: Added an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
NEW: Added incoterms dara into the substitution array
NEW: Add employee link in expense report binding page
NEW: Add export for various payment
NEW: add extra fields labels and values in mail on create ticket
NEW: Add extrafields support on ECM module
NEW: Add filter rules "is answer" and "is not answer" in email collector
NEW: Add focus when editing on product/stock/product.php Close #14548
NEW: added an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
NEW: added incoterms data into the substitution array
NEW: add employee link in expense report binding page
NEW: add export for various payment
NEW: add Extrafields labels and values in mail on create ticket
NEW: add Extrafields support on ECM module
NEW: add filter rules "is answer" and "is not answer" in email collector
NEW: add focus when editing on product/stock/product.php Close #14548
NEW: add formConfirm hook on product page
NEW: add free text on each terminal of cash desk
NEW: Add function dolButtonToOpenUrlInDialogPopup() to be able to open
NEW: Add global search for customer payments and vendor payments
NEW: Add global search for miscellaneous payments
NEW: Add helper function for table headers with numbers
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open
NEW: add global search for customer payments and vendor payments
NEW: add global search for miscellaneous payments
NEW: add helper function for table headers with numbers
NEW: add hooks on stats pages
NEW: Add link to edit property from search result of website pages
NEW: Add link to reset qty on supplier dispatch page
NEW: add link to edit property from search result of website pages
NEW: add link to reset qty on supplier dispatch page
NEW: add MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const to remove header stored by email collector
NEW: Add Manufacturing Orders attached files into the automatic ECM view
NEW: add Manufacturing Orders attached files into the automatic ECM view
NEW: add margin info in invoice list
NEW: Add mass action to set category on a list of website pages.
NEW: Add mass deletion for events
NEW: Add mass deletion for draft invoices
NEW: Add __MEMBER_TYPE__ substitution key
NEW: Add a message in error_log after detection of SQL or script injection
NEW: Add module Credit transfer SEPA to manage payment of supplier using
NEW: Add more filters on monthly statement list
NEW: Add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
NEW: Add option to define a default warehouse at user level
NEW: Add option to include products without alert in replenish
NEW: add mass action to set category on a list of website pages
NEW: add mass deletion for events
NEW: add mass deletion for draft invoices
NEW: add __MEMBER_TYPE__ substitution key
NEW: add a message in error_log after detection of SQL or script injection
NEW: add module Credit transfer SEPA to manage payment of supplier using
NEW: add more filters on monthly statement list
NEW: add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
NEW: add option to define a default warehouse at user level
NEW: add option to include products without alert in replenish
NEW: add order by lastname and firstname by default in get sales representatives
NEW: Add param to not show links when output tags
NEW: Add PDF document templates for warehouses (list of stock)
NEW: Add property cssview when declaring fields of an object
NEW: Add prospect status managment for the contact with managment of custom icon
NEW: Add public note on products. This also partially fix the #14342
NEW: Add quick dropdown menu in top right menu (MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)
NEW: add param to not show links when output tags
NEW: add PDF document templates for warehouses (list of stock)
NEW: add property cssview when declaring fields of an object
NEW: add prospect status managment for the contact with managment of custom icon
NEW: add public note on products ; this also partially fix the #14342
NEW: add quick dropdown menu in top right menu (MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)
NEW: add region in export companies and contacts
NEW: add rights on margin info on invoice list
NEW: Add search param for close date on order list
NEW: add search param for close date on order list
NEW: add send context for ticket
NEW: Add show preview for mail attachement on form mail
NEW: add show preview for mail attachement on form mail
NEW: add state origin for product
NEW: add State/Province origin for products
NEW: Add the workflow interaction close intervention on closing ticket
NEW: Add third order printer to TakePOS
NEW: add the workflow interaction close intervention on closing ticket
NEW: add third order printer to TakePOS
NEW: add tracking number in list and search_all items
NEW: add two hooks printFieldListFrom and printFieldSearchParam
NEW: Add __TYPE__ substitution key
NEW: Add validation of MX domain for emails
NEW: add __TYPE__ substitution key
NEW: add validation of MX domain for emails
NEW: add vcard for aderent and user
NEW: add week number for month view in agenda
NEW: Algeria data (tva and forme_juridique)
NEW: Allow click on all header numbers on commerce area
NEW: Allow to reopen interventions (green button)
NEW: Allow zero quality on supplier/vendor order line
NEW: Appearance tab in TakePOS with more visual parameters
NEW: Better currency rate editor
NEW: Calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
NEW: Can add event to log into blockedlog module with a constant.
NEW: Can build vendor invoice from vendor orders
NEW: Can change a product in line of recurring invoice or contract
NEW: Can change size of logo on PDF documents
NEW: Can change VAT rate of all lines of a draft object in one step.
NEW: Can define date range of validity of a login during creation
NEW: Can disable, from edit page, the whole web site
NEW: allow click on all header numbers on commerce area
NEW: allow to reopen interventions (green button)
NEW: allow zero quality on supplier/vendor order line
NEW: appearance tab in TakePOS with more visual parameters
NEW: better currency rate editor
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
NEW: can add event to log into blockedlog module with a constant
NEW: can build vendor invoice from vendor orders
NEW: can change a product in line of recurring invoice or contract
NEW: can change size of logo on PDF documents
NEW: can change VAT rate of all lines of a draft object in one step
NEW: can define date range of validity of a login during creation
NEW: can disable, from edit page, the whole web site
NEW: can edit and set sales representatives directly on thirdparty card
NEW: Can edit the list of sending email profiles.
NEW: Can enable/disable users in bulk actions
NEW: Can filter on accounting system ref in export of chart of account
NEW: Can filter on container type, language and tags in the list of pages
NEW: Can force the antivirus from conf file or autoprepend ini setup.
NEW: Can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY
NEW: Can import proposals, sales orders, supplier invoices
NEW: can enable/disable users in bulk actions
NEW: can filter on accounting system ref in export of chart of account
NEW: can filter on container type, language and tags in the list of pages
NEW: can force the antivirus from conf file or autoprepend ini setup
NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY
NEW: can import proposals, sales orders, supplier invoices
NEW: can set a dedicated SMTP config for sending email from public ticket interface
NEW: Can set tags/categories to website pages.
NEW: Can set type of price without tax per default for new sale price creation
NEW: Can use desired stock of a given warehouse for replenishment
NEW: Can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
NEW: change thirdparty with barcode scan in takepos
NEW: Common behavior for monthly leave list view
NEW: can set tags/categories to website pages
NEW: can set type of price without tax per default for new sale price creation
NEW: can use desired stock of a given warehouse for replenishment
NEW: can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
NEW: change thirdparty with barcode scan in TakePOS
NEW: common behavior for monthly leave list view
NEW: conf to allow show full arbo in warehouse getnomurl
NEW: convert all subscription in datetime
NEW: create thirdparty customer from TAKEPOS
NEW: Date shipment from order accepts hours
NEW: Declinaison price level compatibility
NEW: Delayed payment in TakePOS
NEW: Development of module Recruitment
NEW: display date range if exist in takepos
NEW: display resiliate status in takepos for member
NEW: create thirdparty customer from TakePOS
NEW: date shipment from order accepts hours
NEW: declinaison price level compatibility
NEW: delayed payment in TakePOS
NEW: development of module Recruitment
NEW: display date range if exist in TakePOS
NEW: display resiliate status in TakePOS for member
NEW: display stat for BOM on "object referent"/linked Object product tab
NEW: edit and update a ticket
NEW: edit or delete dispatched lines
NEW: Email configuration - Allow auto signed certificat when smtp ssl activated
NEW: Email configuration - allow auto signed certificat when smtp ssl activated
NEW: enable free emails input with select2
NEW: endpoint getContacts and Clean results
NEW: Events in agenda for contact
NEW: Field to link website page to an other object
NEW: Fill ECM src object fields in dol_add_file_process
NEW: fill ECM src object fields in dol_add_file_process
NEW: filter on progress column in task list
NEW: filter product list by country and/or state/province
NEW: format tickets sent by mail in public interface
NEW: add juridical status for Algeria
NEW: form to add customer/supplier into categories
NEW: Framework is ready for CSRF token protection on explicit GET URLs.
NEW: Framework is ready for CSRF token protection on explicit GET URLs
NEW: get all child recursively
NEW: Get contacts list of a given order
NEW: get contacts list of a given order
NEW: helper functions for export with phpspreadsheet
NEW: hide closed contract lines
NEW: hide label in pdf for variants
NEW: hide label in PDF for variants
NEW: Hook on propal card
NEW: If specific help page is available, we change color of icon
NEW: Include the tag editor of page as a popup into website editor
NEW: Introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM
NEW: Introducing new modal boxes in TakePOS
NEW: Keep takepos terminal when login/logout
NEW: Link on balance to the ledger
NEW: if specific help page is available, we change color of icon
NEW: include the tag editor of page as a popup into website editor
NEW: introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM
NEW: introducing new modal boxes in TakePOS
NEW: keep TakePOS terminal when login/logout
NEW: link on balance to the ledger
NEW: MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const in email collector
NEW: manage errors on update extra fields in ticket card
NEW: mass-actions for the event list view
NEW: Module Intracomm report
NEW: More filter for "View change logs"
NEW: multicurrency total in takepos
NEW: more filter for "View change logs"
NEW: multicurrency total in TakePOS
NEW: multiselect type and date to date filter
NEW: Nature of product is now a dictionay
NEW: new line template: hidden conf to fill service dates from the last service line
@ -159,38 +161,38 @@ NEW: possibilty to group payments by mode and show their subtotal
NEW: Print payment method and change in TakePOS
NEW: Priority and transparency from external calendar events
NEW: Products Import/Export 'default warehouse' and 'use batch number' fields
NEW: Purchase price table: Added filterable table columns
NEW: Purchase price table: added filterable table columns
NEW: rate editor for multicurrency
NEW: ref_ext field for Commande lines, order lines, Attributes and Combinations, Invoice lines, payments, order lines
NEW: remove new lines in mail on add ticket message
NEW: restrict thirdparty to customer in takepos
NEW: Allow to edit "demand reason" field though API
NEW: restrict thirdparty to customer in TakePOS
NEW: allow to edit "demand reason" field though API
NEW: Rule "email to" accept wildcard *
NEW: Save filter of the project homepage
NEW: Select-able columns on customer invoice paymnet list
NEW: Select-able columns on miscellaneous payments + more data columns
NEW: Select-able columns on social taxes list
NEW: Select-able columns on supplier invoice payment list
NEW: select-able columns on customer invoice paymnet list
NEW: select-able columns on miscellaneous payments + more data columns
NEW: select-able columns on social taxes list
NEW: select-able columns on supplier invoice payment list
NEW: send context and remove new lines on create ticket
NEW: set entity when creating invoice on takepos
NEW: Show available stock in TakePOS
NEW: Show category filter on lists only when user have rights to read categories
NEW: Show header number and make it clickable in warehouse arean, payment area, shipment area
NEW: Show image of user in the combo select of users
NEW: Show label on batch card
NEW: Show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
NEW: show available stock in TakePOS
NEW: show category filter on lists only when user have rights to read categories
NEW: show header number and make it clickable in warehouse arean, payment area, shipment area
NEW: show image of user in the combo select of users
NEW: show label on batch card
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
NEW: show links for select and multi-select in category extra field
NEW: Show module and permission ids on user/group rights (only admin)
NEW: Show place from events on import calender
NEW: Show references in contract form on interventions
NEW: Show tags and status in search list of website pages
NEW: Show user on external calender events (when found)
NEW: show module and permission ids on user/group rights (only admin)
NEW: show place from events on import calender
NEW: show references in contract form on interventions
NEW: show tags and status in search list of website pages
NEW: show user on external calender events (when found)
NEW: subject title with company name instead of application title in ticket message
NEW: Support for Samba4 AD
NEW: TakePOS connector compatibility with RECEIPT PRINTERS module
NEW: TakePOS Gift Receipt
NEW: TakePOS Multicurrency compatibility
NEW: The global header of a website can also have dynamic content
NEW: the global header of a website can also have dynamic content
NEW: Third-Party Import new fields: mother company,outstanding debt limit,bank account,incoterms
NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late
NEW: ticket classification on create from email collector
@ -199,16 +201,18 @@ NEW: translate classification labels in ticket
NEW: triggers create, modify, delete
NEW: VAT for Algeria
NEW: Use preselect third-party from list on new card
NEW: Vat report - Invert constant to show by default zero vat in reports
NEW: VAT report - Invert constant to show by default zero vat in reports
NEW: website page fields selection
NEW: Weighing Scale compatibility with TakePOS connector
NEW: When creating a user from a member linked to a thirdparty, you can choose to create if as external or internal user
NEW: Add clone functionality on miscellaneous payment
NEW: when creating a user from a member linked to a thirdparty, you can choose to create if as external or internal user
NEW: add clone functionality on miscellaneous payment
For developers:
---------------
NEW: Can use dynamic code into the 'enabled' property of DAO fields
NEW: API Can update a payment
NEW: api get member by thirdparty
NEW: API can update a payment
NEW: API get member by thirdparty
NEW: API get thirdparty by barcode
NEW: API get users by email / login
NEW: fetch contact by email with REST API
@ -216,14 +220,15 @@ NEW: field ref_ext in llx_commandedet
NEW: fields ref_ext for Attributes and Combinations
NEW: get state by REST API
NEW: get state dictionnary by REST API
NEW: Improve Product API for variant products
NEW: Oauth SCOPE for Admin SDK
NEW: Retrieve discount from invoice from API
NEW: improve Product API for variant products
NEW: OAuth SCOPE for Admin SDK
NEW: retrieve discount from invoice from API
NEW: standardizes API thirdparties by email like other object
NEW: thirdparty REST API: endpoint to set price level
NEW: Use new category API for project list view
NEW: Thirdparty REST API: endpoint to set price level
NEW: use new category API for project list view
NEW: Triggers Attributes and Attributes values
NEW: Add hooks on newpayment page to allow external payment modules
NEW: add hooks on newpayment page to allow external payment modules
WARNING:
@ -289,6 +294,7 @@ FIX: Visualization rights correction on last modified contacts box
FIX: Wrong redirection
FIX: Yogosha report 4425 (backport)
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
FIX: DebugBar hides content at page bottom

View File

@ -37,7 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->loadLangs(array("companies", "members", "other"));
$id = GETPOST('id', 'int');
$id = GETPOSTISSET('id') ? GETPOST('id', 'int') : GETPOST('rowid', 'int');
$ref = GETPOST('ref', 'alphanohtml');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
@ -60,7 +61,7 @@ if (!$sortfield) $sortfield = "name";
$form = new Form($db);
$object = new Adherent($db);
$membert = new AdherentType($db);
$result = $object->fetch($id);
$result = $object->fetch($id, $ref);
if ($result < 0) {
dol_print_error($db);
exit;

View File

@ -69,8 +69,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity?$object->entity:1] . "/bom/" . dol_sanitizeFileName($object->id);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".dol_sanitizeFileName($object->ref);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object);
/*

View File

@ -153,7 +153,7 @@ if ($action == 'create')
print '<table class="border centpercent tableforfieldcreate">';
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth100" name="title" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth300" name="title" value="'.dol_escape_htmltag($title).'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
dol_set_focus('#titlebookmark');
// Url
@ -167,12 +167,12 @@ if ($action == 'create')
// Owner
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
print img_picto('', 'user').' '.$form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td><td class="hideonsmartphone">&nbsp;</td></tr>';
// Position
print '<tr><td>'.$langs->trans("Position").'</td><td>';
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"]) ? $_POST["position"] : $object->position).'">';
print '<input class="flat" name="position" size="5" value="'.(GETPOSTISSET("position") ? GETPOST("position", 'int') : $object->position).'">';
print '</td><td class="hideonsmartphone">&nbsp;</td></tr>';
print '</table>';
@ -238,7 +238,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
}
print '</td><td>';
if ($action == 'edit') print '<input class="flat minwidth200" name="title" value="'.(isset($_POST["title"]) ?GETPOST("title", '', 2) : $object->title).'">';
if ($action == 'edit') print '<input class="flat minwidth300" name="title" value="'.(GETPOSTISSET("title") ? GETPOST("title", '', 2) : $object->title).'">';
else print $object->title;
print '</td></tr>';
@ -251,7 +251,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
print '</span>';
}
print '</td><td>';
if ($action == 'edit') print '<input class="flat minwidth500" name="url" value="'.(isset($_POST["url"]) ? $_POST["url"] : $object->url).'">';
if ($action == 'edit') print '<input class="flat minwidth500 quatrevingtpercent" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
else print '<a href="'.(preg_match('/^http/i', $object->url) ? $object->url : DOL_URL_ROOT.$object->url).'"'.($object->target ? ' target="_blank"' : '').'>'.$object->url.'</a>';
print '</td></tr>';
@ -259,7 +259,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
if ($action == 'edit')
{
$liste = array(1=>$langs->trans("OpenANewWindow"), 0=>$langs->trans("ReplaceWindow"));
print $form->selectarray('target', $liste, isset($_POST["target"]) ? $_POST["target"] : $object->target);
print $form->selectarray('target', $liste, GETPOSTISSET("target") ? GETPOST("target") : $object->target);
} else {
if ($object->target == 0) print $langs->trans("ReplaceWindow");
if ($object->target == 1) print $langs->trans("OpenANewWindow");
@ -269,7 +269,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
if ($action == 'edit' && $user->admin)
{
print img_picto('', 'user').' '.$form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
} else {
if ($object->fk_user > 0)
{
@ -284,7 +284,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
// Position
print '<tr><td>'.$langs->trans("Position").'</td><td>';
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"]) ? $_POST["position"] : $object->position).'">';
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(GETPOSTISSET("position") ? GETPOST("position", 'int') : $object->position).'">';
else print $object->position;
print '</td></tr>';

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -197,14 +197,14 @@ while ($i < min($num, $limit))
// Title
print "<td>";
$linkintern = 1;
if ($linkintern) print "<a href=\"".$obj->url."\">";
if ($linkintern) print '<a href="'.$obj->url.'">';
print $title;
if ($linkintern) print "</a>";
print "</td>\n";
// Url
print '<td class="tdoverflowmax200">';
if (!$linkintern) print '<a href="'.$obj->url.'"'.($obj->target ? ' target="newlink"' : '').'>';
if (!$linkintern) print '<a href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
print $link;
if (!$linkintern) print '</a>';
print "</td>\n";
@ -241,7 +241,7 @@ while ($i < min($num, $limit))
print '<td class="nowrap right">';
if ($user->rights->bookmark->creer)
{
print '<a class="editfielda" href="'.DOL_URL_ROOT."/bookmarks/card.php?action=edit&token='.newToken().'&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
}
if ($user->rights->bookmark->supprimer)
{

View File

@ -32,7 +32,7 @@ $conf_db_base = $dolibarr_main_db_name;
$conf_fksoc = (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"])) ? $_SESSION["CASHDESK_ID_THIRDPARTY"] : ($conf->global->CASHDESK_ID_THIRDPARTY > 0 ? $conf->global->CASHDESK_ID_THIRDPARTY : 0);
// Identifiant unique correspondant a l'entrepot a utiliser
$conf_fkentrepot = (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"])) ? $_SESSION["CASHDESK_ID_WAREHOUSE"] : ($conf->global->CASHDESK_ID_WAREHOUSE > 0 ? $conf->global->CASHDESK_ID_WAREHOUSE : 0);
if (!empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) $conf_fkentrepot = 0; // If option to disable stock decrease is on, we set warehouse id to 0.
if (!empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) $conf_fkentrepot = 0; // If option to disable the stock decrease is on, we set warehouse id to 0.
// Identifiant unique correspondant au compte caisse / liquide
$conf_fkaccount_cash = (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"])) ? $_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"] : ($conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0 ? $conf->global->CASHDESK_ID_BANKACCOUNT_CASH : 0);
@ -46,6 +46,3 @@ $conf_fkaccount_cb = (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"])) ? $_SESSI
// View parameters
$conf_taille_listes = (empty($conf->global->PRODUIT_LIMIT_SIZE) ? 1000 : $conf->global->PRODUIT_LIMIT_SIZE); // Number max of lines to show in lists
$conf_nbr_car_listes = 60; // Nombre max de caracteres par ligne dans les listes
// Add hidden option to force decrease of stock whatever is user setup
if (!empty($conf->global->CASHDESK_FORCE_STOCK_ON_BILL)) $conf->global->STOCK_CALCULATE_ON_BILL = 1;

View File

@ -171,13 +171,14 @@ if (empty($reshook))
GETPOST('date_deliveryday', 'int'),
GETPOST('date_deliveryyear', 'int')
);
if (!empty($object->date_livraison) && !empty($date_delivery))
$date_delivery_old = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date);
if (!empty($date_delivery_old) && !empty($date_delivery))
{
//Attempt to get the date without possible hour rounding errors
$old_date_delivery = dol_mktime(12, 0, 0,
dol_print_date($object->date_livraison, '%m'),
dol_print_date($object->date_livraison, '%d'),
dol_print_date($object->date_livraison, '%Y')
dol_print_date($date_delivery_old, '%m'),
dol_print_date($date_delivery_old, '%d'),
dol_print_date($date_delivery_old, '%Y')
);
//Calculate the difference and apply if necessary
$difference = $date_delivery - $old_date_delivery;
@ -341,7 +342,9 @@ if (empty($reshook))
if ($object->fetch(GETPOST('copie_propal', 'int')) > 0) {
$object->ref = GETPOST('ref');
$object->datep = $datep;
$object->date_livraison = $date_delivery;
$object->date = $datep;
$object->date_livraison = $date_delivery; // deprecated
$object->delivery_date = $date_delivery;
$object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id');
$object->fk_delivery_address = GETPOST('fk_address', 'int');
@ -355,8 +358,9 @@ if (empty($reshook))
$object->socid = GETPOST('socid', 'int');
$object->contact_id = GETPOST('contactid', 'int');
$object->fk_project = GETPOST('projectid', 'int');
$object->model_pdf = GETPOST('model');
$object->model_pdf = GETPOST('model', 'alphanohtml');
$object->author = $user->id; // deprecated
$object->user_author_id = $user->id;
$object->note_private = GETPOST('note_private', 'restricthtml');
$object->note_public = GETPOST('note_public', 'restricthtml');
$object->statut = Propal::STATUS_DRAFT;
@ -372,7 +376,9 @@ if (empty($reshook))
$object->ref = GETPOST('ref');
$object->ref_client = GETPOST('ref_client');
$object->datep = $datep;
$object->date = $datep;
$object->date_livraison = $date_delivery;
$object->delivery_date = $date_delivery;
$object->availability_id = GETPOST('availability_id', 'int');
$object->demand_reason_id = GETPOST('demand_reason_id', 'int');
$object->fk_delivery_address = GETPOST('fk_address', 'int');
@ -1823,8 +1829,8 @@ if ($action == 'create')
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), '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)'))
);
if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->date_livraison)) {
$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->date_livraison);
if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->delivery_date)) {
$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date);
}
// Incomplete payment. We ask if reason = discount or other
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
@ -2048,9 +2054,9 @@ if ($action == 'create')
// Delivery date
$langs->load('deliveries');
print '<tr><td>';
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $usercancreate, 'datepicker');
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker');
print '</td><td>';
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $usercancreate, 'datepicker');
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker');
print '</td>';
print '</tr>';

View File

@ -991,6 +991,9 @@ class Propal extends CommonObject
$this->multicurrency_tx = 1;
}
// Set tmp vars
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
dol_syslog(get_class($this)."::create");
// Check parameters
@ -1078,7 +1081,7 @@ class Propal extends CommonObject
$sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL');
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
$sql .= ", '".$this->db->escape($this->ref_client)."'";
$sql .= ", ".($this->date_livraison != '' ? "'".$this->db->idate($this->date_livraison)."'" : "NULL");
$sql .= ", ".(empty($delivery_date) ? "NULL" : "'".$this->db->idate($delivery_date)."'");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".$this->availability_id;
$sql .= ", ".$this->demand_reason_id;
@ -1441,7 +1444,7 @@ class Propal extends CommonObject
$sql .= ", p.date_valid as datev";
$sql .= ", p.datep as dp";
$sql .= ", p.fin_validite as dfv";
$sql .= ", p.date_livraison as date_livraison";
$sql .= ", p.date_livraison as delivery_date";
$sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams";
$sql .= ", p.note_private, p.note_public";
$sql .= ", p.fk_projet as fk_project, p.fk_statut";
@ -1523,8 +1526,8 @@ class Propal extends CommonObject
$this->date = $this->db->jdate($obj->dp); // Proposal date
$this->datep = $this->db->jdate($obj->dp); // deprecated
$this->fin_validite = $this->db->jdate($obj->dfv);
$this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->delivery_date = $this->db->jdate($obj->date_livraison);
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
$this->availability_id = $obj->fk_availability;
$this->availability_code = $obj->availability_code;
@ -2111,7 +2114,7 @@ class Propal extends CommonObject
{
$this->oldcopy = clone $this;
$this->date_livraison = $delivery_date;
$this->date_delivery = $delivery_date;
$this->delivery_date = $delivery_date;
}
if (!$notrigger && empty($error))
@ -3574,16 +3577,24 @@ class Propal extends CommonObject
if (isset($this->statut)) {
$label .= ' '.$this->getLibStatut(5);
}
if (!empty($this->ref))
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_client))
}
if (!empty($this->ref_client)) {
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
if (!empty($this->total_ht))
}
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_tva))
}
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_ttc))
}
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->delivery_date)) {
$label .= '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
}
if ($option == '') {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params;

View File

@ -120,6 +120,8 @@ if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WA
$error = 0;
$date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
/*
* Actions
@ -274,7 +276,7 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int');
$object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id');
$object->date_livraison = $datelivraison;
$object->date_livraison = $datelivraison; // deprecated
$object->delivery_date = $datelivraison;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int');
@ -539,10 +541,10 @@ if (empty($reshook))
}
} elseif ($action == 'setdate_livraison' && $usercancreate) {
// print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$object->fetch($id);
$result = $object->setDeliveryDate($user, $datedelivery);
$result = $object->setDeliveryDate($user, $date_delivery);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@ -1507,7 +1509,8 @@ if ($action == 'create' && $usercancreate)
$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : '';
$datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : '');
$date_delivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '');
if (empty($date_delivery)) $date_delivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : '');
if (!empty($conf->multicurrency->enabled))
{
@ -1620,8 +1623,7 @@ if ($action == 'create' && $usercancreate)
// Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">';
//print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed.
$date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
$date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery);
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "</td>\n";
print '</tr>';
@ -2138,12 +2140,12 @@ if ($action == 'create' && $usercancreate)
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
print $object->date_livraison ? dol_print_date($object->date_livraison, 'dayhour') : '&nbsp;';
if ($object->hasDelay() && !empty($object->date_livraison)) {
print $object->delivery_date ? dol_print_date($object->delivery_date, 'dayhour') : '&nbsp;';
if ($object->hasDelay() && !empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
}

View File

@ -182,10 +182,13 @@ class Commande extends CommonOrder
/**
* @var int Date expected for delivery
* @deprecated
* @deprecated Use delivery_date instead.
*/
public $date_livraison; // deprecated; Use delivery_date instead.
public $date_livraison;
/**
* @var int Date expected for delivery
*/
public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after)
/**
@ -886,8 +889,9 @@ class Commande extends CommonOrder
// Clean parameters
$this->brouillon = 1; // set command as draft
// $date_commande is deprecated
// Set tmp vars
$date = ($this->date_commande ? $this->date_commande : $this->date);
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// 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);
@ -960,7 +964,7 @@ class Commande extends CommonOrder
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
$sql .= ", ".($this->availability_id > 0 ? $this->availability_id : "null");
$sql .= ", ".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null");
$sql .= ", ".($this->date_livraison ? "'".$this->db->idate($this->date_livraison)."'" : "null");
$sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null");
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : 'NULL');
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL');
@ -1359,7 +1363,7 @@ class Commande extends CommonOrder
$this->fk_account = $object->fk_account;
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison;
$this->date_livraison = $object->date_livraison; // deprecated
$this->delivery_date = $object->date_livraison;
$this->shipping_method_id = $object->shipping_method_id;
$this->warehouse_id = $object->warehouse_id;
@ -1784,7 +1788,7 @@ class Commande extends CommonOrder
$sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason';
$sql .= ', c.fk_account';
$sql .= ', c.date_commande, c.date_valid, c.tms';
$sql .= ', c.date_livraison';
$sql .= ', c.date_livraison as delivery_date';
$sql .= ', c.fk_shipping_method';
$sql .= ', c.fk_warehouse';
$sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed';
@ -1870,8 +1874,8 @@ class Commande extends CommonOrder
$this->availability = $obj->availability_label;
$this->demand_reason_id = $obj->fk_input_reason;
$this->demand_reason_code = $obj->demand_reason_code;
$this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->delivery_date = $this->db->jdate($obj->date_livraison);
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
$this->warehouse_id = ($obj->fk_warehouse > 0) ? $obj->fk_warehouse : null;
$this->fk_delivery_address = $obj->fk_delivery_address;
@ -2013,7 +2017,7 @@ class Commande extends CommonOrder
$sql .= ' l.total_ht, l.total_ttc, l.total_tva, l.total_localtax1, l.total_localtax2, l.date_start, l.date_end,';
$sql .= ' l.fk_unit,';
$sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,';
$sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_tobatch,';
$sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch,';
$sql .= ' p.weight, p.weight_units, p.volume, p.volume_units';
$sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
@ -2076,6 +2080,8 @@ class Commande extends CommonOrder
$line->libelle = $objp->product_label;
$line->product_label = $objp->product_label;
$line->product_desc = $objp->product_desc;
$line->product_tosell = $objp->product_tosell;
$line->product_tobuy = $objp->product_tobuy;
$line->product_tobatch = $objp->product_tobatch;
$line->fk_product_type = $objp->fk_product_type; // Produit ou service
$line->fk_unit = $objp->fk_unit;
@ -3660,6 +3666,9 @@ class Commande extends CommonOrder
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->delivery_date)) {
$label .= '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
}
}
$linkclose = '';

View File

@ -931,7 +931,7 @@ if ($resql)
$generic_commande->statut = $obj->fk_statut;
$generic_commande->billed = $obj->billed;
$generic_commande->date = $db->jdate($obj->date_commande);
$generic_commande->date_livraison = $db->jdate($obj->date_delivery);
$generic_commande->date_livraison = $db->jdate($obj->date_delivery); // deprecated
$generic_commande->delivery_date = $db->jdate($obj->date_delivery);
$generic_commande->ref_client = $obj->ref_client;
$generic_commande->total_ht = $obj->total_ht;

View File

@ -1093,7 +1093,7 @@ if ($resql)
}
print '<td class="center">';
print '<input type="checkbox" id="selectAll" />';
print '<input type="checkbox" id="selectAll" title="'.dol_escape_htmltag($langs->trans("SelectAll")).'" />';
print ' <script type="text/javascript">
$("input#selectAll").change(function() {
$("input[type=checkbox][name^=rowid]").prop("checked", $(this).is(":checked"));

View File

@ -92,14 +92,14 @@ $fieldstosearchall = array(
$checkedtypetiers = 0;
$arrayfields = array(
'b.ref'=>array('label'=>$langs->trans("BankAccounts"), 'checked'=>1),
'accountype'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
'b.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
'b.number'=>array('label'=>$langs->trans("AccountIdShort"), 'checked'=>1),
'b.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>(!empty($conf->accounting->enabled) || !empty($conf->accounting->enabled))),
'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>(!empty($conf->accounting->enabled) || !empty($conf->accounting->enabled))),
'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1),
'b.currency_code'=>array('label'=>$langs->trans("Currency"), 'checked'=>0),
'b.ref'=>array('label'=>$langs->trans("BankAccounts"), 'checked'=>1, 'position'=>10),
'b.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1, 'position'=>12),
'accountype'=>array('label'=>$langs->trans("Type"), 'checked'=>1, 'position'=>14),
'b.number'=>array('label'=>$langs->trans("AccountIdShort"), 'checked'=>1, 'position'=>16),
'b.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>(!empty($conf->accounting->enabled) || !empty($conf->accounting->enabled)), 'position'=>18),
'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>(!empty($conf->accounting->enabled) || !empty($conf->accounting->enabled)), 'position'=>20),
'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1, 'position'=>50),
'b.currency_code'=>array('label'=>$langs->trans("Currency"), 'checked'=>0, 'position'=>22),
'b.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'b.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'b.clos'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
@ -525,7 +525,7 @@ foreach ($accounts as $key=>$type)
if ($result < 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$objecttmp->id.'&search_conciliated=0">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&id='.$objecttmp->id.'&search_account='.$objecttmp->id.'&search_conciliated=0&contextpage=banktransactionlist">';
print '<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans("TransactionsToConciliate")).'">';
print $result->nbtodo;
print '</span>';

View File

@ -1338,8 +1338,8 @@ class Facture extends CommonInvoice
$this->mode_reglement_id = $object->mode_reglement_id;
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison;
$this->delivery_date = $object->date_livraison;
$this->delivery_date = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date);
$this->date_livraison = $object->delivery_date; // deprecated
$this->fk_delivery_address = $object->fk_delivery_address; // deprecated
$this->contact_id = $object->contact_id;
$this->ref_client = $object->ref_client;

View File

@ -2183,7 +2183,7 @@ if (!empty($conf->margin->enabled) && $action == 'editline')
$(document).ready(function() {
var idprod = $("input[name='idprod']").val();
var fournprice = $("input[name='fournprice']").val();
var token = '<?php echo $_SESSION["token"]; ?>'; // For AJAX Call we use old 'token' and not 'newtoken'
var token = '<?php echo currentToken(); ?>'; // For AJAX Call we use old 'token' and not 'newtoken'
if (idprod > 0) {
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {
'idprod': idprod,

View File

@ -115,7 +115,6 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$delivery_date = $this->db->jdate($objp->delivery_date);
$datem = $this->db->jdate($objp->tms);
$supplierorderstatic->date_livraison = $delivery_date;
$supplierorderstatic->delivery_date = $delivery_date;
$supplierorderstatic->statut = $objp->fk_statut;

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
*
* This program is free software; you can redistribute it and/or modify
@ -120,7 +120,11 @@ abstract class CommonDocGenerator
{
global $conf, $extrafields;
$logotouse = $conf->adherent->dir_output.'/'.get_exdir($member->id, 2, 0, 1, $member, 'user').'/'.$member->photo;
if ($member->photo) {
$logotouse = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $member, 'user').'/photos/'.$member->photo;
} else {
$logotouse = DOL_DOCUMENT_ROOT . '/public/theme/common/nophoto.png';
}
$array_member = array(
'mymember_lastname' => $member->lastname,
@ -1296,7 +1300,7 @@ abstract class CommonDocGenerator
$html = '';
$fields = array();
if (is_array($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) {
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
{
// Enable extrafield ?

View File

@ -62,6 +62,11 @@ abstract class CommonObject
*/
public $error;
/**
* @var string Error string that is hidden but can be used to store complementatry technical code.
*/
public $errorhidden;
/**
* @var string[] Array of error strings
*/
@ -1248,9 +1253,7 @@ abstract class CommonObject
{
$sql = "SELECT ec.datecreate, ec.statut, ec.fk_socpeople, ec.fk_c_type_contact,";
$sql .= " tc.code, tc.libelle";
//$sql.= ", s.fk_soc";
$sql .= " FROM (".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc)";
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as s ON ec.fk_socpeople=s.rowid"; // Si contact de type external, alors il est lie a une societe
$sql .= " WHERE ec.rowid =".$rowid;
$sql .= " AND ec.fk_c_type_contact=tc.rowid";
$sql .= " AND tc.element = '".$this->db->escape($this->element)."'";
@ -2449,8 +2452,6 @@ abstract class CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " SET model_pdf = '".$this->db->escape($newmodelpdf)."'";
$sql .= " WHERE rowid = ".$this->id;
// if ($this->element == 'facture') $sql.= " AND fk_statut < 2";
// if ($this->element == 'propal') $sql.= " AND fk_statut = 0";
dol_syslog(get_class($this)."::setDocModel", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -2565,8 +2566,7 @@ abstract class CommonObject
} else dol_print_error($this->db);
if ($nl > 0)
{
// The goal of this part is to reorder all lines, with all children lines sharing the same
// counter that parents.
// The goal of this part is to reorder all lines, with all children lines sharing the same counter that parents.
$rows = array();
// We first search all lines that are parent lines (for multilevel details lines)
@ -5459,7 +5459,6 @@ abstract class CommonObject
$sql .= ")";
$resql = $this->db->query($sql);
if (!$resql)
{
$this->error = $this->db->lasterror();
@ -5927,8 +5926,7 @@ abstract class CommonObject
}
}
if (in_array($type, array('date', 'datetime')))
{
if (in_array($type, array('date', 'datetime'))) {
$tmp = explode(',', $size);
$newsize = $tmp[0];
@ -5939,25 +5937,19 @@ abstract class CommonObject
// TODO Must also support $moreparam
$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1);
} elseif (in_array($type, array('duration')))
{
} elseif (in_array($type, array('duration'))) {
$out = $form->select_duration($keyprefix.$key.$keysuffix, $value, 0, 'text', 0, 1);
} elseif (in_array($type, array('int', 'integer')))
{
} elseif (in_array($type, array('int', 'integer'))) {
$tmp = explode(',', $size);
$newsize = $tmp[0];
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
} elseif (in_array($type, array('real')))
{
} elseif (in_array($type, array('real'))) {
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
} elseif (preg_match('/varchar/', $type))
{
} elseif (preg_match('/varchar/', $type)) {
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$size.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
} elseif (in_array($type, array('mail', 'phone', 'url')))
{
} elseif (in_array($type, array('mail', 'phone', 'url'))) {
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
} elseif (preg_match('/^text/', $type))
{
} elseif (preg_match('/^text/', $type)) {
if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -5966,18 +5958,15 @@ abstract class CommonObject
} else {
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
}
} elseif (preg_match('/^html/', $type))
{
if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field
{
} elseif (preg_match('/^html/', $type)) {
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
$out = $doleditor->Create(1);
} else {
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
}
} elseif ($type == 'boolean')
{
} elseif ($type == 'boolean') {
$checked = '';
if (!empty($value)) {
$checked = ' checked value="1" ';
@ -5985,20 +5974,17 @@ abstract class CommonObject
$checked = ' value="1" ';
}
$out = '<input type="checkbox" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam ? $moreparam : '').'>';
} elseif ($type == 'price')
{
} elseif ($type == 'price') {
if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format.
$value = price($value);
}
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> '.$langs->getCurrencySymbol($conf->currency);
} elseif (preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type))
{
} elseif (preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type)) {
if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format.
$value = price($value);
}
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
} elseif ($type == 'select')
{
} elseif ($type == 'select') {
$out = '';
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2))
{
@ -6018,18 +6004,15 @@ abstract class CommonObject
$out .= '>'.$val.'</option>';
}
$out .= '</select>';
} elseif ($type == 'sellist')
{
} elseif ($type == 'sellist') {
$out = '';
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2))
{
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
}
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
if (is_array($param['options']))
{
if (is_array($param['options'])) {
$param_list = array_keys($param['options']);
$InfoFieldList = explode(":", $param_list[0]);
$parentName = '';
@ -6175,12 +6158,10 @@ abstract class CommonObject
}
}
$out .= '</select>';
} elseif ($type == 'checkbox')
{
} elseif ($type == 'checkbox') {
$value_arr = explode(',', $value);
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
} elseif ($type == 'radio')
{
} elseif ($type == 'radio') {
$out = '';
foreach ($param['options'] as $keyopt => $val)
{
@ -6190,8 +6171,7 @@ abstract class CommonObject
$out .= ($value == $keyopt ? 'checked' : '');
$out .= '/><label for="'.$keyprefix.$key.$keysuffix.'_'.$keyopt.'">'.$val.'</label><br>';
}
} elseif ($type == 'chkbxlst')
{
} elseif ($type == 'chkbxlst') {
if (is_array($value)) {
$value_arr = $value;
} else {
@ -6332,8 +6312,7 @@ abstract class CommonObject
print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
}
}
} elseif ($type == 'link')
{
} elseif ($type == 'link') {
$param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter]]'
$param_list_array = explode(':', $param_list[0]);
$showempty = (($required && $default != '') ? 0 : 1);
@ -6358,25 +6337,20 @@ abstract class CommonObject
$out .= '<a class="butActionNew" title="'.$langs->trans("New").'" href="'.$url_path.'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].($paramforthenewlink ? '?'.$paramforthenewlink : '')).'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
}
} elseif ($type == 'password')
{
} elseif ($type == 'password') {
// If prefix is 'search_', field is used as a filter, we use a common text field.
$out = '<input type="'.($keyprefix == 'search_' ? 'text' : 'password').'" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'>';
} elseif ($type == 'array')
{
} elseif ($type == 'array') {
$newval = $val;
$newval['type'] = 'varchar(256)';
$out = '';
$inputs = array();
if (!empty($value)) {
foreach ($value as $option) {
$out .= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
$out .= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', $option, $moreparam, '', '', $morecss).'<br></span>';
}
}
$out .= '<a id="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_add" href="javascript:;"><span class="fa fa-plus-circle valignmiddle"></span></a>';
$newInput = '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
@ -6479,27 +6453,20 @@ abstract class CommonObject
if (empty($morecss))
{
if ($type == 'date')
{
if ($type == 'date') {
$morecss = 'minwidth100imp';
} elseif ($type == 'datetime' || $type == 'timestamp')
{
} elseif ($type == 'datetime' || $type == 'timestamp') {
$morecss = 'minwidth200imp';
} elseif (in_array($type, array('int', 'double', 'price')))
{
} elseif (in_array($type, array('int', 'double', 'price'))) {
$morecss = 'maxwidth75';
} elseif ($type == 'url')
{
} elseif ($type == 'url') {
$morecss = 'minwidth400';
} elseif ($type == 'boolean')
{
} elseif ($type == 'boolean') {
$morecss = '';
} else {
if (round($size) < 12)
{
if (round($size) < 12) {
$morecss = 'minwidth100';
} elseif (round($size) <= 48)
{
} elseif (round($size) <= 48) {
$morecss = 'minwidth200';
} else {
$morecss = 'minwidth400';
@ -6510,57 +6477,47 @@ abstract class CommonObject
// Format output value differently according to properties of field
if ($key == 'ref' && method_exists($this, 'getNomUrl')) $value = $this->getNomUrl(1, '', 0, '', 1);
elseif ($key == 'status' && method_exists($this, 'getLibStatut')) $value = $this->getLibStatut(3);
elseif ($type == 'date')
{
elseif ($type == 'date') {
if (!empty($value)) {
$value = dol_print_date($value, 'day');
} else {
$value = '';
}
} elseif ($type == 'datetime' || $type == 'timestamp')
{
} elseif ($type == 'datetime' || $type == 'timestamp') {
if (!empty($value)) {
$value = dol_print_date($value, 'dayhour');
} else {
$value = '';
}
} elseif ($type == 'duration')
{
} elseif ($type == 'duration') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!is_null($value) && $value !== '') {
$value = convertSecondToTime($value, 'allhourmin');
}
} elseif ($type == 'double' || $type == 'real')
{
} elseif ($type == 'double' || $type == 'real') {
if (!is_null($value) && $value !== '') {
$value = price($value);
}
} elseif ($type == 'boolean')
{
} elseif ($type == 'boolean') {
$checked = '';
if (!empty($value)) {
$checked = ' checked ';
}
$value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>';
} elseif ($type == 'mail')
{
} elseif ($type == 'mail') {
$value = dol_print_email($value, 0, 0, 0, 64, 1, 1);
} elseif ($type == 'url')
{
} elseif ($type == 'url') {
$value = dol_print_url($value, '_blank', 32, 1);
} elseif ($type == 'phone')
{
} elseif ($type == 'phone') {
$value = dol_print_phone($value, '', 0, 0, '', '&nbsp;', 1);
} elseif ($type == 'price')
{
if (!is_null($value) && $value !== '') {
$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
}
} elseif ($type == 'select')
{
} elseif ($type == 'select') {
$value = $param['options'][$value];
} elseif ($type == 'sellist')
{
} elseif ($type == 'sellist') {
$param_list = array_keys($param['options']);
$InfoFieldList = explode(":", $param_list[0]);
@ -6632,11 +6589,9 @@ abstract class CommonObject
}
}
} else dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
} elseif ($type == 'radio')
{
} elseif ($type == 'radio') {
$value = $param['options'][$value];
} elseif ($type == 'checkbox')
{
} elseif ($type == 'checkbox') {
$value_arr = explode(',', $value);
$value = '';
if (is_array($value_arr) && count($value_arr) > 0)
@ -6647,8 +6602,7 @@ abstract class CommonObject
}
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
}
} elseif ($type == 'chkbxlst')
{
} elseif ($type == 'chkbxlst') {
$value_arr = explode(',', $value);
$param_list = array_keys($param['options']);
@ -6714,8 +6668,7 @@ abstract class CommonObject
} else {
dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
}
} elseif ($type == 'link')
{
} elseif ($type == 'link') {
$out = '';
// only if something to display (perf)
@ -6741,14 +6694,11 @@ abstract class CommonObject
return 'Error bad setup of extrafield';
}
} else $value = '';
} elseif (preg_match('/^(text|html)/', $type))
{
} elseif (preg_match('/^(text|html)/', $type)) {
$value = dol_htmlentitiesbr($value);
} elseif ($type == 'password')
{
} elseif ($type == 'password') {
$value = preg_replace('/./i', '*', $value);
} elseif ($type == 'array')
{
} elseif ($type == 'array') {
$value = implode('<br>', $value);
}
@ -7381,8 +7331,7 @@ abstract class CommonObject
*/
protected function isArray($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['type']) && $info['type'] == 'array') return true;
else return false;
}
@ -7409,8 +7358,7 @@ abstract class CommonObject
*/
public function isDuration($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['type']) && ($info['type'] == 'duration')) return true;
else return false;
} else return false;
@ -7424,8 +7372,7 @@ abstract class CommonObject
*/
public function isInt($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['type']) && ($info['type'] == 'int' || preg_match('/^integer/i', $info['type']))) return true;
else return false;
} else return false;
@ -7439,8 +7386,7 @@ abstract class CommonObject
*/
public function isFloat($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['type']) && (preg_match('/^(double|real|price)/i', $info['type']))) return true;
else return false;
}
@ -7455,8 +7401,7 @@ abstract class CommonObject
*/
public function isText($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['type']) && $info['type'] == 'text') return true;
else return false;
}
@ -7471,8 +7416,7 @@ abstract class CommonObject
*/
protected function canBeNull($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['notnull']) && $info['notnull'] != '1') return true;
else return false;
}
@ -7487,8 +7431,7 @@ abstract class CommonObject
*/
protected function isForcedToNullIfZero($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['notnull']) && $info['notnull'] == '-1') return true;
else return false;
}
@ -7503,8 +7446,7 @@ abstract class CommonObject
*/
protected function isIndex($info)
{
if (is_array($info))
{
if (is_array($info)) {
if (isset($info['index']) && $info['index'] == true) return true;
else return false;
}
@ -7591,8 +7533,7 @@ abstract class CommonObject
{
foreach ($this->fields as $field => $info)
{
if ($this->isDate($info))
{
if ($this->isDate($info)) {
if (empty($obj->{$field}) || $obj->{$field} === '0000-00-00 00:00:00' || $obj->{$field} === '1000-01-01 00:00:00') $this->{$field} = 0;
else $this->{$field} = strtotime($obj->{$field});
} elseif ($this->isArray($info))
@ -7604,12 +7545,10 @@ abstract class CommonObject
} else {
$this->{$field} = array();
}
} elseif ($this->isInt($info))
{
} elseif ($this->isInt($info)) {
if ($field == 'rowid') $this->id = (int) $obj->{$field};
else {
if ($this->isForcedToNullIfZero($info))
{
if ($this->isForcedToNullIfZero($info)) {
if (empty($obj->{$field})) $this->{$field} = null;
else $this->{$field} = (double) $obj->{$field};
} else {
@ -7620,10 +7559,8 @@ abstract class CommonObject
}
}
}
} elseif ($this->isFloat($info))
{
if ($this->isForcedToNullIfZero($info))
{
} elseif ($this->isFloat($info)) {
if ($this->isForcedToNullIfZero($info)) {
if (empty($obj->{$field})) $this->{$field} = null;
else $this->{$field} = (double) $obj->{$field};
} else {

View File

@ -2038,7 +2038,7 @@ class ExtraFields
$value_arr = GETPOST("options_".$key, 'alpha');
$value_key = price2num($value_arr);
} elseif (in_array($key_type, array('html'))) {
$value_key = GETPOST("options_".$key, 'alpha');
$value_key = GETPOST("options_".$key, 'restricthtml');
} elseif (in_array($key_type, array('text'))) {
$value_key = GETPOST("options_".$key, 'alphanohtml');
} else {

View File

@ -1463,10 +1463,10 @@ class Form
}
// We search third parties
$sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste";
if ($showsoc > 0) $sql .= " , s.nom as company";
$sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste, sp.email, sp.phone, sp.phone_perso, sp.phone_mobile, sp.town AS contact_town";
if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql .= ", s.nom as company, s.town AS company_town";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
if ($showsoc > 0) $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=sp.fk_soc";
if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=sp.fk_soc";
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
if ($socid > 0 || $socid == -1) $sql .= " AND sp.fk_soc=".$socid;
if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql .= " AND sp.statut <> 0";
@ -1499,6 +1499,28 @@ class Form
{
$obj = $this->db->fetch_object($resql);
// Set email (or phones) and town extended infos
$extendedInfos = '';
if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
$extendedInfos = array();
$email = trim($obj->email);
if (!empty($email)) $extendedInfos[] = $email;
else {
$phone = trim($obj->phone);
$phone_perso = trim($obj->phone_perso);
$phone_mobile = trim($obj->phone_mobile);
if (!empty($phone)) $extendedInfos[] = $phone;
if (!empty($phone_perso)) $extendedInfos[] = $phone_perso;
if (!empty($phone_mobile)) $extendedInfos[] = $phone_mobile;
}
$contact_town = trim($obj->contact_town);
$company_town = trim($obj->company_town);
if (!empty($contact_town)) $extendedInfos[] = $contact_town;
elseif (!empty($company_town)) $extendedInfos[] = $company_town;
$extendedInfos = implode(' - ', $extendedInfos);
if (!empty($extendedInfos)) $extendedInfos = ' - ' . $extendedInfos;
}
$contactstatic->id = $obj->rowid;
$contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname;
@ -1513,7 +1535,7 @@ class Form
$out .= '<option value="'.$obj->rowid.'"';
if ($disabled) $out .= ' disabled';
$out .= ' selected>';
$out .= $contactstatic->getFullName($langs);
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
$out .= '</option>';
@ -1521,7 +1543,7 @@ class Form
$out .= '<option value="'.$obj->rowid.'"';
if ($disabled) $out .= ' disabled';
$out .= '>';
$out .= $contactstatic->getFullName($langs);
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
$out .= '</option>';
@ -1529,7 +1551,7 @@ class Form
} else {
if (in_array($obj->rowid, $selected))
{
$out .= $contactstatic->getFullName($langs);
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
}
@ -4384,7 +4406,7 @@ class Form
</script>';
$formconfirm .= "<!-- end ajax formconfirm -->\n";
} else {
$formconfirm .= "\n<!-- begin formconfirm page=".$page." -->\n";
$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
if (empty($disableformtag)) $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
@ -4415,7 +4437,7 @@ class Form
$formconfirm .= '<td class="valid">';
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice);
$formconfirm .= '</td>';
$formconfirm .= '<td class="valid center"><input class="button valignmiddle" type="submit" value="'.$langs->trans("Validate").'"></td>';
$formconfirm .= '<td class="valid center"><input class="button valignmiddle confirmvalidatebutton" type="submit" value="'.$langs->trans("Validate").'"></td>';
$formconfirm .= '</tr>'."\n";
$formconfirm .= '</table>'."\n";
@ -4423,6 +4445,23 @@ class Form
if (empty($disableformtag)) $formconfirm .= "</form>\n";
$formconfirm .= '<br>';
if (empty($conf->use_javascript_ajax)) {
$formconfirm .= '<!-- code to disable button to avoid double clic -->';
$formconfirm .= '<script type="text/javascript">'."\n";
$formconfirm .= '
$(document).ready(function () {
$(".confirmvalidatebutton").on("click", function() {
console.log("We click on button");
$(this).attr("disabled", "disabled");
setTimeout(\'$(".confirmvalidatebutton").removeAttr("disabled")\', 3000);
//console.log($(this).closest("form"));
$(this).closest("form").submit();
});
});
';
$formconfirm .= '</script>'."\n";
}
$formconfirm .= "<!-- end formconfirm -->\n";
}

View File

@ -3190,7 +3190,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building',
'cash-register', 'category', 'check', 'clock', 'close_title', 'company', 'contact', 'contract', 'cubes',
'delete', 'dolly', 'dollyrevert', 'donation', 'edit', 'ellipsis-h', 'email', 'external-link-alt', 'external-link-square-alt',
'delete', 'dolly', 'dollyrevert', 'donation', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
'help', 'holiday',
'intervention', 'label', 'language', 'list', 'listlight', 'lot',
@ -5525,23 +5525,25 @@ function yn($yesno, $case = 1, $color = 0)
/**
* Return a path to have a the directory according to object where files are stored.
* New usage: $conf->module->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart)
* or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, $modulepart) if multidir_output not defined.
* New usage: $conf->module->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, '')
* or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, '') if multidir_output not defined.
* Example our with new usage: $object is invoice -> 'INYYMM-ABCD'
* Example our with old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/"
*
* @param string $num Id of object (deprecated, $object will be used in future)
* @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future)
* @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). (deprecated, global option will be used in future)
* @param int $withoutslash 0=With slash at end (except if '/', we return ''), 1=without slash at end
* @param Object $object Object
* @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...')
* @return string Dir to use ending. Example '' or '1/' or '1/2/'
* @param string|int $num Id of object (deprecated, $object will be used in future)
* @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future)
* @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). (deprecated, global option will be used in future)
* @param int $withoutslash 0=With slash at end (except if '/', we return ''), 1=without slash at end
* @param Object $object Object to use to get ref to forge the path.
* @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...'). Use '' for autodetect from $object.
* @return string Dir to use ending. Example '' or '1/' or '1/2/'
*/
function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart)
function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '')
{
global $conf;
if (empty($modulepart) && !empty($object->module)) $modulepart = $object->module;
$path = '';
$arrayforoldpath = array('cheque', 'user', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment');
@ -5556,14 +5558,12 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart)
if ($level == 2) $path = substr($num, 1, 1).'/'.substr($num, 0, 1);
if ($level == 3) $path = substr($num, 2, 1).'/'.substr($num, 1, 1).'/'.substr($num, 0, 1);
} else {
// TODO
// We will enhance here a common way of forging path for document storage
// Here, object->id, object->ref and modulepart are required.
// We will enhance here a common way of forging path for document storage.
// In a future, we may distribut directories on several levels depending on setup and object.
// Here, $object->id, $object->ref and $modulepart are required.
//var_dump($modulepart);
if (in_array($modulepart, array('thirdparty', 'contact', 'member', 'propal', 'proposal', 'commande', 'order', 'facture', 'invoice',
'supplier_order', 'supplier_proposal', 'shipment', 'contract', 'expensereport', 'ficheinter')))
{
$path = ($object->ref ? $object->ref : $object->id);
if (! in_array($modulepart, array('product'))) { // Test to remove
$path = dol_sanitizeFileName(empty($object->ref) ? $object->id : $object->ref);
}
}
@ -6260,12 +6260,12 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '');
$birthday = dol_print_date($object->birth, 'day');
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '')) : '');
if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0)
{
$birthday = (empty($object->birth) ? '': dol_print_date($object->birth, 'day'));
$substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : '');
if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel();
$substitutionarray['__MEMBER_FIRSTNAME__'] = (isset($object->firstname) ? $object->firstname : '');
@ -6660,6 +6660,14 @@ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object
}
}
}
if (!empty($conf->global->ODT_ENABLE_ALL_TAGS_IN_SUBSTITUTIONS)) {
// to list all tags in odt template
$tags = '';
foreach ($substitutionarray as $key => $value) {
$tags .= '{' . $key . '} => ' . $value ."\n";
}
$substitutionarray = array_merge($substitutionarray, array('__ALL_TAGS__' => $tags));
}
}
/**

View File

@ -90,16 +90,6 @@ function product_prepare_head($object)
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/product/stats/card.php?id=".$object->id;
$head[$h][1] = $langs->trans('Statistics');
$head[$h][2] = 'stats';
$h++;
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?showmessage=1&id=".$object->id;
$head[$h][1] = $langs->trans('Referers');
$head[$h][2] = 'referers';
$h++;
if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) {
global $db;
@ -149,6 +139,16 @@ function product_prepare_head($object)
}
}
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?showmessage=1&id=".$object->id;
$head[$h][1] = $langs->trans('Referers');
$head[$h][2] = 'referers';
$h++;
$head[$h][0] = DOL_URL_ROOT."/product/stats/card.php?id=".$object->id;
$head[$h][1] = $langs->trans('Statistics');
$head[$h][2] = 'stats';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -741,7 +741,7 @@ class pdf_einstein extends ModelePDFCommandes
}*/
// Show planed date of delivery
if (!empty($object->date_livraison))
if (!empty($object->delivery_date))
{
$outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2);
@ -750,7 +750,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true);
$dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1;

View File

@ -958,7 +958,7 @@ class pdf_eratosthene extends ModelePDFCommandes
}*/
// Show planed date of delivery
if (!empty($object->date_livraison))
if (!empty($object->delivery_date))
{
$outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2);
@ -967,7 +967,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true);
$dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1;

View File

@ -139,7 +139,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder
return 0;
}
$numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->date_livraison);
$numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->delivery_date);
return $numFinal;
}

View File

@ -322,11 +322,6 @@ class doc_generic_member_odt extends ModelePDFMember
$tmparray = array_merge($array_member, $array_soc, $array_thirdparty, $array_other, $array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
$tags = '';
foreach ($tmparray as $key => $value) {
$tags .= '{' . $key . '} => ' . $value ."\n";
}
$tmparray = array_merge($tmparray, array('__ALL_TAGS__' => $tags));
// Call the ODTSubstitution hook
$parameters = array(
'file'=>$file,
@ -352,12 +347,10 @@ class doc_generic_member_odt extends ModelePDFMember
// Replace labels translated
$tmparray = $outputlangs->get_translations_for_substitutions();
foreach ($tmparray as $key=>$value)
{
foreach ($tmparray as $key=>$value) {
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
} catch (OdfException $e)
{
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_WARNING);
}
}

View File

@ -870,7 +870,7 @@ class pdf_azur extends ModelePDFPropales
$posxval = 52;
// Show shipping date
if (!empty($object->date_livraison))
if (!empty($object->delivery_date))
{
$outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2);
@ -879,7 +879,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true);
$dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1;

View File

@ -1006,7 +1006,7 @@ class pdf_cyan extends ModelePDFPropales
$posxval = 52;
// Show shipping date
if (!empty($object->date_livraison))
if (!empty($object->delivery_date))
{
$outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2);
@ -1015,7 +1015,7 @@ class pdf_cyan extends ModelePDFPropales
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true);
$dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1;

View File

@ -1276,11 +1276,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetTextColor(0, 0, 60);
$usehourmin = 'day';
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour';
if (!empty($object->date_livraison))
if (!empty($object->delivery_date))
{
$posy += 4;
$pdf->SetXY($posx - 90, $posy);
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R');
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->delivery_date, $usehourmin, false, $outputlangs, true), '', 'R');
}
if ($object->thirdparty->code_fournisseur)

View File

@ -1190,11 +1190,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetTextColor(0, 0, 60);
$usehourmin = 'day';
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour';
if (!empty($object->date_livraison))
if (!empty($object->delivery_date))
{
$posy += 4;
$pdf->SetXY($posx - 90, $posy);
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R');
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->delivery_date, $usehourmin, false, $outputlangs, true), '', 'R');
}
if ($object->thirdparty->code_fournisseur)

View File

@ -724,7 +724,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$posxval = 52;
// Show shipping date
if (!empty($object->date_livraison))
if (!empty($object->delivery_date))
{
$outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2);
@ -733,7 +733,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true);
$dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1;
@ -745,7 +745,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
//$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true);
//$dlp=dol_print_date($object->delivery_date,"daytext",false,$outputlangs,true);
$pdf->MultiCell(80, 4, '', 0, 'L');
$posy = $pdf->GetY() + 1;
@ -1325,7 +1325,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->date_livraison, "day", false, $outputlangs, true), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->delivery_date, "day", false, $outputlangs, true), '', 'R');
*/
if ($object->thirdparty->code_fournisseur)

View File

@ -153,7 +153,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname', 'alpha'); ?>"> <span class="opacitymedium">(<?php echo $langs->trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)</span></td></tr>
<!-- Type -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
<?php print $form->selectarray('type', $type2label, GETPOST('type', 'alpha')); ?>
<?php print $form->selectarray('type', $type2label, GETPOST('type', 'alpha'), 0, 0, 0, '', 0, 0, 0, '', '', 1); ?>
</td></tr>
<!-- Size -->
<tr class="extra_size"><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size', 'alpha') ?GETPOST('size', 'alpha') : ''); ?>"></td></tr>

View File

@ -205,7 +205,8 @@ $typewecanchangeinto = array(
'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'),
'url'=>array('varchar', 'phone', 'mail', 'url', 'select'),
'phone'=>array('varchar', 'phone', 'mail', 'url', 'select'),
'select'=>array('varchar', 'phone', 'mail', 'url', 'select')
'select'=>array('varchar', 'phone', 'mail', 'url', 'select'),
'date'=>array('date', 'datetime')
);
/* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert
if ($size <= 255 && in_array($type, array('text', 'html'))) {
@ -224,6 +225,7 @@ if (in_array($type, array_keys($typewecanchangeinto)))
else print '<option value="'.$key.'" disabled="disabled"'.$selected.'>'.$val.'</option>';
}
print '</select>';
print ajax_combobox('type');
} else {
print $type2label[$type];
print '<input type="hidden" name="type" id="type" value="'.$type.'">';

View File

@ -693,7 +693,8 @@ if (!empty($usemargins) && $user->rights->margins->creer)
$("#buying_price").val("").show();
/* Call post to load content of combo list fournprice_predef */
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', { 'idprod': $(this).val(), 'token': '<?php echo newToken(); ?>' }, function(data) {
var token = '<?php echo currentToken(); ?>'; // For AJAX Call we use old 'token' and not 'newtoken'
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', { 'idprod': $(this).val(), 'token': token }, function(data) {
if (data && data.length > 0)
{
var options = ''; var defaultkey = ''; var defaultprice = ''; var bestpricefound = 0;

View File

@ -434,7 +434,8 @@ jQuery(document).ready(function()
});
/* Init field buying_price and fournprice */
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product ? $line->fk_product : 0; ?>, 'token': '<?php echo newToken(); ?>'}, function(data) {
var token = '<?php echo currentToken(); ?>'; // For AJAX Call we use old 'token' and not 'newtoken'
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product ? $line->fk_product : 0; ?>, 'token': token }, function(data) {
if (data && data.length > 0) {
var options = '';
var trouve=false;

View File

@ -105,6 +105,8 @@ $hookmanager->initHooks(array('expeditioncard', 'globalcard'));
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
//var_dump($object->lines[0]->detail_batch);
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
/*
* Actions
@ -201,8 +203,6 @@ if (empty($reshook))
$object->size_units = GETPOST('size_units', 'int');
$object->weight_units = GETPOST('weight_units', 'int');
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
// We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver
$classname = ucfirst($object->origin);
$objectsrc = new $classname($db);
@ -936,8 +936,7 @@ if ($action == 'create')
// Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">';
//print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed.
$date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "</td>\n";
print '</tr>';
@ -1048,7 +1047,7 @@ if ($action == 'create')
$i++;
}
print '});
jQuery("#autoreset").click(function() {';
jQuery("#autoreset").click(function() { console.log("Reset values to 0"); ';
$i = 0;
while ($i < $numAsked)
{
@ -1076,12 +1075,12 @@ if ($action == 'create')
print '<td class="center">'.$langs->trans("QtyToShip");
if (empty($conf->productbatch->enabled))
{
print '<br><a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
print '<br><a href="#" id="autofill" class="opacitymedium link cursor cursorpointer">'.$langs->trans("Fill").'</a>';
print ' / ';
} else {
print '<br>';
}
print '<a href="#" id="autoreset">'.$langs->trans("Reset").'</a>';
print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Reset"), 'eraser').'</span>';
print '</td>';
if (!empty($conf->stock->enabled))
{
@ -1115,7 +1114,7 @@ if ($action == 'create')
if (!empty($line->date_start)) $type = 1;
if (!empty($line->date_end)) $type = 1;
print '<!-- line '.$line->rowid.' for product -->'."\n";
print '<!-- line '.$line->id.' for product -->'."\n";
print '<tr class="oddeven">'."\n";
// Product label
@ -1126,13 +1125,16 @@ if ($action == 'create')
//var_dump($product->stock_warehouse[1]);
print '<td>';
print '<a name="'.$line->rowid.'"></a>'; // ancre pour retourner sur la ligne
print '<a name="'.$line->id.'"></a>'; // ancre pour retourner sur la ligne
// Show product and description
$product_static->type = $line->fk_product_type;
$product_static->id = $line->fk_product;
$product_static->ref = $line->ref;
$product_static->status = $line->product_tosell;
$product_static->status_buy = $line->product_tobuy;
$product_static->status_batch = $line->product_tobatch;
$text = $product_static->getNomUrl(1);
$text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label);
$description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($line->desc));
@ -2049,7 +2051,7 @@ if ($action == 'create')
$sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot";
$sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition";
//if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
$sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
$sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch';
$sql .= ', p.description as product_desc';
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql .= ", ".MAIN_DB_PREFIX."expedition as e";
@ -2076,7 +2078,10 @@ if ($action == 'create')
if ($obj)
{
// $obj->rowid is rowid in $origin."det" table
$alreadysent[$obj->rowid][$obj->shipmentline_id] = array('shipment_ref'=>$obj->shipment_ref, 'shipment_id'=>$obj->shipment_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped, 'date_valid'=>$db->jdate($obj->date_valid), 'date_delivery'=>$db->jdate($obj->date_delivery));
$alreadysent[$obj->rowid][$obj->shipmentline_id] = array(
'shipment_ref'=>$obj->shipment_ref, 'shipment_id'=>$obj->shipment_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped,
'product_tosell'=>$obj->product_tosell, 'product_tobuy'=>$obj->product_tobuy, 'product_tobatch'=>$obj->product_tobatch,
'date_valid'=>$db->jdate($obj->date_valid), 'date_delivery'=>$db->jdate($obj->date_delivery));
}
$i++;
}
@ -2085,6 +2090,7 @@ if ($action == 'create')
}
print '<tbody>';
// Loop on each product to send/sent
for ($i = 0; $i < $num_prod; $i++)
{
@ -2120,6 +2126,8 @@ if ($action == 'create')
$product_static->type = $lines[$i]->fk_product_type;
$product_static->id = $lines[$i]->fk_product;
$product_static->ref = $lines[$i]->ref;
$product_static->status = $lines[$i]->product_tosell;
$product_static->status_buy = $lines[$i]->product_tobuy;
$product_static->status_batch = $lines[$i]->product_tobatch;
$product_static->weight = $lines[$i]->weight;

View File

@ -619,10 +619,8 @@ class Expedition extends CommonObject
// Tracking url
$this->getUrlTrackingStatus($obj->tracking_number);
/*
* Thirdparty
*/
$result = $this->fetch_thirdparty();
// Thirdparty
$result = $this->fetch_thirdparty(); // TODO Remove this
// Retrieve extrafields
$this->fetch_optionals();
@ -919,6 +917,7 @@ class Expedition extends CommonObject
$line->entrepot_id = $entrepot_id;
$line->origin_line_id = $id;
$line->fk_origin_line = $id;
$line->qty = $qty;
$orderline = new OrderLine($this->db);
@ -931,31 +930,37 @@ class Expedition extends CommonObject
{
$fk_product = $orderline->fk_product;
if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS))
{
if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorWarehouseRequiredIntoShipmentLine");
return -1;
}
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT)
{
// Check must be done for stock of product into warehouse if $entrepot_id defined
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) {
$product = new Product($this->db);
$result = $product->fetch($fk_product);
$product->fetch($fk_product);
// Check must be done for stock of product into warehouse if $entrepot_id defined
if ($entrepot_id > 0) {
$product->load_stock('warehouseopen');
$product_stock = $product->stock_warehouse[$entrepot_id]->real;
} else $product_stock = $product->stock_reel;
} else {
$product_stock = $product->stock_reel;
}
$product_type = $product->type;
if ($product_type == 0 && $product_stock < $qty)
{
$langs->load("errors");
$this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnShipment', $product->ref);
$this->db->rollback();
return -3;
if ($product_type == 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
$isavirtualproduct = ($product->hasFatherOrChild(1) > 0);
// The product is qualified for a check of quantity (must be enough in stock to be added into shipment).
if (!$isavirtualproduct || empty($conf->global->PRODUIT_SOUSPRODUITS) || ($isavirtualproduct && empty($conf->global->STOCK_EXCLUDE_VIRTUAL_PRODUCTS))) { // If STOCK_EXCLUDE_VIRTUAL_PRODUCTS is set, we do not manage stock for kits/virtual products.
if ($product_stock < $qty) {
$langs->load("errors");
$this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnShipment', $product->ref);
$this->errorhidden = 'ErrorStockIsNotEnoughToAddProductOnShipment';
$this->db->rollback();
return -3;
}
}
}
}
}
@ -1576,7 +1581,7 @@ class Expedition extends CommonObject
$sql .= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc, cd.rang";
$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.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch";
$sql .= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch";
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product";
$sql .= " WHERE ed.fk_expedition = ".$this->id;
@ -1638,6 +1643,8 @@ class Expedition extends CommonObject
$line->product_ref = $obj->product_ref;
$line->product_label = $obj->product_label;
$line->libelle = $obj->product_label; // TODO deprecated
$line->product_tosell = $obj->product_tosell;
$line->product_tobuy = $obj->product_tobuy;
$line->product_tobatch = $obj->product_tobatch;
$line->label = $obj->custom_label;
$line->description = $obj->description;

View File

@ -212,7 +212,7 @@ llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
$sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,";
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,";
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -618,6 +618,7 @@ if ($resql)
$object = new Expedition($db);
$object->fetch($obj->rowid);
print '<tr class="oddeven">';
// Ref
@ -705,7 +706,7 @@ if ($resql)
if (!empty($arrayfields['e.date_delivery']['checked']))
{
print '<td class="center">';
print dol_print_date($db->jdate($obj->date_livraison), "dayhour");
print dol_print_date($db->jdate($obj->delivery_date), "dayhour");
/*$now = time();
if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 )
{

View File

@ -354,7 +354,7 @@ if ($id > 0 || !empty($ref))
print '<tr><td>'.$langs->trans('Date').'</td>';
print '<td colspan="2">';
print dol_print_date($object->date, 'day');
if ($object->hasDelay() && empty($object->date_livraison)) {
if ($object->hasDelay() && empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
print '</td>';
@ -374,12 +374,12 @@ if ($id > 0 || !empty($ref))
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdatedelivery">';
print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
print dol_print_date($object->date_livraison, 'dayhour');
if ($object->hasDelay() && !empty($object->date_livraison)) {
print dol_print_date($object->delivery_date, 'dayhour');
if ($object->hasDelay() && !empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
}

View File

@ -9,7 +9,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -121,7 +121,7 @@ class CommandeFournisseur extends CommonOrder
public $date_livraison;
/**
* Delivery date
* @var int Date expected for delivery
*/
public $delivery_date;
@ -132,16 +132,6 @@ class CommandeFournisseur extends CommonOrder
public $total_ttc;
public $source;
/**
* @deprecated
* @see $note_private, $note_public
*/
public $note;
public $note_private;
public $note_public;
public $model_pdf;
/**
* @var int ID
*/
@ -375,7 +365,7 @@ class CommandeFournisseur extends CommonOrder
$this->date_approve = $this->db->jdate($obj->date_approve);
$this->date_approve2 = $this->db->jdate($obj->date_approve2);
$this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier
$this->date_livraison = $this->db->jdate($obj->delivery_date);
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->remise_percent = $obj->remise_percent;
$this->methode_commande_id = $obj->fk_input_method;
@ -778,16 +768,24 @@ class CommandeFournisseur extends CommonOrder
if (isset($this->statut)) {
$label .= ' '.$this->getLibStatut(5);
}
if (!empty($this->ref))
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_supplier))
}
if (!empty($this->ref_supplier)) {
$label .= '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
if (!empty($this->total_ht))
}
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_tva))
}
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_ttc))
}
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->delivery_date)) {
$label .= '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
}
}
$picto = 'order';
@ -1257,9 +1255,10 @@ class CommandeFournisseur extends CommonOrder
$error = 0;
$now = dol_now();
// $date_commande is deprecated
// set tmp vars
$date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set
if (empty($date)) $date = $now;
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// Clean parameters
if (empty($this->source)) $this->source = 0;
@ -1308,7 +1307,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= ", ".$this->socid;
$sql .= ", ".($this->fk_project > 0 ? $this->fk_project : "null");
$sql .= ", '".$this->db->idate($date)."'";
$sql .= ", ".($this->date_livraison ? "'".$this->db->idate($this->date_livraison)."'" : "null");
$sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null");
$sql .= ", ".$user->id;
$sql .= ", ".self::STATUS_DRAFT;
$sql .= ", ".$this->db->escape($this->source);
@ -2925,7 +2924,7 @@ class CommandeFournisseur extends CommonOrder
{
$response->nbtodo++;
$commandestatic->date_livraison = $this->db->jdate($obj->delivery_date);
$commandestatic->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$commandestatic->delivery_date = $this->db->jdate($obj->delivery_date);
$commandestatic->date_commande = $this->db->jdate($obj->date_commande);
$commandestatic->statut = $obj->fk_statut;
@ -3079,10 +3078,10 @@ class CommandeFournisseur extends CommonOrder
{
global $conf;
if (empty($this->date_delivery) && !empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility
if (empty($this->delivery_date) && !empty($this->date_livraison)) $this->delivery_date = $this->date_livraison; // For backward compatibility
$now = dol_now();
$date_to_test = empty($this->date_delivery) ? $this->date_commande : $this->date_delivery;
$date_to_test = empty($this->delivery_date) ? $this->date_commande : $this->delivery_date;
return ($this->statut > 0 && $this->statut < 5) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay);
}
@ -3096,10 +3095,13 @@ class CommandeFournisseur extends CommonOrder
{
global $conf, $langs;
if (empty($this->date_delivery) && !empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility
if (empty($this->delivery_date) && !empty($this->date_livraison)) $this->delivery_date = $this->date_livraison; // For backward compatibility
if (empty($this->date_delivery)) $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day');
else $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->date_delivery, 'day');
if (empty($this->delivery_date)) {
$text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day');
} else {
$text = $langs->trans("DeliveryDate").' '.dol_print_date($this->delivery_date, 'day');
}
$text .= ' '.($conf->commande->fournisseur->warning_delay > 0 ? '+' : '-').' '.round(abs($conf->commande->fournisseur->warning_delay) / 3600 / 24, 1).' '.$langs->trans("days").' < '.$langs->trans("Today");
return $text;

View File

@ -1145,7 +1145,7 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int');
$object->note_private = GETPOST('note_private', 'restricthtml');
$object->note_public = GETPOST('note_public', 'restricthtml');
$object->date_livraison = $datelivraison;
$object->date_livraison = $datelivraison; // deprecated
$object->delivery_date = $datelivraison;
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
@ -1200,7 +1200,8 @@ if (empty($reshook))
$result = $srcobject->fetch($object->origin_id);
if ($result > 0)
{
$object->setDeliveryDate($user, $srcobject->date_livraison);
$tmpdate = ($srcobject->delivery_date ? $srcobject->delivery_date : $srcobject->date_livraison);
$object->setDeliveryDate($user, $tmpdate);
$object->set_id_projet($user, $srcobject->fk_project);
$lines = $srcobject->lines;
@ -1552,7 +1553,7 @@ if ($action == 'create')
$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '';
$datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : '');
$datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''));
if (!empty($conf->multicurrency->enabled))
{
@ -2161,14 +2162,14 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="setdate_livraison">';
$usehourmin = 0;
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 1;
print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison");
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
$usehourmin = 'day';
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour';
print $object->date_livraison ? dol_print_date($object->date_livraison, $usehourmin) : '&nbsp;';
if ($object->hasDelay() && !empty($object->date_livraison)) {
print $object->delivery_date ? dol_print_date($object->delivery_date, $usehourmin) : '&nbsp;';
if ($object->hasDelay() && !empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
}

View File

@ -64,7 +64,7 @@ if (!$sortfield) $sortfield = "position_name";
$object = new Holiday($db);
$object->fetch($id, $ref);
$upload_dir = $conf->holiday->dir_output.'/'.get_exdir($object->id, 0, 0, 0, $object, 'holiday').dol_sanitizeFileName($object->ref);
$upload_dir = $conf->holiday->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, '');
$modulepart = 'holiday';

View File

@ -2068,8 +2068,8 @@ function migrate_commande_livraison($db, $langs, $conf)
$db->begin();
$sql = "SELECT l.rowid, l.fk_commande";
$sql .= ", c.ref_client, c.date_livraison";
$sql = "SELECT l.rowid, l.fk_commande,";
$sql .= " c.ref_client, c.date_livraison as delivery_date";
$sql .= " FROM ".MAIN_DB_PREFIX."livraison as l, ".MAIN_DB_PREFIX."commande as c";
$sql .= " WHERE c.rowid = l.fk_commande";
$resql = $db->query($sql);
@ -2090,7 +2090,7 @@ function migrate_commande_livraison($db, $langs, $conf)
if ($resql2)
{
$delivery_date = $db->jdate($obj->date_livraison);
$delivery_date = $db->jdate($obj->delivery_date);
$sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET";
$sqlu .= " ref_client='".$db->escape($obj->ref_client)."'";
@ -3007,7 +3007,7 @@ function migrate_customerorder_shipping($db, $langs, $conf)
if ($db->query($sqlAdd1) && $db->query($sqlAdd2))
{
$sqlSelect = "SELECT e.rowid as shipping_id, c.ref_client, c.date_livraison";
$sqlSelect = "SELECT e.rowid as shipping_id, c.ref_client, c.date_livraison as delivery_date";
$sqlSelect .= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sqlSelect .= ", ".MAIN_DB_PREFIX."element_element as el";
$sqlSelect .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON c.rowid = el.fk_source AND el.sourcetype = 'commande'";
@ -3028,7 +3028,7 @@ function migrate_customerorder_shipping($db, $langs, $conf)
$sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."expedition SET";
$sqlUpdate .= " ref_customer = '".$db->escape($obj->ref_client)."'";
$sqlUpdate .= ", date_delivery = '".$db->escape($obj->date_livraison ? $obj->date_livraison : 'null')."'";
$sqlUpdate .= ", date_delivery = '".$db->escape($obj->delivery_date ? $obj->delivery_date : 'null')."'";
$sqlUpdate .= " WHERE rowid = ".$obj->shipping_id;
$result = $db->query($sqlUpdate);

View File

@ -1314,6 +1314,7 @@ PHPModuleLoaded=PHP component %s is loaded
PreloadOPCode=Preloaded OPCode is used
AddRefInList=Display Customer/Vendor ref. info list (select list or combobox) and most of hyperlink.<br>Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp".
AddAdressInList=Display Customer/Vendor adress info list (select list or combobox)<br>Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp".
AddEmailPhoneTownInContactList=Display Contact email (or phones if not defined) and town info list (select list or combobox)<br>Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand".
AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties.
FieldEdition=Edition of field %s
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)

View File

@ -111,7 +111,7 @@ Refund=Refund
SocialContributionsPayments=Social/fiscal taxes payments
ShowVatPayment=Show VAT payment
TotalToPay=Total to pay
BalanceVisibilityDependsOnSortAndFilters=Balance is visible in this list only if table is sorted ascending on %s and filtered for 1 bank account
BalanceVisibilityDependsOnSortAndFilters=Balance is visible in this list only if table is sorted on %s and filtered on 1 bank account (with no other filters)
CustomerAccountancyCode=Customer accounting code
SupplierAccountancyCode=Vendor accounting code
CustomerAccountancyCodeShort=Cust. account. code

View File

@ -32,7 +32,7 @@ IntracommReportTitle=Preparation of an XML file in ProDouane format
# List
IntracommReportList=List of generated declarations
IntracommReportNumber=Numero of declaration
IntracommReportPeriod=Period of nalysis
IntracommReportPeriod=Period of analysis
IntracommReportTypeDeclaration=Type of declaration
IntracommReportDownload=download XML file

View File

@ -197,6 +197,7 @@ ReOpen=Re-Open
Upload=Upload
ToLink=Link
Select=Select
SelectAll=Select all
Choose=Choose
Resize=Resize
ResizeOrCrop=Resize or Crop

View File

@ -167,8 +167,10 @@ BuyingPrices=Buying prices
CustomerPrices=Customer prices
SuppliersPrices=Vendor prices
SuppliersPricesOfProductsOrServices=Vendor prices (of products or services)
CustomCode=Customs / Commodity / HS code
CustomCode=Customs|Commodity|HS code
CountryOrigin=Origin country
RegionStateOrigin=Region origin
StateOrigin=State|Province origin
Nature=Nature of product (material/finished)
NatureOfProductShort=Nature of product
NatureOfProductDesc=Raw material or finished product

View File

@ -1276,6 +1276,7 @@ PHPModuleLoaded=Le composant PHP %s est chargé
PreloadOPCode=Le code OP préchargé est utilisé
AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables.<br>Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp".
AddAdressInList=Affiche les informations sur ladresse du client/fournisseur (liste de sélection ou liste déroulante) <br> Les tiers apparaîtront avec le format de nom suivant: "The Big Company corp. - 21, rue du saut 123456 Big town - USA" au lieu de "The Big Company corp".
AddEmailPhoneTownInContactList=Affiche les informations sur lemail (ou les telephones si non définie) et la ville du contact (liste de sélection ou liste déroulante) <br> Les contacts apparaîtront avec le format de nom suivant: "Dupond Durand - dupond.durand@email.com - Paris" ou "Dupond Durand - 06 07 59 65 66 - Paris" au lieu de "Dupond Durand".
AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les Tiers
FieldEdition=Édition du champ %s
FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export)

View File

@ -988,7 +988,7 @@ if (!defined('NOLOGIN'))
$user->getrights();
}
dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09'));
dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.constant('NOTOKENRENEWAL'));
//Another call for easy debugg
//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));

View File

@ -98,8 +98,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity?$object->entity:$conf->entity] . "/myobject/" . dol_sanitizeFileName($object->id);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".dol_sanitizeFileName($object->ref);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object);
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();

View File

@ -67,8 +67,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity?$object->entity:$conf->entity] . "/mo/" . dol_sanitizeFileName($object->id);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/mo/".dol_sanitizeFileName($object->ref);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/mo/".get_exdir(0, 0, 0, 1, $object);
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();

View File

@ -1175,10 +1175,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// State
if (empty($conf->global->PRODUCT_DISABLE_STATE))
{
if ($conf->browser->layout == 'phone') print '</tr><tr>';
if ($conf->browser->layout == 'phone') print '</tr><tr>';
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
{
print '<td>'.$form->editfieldkey('Region-StateOrigine', 'state_id', '', $object, 0).'</td><td colspan="3">';
print '<td>'.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
} else {
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
}
@ -1186,7 +1186,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print $formcompany->select_state($object->state_id, $object->country_code);
print '</tr>';
}
print '</tr>';
print '</tr>';
}
// Other attributes
@ -1634,7 +1635,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
if ($conf->browser->layout == 'phone') print '</tr><tr>';
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
{
print '<td>'.$form->editfieldkey('Region-StateOrigine', 'state_id', '', $object, 0).'</td><td colspan="3">';
print '<td>'.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
} else {
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
}

View File

@ -3807,11 +3807,11 @@ class Product extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Verifie si c'est un sous-produit
* Check if it is a sub-product into a kit
*
* @param int $fk_parent Id du produit auquel le produit est lie
* @param int $fk_child Id du produit lie
* @return int < 0 si erreur, > 0 si ok
* @param int $fk_parent Id of parent kit product
* @param int $fk_child Id of child product
* @return int <0 if KO, >0 if OK
*/
public function is_sousproduit($fk_parent, $fk_child)
{
@ -3827,6 +3827,7 @@ class Product extends CommonObject
if ($num > 0) {
$obj = $this->db->fetch_object($result);
$this->is_sousproduit_qty = $obj->qty;
$this->is_sousproduit_incdec = $obj->incdec;
@ -4221,17 +4222,26 @@ class Product extends CommonObject
}
/**
* Return all parent products for current product (first level only)
* Count all parent and children products for current product (first level only)
*
* @return int Nb of father + child
* @param int $mode 0=Both parent and child, -1=Parents only, 1=Children only
* @return int Nb of father + child
* @see getFather(), get_sousproduits_arbo()
*/
public function hasFatherOrChild()
public function hasFatherOrChild($mode = 0)
{
$nb = 0;
$sql = "SELECT COUNT(pa.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."product_association as pa";
$sql .= " WHERE pa.fk_product_fils = ".$this->id." OR pa.fk_product_pere = ".$this->id;
if ($mode == 0) {
$sql .= " WHERE pa.fk_product_fils = ".$this->id." OR pa.fk_product_pere = ".$this->id;
} elseif ($mode == -1) {
$sql .= " WHERE pa.fk_product_fils = ".$this->id; // We are a child, so we found lines that link to parents (can have several parents)
} elseif ($mode == 1) {
$sql .= " WHERE pa.fk_product_pere = ".$this->id; // We are a parent, so we found lines that link to children (can have several children)
}
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
@ -4297,6 +4307,7 @@ class Product extends CommonObject
* Return all parent products for current product (first level only)
*
* @return array Array of product
* @see hasFatherOrChild()
*/
public function getFather()
{

View File

@ -170,6 +170,7 @@ if ($id > 0 || !empty($ref))
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER ['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))

View File

@ -111,6 +111,8 @@ $hookmanager->initHooks(array('receptioncard', 'globalcard'));
$permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php
//var_dump($object->lines[0]->detail_batch);
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
/*
* Actions
@ -226,8 +228,6 @@ if (empty($reshook))
$object->size_units = GETPOST('size_units', 'int');
$object->weight_units = GETPOST('weight_units', 'int');
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
// On va boucler sur chaque ligne du document d'origine pour completer objet reception
// avec info diverses + qte a livrer
@ -777,8 +777,7 @@ if ($action == 'create')
// Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">';
//print dol_print_date($object->date_livraison,"day"); // date_livraison come from order and will be stored into date_delivery planed.
$date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "</td>\n";
print '</tr>';

View File

@ -409,7 +409,7 @@ $formfile = new FormFile($db);
$helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:M&oacute;dulo_Receptiones';
llxHeader('', $langs->trans('ListOfReceptions'), $helpurl);
$sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed,";
$sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as delivery_date, l.date_delivery as date_reception2, e.fk_statut, e.billed,";
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -499,21 +499,21 @@ if ($resql)
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
if ($sall) $param .= "&amp;sall=".$sall;
if ($search_ref_rcp) $param .= "&amp;search_ref_rcp=".$search_ref_rcp;
if ($search_ref_liv) $param .= "&amp;search_ref_liv=".$search_ref_liv;
if ($search_company) $param .= "&amp;search_company=".$search_company;
if ($optioncss != '') $param .= '&amp;optioncss='.$optioncss;
if ($search_billed != '' && $search_billed >= 0)$param .= "&amp;search_billed=".$search_billed;
if ($search_town) $param .= "&amp;search_town=".$search_town;
if ($search_zip) $param .= "&amp;search_zip=".$search_zip;
if ($search_state) $param .= "&amp;search_state=".$search_state;
if ($search_status) $param .= "&amp;search_status=".$search_status;
if ($search_country) $param .= "&amp;search_country=".$search_country;
if ($search_type_thirdparty) $param .= "&amp;search_type_thirdparty=".$search_type_thirdparty;
if ($search_ref_supplier) $param .= "&amp;search_ref_supplier=".$search_ref_supplier;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= "&amp;sall=".urlencode($sall);
if ($search_ref_rcp) $param .= "&amp;search_ref_rcp=".urlencode($search_ref_rcp);
if ($search_ref_liv) $param .= "&amp;search_ref_liv=".urlencode($search_ref_liv);
if ($search_company) $param .= "&amp;search_company=".urlencode($search_company);
if ($optioncss != '') $param .= '&amp;optioncss='.urlencode($optioncss);
if ($search_billed != '' && $search_billed >= 0) $param .= "&amp;search_billed=".urlencode($search_billed);
if ($search_town) $param .= "&amp;search_town=".urlencode($search_town);
if ($search_zip) $param .= "&amp;search_zip=".urlencode($search_zip);
if ($search_state) $param .= "&amp;search_state=".urlencode($search_state);
if ($search_status) $param .= "&amp;search_status=".urlencode($search_status);
if ($search_country) $param .= "&amp;search_country=".urlencode($search_country);
if ($search_type_thirdparty) $param .= "&amp;search_type_thirdparty=".urlencode($search_type_thirdparty);
if ($search_ref_supplier) $param .= "&amp;search_ref_supplier=".urlencode($search_ref_supplier);
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
@ -838,7 +838,7 @@ if ($resql)
if (!empty($arrayfields['e.date_delivery']['checked']))
{
print '<td class="center">';
print dol_print_date($db->jdate($obj->date_livraison), "day");
print dol_print_date($db->jdate($obj->delivery_date), "day");
/*$now = time();
if ( ($now - $db->jdate($obj->date_reception)) > $conf->warnings->lim && $obj->statutid == 1 )
{

View File

@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentcandidature/".dol_sanitizeFileName($object->ref);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentcandidature/".get_exdir(0, 0, 0, 1, $object);
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();

View File

@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentjobposition/".dol_sanitizeFileName($object->ref);
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentjobposition/".get_exdir(0, 0, 0, 1, $object);
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();

View File

@ -198,6 +198,18 @@ if ($action == "setaddadressinlist") {
}
}
//Activate Set email phone town in contact list
if ($action == "setaddemailphonetownincontactlist") {
$val = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity);
if (!$res > 0) $error++;
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
//Activate Ask For Preferred Shipping Method
if ($action == "setaskforshippingmet") {
$setaskforshippingmet = GETPOST('value', 'int');
@ -383,7 +395,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers)
} else {
$disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false);
print '<td class="center">';
if (!$disabled) print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodeclient&amp;token='.newToken().'&amp;value='.$file.'">';
if (!$disabled) print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodeclient&amp;token='.newToken().'&amp;value='.urlencode($file).'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
if (!$disabled) print '</a>';
print '</td>';
@ -559,7 +571,7 @@ foreach ($dirsociete as $dirroot)
print "<td class=\"center\">\n";
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
//{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&token='.newToken().'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>';
//}
@ -571,12 +583,12 @@ foreach ($dirsociete as $dirroot)
} else {
if (versioncompare($module->phpmin, versionphparray()) > 0)
{
print "<td class=\"center\">\n";
print '<td class="center">'."\n";
print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", join('.', $module->phpmin))), 'switch_off');
print "</td>";
} else {
print "<td class=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&token='.newToken().'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>";
}
}
@ -599,7 +611,7 @@ foreach ($dirsociete as $dirroot)
print '<td class="center nowrap">';
if ($module->type == 'pdf')
{
$linkspec = '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
$linkspec = '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&token='.newToken().'&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
} else {
$linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
@ -800,6 +812,20 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST))
print '</a></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td width="80%">' . $langs->trans("AddEmailPhoneTownInContactList") . '</td>';
print '<td>&nbsp</td>';
print '<td class="center">';
if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setaddemailphonetownincontactlist&token='.newToken().'&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setaddemailphonetownincontactlist&token='.newToken().'&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
}
print '</a></td>';
print '</tr>';
if (!empty($conf->expedition->enabled)) {
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal)
print '<tr class="oddeven">';

View File

@ -257,7 +257,7 @@ if (empty($reshook))
{
if ($object->fetch(GETPOST('copie_supplier_proposal')) > 0) {
$object->ref = GETPOST('ref');
$object->date_livraison = $date_delivery;
$object->date_livraison = $date_delivery; // deprecated
$object->delivery_date = $date_delivery;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->cond_reglement_id = GETPOST('cond_reglement_id');
@ -1565,11 +1565,11 @@ if ($action == 'create')
print '<form name="editdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" class="formconsumeproduce">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison");
print $form->selectDate($object->delivery_date, 'liv_', '', '', '', "editdate_livraison");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
print dol_print_date($object->date_livraison, 'daytext');
print dol_print_date($object->delivery_date, 'daytext');
}
print '</td>';
print '</tr>';

View File

@ -109,6 +109,12 @@ class SupplierProposal extends CommonObject
*/
public $date;
/**
* @var integer|string date_livraison
* @deprecated
*/
public $date_livraison;
/**
* @var integer|string date_livraison
*/
@ -855,8 +861,6 @@ class SupplierProposal extends CommonObject
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
return -3;
}
// Check parameters
if (!empty($this->ref)) // We check that ref is not already used
{
$result = self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used
@ -869,6 +873,9 @@ class SupplierProposal extends CommonObject
}
}
// Set tmp vars
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// Multicurrency
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now);
if (empty($this->fk_multicurrency))
@ -923,7 +930,7 @@ class SupplierProposal extends CommonObject
$sql .= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'NULL');
$sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL');
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
$sql .= ", ".($this->date_livraison != '' ? "'".$this->db->idate($this->date_livraison)."'" : "null");
$sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".($this->fk_project ? $this->fk_project : "null");
$sql .= ", ".$conf->entity;
@ -1256,7 +1263,7 @@ class SupplierProposal extends CommonObject
$this->datev = $this->db->jdate($obj->datev); // TODO deprecated
$this->date_creation = $this->db->jdate($obj->datec); //Creation date
$this->date_validation = $this->db->jdate($obj->datev); //Validation date
$this->date_livraison = $this->db->jdate($obj->delivery_date);
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
@ -1538,6 +1545,7 @@ class SupplierProposal extends CommonObject
if ($this->db->query($sql))
{
$this->date_livraison = $delivery_date;
$this->delivery_date = $delivery_date;
return 1;
} else {
$this->error = $this->db->error();