Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
96ab66ea5a
commit
1512521d91
@ -511,7 +511,7 @@ $tabhelp[23] = array('revenuestamp_type'=>'FixedOrPercent');
|
|||||||
$tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
||||||
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"),'picto'=>$langs->trans("PictoHelp"));
|
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
||||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
||||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||||
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
||||||
@ -524,7 +524,7 @@ $tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
|||||||
$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('MeasuringUnitTypeDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'));
|
$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('MeasuringUnitTypeDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'));
|
||||||
$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'));
|
$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'));
|
||||||
$tabhelp[39] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[39] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[40] = array('code'=>$langs->trans("EnterAnyCode"),'picto'=>$langs->trans("PictoHelp"));
|
$tabhelp[40] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
||||||
|
|
||||||
// List of check for fields (NOT USED YET)
|
// List of check for fields (NOT USED YET)
|
||||||
$tabfieldcheck = array();
|
$tabfieldcheck = array();
|
||||||
|
|||||||
@ -1415,7 +1415,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
|
|||||||
$out .= "$('#moretabs".$tabsname."').mouseenter( function() {
|
$out .= "$('#moretabs".$tabsname."').mouseenter( function() {
|
||||||
var x = this.offsetLeft, y = this.offsetTop;
|
var x = this.offsetLeft, y = this.offsetTop;
|
||||||
console.log('mouseenter ".$left." x='+x+' y='+y+' window.innerWidth='+window.innerWidth);
|
console.log('mouseenter ".$left." x='+x+' y='+y+' window.innerWidth='+window.innerWidth);
|
||||||
if ((window.innerWidth - x) < ".($widthofpopup+10).") {
|
if ((window.innerWidth - x) < ".($widthofpopup + 10).") {
|
||||||
$('#moretabsList".$tabsname."').css('".$right."','8px');
|
$('#moretabsList".$tabsname."').css('".$right."','8px');
|
||||||
}
|
}
|
||||||
$('#moretabsList".$tabsname."').css('".$left."','auto');
|
$('#moretabsList".$tabsname."').css('".$left."','auto');
|
||||||
@ -4048,7 +4048,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return a http error code if possible
|
// Return a http error code if possible
|
||||||
if (! headers_sent()) {
|
if (!headers_sent()) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8979,8 +8979,8 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1)
|
|||||||
|
|
||||||
if ($method == -1) {
|
if ($method == -1) {
|
||||||
$method = 0;
|
$method = 0;
|
||||||
if (! empty($conf->global->MAIN_FORCE_READFILE_WITH_FREAD)) $method = 1;
|
if (!empty($conf->global->MAIN_FORCE_READFILE_WITH_FREAD)) $method = 1;
|
||||||
if (! empty($conf->global->MAIN_FORCE_READFILE_WITH_STREAM_COPY)) $method = 2;
|
if (!empty($conf->global->MAIN_FORCE_READFILE_WITH_STREAM_COPY)) $method = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Be sure we don't have output buffering enabled to have readfile working correctly
|
// Be sure we don't have output buffering enabled to have readfile working correctly
|
||||||
|
|||||||
@ -122,7 +122,7 @@ function pdf_getInstance($format = '', $metric = 'mm', $pagetype = 'P')
|
|||||||
define('K_SMALL_RATIO', 2 / 3);
|
define('K_SMALL_RATIO', 2 / 3);
|
||||||
define('K_THAI_TOPCHARS', true);
|
define('K_THAI_TOPCHARS', true);
|
||||||
define('K_TCPDF_CALLS_IN_HTML', true);
|
define('K_TCPDF_CALLS_IN_HTML', true);
|
||||||
if (! empty($conf->global->TCPDF_THROW_ERRORS_INSTEAD_OF_DIE)) {
|
if (!empty($conf->global->TCPDF_THROW_ERRORS_INSTEAD_OF_DIE)) {
|
||||||
define('K_TCPDF_THROW_EXCEPTION_ERROR', true);
|
define('K_TCPDF_THROW_EXCEPTION_ERROR', true);
|
||||||
} else {
|
} else {
|
||||||
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
||||||
@ -2140,11 +2140,11 @@ function pdf_getLinkedObjects($object, $outputlangs)
|
|||||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order
|
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order
|
||||||
{
|
{
|
||||||
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
|
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
|
||||||
if (! empty($elementobject->linkedObjectsIds['commande'])){
|
if (!empty($elementobject->linkedObjectsIds['commande'])) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
$order = new Commande($db);
|
$order = new Commande($db);
|
||||||
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
|
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
|
||||||
if ($ret < 1) { $order=null; }
|
if ($ret < 1) { $order = null; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!is_object($order))
|
if (!is_object($order))
|
||||||
|
|||||||
@ -265,15 +265,15 @@ class modCommande extends DolibarrModules
|
|||||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
||||||
// Imports
|
// Imports
|
||||||
//--------
|
//--------
|
||||||
$r=0;
|
$r = 0;
|
||||||
//Import Order Header
|
//Import Order Header
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->import_code[$r] = 'commande_' . $r;
|
$this->import_code[$r] = 'commande_'.$r;
|
||||||
$this->import_label[$r] = 'Sales Orders';
|
$this->import_label[$r] = 'Sales Orders';
|
||||||
$this->import_icon[$r] = $this->picto;
|
$this->import_icon[$r] = $this->picto;
|
||||||
$this->import_entities_array[$r] = [];
|
$this->import_entities_array[$r] = [];
|
||||||
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX . 'commande', 'extra' => MAIN_DB_PREFIX . 'commande_extrafields'];
|
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX.'commande', 'extra' => MAIN_DB_PREFIX.'commande_extrafields'];
|
||||||
$this->import_tables_creator_array[$r] = ['c' => 'fk_user_author']; // Fields to store import user id
|
$this->import_tables_creator_array[$r] = ['c' => 'fk_user_author']; // Fields to store import user id
|
||||||
$this->import_fields_array[$r] = [
|
$this->import_fields_array[$r] = [
|
||||||
'c.ref' => 'Document Ref*',
|
'c.ref' => 'Document Ref*',
|
||||||
@ -299,7 +299,7 @@ class modCommande extends DolibarrModules
|
|||||||
'c.model_pdf' => 'Model'
|
'c.model_pdf' => 'Model'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (! empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
|
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
|
||||||
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
|
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
|
||||||
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
||||||
@ -309,23 +309,23 @@ class modCommande extends DolibarrModules
|
|||||||
|
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$import_extrafield_sample = [];
|
$import_extrafield_sample = [];
|
||||||
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'commande' AND entity IN (0, " . $conf->entity . ")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$fieldname = 'extra.' . $obj->name;
|
$fieldname = 'extra.'.$obj->name;
|
||||||
$fieldlabel = ucfirst($obj->label);
|
$fieldlabel = ucfirst($obj->label);
|
||||||
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
|
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
|
||||||
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add extra fields
|
// End add extra fields
|
||||||
|
|
||||||
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'commande'];
|
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'commande'];
|
||||||
$this->import_regex_array[$r] = [
|
$this->import_regex_array[$r] = [
|
||||||
'c.ref' => '(CPV\d{4}-\d{4}|CO\d{4}-\d{4}|PROV.{1,32}$)',
|
'c.ref' => '(CPV\d{4}-\d{4}|CO\d{4}-\d{4}|PROV.{1,32}$)',
|
||||||
'c.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency'
|
'c.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->import_updatekeys_array[$r] = ['c.ref' => 'Ref'];
|
$this->import_updatekeys_array[$r] = ['c.ref' => 'Ref'];
|
||||||
@ -359,7 +359,7 @@ class modCommande extends DolibarrModules
|
|||||||
$this->import_label[$r] = 'Order Details';
|
$this->import_label[$r] = 'Order Details';
|
||||||
$this->import_icon[$r] = $this->picto;
|
$this->import_icon[$r] = $this->picto;
|
||||||
$this->import_entities_array[$r] = [];
|
$this->import_entities_array[$r] = [];
|
||||||
$this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX . 'commandedet', 'extra' => MAIN_DB_PREFIX . 'commandedet_extrafields'];
|
$this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX.'commandedet', 'extra' => MAIN_DB_PREFIX.'commandedet_extrafields'];
|
||||||
$this->import_fields_array[$r] = [
|
$this->import_fields_array[$r] = [
|
||||||
'cd.fk_commande' => 'Document Ref*',
|
'cd.fk_commande' => 'Document Ref*',
|
||||||
'cd.fk_parent_line' => 'PrParentLine',
|
'cd.fk_parent_line' => 'PrParentLine',
|
||||||
@ -382,7 +382,7 @@ class modCommande extends DolibarrModules
|
|||||||
'cd.rang' => 'LinePosition'
|
'cd.rang' => 'LinePosition'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (! empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
|
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
|
||||||
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
|
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
|
||||||
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
||||||
@ -391,22 +391,22 @@ class modCommande extends DolibarrModules
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql="SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'commandedet' AND entity IN (0, " . $conf->entity . ")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commandedet' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$fieldname = 'extra.' . $obj->name;
|
$fieldname = 'extra.'.$obj->name;
|
||||||
$fieldlabel = ucfirst($obj->label);
|
$fieldlabel = ucfirst($obj->label);
|
||||||
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
|
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add extra fields
|
// End add extra fields
|
||||||
|
|
||||||
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'commandedet'];
|
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'commandedet'];
|
||||||
$this->import_regex_array[$r] = [
|
$this->import_regex_array[$r] = [
|
||||||
'cd.product_type' => '[0|1]$',
|
'cd.product_type' => '[0|1]$',
|
||||||
'cd.fk_product' => 'rowid@' . MAIN_DB_PREFIX . 'product',
|
'cd.fk_product' => 'rowid@'.MAIN_DB_PREFIX.'product',
|
||||||
'cd.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency'
|
'cd.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'
|
||||||
];
|
];
|
||||||
$this->import_updatekeys_array[$r] = ['cd.fk_commande' => 'Sales Order Id', 'cd.fk_product' => 'Product Id'];
|
$this->import_updatekeys_array[$r] = ['cd.fk_commande' => 'Sales Order Id', 'cd.fk_product' => 'Product Id'];
|
||||||
$this->import_convertvalue_array[$r] = [
|
$this->import_convertvalue_array[$r] = [
|
||||||
|
|||||||
@ -299,7 +299,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'p.accountancy_code_buy'=>'ProductAccountancyBuyCode', 'project.rowid'=>'ProjectId',
|
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'p.accountancy_code_buy'=>'ProductAccountancyBuyCode', 'project.rowid'=>'ProjectId',
|
||||||
'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
|
'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
|
||||||
);
|
);
|
||||||
if (! empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
|
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
|
||||||
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
|
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
|
||||||
@ -434,7 +434,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
'f.fk_statut'=>'InvoiceStatus', 'f.note_public'=>"InvoiceNote", 'p.rowid'=>'PaymentId', 'pf.amount'=>'AmountPayment',
|
'f.fk_statut'=>'InvoiceStatus', 'f.note_public'=>"InvoiceNote", 'p.rowid'=>'PaymentId', 'pf.amount'=>'AmountPayment',
|
||||||
'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'p.fk_bank'=>'IdTransaction', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
|
'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'p.fk_bank'=>'IdTransaction', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
|
||||||
);
|
);
|
||||||
if (! empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
|
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
|
||||||
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
|
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
|
||||||
@ -528,7 +528,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
'fd.total_tva'=>"LineTotalVAT", 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId',
|
'fd.total_tva'=>"LineTotalVAT", 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId',
|
||||||
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
|
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
|
||||||
);
|
);
|
||||||
if (! empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
|
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
|
||||||
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
|
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
|
||||||
@ -654,14 +654,14 @@ class modFournisseur extends DolibarrModules
|
|||||||
|
|
||||||
//Import Supplier Invoice
|
//Import Supplier Invoice
|
||||||
//--------
|
//--------
|
||||||
$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] = "Supplier Invoice"; // Translation key
|
$this->import_label[$r] = "Supplier Invoice"; // Translation key
|
||||||
$this->import_icon[$r] = $this->picto;
|
$this->import_icon[$r] = $this->picto;
|
||||||
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r] = ['f' => MAIN_DB_PREFIX . 'facture_fourn', 'extra' => MAIN_DB_PREFIX . 'facture_fourn_extrafields'];
|
$this->import_tables_array[$r] = ['f' => MAIN_DB_PREFIX.'facture_fourn', 'extra' => MAIN_DB_PREFIX.'facture_fourn_extrafields'];
|
||||||
$this->import_tables_creator_array[$r] = ['f' => 'fk_user_author']; // Fields to store import user id
|
$this->import_tables_creator_array[$r] = ['f' => 'fk_user_author']; // Fields to store import user id
|
||||||
$this->import_fields_array[$r] = [
|
$this->import_fields_array[$r] = [
|
||||||
'f.ref' => 'InvoiceRef*',
|
'f.ref' => 'InvoiceRef*',
|
||||||
@ -697,19 +697,19 @@ class modFournisseur extends DolibarrModules
|
|||||||
}
|
}
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$import_extrafield_sample = [];
|
$import_extrafield_sample = [];
|
||||||
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, " . $conf->entity . ")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$fieldname = 'extra.' . $obj->name;
|
$fieldname = 'extra.'.$obj->name;
|
||||||
$fieldlabel = ucfirst($obj->label);
|
$fieldlabel = ucfirst($obj->label);
|
||||||
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
|
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
|
||||||
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add extra fields
|
// End add extra fields
|
||||||
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'facture_fourn'];
|
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facture_fourn'];
|
||||||
$this->import_regex_array[$r] = ['f.ref' => '(SI\d{4}-\d{4}|PROV.{1,32}$)', 'f.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency'];
|
$this->import_regex_array[$r] = ['f.ref' => '(SI\d{4}-\d{4}|PROV.{1,32}$)', 'f.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'];
|
||||||
$import_sample = [
|
$import_sample = [
|
||||||
'f.ref' => '(PROV001)',
|
'f.ref' => '(PROV001)',
|
||||||
'f.ref_supplier' => 'Supplier1',
|
'f.ref_supplier' => 'Supplier1',
|
||||||
@ -754,7 +754,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->import_label[$r] = "Supplier Invoice Lines"; // Translation key
|
$this->import_label[$r] = "Supplier Invoice Lines"; // Translation key
|
||||||
$this->import_icon[$r] = $this->picto;
|
$this->import_icon[$r] = $this->picto;
|
||||||
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r] = ['fd' => MAIN_DB_PREFIX . 'facture_fourn_det', 'extra' => MAIN_DB_PREFIX . 'facture_fourn_det_extrafields'];
|
$this->import_tables_array[$r] = ['fd' => MAIN_DB_PREFIX.'facture_fourn_det', 'extra' => MAIN_DB_PREFIX.'facture_fourn_det_extrafields'];
|
||||||
$this->import_fields_array[$r] = [
|
$this->import_fields_array[$r] = [
|
||||||
'fd.fk_facture_fourn' => 'InvoiceRef*',
|
'fd.fk_facture_fourn' => 'InvoiceRef*',
|
||||||
'fd.fk_parent_line' => 'FacParentLine',
|
'fd.fk_parent_line' => 'FacParentLine',
|
||||||
@ -784,19 +784,19 @@ class modFournisseur extends DolibarrModules
|
|||||||
}
|
}
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$import_extrafield_sample = [];
|
$import_extrafield_sample = [];
|
||||||
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, " . $conf->entity . ")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$fieldname = 'extra.' . $obj->name;
|
$fieldname = 'extra.'.$obj->name;
|
||||||
$fieldlabel = ucfirst($obj->label);
|
$fieldlabel = ucfirst($obj->label);
|
||||||
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
|
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
|
||||||
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add extra fields
|
// End add extra fields
|
||||||
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'facture_fourn_det'];
|
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facture_fourn_det'];
|
||||||
$this->import_regex_array[$r] = ['fd.product_type' => '[0|1]$', 'fd.fk_product' => 'rowid@' . MAIN_DB_PREFIX . 'product', 'fd.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency'];
|
$this->import_regex_array[$r] = ['fd.product_type' => '[0|1]$', 'fd.fk_product' => 'rowid@'.MAIN_DB_PREFIX.'product', 'fd.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'];
|
||||||
$import_sample = [
|
$import_sample = [
|
||||||
'fd.fk_facture_fourn' => '(PROV001)',
|
'fd.fk_facture_fourn' => '(PROV001)',
|
||||||
'fd.fk_parent_line' => '',
|
'fd.fk_parent_line' => '',
|
||||||
|
|||||||
@ -265,7 +265,7 @@ class modPropale extends DolibarrModules
|
|||||||
$this->import_label[$r] = 'Proposals'; // Translation key
|
$this->import_label[$r] = 'Proposals'; // Translation key
|
||||||
$this->import_icon[$r] = $this->picto;
|
$this->import_icon[$r] = $this->picto;
|
||||||
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX . 'propal', 'extra' => MAIN_DB_PREFIX . 'propal_extrafields'];
|
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX.'propal', 'extra' => MAIN_DB_PREFIX.'propal_extrafields'];
|
||||||
$this->import_tables_creator_array[$r] = ['c'=>'fk_user_author']; // Fields to store import user id
|
$this->import_tables_creator_array[$r] = ['c'=>'fk_user_author']; // Fields to store import user id
|
||||||
$this->import_fields_array[$r] = [
|
$this->import_fields_array[$r] = [
|
||||||
'c.ref' => 'Document Ref*',
|
'c.ref' => 'Document Ref*',
|
||||||
@ -282,7 +282,7 @@ class modPropale extends DolibarrModules
|
|||||||
'c.date_livraison' => 'DeliveryDate',
|
'c.date_livraison' => 'DeliveryDate',
|
||||||
'c.fk_user_valid' => 'ValidatedById'
|
'c.fk_user_valid' => 'ValidatedById'
|
||||||
];
|
];
|
||||||
if (! empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
|
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
|
||||||
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
|
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
|
||||||
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
||||||
@ -291,18 +291,18 @@ class modPropale extends DolibarrModules
|
|||||||
}
|
}
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$import_extrafield_sample = [];
|
$import_extrafield_sample = [];
|
||||||
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'propal' AND entity IN (0, " . $conf->entity . ")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'propal' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$fieldname = 'extra.' . $obj->name;
|
$fieldname = 'extra.'.$obj->name;
|
||||||
$fieldlabel = ucfirst($obj->label);
|
$fieldlabel = ucfirst($obj->label);
|
||||||
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
|
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
|
||||||
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add extra fields
|
// End add extra fields
|
||||||
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'propal'];
|
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'propal'];
|
||||||
$this->import_regex_array[$r] = ['c.ref' => '[^ ]'];
|
$this->import_regex_array[$r] = ['c.ref' => '[^ ]'];
|
||||||
$import_sample = [
|
$import_sample = [
|
||||||
'c.ref' => 'PROV0077',
|
'c.ref' => 'PROV0077',
|
||||||
@ -343,8 +343,8 @@ class modPropale extends DolibarrModules
|
|||||||
$this->import_icon[$r] = $this->picto;
|
$this->import_icon[$r] = $this->picto;
|
||||||
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r] = [
|
$this->import_tables_array[$r] = [
|
||||||
'cd' => MAIN_DB_PREFIX . 'propaldet',
|
'cd' => MAIN_DB_PREFIX.'propaldet',
|
||||||
'extra' => MAIN_DB_PREFIX . 'propaldet_extrafields'
|
'extra' => MAIN_DB_PREFIX.'propaldet_extrafields'
|
||||||
];
|
];
|
||||||
$this->import_fields_array[$r] = [
|
$this->import_fields_array[$r] = [
|
||||||
'cd.fk_propal' => 'Document Ref*',
|
'cd.fk_propal' => 'Document Ref*',
|
||||||
@ -366,7 +366,7 @@ class modPropale extends DolibarrModules
|
|||||||
'cd.date_end' => 'End Date',
|
'cd.date_end' => 'End Date',
|
||||||
'cd.buy_price_ht' => 'LineBuyPriceHT'
|
'cd.buy_price_ht' => 'LineBuyPriceHT'
|
||||||
];
|
];
|
||||||
if (! empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
|
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
|
||||||
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
|
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
|
||||||
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
|
||||||
@ -379,14 +379,14 @@ class modPropale extends DolibarrModules
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$fieldname = 'extra.' . $obj->name;
|
$fieldname = 'extra.'.$obj->name;
|
||||||
$fieldlabel = ucfirst($obj->label);
|
$fieldlabel = ucfirst($obj->label);
|
||||||
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
|
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
|
||||||
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
$import_extrafield_sample[$fieldname] = $fieldlabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add extra fields
|
// End add extra fields
|
||||||
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'propaldet'];
|
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'propaldet'];
|
||||||
$this->import_regex_array[$r] = ['cd.product_type' => '[0|1]$'];
|
$this->import_regex_array[$r] = ['cd.product_type' => '[0|1]$'];
|
||||||
$import_sample = [
|
$import_sample = [
|
||||||
'cd.fk_propal' => 'PROV(0001)',
|
'cd.fk_propal' => 'PROV(0001)',
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class EcmDirectory extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element='ecm_directories';
|
public $table_element = 'ecm_directories';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
|||||||
@ -381,7 +381,7 @@ if (!empty($object->share))
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print $object->showOptionals($extrafields, ($action == 'edit'?'edit':'view'));
|
print $object->showOptionals($extrafields, ($action == 'edit' ? 'edit' : 'view'));
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -368,7 +368,7 @@ class Productcustomerprice extends CommonObject
|
|||||||
} elseif ($key == 'prod.ref' || $key == 'prod.label') {
|
} elseif ($key == 'prod.ref' || $key == 'prod.label') {
|
||||||
$sql .= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
$sql .= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
||||||
} elseif ($key == 't.price' || $key == 't.price_ttc') {
|
} elseif ($key == 't.price' || $key == 't.price_ttc') {
|
||||||
$sql .= ' AND ' . $key . ' LIKE \'%' . price2num($value) . '%\'';
|
$sql .= ' AND '.$key.' LIKE \'%'.price2num($value).'%\'';
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' AND '.$key.' = '.((int) $value);
|
$sql .= ' AND '.$key.' = '.((int) $value);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -630,7 +630,7 @@ if ($search_ref || $search_label || $sall || $salert || $draftorder || GETPOST('
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
$filters .= '&limit=' . urlencode($limit);
|
$filters .= '&limit='.urlencode($limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
$param = (isset($type) ? '&type='.$type : '');
|
$param = (isset($type) ? '&type='.$type : '');
|
||||||
@ -701,7 +701,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre
|
|||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_titre right">';
|
print '<td class="liste_titre right">';
|
||||||
if (! empty($conf->global->STOCK_REPLENISH_ADD_CHECKBOX_INCLUDE_DRAFT_ORDER)) {
|
if (!empty($conf->global->STOCK_REPLENISH_ADD_CHECKBOX_INCLUDE_DRAFT_ORDER)) {
|
||||||
print $langs->trans('IncludeAlsoDraftOrders').' <input type="checkbox" id="draftorder" name="draftorder" '.(!empty($draftchecked) ? $draftchecked : '').'>';
|
print $langs->trans('IncludeAlsoDraftOrders').' <input type="checkbox" id="draftorder" name="draftorder" '.(!empty($draftchecked) ? $draftchecked : '').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -768,7 +768,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stockwarehouse=0;
|
$stockwarehouse = 0;
|
||||||
if ($usevirtualstock)
|
if ($usevirtualstock)
|
||||||
{
|
{
|
||||||
// If option to increase/decrease is not on an object validation, virtual stock may differs from physical stock.
|
// If option to increase/decrease is not on an object validation, virtual stock may differs from physical stock.
|
||||||
|
|||||||
@ -178,7 +178,7 @@ class Project extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||||
*/
|
*/
|
||||||
public $fields=array(
|
public $fields = array(
|
||||||
'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||||
'fk_soc' =>array('type'=>'integer', 'label'=>'Fk soc', 'enabled'=>1, 'visible'=>3, 'position'=>15),
|
'fk_soc' =>array('type'=>'integer', 'label'=>'Fk soc', 'enabled'=>1, 'visible'=>3, 'position'=>15),
|
||||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>1, 'position'=>20),
|
'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>1, 'position'=>20),
|
||||||
|
|||||||
@ -262,15 +262,15 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||||||
$filter ['prod.ref'] = $search_prod;
|
$filter ['prod.ref'] = $search_prod;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($search_label)) {
|
if (!empty($search_label)) {
|
||||||
$filter ['prod.label'] = $search_label;
|
$filter ['prod.label'] = $search_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($search_price)) {
|
if (!empty($search_price)) {
|
||||||
$filter ['t.price'] = $search_price;
|
$filter ['t.price'] = $search_price;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($search_price_ttc)) {
|
if (!empty($search_price_ttc)) {
|
||||||
$filter ['t.price_ttc'] = $search_price_ttc;
|
$filter ['t.price_ttc'] = $search_price_ttc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ if ($setterminal > 0)
|
|||||||
setcookie("takeposterminal", $setterminal, (time() + (86400 * 354)), '/', null, false, true); // Permanent takeposterminal var in a cookie
|
setcookie("takeposterminal", $setterminal, (time() + (86400 * 354)), '/', null, false, true); // Permanent takeposterminal var in a cookie
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($setcurrency!="")
|
if ($setcurrency != "")
|
||||||
{
|
{
|
||||||
$_SESSION["takeposcustomercurrency"] = $setcurrency;
|
$_SESSION["takeposcustomercurrency"] = $setcurrency;
|
||||||
}
|
}
|
||||||
@ -812,7 +812,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
|
|||||||
?>
|
?>
|
||||||
</a>
|
</a>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($conf->multicurrency->enabled)){
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
print '<a class="valignmiddle tdoverflowmax100 minwidth75" id="multicurrency" onclick="ModalBox(\'ModalCurrency\');" title=""><span class="fas fa-coins paddingrightonly"></span>'.$langs->trans("Currency").'</a>';
|
print '<a class="valignmiddle tdoverflowmax100 minwidth75" id="multicurrency" onclick="ModalBox(\'ModalCurrency\');" title=""><span class="fas fa-coins paddingrightonly"></span>'.$langs->trans("Currency").'</a>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -850,10 +850,10 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<span class="close" href="#" onclick="document.getElementById('ModalTerminal').style.display = 'none';">×</span>
|
<span class="close" href="#" onclick="document.getElementById('ModalTerminal').style.display = 'none';">×</span>
|
||||||
<h3><?php print $langs->trans("TerminalSelect");?></h3>
|
<h3><?php print $langs->trans("TerminalSelect"); ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<button type="button" class="block" onclick="location.href='index.php?setterminal=1'"><?php print $langs->trans("Terminal");?> 1</button>
|
<button type="button" class="block" onclick="location.href='index.php?setterminal=1'"><?php print $langs->trans("Terminal"); ?> 1</button>
|
||||||
<?php
|
<?php
|
||||||
for ($i = 2; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
for ($i = 2; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -278,7 +278,7 @@ if ($action == 'history')
|
|||||||
$invoice->fetch($placeid);
|
$invoice->fetch($placeid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="") {
|
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "") {
|
||||||
$invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]);
|
$invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -737,7 +737,7 @@ function TakeposPrinting(id){
|
|||||||
|
|
||||||
function TakeposConnector(id){
|
function TakeposConnector(id){
|
||||||
console.log("TakeposConnector" + id);
|
console.log("TakeposConnector" + id);
|
||||||
$.get("ajax/ajax.php?action=printinvoiceticket&term=<?php echo $_SESSION["takeposterminal"];?>&id="+id, function(data, status){
|
$.get("ajax/ajax.php?action=printinvoiceticket&term=<?php echo $_SESSION["takeposterminal"]; ?>&id="+id, function(data, status){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php',
|
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php',
|
||||||
@ -902,12 +902,12 @@ if ($_SESSION["basiclayout"] != 1)
|
|||||||
// In phone version only show when it is invoice page
|
// In phone version only show when it is invoice page
|
||||||
if ($mobilepage == "invoice" || $mobilepage == "") {
|
if ($mobilepage == "invoice" || $mobilepage == "") {
|
||||||
print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</span>';
|
print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</span>';
|
||||||
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="" && $conf->currency!=$_SESSION["takeposcustomercurrency"]) {
|
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
|
||||||
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
|
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
|
||||||
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||||
$multicurrency = new MultiCurrency($db);
|
$multicurrency = new MultiCurrency($db);
|
||||||
$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
|
$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
|
||||||
print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($invoice->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>';
|
print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($invoice->total_ttc * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -1108,12 +1108,12 @@ if ($placeid > 0)
|
|||||||
$htmlforlines .= '</td>';
|
$htmlforlines .= '</td>';
|
||||||
$htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">';
|
$htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">';
|
||||||
$htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency);
|
$htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency);
|
||||||
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="" && $conf->currency!=$_SESSION["takeposcustomercurrency"]) {
|
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
|
||||||
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
|
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
|
||||||
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||||
$multicurrency = new MultiCurrency($db);
|
$multicurrency = new MultiCurrency($db);
|
||||||
$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
|
$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
|
||||||
$htmlforlines .= '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($line->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>';
|
$htmlforlines .= '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($line->total_ttc * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>';
|
||||||
}
|
}
|
||||||
$htmlforlines .= '</td>';
|
$htmlforlines .= '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -231,7 +231,7 @@ else print "var received=0;";
|
|||||||
<div style="position:relative; padding-top: 20px; left:5%; height:150px; width:90%;">
|
<div style="position:relative; padding-top: 20px; left:5%; height:150px; width:90%;">
|
||||||
|
|
||||||
<div class="paymentbordline paymentbordlinetotal">
|
<div class="paymentbordline paymentbordlinetotal">
|
||||||
<center><span class="takepospay"><font color="white"><?php echo $langs->trans('TotalTTC'); ?>: </font><span id="totaldisplay" class="colorwhite"><?php echo price($invoice->total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code);?></span></span></center>
|
<center><span class="takepospay"><font color="white"><?php echo $langs->trans('TotalTTC'); ?>: </font><span id="totaldisplay" class="colorwhite"><?php echo price($invoice->total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span></span></center>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($remaintopay != $invoice->total_ttc) { ?>
|
<?php if ($remaintopay != $invoice->total_ttc) { ?>
|
||||||
<div class="paymentbordline paymentbordlineremain">
|
<div class="paymentbordline paymentbordlineremain">
|
||||||
@ -245,7 +245,7 @@ else print "var received=0;";
|
|||||||
<center><span class="takepospay"><font color="white"><?php echo $langs->trans("Change"); ?>: </font><span class="change2 colorwhite"><?php echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span><input type="hidden" id="change2" class="change2" value="0"></span></center>
|
<center><span class="takepospay"><font color="white"><?php echo $langs->trans("Change"); ?>: </font><span class="change2 colorwhite"><?php echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span><input type="hidden" id="change2" class="change2" value="0"></span></center>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if (! empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
|
if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
|
||||||
print '<div class="paymentbordline paddingtop paddingbottom">
|
print '<div class="paymentbordline paddingtop paddingbottom">
|
||||||
<center>';
|
<center>';
|
||||||
$filter = '';
|
$filter = '';
|
||||||
|
|||||||
@ -91,7 +91,7 @@ if (!empty($hookmanager->resPrint)) {
|
|||||||
<br>
|
<br>
|
||||||
<p class="left">
|
<p class="left">
|
||||||
<?php
|
<?php
|
||||||
$constFreeText = 'TAKEPOS_HEADER' . $_SESSION['takeposterminal'];
|
$constFreeText = 'TAKEPOS_HEADER'.$_SESSION['takeposterminal'];
|
||||||
if (!empty($conf->global->TAKEPOS_HEADER) || !empty($conf->global->{$constFreeText}))
|
if (!empty($conf->global->TAKEPOS_HEADER) || !empty($conf->global->{$constFreeText}))
|
||||||
{
|
{
|
||||||
$newfreetext = '';
|
$newfreetext = '';
|
||||||
@ -127,8 +127,8 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="center"><?php print $langs->trans("Label"); ?></th>
|
<th class="center"><?php print $langs->trans("Label"); ?></th>
|
||||||
<th class="right"><?php print $langs->trans("Qty"); ?></th>
|
<th class="right"><?php print $langs->trans("Qty"); ?></th>
|
||||||
<th class="right"><?php if ($gift!=1) print $langs->trans("Price"); ?></th>
|
<th class="right"><?php if ($gift != 1) print $langs->trans("Price"); ?></th>
|
||||||
<th class="right"><?php if ($gift!=1) print $langs->trans("TotalTTC"); ?></th>
|
<th class="right"><?php if ($gift != 1) print $langs->trans("TotalTTC"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -142,8 +142,8 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
|
|||||||
else echo $line->description; ?>
|
else echo $line->description; ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="right"><?php echo $line->qty; ?></td>
|
<td class="right"><?php echo $line->qty; ?></td>
|
||||||
<td class="right"><?php if ($gift!=1) echo price(price2num($line->total_ttc / $line->qty, 'MT'), 1); ?></td>
|
<td class="right"><?php if ($gift != 1) echo price(price2num($line->total_ttc / $line->qty, 'MT'), 1); ?></td>
|
||||||
<td class="right"><?php if ($gift!=1) echo price($line->total_ttc, 1); ?></td>
|
<td class="right"><?php if ($gift != 1) echo price($line->total_ttc, 1); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -153,8 +153,8 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
|
|||||||
<br>
|
<br>
|
||||||
<table class="right">
|
<table class="right">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="right"><?php if ($gift!=1) echo $langs->trans("TotalHT"); ?></th>
|
<th class="right"><?php if ($gift != 1) echo $langs->trans("TotalHT"); ?></th>
|
||||||
<td class="right"><?php if ($gift!=1) echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
<td class="right"><?php if ($gift != 1) echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php if ($conf->global->TAKEPOS_TICKET_VAT_GROUPPED) {
|
<?php if ($conf->global->TAKEPOS_TICKET_VAT_GROUPPED) {
|
||||||
$vat_groups = array();
|
$vat_groups = array();
|
||||||
@ -168,27 +168,27 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
|
|||||||
foreach ($vat_groups as $key => $val) {
|
foreach ($vat_groups as $key => $val) {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="right"><?php if ($gift!=1) echo $langs->trans("VAT").' '.vatrate($key, 1); ?></th>
|
<th align="right"><?php if ($gift != 1) echo $langs->trans("VAT").' '.vatrate($key, 1); ?></th>
|
||||||
<td align="right"><?php if ($gift!=1) echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
<td align="right"><?php if ($gift != 1) echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
} else { ?>
|
} else { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="right"><?php if ($gift!=1) echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
<th class="right"><?php if ($gift != 1) echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="right"><?php if ($gift!=1) echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
<th class="right"><?php if ($gift != 1) echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="" && $conf->currency!=$_SESSION["takeposcustomercurrency"]) {
|
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
|
||||||
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
|
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
|
||||||
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||||
$multicurrency = new MultiCurrency($db);
|
$multicurrency = new MultiCurrency($db);
|
||||||
$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
|
$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
|
||||||
echo '<tr><th class="right">';
|
echo '<tr><th class="right">';
|
||||||
if ($gift!=1) echo ''.$langs->trans("TotalTTC").' '.$_SESSION["takeposcustomercurrency"].'</th><td class="right">'.price($object->total_ttc*$multicurrency->rate->rate, 1, '', 1, - 1, - 1, $_SESSION["takeposcustomercurrency"])."\n";
|
if ($gift != 1) echo ''.$langs->trans("TotalTTC").' '.$_SESSION["takeposcustomercurrency"].'</th><td class="right">'.price($object->total_ttc * $multicurrency->rate->rate, 1, '', 1, - 1, - 1, $_SESSION["takeposcustomercurrency"])."\n";
|
||||||
echo '</td></tr>';
|
echo '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,12 +211,12 @@ if ($conf->global->TAKEPOS_PRINT_PAYMENT_METHOD) {
|
|||||||
echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
|
echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '<td class="right">';
|
echo '<td class="right">';
|
||||||
$amount_payment=($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
|
$amount_payment = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
|
||||||
if ($row->code == "LIQ") $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
|
if ($row->code == "LIQ") $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
|
||||||
echo price($amount_payment, 1, '', 1, - 1, - 1, $conf->currency);
|
echo price($amount_payment, 1, '', 1, - 1, - 1, $conf->currency);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
if ($row->code == "LIQ" && $row->pos_change>0) // Print change only in cash payments
|
if ($row->code == "LIQ" && $row->pos_change > 0) // Print change only in cash payments
|
||||||
{
|
{
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="right">';
|
echo '<td class="right">';
|
||||||
@ -238,7 +238,7 @@ if ($conf->global->TAKEPOS_PRINT_PAYMENT_METHOD) {
|
|||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php
|
||||||
$constFreeText = 'TAKEPOS_FOOTER' . $_SESSION['takeposterminal'];
|
$constFreeText = 'TAKEPOS_FOOTER'.$_SESSION['takeposterminal'];
|
||||||
if (!empty($conf->global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeText}))
|
if (!empty($conf->global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeText}))
|
||||||
{
|
{
|
||||||
$newfreetext = '';
|
$newfreetext = '';
|
||||||
|
|||||||
@ -51,7 +51,7 @@ $invoice->fetch($facid);
|
|||||||
$customer = new Societe($db);
|
$customer = new Societe($db);
|
||||||
$customer->fetch($invoice->socid);
|
$customer->fetch($invoice->socid);
|
||||||
|
|
||||||
if ($action=="send")
|
if ($action == "send")
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
|
|||||||
@ -1186,7 +1186,7 @@ class User extends CommonObject
|
|||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER) && !empty($conf->global->STOCK_USERSTOCK_AUTOCREATE))
|
if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER) && !empty($conf->global->STOCK_USERSTOCK_AUTOCREATE))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
|||||||
@ -619,7 +619,7 @@ class WebsitePage extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (!$error) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user