';
/*
diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php
index 5bce8045df9..743c1e47c2e 100644
--- a/htdocs/compta/prelevement/card.php
+++ b/htdocs/compta/prelevement/card.php
@@ -86,7 +86,11 @@ if (empty($reshook))
$res = $object->delete($user);
if ($res > 0)
{
- header("Location: index.php");
+ if ($object->type == 'bank-transfer') {
+ header("Location: ".DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php');
+ } else {
+ header("Location: ".DOL_URL_ROOT.'/compta/prelevement/index.php');
+ }
exit;
}
}
diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php
index 6f9144330e1..3b13b867fd7 100644
--- a/htdocs/core/actions_addupdatedelete.inc.php
+++ b/htdocs/core/actions_addupdatedelete.inc.php
@@ -206,7 +206,7 @@ if ($action == "update_extras" && !empty($permissiontoadd))
$object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int'));
//var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit;
} else {
- $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, ' alpha');
+ $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha');
}
$result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 90694f6afb5..711707414a2 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7611,18 +7611,17 @@ abstract class CommonObject
$now = dol_now();
$fieldvalues = $this->setSaveQuery();
-
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now);
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id;
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
if (array_key_exists('ref', $fieldvalues)) $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data
$keys = array();
- $values = array();
+ $values = array(); // Array to store string forged for SQL syntax
foreach ($fieldvalues as $k => $v) {
$keys[$k] = $k;
$value = $this->fields[$k];
- $values[$k] = $this->quote($v, $value);
+ $values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null
}
// Clean and check mandatory
@@ -7632,8 +7631,7 @@ abstract class CommonObject
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key] = '';
if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = '';
- //var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
- if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && !isset($values[$key]) && is_null($this->fields[$key]['default']))
+ if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && (!isset($values[$key]) || $values[$key] === 'NULL') && is_null($this->fields[$key]['default']))
{
$error++;
$this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php
index f54b25731d8..3234b1900f2 100644
--- a/htdocs/core/class/dolreceiptprinter.class.php
+++ b/htdocs/core/class/dolreceiptprinter.class.php
@@ -467,6 +467,26 @@ class dolReceiptPrinter extends Printer
return $error;
}
+ /**
+ * Function to delete a printer template in db
+ *
+ * @param int $templateid Template ID
+ * @return int 0 if OK; >0 if KO
+ */
+ public function deleteTemplate($templateid)
+ {
+ global $conf;
+ $error = 0;
+ $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt_template';
+ $sql .= " WHERE rowid = ".((int) $this->db->escape($templateid));
+ $sql .= " AND entity = ".$conf->entity;
+ $resql = $this->db->query($sql);
+ if (!$resql) {
+ $error++;
+ $this->errors[] = $this->db->lasterror;
+ }
+ return $error;
+ }
/**
* Function to Update a printer template in db
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 3189485ff6c..2a97fac2f8d 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -154,8 +154,8 @@ class ExtraFields
public static $type2label = array(
- 'varchar'=>'String',
- 'text'=>'TextLong',
+ 'varchar'=>'String1Line',
+ 'text'=>'TextLongNLines',
'html'=>'HtmlText',
'int'=>'Int',
'double'=>'Float',
@@ -2025,6 +2025,8 @@ class ExtraFields
$value_key = price2num($value_arr);
} elseif (in_array($key_type, array('html'))) {
$value_key = GETPOST("options_".$key, 'alpha');
+ } elseif (in_array($key_type, array('text'))) {
+ $value_key = GETPOST("options_".$key, 'alphanohtml');
} else {
$value_key = GETPOST("options_".$key);
if (in_array($key_type, array('link')) && $value_key == '-1') $value_key = '';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 2e0bc37069e..41d696d49aa 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2641,9 +2641,9 @@ class Form
$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
if ($virtualstock > 0) {
- $outval .= ' - ';
+ $outval .= '';
} elseif ($virtualstock <= 0) {
- $outval .= ' - ';
+ $outval .= '';
}
$outval .= $virtualstock;
$outval .= '';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 53ea0565ff6..0db2a6e48d3 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -591,7 +591,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
$out = str_replace(array('"', '../'), '', trim($out));
- $out = dol_string_nohtmltag($out, 1);
+ $out = dol_string_nohtmltag($out, 0);
}
break;
case 'restricthtml': // Recommended for most html textarea
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 3113d8a3e65..cfcdd015f1d 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -234,12 +234,14 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
!empty($conf->ficheinter->enabled)
) ? 1 : 0,
'perms'=>(!empty($user->rights->propal->lire) ||
- !empty($user->rights->commande->lire) ||
- !empty($user->rights->fournisseur->lire) ||
- !empty($user->rights->supplier_proposal->lire) ||
- !empty($user->rights->supplier_order->lire) ||
- !empty($user->rights->contrat->lire) ||
- !empty($user->rights->ficheinter->lire)
+ !empty($user->rights->commande->lire) ||
+ !empty($user->rights->fournisseur->lire) ||
+ !empty($user->rights->supplier_proposal->lire) ||
+ !empty($user->rights->supplier_order->lire) ||
+ !empty($user->rights->contrat->lire) ||
+ !empty($user->rights->ficheinter->lire) ||
+ !empty($user->rights->supplier_order->lire) ||
+ !empty($user->rights->fournisseur->commande->lire)
),
'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
);
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
index eaf2c58eb4b..f677197e3df 100644
--- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
@@ -185,8 +185,10 @@ if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_a
?>
trans("LabelOrTranslationKey"); ?>
+
trans("AttributeCode"); ?>
+
trans("Type"); ?>
array('varchar', 'phone', 'mail', 'url', 'select'),
'select'=>array('varchar', 'phone', 'mail', 'url', 'select')
);
+/* 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'))) {
+ $typewecanchangeinto['text'][] = 'varchar';
+}*/
if (in_array($type, array_keys($typewecanchangeinto)))
{
@@ -222,8 +228,10 @@ if (in_array($type, array_keys($typewecanchangeinto)))
}
?>
+
trans("Size"); ?>
+
@@ -244,33 +252,44 @@ if (in_array($type, array_keys($typewecanchangeinto)))
diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php
index 8d09f6840b3..22a6135cd13 100644
--- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php
@@ -40,7 +40,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e
} else {
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
$morecss = '';
- if (in_array($typeofextrafield, array('link', 'sellist'))) $morecss = 'maxwidth200';
+ if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) $morecss = 'maxwidth200';
echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
}
print '';
diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
index 2a7a8963e9f..83a502dbbff 100644
--- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
+++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
@@ -98,7 +98,7 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0;
-ALTER TABLE llx_bom_bomline DROP COLUMN rank;
+ALTER TABLE llx_bom_bomline DROP COLUMN `rank`;
create table llx_categorie_warehouse
(
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 36098ab54c1..4f7e309f18b 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -409,7 +409,9 @@ PriceBaseTypeToChange=Modify on prices with base reference value defined on
MassConvert=Launch bulk conversion
PriceFormatInCurrentLanguage=Price Format In Current Language
String=String
+String1Line=String (1 line)
TextLong=Long text
+TextLongNLines=Long text (n lines)
HtmlText=Html text
Int=Integer
Float=Float
@@ -2008,3 +2010,6 @@ RssNote=Note: Each RSS feed definition provides a widget that you must enable to
JumpToBoxes=Jump to Setup -> Widgets
MeasuringUnitTypeDesc=Use here a value like "size", "surface", "volume", "weight", "time"
MeasuringScaleDesc=The scale is the number of places you have to move the decimal part to match the default reference unit. For "time" unit type, it is the number of seconds. Values between 80 and 99 are reserved values.
+TemplateAdded=Template added
+TemplateUpdated=Template updated
+TemplateDeleted=Template deleted
\ No newline at end of file
diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang
index b755a388f5b..73d8bdaa0df 100644
--- a/htdocs/langs/en_US/cashdesk.lang
+++ b/htdocs/langs/en_US/cashdesk.lang
@@ -119,3 +119,4 @@ NumberOfLinesToShow=Number of lines of images to show
DefineTablePlan=Define tables plan
GiftReceiptButton=Gift receipt button
GiftReceipt=Gift receipt
+ModuleReceiptPrinterMustBeEnabled=Module Receipt printer must have been enabled first
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 33733a8901d..28ca230a56b 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -563,7 +563,7 @@ class Product extends CommonObject
return -1;
}
- if (empty($this->ref)) {
+ if (empty($this->ref) || $this->ref == 'auto') {
// Load object modCodeProduct
$module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
if ($module != 'mod_codeproduct_leopard') // Do not load module file for leopard
@@ -3490,7 +3490,7 @@ class Product extends CommonObject
$sql = "SELECT sum(d.qty), date_format(d.date_valid, '%Y%m')";
if ($mode == 'bynumber') {
- $sql .= ", count(DISTINCT c.rowid)";
+ $sql .= ", count(DISTINCT d.rowid)";
}
$sql .= " FROM ".MAIN_DB_PREFIX."mrp_mo as d LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON d.fk_soc = s.rowid";
if ($filteronproducttype >= 0) {
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index 15ee5c2e52b..869635e02b9 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -657,7 +657,7 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n
$genallowed = $user->rights->stock->lire;
$delallowed = $user->rights->stock->creer;
- print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
+ print $formfile->showdocuments('massfilesarea_stock', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
}
// End of page
diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php
index 3d4bd490dde..b6a06dee9fb 100644
--- a/htdocs/takepos/admin/bar.php
+++ b/htdocs/takepos/admin/bar.php
@@ -105,14 +105,16 @@ print "\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") {
print '