Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-10-19 00:48:52 +02:00
commit a75143842b
27 changed files with 201 additions and 118 deletions

View File

@ -56,9 +56,9 @@ print $langs->trans("SetupDescription2")."<br><br>";
print '<br>'; print '<br>';
//print '<hr style="color: #DDDDDD;">'; //print '<hr style="color: #DDDDDD;">';
print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home'); print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home');
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS))
{ {
$langs->load("errors"); $langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete")); $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>'; print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
} }

View File

@ -776,8 +776,8 @@ if ($id > 0)
{ {
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
$langs->load("bills"); $langs->load("bills");
$langs->load("orders"); $langs->load("orders");
if (! empty($conf->commande->enabled)) if (! empty($conf->commande->enabled))
{ {

View File

@ -1591,9 +1591,6 @@ print '</table><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -1260,9 +1260,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer)
{ {
if ($action == 'addcontact' && $user->rights->commande->creer) if ($action == 'addcontact')
{ {
if ($object->id > 0) if ($object->id > 0)
{ {
@ -1290,7 +1290,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->commande->creer) else if ($action == 'swapstatut')
{ {
if ($object->id > 0) if ($object->id > 0)
{ {
@ -1303,7 +1303,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->commande->creer) else if ($action == 'deletecontact')
{ {
$result = $object->delete_contact($lineid); $result = $object->delete_contact($lineid);
@ -2101,9 +2101,6 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -1629,9 +1629,9 @@ else if ($action == 'remove_file')
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer)
{ {
if ($action == 'addcontact' && $user->rights->facture->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -1661,7 +1661,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->facture->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -1674,7 +1674,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->facture->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact($lineid); $result = $object->delete_contact($lineid);
@ -2980,10 +2980,6 @@ else if ($id > 0 || ! empty($ref))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -486,9 +486,9 @@ else if ($action == 'setnote' && $user->rights->contrat->creer)
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer)
{ {
if ($action == 'addcontact' && $user->rights->contrat->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -518,7 +518,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->contrat->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -531,7 +531,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->contrat->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid')); $result = $object->delete_contact(GETPOST('lineid'));
@ -627,9 +627,9 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("NotePublic").'</td><td valign="top">'; print '<tr><td>'.$langs->trans("NotePublic").'</td><td valign="top">';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('note_public', GETPOST('note_public'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); $doleditor=new DolEditor('note_public', GETPOST('note_public'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70);
print $doleditor->Create(1); print $doleditor->Create(1);
/* /*
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">'; print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
print GETPOST("note_public"); print GETPOST("note_public");
@ -639,9 +639,9 @@ if ($action == 'create')
if (! $user->societe_id) if (! $user->societe_id)
{ {
print '<tr><td>'.$langs->trans("NotePrivate").'</td><td valign="top">'; print '<tr><td>'.$langs->trans("NotePrivate").'</td><td valign="top">';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('note', GETPOST('note'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); $doleditor=new DolEditor('note', GETPOST('note'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70);
print $doleditor->Create(1); print $doleditor->Create(1);
/* /*
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">'; print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
print GETPOST("note"); print GETPOST("note");
@ -814,9 +814,6 @@ else
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
@ -830,7 +827,7 @@ else
} }
$servicepos=(isset($_REQUEST["servicepos"])?$_REQUEST["servicepos"]:1); $servicepos=(GETPOST('servicepos')?GETPOST('servicepos'):1); // FIXME : not used ?
$colorb='666666'; $colorb='666666';
$arrayothercontracts=$object->getListOfContracts('others'); $arrayothercontracts=$object->getListOfContracts('others');

View File

@ -1480,7 +1480,7 @@ class Form
$outval.=$objRef.' ('.$objRefFourn.') - '; $outval.=$objRef.' ('.$objRefFourn.') - ';
$opt.=dol_trunc($objp->label,18).' - '; $opt.=dol_trunc($objp->label,18).' - ';
$outval.=dol_trunc($label,18).' - '; $outval.=dol_trunc($label,18).' - ';
if (! empty($objp->idprodfournprice)) if (! empty($objp->idprodfournprice))
{ {
$currencytext=$langs->trans("Currency".$conf->currency); $currencytext=$langs->trans("Currency".$conf->currency);
@ -1488,24 +1488,28 @@ class Form
if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code
$opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
$outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
$outqty=$objp->quantity; $outqty=$objp->quantity;
$outdiscount=$objp->remise_percent; $outdiscount=$objp->remise_percent;
if ($objp->quantity == 1) if ($objp->quantity == 1)
{ {
$opt.= strtolower($langs->trans("Unit")); $opt.= price($objp->fprice).' '.$currencytext."/";
$outval.=strtolower($langs->transnoentities("Unit")); $outval.= price($objp->fprice).' '.$currencytextnoent."/";
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Unit");
} }
else else
{ {
$opt.= strtolower($langs->trans("Units")); $opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
$outval.=strtolower($langs->transnoentities("Units")); $outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Units");
} }
if ($objp->quantity >= 1) if ($objp->quantity >= 1)
{ {
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".strtolower($langs->trans("Unit")).")"; $opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".strtolower($langs->transnoentities("Unit")).")"; $outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
} }
if ($objp->remise_percent >= 1) if ($objp->remise_percent >= 1)
{ {
@ -1529,13 +1533,22 @@ class Form
$outval.=$langs->transnoentities("NoPriceDefinedForThisSupplier"); $outval.=$langs->transnoentities("NoPriceDefinedForThisSupplier");
} }
$opt .= "</option>\n"; $opt .= "</option>\n";
// Add new entry // Add new entry
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
$outselect.=$opt; $outselect.=$opt;
array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false))); array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false)));
// Exemple of var_dump $outjson
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
// ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false)
//}
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
//$outval=array('label'=>'ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/ Unité (20,00 Euros/unité)');
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
$i++; $i++;
} }
$outselect.='</select>'; $outselect.='</select>';

View File

@ -446,6 +446,30 @@ function dol_escape_htmltag($stringtoescape,$keepb=0)
return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8'); return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
} }
/**
* Convert a string to lower. Never use strtolower because it does not works with UTF8 strings.
*
* @param string $utf8_string String to encode
* @return string String converted
*/
function dol_strtolower($utf8_string)
{
return mb_strtolower($utf8_string, "UTF-8");
}
/**
* Convert a string to upper. Never use strtolower because it does not works with UTF8 strings.
*
* @param string $utf8_string String to encode
* @return string String converted
*/
function dol_strtoupper($utf8_string)
{
return mb_strtoupper($utf8_string, "UTF-8");
}
/** /**
* Write log message into outputs. Possible outputs can be: * Write log message into outputs. Possible outputs can be:
* A file if SYSLOG_FILE_ON defined: file name is then defined by SYSLOG_FILE * A file if SYSLOG_FILE_ON defined: file name is then defined by SYSLOG_FILE

View File

@ -33,7 +33,8 @@ if (! function_exists('json_encode'))
*/ */
function json_encode($elements) function json_encode($elements)
{ {
return dol_json_encode($elements); return 'ttt';
//return dol_json_encode($elements);
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -157,6 +158,25 @@ class modCategorie extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_member = p.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_member = p.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' AND u.type = 3'; // Supplier categories $this->export_sql_end[$r] .=' AND u.type = 3'; // Supplier categories
// Imports
//--------
$r=0;
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="CatList"; // Translation key
$this->import_icon[$r]=$this->picto;
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('ca'=>MAIN_DB_PREFIX.'categorie');
$this->import_fields_array[$r]=array('ca.label'=>"Label*",
'ca.type'=>"Type*",'ca.description'=>"Description"
);
$this->import_regex_array[$r]=array('ca.type'=>'^[0|1|2|3]');
$this->import_examplevalues_array[$r]=array('ca.label'=>"Supplier Category",
'ca.type'=>"1", 'ca.description'=>"Imported category");
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -188,7 +189,37 @@ class modProduct extends DolibarrModules
// End add extra fields // End add extra fields
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31'); $this->import_examplevalues_array[$r]=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31');
if (! empty($conf->fournisseur->enabled))
{
// Import product suppliers
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="SuppliersPrices"; // Translation key
$this->import_icon[$r]='product';
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
$this->import_fields_array[$r]=array('sp.fk_product'=>"Product*",
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate',
'sp.price'=>"PriceQtyMinHT*",
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this file not required and calculate it from price and qty
'sp.remise_percent'=>'DiscountQtyMin'
);
$this->import_convertvalue_array[$r]=array(
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
'sp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
);
$this->import_examplevalues_array[$r]=array('sp.fk_product'=>"PREF123456",
'sp.fk_soc'=>"My Supplier",'sp.ref_fourn'=>"SupplierRef", 'sp.quantity'=>"1", 'sp.tva_tx'=>'21',
'sp.price'=>"50",
'sp.unitprice'=>'50',
'sp.remise_percent'=>'0'
);
}
} }

View File

@ -133,31 +133,31 @@ class modStock extends DolibarrModules
$this->export_sql_end[$r] .=' AND e.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND e.entity = '.$conf->entity;
// Imports // Imports
//-------- //--------
$r=0; $r=0;
$r++; $r++;
$this->import_code[$r]=$this->rights_class.'_'.$r; $this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="Warehouses"; // Translation key $this->import_label[$r]="Warehouses"; // Translation key
$this->import_icon[$r]=$this->picto; $this->import_icon[$r]=$this->picto;
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('e'=>MAIN_DB_PREFIX.'entrepot'); $this->import_tables_array[$r]=array('e'=>MAIN_DB_PREFIX.'entrepot');
$this->import_tables_creator_array[$r]=array('e'=>'fk_user_author'); $this->import_tables_creator_array[$r]=array('e'=>'fk_user_author');
$this->import_fields_array[$r]=array('e.label'=>"LocationSummary*", $this->import_fields_array[$r]=array('e.label'=>"LocationSummary*",
'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse", 'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse",
'e.address'=>"Address",'e.cp'=>'Zip','e.fk_pays'=>'CountryCode', 'e.address'=>"Address",'e.cp'=>'Zip','e.fk_pays'=>'CountryCode',
'e.statut'=>'Status' 'e.statut'=>'Status'
); );
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionnaryCountry') 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionnaryCountry')
); );
$this->import_regex_array[$r]=array('e.statut'=>'^[0|1]'); $this->import_regex_array[$r]=array('e.statut'=>'^[0|1]');
$this->import_examplevalues_array[$r]=array('e.label'=>"ALM001", $this->import_examplevalues_array[$r]=array('e.label'=>"ALM001",
'e.description'=>"Central Warehouse",'e.lieu'=>"Central", 'e.description'=>"Central Warehouse",'e.lieu'=>"Central",
'e.address'=>"Route 66",'e.cp'=>'28080','e.fk_pays'=>'US', 'e.address'=>"Route 66",'e.cp'=>'28080','e.fk_pays'=>'US',
'e.statut'=>'1'); 'e.statut'=>'1');
} }

View File

@ -16,6 +16,13 @@
* *
*/ */
if (! class_exists('Contact')) {
require DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
}
if (! class_exists('FormCompany')) {
require DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
}
$module = $object->element; $module = $object->element;
// Special cases // Special cases
@ -25,6 +32,7 @@ elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur-
elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; } elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; }
elseif (! isset($permission)) { $permission=$user->rights->$module->creer; } // If already defined by caller page elseif (! isset($permission)) { $permission=$user->rights->$module->creer; } // If already defined by caller page
$formcompany= new FormCompany($db);
$companystatic=new Societe($db); $companystatic=new Societe($db);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$userstatic=new User($db); $userstatic=new User($db);

View File

@ -648,9 +648,9 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA
$action='presend'; $action='presend';
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->ficheinter->creer)
{ {
if ($action == 'addcontact' && $user->rights->ficheinter->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -680,7 +680,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->ficheinter->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -693,7 +693,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->ficheinter->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid','int')); $result = $object->delete_contact(GETPOST('lineid','int'));
@ -957,10 +957,6 @@ else if ($id > 0 || ! empty($ref))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -876,9 +876,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->commande->creer)
{ {
if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -908,7 +908,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -921,7 +921,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]); $result = $object->delete_contact($_GET["lineid"]);
@ -1253,10 +1253,6 @@ if ($id > 0 || ! empty($ref))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -443,7 +443,7 @@ elseif ($action == 'update_line')
$localtax1tx= get_localtax($_POST['tauxtva'], 1, $object->thirdparty); $localtax1tx= get_localtax($_POST['tauxtva'], 1, $object->thirdparty);
$localtax2tx= get_localtax($_POST['tauxtva'], 2, $object->thirdparty); $localtax2tx= get_localtax($_POST['tauxtva'], 2, $object->thirdparty);
$remise_percent=GETPOST('remise_percent'); $remise_percent=GETPOST('remise_percent');
$result=$object->updateline(GETPOST('lineid'), $label, $pu, GETPOST('tauxtva'), $localtax1tx, $localtax2tx, GETPOST('qty'), GETPOST('idprod'), $price_base_type, 0, $type, $remise_percent); $result=$object->updateline(GETPOST('lineid'), $label, $pu, GETPOST('tauxtva'), $localtax1tx, $localtax2tx, GETPOST('qty'), GETPOST('idprod'), $price_base_type, 0, $type, $remise_percent);
if ($result >= 0) if ($result >= 0)
{ {
@ -500,7 +500,7 @@ elseif ($action == 'addline')
$localtax1tx= get_localtax($tauxtva, 1, $object->thirdparty); $localtax1tx= get_localtax($tauxtva, 1, $object->thirdparty);
$localtax2tx= get_localtax($tauxtva, 2, $object->thirdparty); $localtax2tx= get_localtax($tauxtva, 2, $object->thirdparty);
$remise_percent=GETPOST('remise_percent'); $remise_percent=GETPOST('remise_percent');
if (! $_POST['dp_desc']) if (! $_POST['dp_desc'])
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")).'</div>';
@ -842,9 +842,9 @@ elseif ($action == 'remove_file')
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->facture->creer)
{ {
if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -874,7 +874,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -887,7 +887,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]); $result = $object->delete_contact($_GET["lineid"]);
@ -1526,11 +1526,6 @@ else
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
print '<br>'; print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
@ -1643,7 +1638,7 @@ else
print '<td align="right"><input size="1" name="qty" type="text" value="'.$object->lines[$i]->qty.'"></td>'; print '<td align="right"><input size="1" name="qty" type="text" value="'.$object->lines[$i]->qty.'"></td>';
print '<td align="right" nowrap="nowrap"><input size="1" name="remise_percent" type="text" value="'.$object->lines[$i]->remise_percent.'">%</td>'; print '<td align="right" nowrap="nowrap"><input size="1" name="remise_percent" type="text" value="'.$object->lines[$i]->remise_percent.'">%</td>';
print '<td align="right" nowrap="nowrap">&nbsp;</td>'; print '<td align="right" nowrap="nowrap">&nbsp;</td>';
print '<td align="right" nowrap="nowrap">&nbsp;</td>'; print '<td align="right" nowrap="nowrap">&nbsp;</td>';
@ -1701,7 +1696,7 @@ else
print '<td align="right">'.$object->lines[$i]->qty.'</td>'; print '<td align="right">'.$object->lines[$i]->qty.'</td>';
print '<td align="right">'.(($object->lines[$i]->remise_percent > 0)?$object->lines[$i]->remise_percent.'%':'').'</td>'; print '<td align="right">'.(($object->lines[$i]->remise_percent > 0)?$object->lines[$i]->remise_percent.'%':'').'</td>';
print '<td align="right" nowrap="nowrap">'.price($object->lines[$i]->total_ht).'</td>'; print '<td align="right" nowrap="nowrap">'.price($object->lines[$i]->total_ht).'</td>';
print '<td align="right" nowrap="nowrap">'.price($object->lines[$i]->total_ttc).'</td>'; print '<td align="right" nowrap="nowrap">'.price($object->lines[$i]->total_ttc).'</td>';

View File

@ -404,9 +404,9 @@ if ($object->fetch($id))
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?id='.$object->id); show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?id='.$object->id);
} }
// Addresses list // Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
{ {
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
} }

View File

@ -77,7 +77,8 @@ $contentlinevalues=array();
$i = 0; $i = 0;
foreach($fieldstarget as $code=>$label) foreach($fieldstarget as $code=>$label)
{ {
$headerlinefields[]=$fieldstarget[$code].' ('.$code.')'; $withoutstar=preg_replace('/\*/','',$fieldstarget[$code]);
$headerlinefields[]=$langs->transnoentities($withoutstar).($withoutstar != $fieldstarget[$code]?'*':'').' ('.$code.')';
$contentlinevalues[]=$valuestarget[$code]; $contentlinevalues[]=$valuestarget[$code];
} }
//var_dump($headerlinefields); //var_dump($headerlinefields);

View File

@ -733,7 +733,7 @@ if ($step == 4 && $datatoimport)
print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>'; print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>';
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : '; print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : ';
print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>'; print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>';
print '<input type="submit" value="'.$langs->trans('Update').'" />'; print '<input type="submit" value="'.$langs->trans('Update').'" class="button" />';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -116,3 +116,7 @@ Excel95FormatDesc=Arxiu amb format <b>Excel</b> (.xls)<br>Aquest és el format n
Excel2007FormatDesc=Arxiu amb format <b>Excel</b> (.xlsx)<br>Aquest és el format natiu d'Excel 2007 (SpreadsheetML). Excel2007FormatDesc=Arxiu amb format <b>Excel</b> (.xlsx)<br>Aquest és el format natiu d'Excel 2007 (SpreadsheetML).
TsvFormatDesc=Arxiu amb format <b>Valors separats per tabulador</b> (. Tsv)<br> Aquest és un format d'arxiu de text en què els camps són separats per un tabulador [tab]. TsvFormatDesc=Arxiu amb format <b>Valors separats per tabulador</b> (. Tsv)<br> Aquest és un format d'arxiu de text en què els camps són separats per un tabulador [tab].
ExportFieldAutomaticallyAdded=S'ha afegit automàticament el camp <b>%s</b>, ja que evitarà que línies idèntiques siguin considerades com duplicades (amb aquest camp, cada línia tindrà un id propi). ExportFieldAutomaticallyAdded=S'ha afegit automàticament el camp <b>%s</b>, ja que evitarà que línies idèntiques siguin considerades com duplicades (amb aquest camp, cada línia tindrà un id propi).
CsvOptions=Opcions de l'arxiu CSV
Separator=Separador
Enclosure=Delimitador de camps
SuppliersProducts=Productes de proveïdors

View File

@ -118,4 +118,5 @@ TsvFormatDesc=<b>Tab Separated Value</b> file format (.tsv)<br>This is a text fi
ExportFieldAutomaticallyAdded=Field <b>%s</b> was automatically added. It will avoid you to have similar lines to be treated as duplicate records (with this field added, all ligne will own its own id and will differ). ExportFieldAutomaticallyAdded=Field <b>%s</b> was automatically added. It will avoid you to have similar lines to be treated as duplicate records (with this field added, all ligne will own its own id and will differ).
CsvOptions=Csv Options CsvOptions=Csv Options
Separator=Separator Separator=Separator
Enclosure=Enclosure Enclosure=Enclosure
SuppliersProducts=Suppliers Products

View File

@ -115,4 +115,8 @@ CSVFormatDesc=Archivo con formato <b>Valores separados por coma</b> (.csv).<br>E
Excel95FormatDesc=Archivo con formato <b>Excel</b> (.xls)<br>Este es el formato nativo de Excel 95 (BIFF5). Excel95FormatDesc=Archivo con formato <b>Excel</b> (.xls)<br>Este es el formato nativo de Excel 95 (BIFF5).
Excel2007FormatDesc=Archivo con formato <b>Excel</b> (.xlsx)<br>Este es el formato nativo de Excel 2007 (SpreadsheetML). Excel2007FormatDesc=Archivo con formato <b>Excel</b> (.xlsx)<br>Este es el formato nativo de Excel 2007 (SpreadsheetML).
TsvFormatDesc=Archivo con formato <b>Valores separados por tabulador</b> (.tsv)<br>Este es un formato de archivo de texto en el que los campos son separados por un tabulador [tab]. TsvFormatDesc=Archivo con formato <b>Valores separados por tabulador</b> (.tsv)<br>Este es un formato de archivo de texto en el que los campos son separados por un tabulador [tab].
ExportFieldAutomaticallyAdded=Se ha añadido automáticamente el campo <b>%s</b>, ya que evitará que líneas idénticas sean consideradas como duplicadas (con este campo, cada línea tendrá un id propio). ExportFieldAutomaticallyAdded=Se ha añadido automáticamente el campo <b>%s</b>, ya que evitará que líneas idénticas sean consideradas como duplicadas (con este campo, cada línea tendrá un id propio).
CsvOptions=Opciones del archivo CSV
Separator=Separador
Enclosure=Delimitador de campos
SuppliersProducts=Productos de proveedores

View File

@ -117,5 +117,6 @@ Excel2007FormatDesc=Format <b>Excel</b> (.xls).<br>Format standard Excel 2007 (S
TsvFormatDesc=Format de fichier à <b>Valeurs Séparées par des Tabulations</b> (.tsv).<br>C'est un fichier texte dont les champs sont séparés par des tabulations [tab]. TsvFormatDesc=Format de fichier à <b>Valeurs Séparées par des Tabulations</b> (.tsv).<br>C'est un fichier texte dont les champs sont séparés par des tabulations [tab].
ExportFieldAutomaticallyAdded=Le champ <b>%s</b> a été ajouté automatiquement car il évitera que des lignes identiques soient considérées comme des doublons (avec ce champ, aucune ligne ne sera identique mais aura un id propre). ExportFieldAutomaticallyAdded=Le champ <b>%s</b> a été ajouté automatiquement car il évitera que des lignes identiques soient considérées comme des doublons (avec ce champ, aucune ligne ne sera identique mais aura un id propre).
CsvOptions=Options du fichier Csv CsvOptions=Options du fichier Csv
Separator=Séparateur Separator=Séparateur de champs
Enclosure=Délimiteur de champs Enclosure=Encadrement des chaines de textes
SuppliersProducts=Produits Fournisseurs

View File

@ -470,7 +470,7 @@ if ($id || $ref)
print vatrate($productfourn->fourn_tva_tx,true); print vatrate($productfourn->fourn_tva_tx,true);
print '</td>'; print '</td>';
// Price quantity // Price for the quantity
print '<td align="right">'; print '<td align="right">';
print $productfourn->fourn_price?price($productfourn->fourn_price):""; print $productfourn->fourn_price?price($productfourn->fourn_price):"";
print '</td>'; print '</td>';

View File

@ -209,8 +209,8 @@ class Entrepot extends CommonObject
// Update denormalized fields because we change content of produt_stock // Update denormalized fields because we change content of produt_stock
$sql = "UPDATE ".MAIN_DB_PREFIX."product p SET p.stock= (SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock ps WHERE ps.fk_product = p.rowid)"; $sql = "UPDATE ".MAIN_DB_PREFIX."product p SET p.stock= (SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock ps WHERE ps.fk_product = p.rowid)";
dol_syslog(get_class($this)."::delete sql=".$sql); dol_syslog(get_class($this)."::delete sql=".$sql);
$resql2=$this->db->query($sql); $resql2=$this->db->query($sql);
if ($resql1 && $resql2) if ($resql1 && $resql2)
{ {

View File

@ -194,8 +194,8 @@ class MouvementStock
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty; $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty;
$sql.= " WHERE rowid = ".$fk_product; $sql.= " WHERE rowid = ".$fk_product;
// May be this request is better: // May be this request is better:
// UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid); // UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid);
dol_syslog(get_class($this)."::_create sql=".$sql); dol_syslog(get_class($this)."::_create sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);