Merge branch 'upstream/develop'
This commit is contained in:
commit
4025fda62a
@ -25,6 +25,15 @@
|
|||||||
* \brief Include to show main page for cashdesk module
|
* \brief Include to show main page for cashdesk module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
// Get list of articles (in warehouse '$conf_fkentrepot' if defined and stock module enabled)
|
// Get list of articles (in warehouse '$conf_fkentrepot' if defined and stock module enabled)
|
||||||
if ( GETPOST('filtre') ) {
|
if ( GETPOST('filtre') ) {
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,8 @@ $langs->load("main");
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("cashdesk");
|
$langs->load("cashdesk");
|
||||||
|
|
||||||
|
// Object $form must de defined
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript" src="javascript/facturation1.js"></script>
|
<script type="text/javascript" src="javascript/facturation1.js"></script>
|
||||||
|
|||||||
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
|
|
||||||
|
// Object $form must de defined
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Summary"); ?></legend>
|
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Summary"); ?></legend>
|
||||||
|
|||||||
@ -21,6 +21,8 @@
|
|||||||
* \brief validation.php
|
* \brief validation.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
// Affichage des templates
|
// Affichage des templates
|
||||||
require ('tpl/validation1.tpl.php');
|
require ('tpl/validation1.tpl.php');
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
|
* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
@ -341,6 +341,12 @@ if ($result)
|
|||||||
print $langs->trans("VATPayment");
|
print $langs->trans("VATPayment");
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
else if ($links[$key]['type']=='payment_salary') {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/compta/salaries/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||||
|
print img_object($langs->trans('ShowPaymentSalary'),'payment').' ';
|
||||||
|
print $langs->trans("SalaryPayment");
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
else if ($links[$key]['type']=='member') {
|
else if ($links[$key]['type']=='member') {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">';
|
print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">';
|
||||||
print img_object($langs->trans('ShowMember'),'user').' ';
|
print img_object($langs->trans('ShowMember'),'user').' ';
|
||||||
@ -353,6 +359,12 @@ if ($result)
|
|||||||
print $langs->trans("TransactionOnTheOtherAccount");
|
print $langs->trans("TransactionOnTheOtherAccount");
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
else if ($links[$key]['type']=='user') {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/user/fiche?id='.$links[$key]['url_id'].'">';
|
||||||
|
print img_object($langs->trans('ShowUser'),'user').' ';
|
||||||
|
print $langs->trans("User");
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
||||||
print img_object('','generic').' ';
|
print img_object('','generic').' ';
|
||||||
|
|||||||
@ -359,20 +359,12 @@ class PaymentSalary extends CommonObject
|
|||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary"); // TODO should be called payment_salary
|
$ok=1;
|
||||||
|
|
||||||
// Start triggers
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary");
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
|
||||||
$interface=new Interfaces($this->db);
|
|
||||||
$result=$interface->run_triggers('PAYMENT_SALARY_CREATE',$this,$user,$langs,$conf);
|
|
||||||
if ($result < 0) {
|
|
||||||
$error++; $this->errors=$interface->errors;
|
|
||||||
}
|
|
||||||
// End triggers
|
|
||||||
|
|
||||||
if ($this->id > 0)
|
if ($this->id > 0)
|
||||||
{
|
{
|
||||||
$ok=1;
|
|
||||||
if (! empty($conf->banque->enabled) && ! empty($this->amount))
|
if (! empty($conf->banque->enabled) && ! empty($this->amount))
|
||||||
{
|
{
|
||||||
// Insert into llx_bank
|
// Insert into llx_bank
|
||||||
@ -406,42 +398,53 @@ class PaymentSalary extends CommonObject
|
|||||||
$ok=0;
|
$ok=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add link 'payment_salary' in bank_url between payment and bank transaction
|
if ($ok)
|
||||||
$url=DOL_URL_ROOT.'/compta/salaries/fiche.php?id=';
|
{
|
||||||
|
// Add link 'payment_salary' in bank_url between payment and bank transaction
|
||||||
|
$url=DOL_URL_ROOT.'/compta/salaries/fiche.php?id=';
|
||||||
|
|
||||||
|
$result=$acc->add_url_line($bank_line_id, $this->id, $url, "(SalaryPayment)", "payment_salary");
|
||||||
|
if ($result <= 0)
|
||||||
|
{
|
||||||
|
$this->error=$acc->error;
|
||||||
|
$ok=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$fuser=new User($this->db);
|
||||||
|
$fuser->fetch($this->fk_user);
|
||||||
|
|
||||||
|
// Add link 'user' in bank_url between operation and bank transaction
|
||||||
|
$result=$acc->add_url_line(
|
||||||
|
$bank_line_id,
|
||||||
|
$this->fk_user,
|
||||||
|
DOL_URL_ROOT.'/user/fiche.php?id=',
|
||||||
|
$langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'),
|
||||||
|
'(User)',
|
||||||
|
'user'
|
||||||
|
);
|
||||||
|
|
||||||
$result=$acc->add_url_line($bank_line_id, $this->id, $url, "(SalaryPayment)", "payment_salary");
|
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$this->error=$acc->error;
|
$this->error=$acc->error;
|
||||||
$ok=0;
|
$ok=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add link 'user' in bank_url between operation and bank transaction
|
|
||||||
$linkaddedforthirdparty=array();
|
|
||||||
foreach ($this->amounts as $key => $value)
|
|
||||||
{
|
|
||||||
$sal = new PaymentSalary($this->db);
|
|
||||||
|
|
||||||
$sal->fetch($key);
|
|
||||||
$sal->fetch_user($this->fk_user);
|
|
||||||
|
|
||||||
if (! in_array($sal->user->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
|
||||||
{
|
|
||||||
$result=$acc->add_url_line(
|
|
||||||
$bank_line_id,
|
|
||||||
$sal->user->id,
|
|
||||||
DOL_URL_ROOT.'/user/fiche.php?id=',
|
|
||||||
$sal->user->lastname,
|
|
||||||
'user'
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($result <= 0) dol_print_error($this->db);
|
|
||||||
$linkaddedforthirdparty[$sal->user->id]=$sal->user->id; // Mark as done for this thirdparty
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start triggers
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$result=$interface->run_triggers('PAYMENT_SALARY_CREATE',$this,$user,$langs,$conf);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
|
// End triggers
|
||||||
|
|
||||||
|
}
|
||||||
|
else $ok=0;
|
||||||
|
|
||||||
|
if ($ok)
|
||||||
|
{
|
||||||
if ($ok)
|
if ($ok)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|||||||
@ -78,6 +78,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
|||||||
$sal->note=GETPOST("note");
|
$sal->note=GETPOST("note");
|
||||||
$sal->type_payment=GETPOST("paymenttype");
|
$sal->type_payment=GETPOST("paymenttype");
|
||||||
$sal->num_payment=GETPOST("num_payment");
|
$sal->num_payment=GETPOST("num_payment");
|
||||||
|
$sal->fk_user_creat=$user->id;
|
||||||
|
|
||||||
if (empty($datep) || empty($datesp) || empty($dateep))
|
if (empty($datep) || empty($datesp) || empty($dateep))
|
||||||
{
|
{
|
||||||
@ -215,11 +216,11 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
||||||
print $form->select_date((empty($datep)?-1:$datep),"datep",'','','','add');
|
print $form->select_date((empty($datep)?-1:$datep),"datep",'','','','add',1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
|
||||||
print $form->select_date((empty($datev)?-1:$datev),"datev",'','','','add');
|
print $form->select_date((empty($datev)?-1:$datev),"datev",'','','','add',1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Employee
|
// Employee
|
||||||
|
|||||||
@ -206,6 +206,32 @@ class modProduct extends DolibarrModules
|
|||||||
if (! empty($conf->fournisseur->enabled)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
|
if (! empty($conf->fournisseur->enabled)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
|
||||||
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')';
|
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')';
|
||||||
|
|
||||||
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
|
{
|
||||||
|
// Exports product multiprice
|
||||||
|
$r++;
|
||||||
|
$this->export_code[$r]=$this->rights_class.'_'.$key;
|
||||||
|
$this->export_label[$r]="ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||||
|
$this->export_permission[$r]=array(array("produit","export"));
|
||||||
|
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",
|
||||||
|
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||||
|
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||||
|
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||||
|
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||||
|
'pr.date_price'=>'DateCreation');
|
||||||
|
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",
|
||||||
|
'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product",
|
||||||
|
'pr.price_ttc'=>"product",
|
||||||
|
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||||
|
'pr.tva_tx'=>'product',
|
||||||
|
'pr.date_price'=>"product");
|
||||||
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product';
|
||||||
|
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
//--------
|
//--------
|
||||||
@ -239,15 +265,15 @@ class modProduct extends DolibarrModules
|
|||||||
|
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
{
|
{
|
||||||
// Import product suppliers
|
// Import suppliers prices (note: this code is duplicated into module service)
|
||||||
$r++;
|
$r++;
|
||||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
$this->import_code[$r]=$this->rights_class.'_supplierprices';
|
||||||
$this->import_label[$r]="SuppliersPrices"; // Translation key
|
$this->import_label[$r]="SuppliersPricesOfProductsOrServices"; // Translation key
|
||||||
$this->import_icon[$r]='product';
|
$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('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
|
$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_tables_creator_array[$r]=array('sp'=>'fk_user');
|
||||||
$this->import_fields_array[$r]=array('sp.fk_product'=>"Product*",
|
$this->import_fields_array[$r]=array('sp.fk_product'=>"ProductOrService*",
|
||||||
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate',
|
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate',
|
||||||
'sp.price'=>"PriceQtyMinHT*",
|
'sp.price'=>"PriceQtyMinHT*",
|
||||||
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this file not required and calculate it from price and qty
|
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this file not required and calculate it from price and qty
|
||||||
@ -266,55 +292,29 @@ class modProduct extends DolibarrModules
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
// Exports product multiprice
|
{
|
||||||
//--------
|
// Import product multiprice
|
||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->import_code[$r]=$this->rights_class.'_multiprice';
|
||||||
$this->export_label[$r]="ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
$this->import_label[$r]="ProductsOrServiceMultiPrice"; // Translation key
|
||||||
$this->export_permission[$r]=array(array("produit","export"));
|
$this->import_icon[$r]=$this->picto;
|
||||||
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",
|
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
$this->import_tables_array[$r]=array('pr'=>MAIN_DB_PREFIX.'product_price');
|
||||||
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
$this->import_tables_creator_array[$r]=array('pr'=>'fk_user_author'); // Fields to store import user id
|
||||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
$this->import_fields_array[$r]=array('pr.fk_product'=>"ProductRowid*",
|
||||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||||
'pr.date_price'=>'DateCreation');
|
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||||
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",
|
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||||
'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product",
|
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||||
'pr.price_ttc'=>"product",
|
'pr.date_price'=>'DateCreation*');
|
||||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
$this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||||
'pr.tva_tx'=>'product',
|
$this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1",
|
||||||
'pr.date_price'=>"product");
|
'pr.price_base_type'=>"HT",'pr.price_level'=>"1",
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
'pr.price'=>"100",'pr.price_ttc'=>"110",
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p';
|
'pr.price_min'=>"100",'pr.price_min_ttc'=>"110",
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product';
|
'pr.tva_tx'=>'19.6',
|
||||||
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')';
|
'pr.date_price'=>'2013-04-10');
|
||||||
|
|
||||||
|
|
||||||
// Import product multiprice
|
|
||||||
//--------
|
|
||||||
$r=0;
|
|
||||||
|
|
||||||
$r++;
|
|
||||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
|
||||||
$this->import_label[$r]="ProductsMultiPrice"; // 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('pr'=>MAIN_DB_PREFIX.'product_price');
|
|
||||||
$this->import_tables_creator_array[$r]=array('pr'=>'fk_user_author'); // Fields to store import user id
|
|
||||||
$this->import_fields_array[$r]=array('pr.fk_product'=>"ProductRowid*",
|
|
||||||
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
|
||||||
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
|
||||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
|
||||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
|
||||||
'pr.date_price'=>'DateCreation*');
|
|
||||||
$this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
|
||||||
$this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1",
|
|
||||||
'pr.price_base_type'=>"HT",'pr.price_level'=>"1",
|
|
||||||
'pr.price'=>"100",'pr.price_ttc'=>"110",
|
|
||||||
'pr.price_min'=>"100",'pr.price_min_ttc'=>"110",
|
|
||||||
'pr.tva_tx'=>'19.6',
|
|
||||||
'pr.date_price'=>'2013-04-10');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,6 +168,35 @@ class modService extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 1 AND p.entity IN ('.getEntity("product", 1).')';
|
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 1 AND p.entity IN ('.getEntity("product", 1).')';
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($conf->product->enabled)) // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
|
{
|
||||||
|
// Exports product multiprice
|
||||||
|
$r++;
|
||||||
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
|
$this->export_label[$r]="ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||||
|
$this->export_permission[$r]=array(array("produit","export"));
|
||||||
|
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",
|
||||||
|
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||||
|
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||||
|
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||||
|
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||||
|
'pr.date_price'=>'DateCreation');
|
||||||
|
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",
|
||||||
|
'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product",
|
||||||
|
'pr.price_ttc'=>"product",
|
||||||
|
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||||
|
'pr.tva_tx'=>'product',
|
||||||
|
'pr.date_price'=>"product");
|
||||||
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product';
|
||||||
|
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
//--------
|
//--------
|
||||||
$r=0;
|
$r=0;
|
||||||
@ -196,6 +225,64 @@ class modService extends DolibarrModules
|
|||||||
$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'=>"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');
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($conf->product->enabled)) // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
|
||||||
|
{
|
||||||
|
if (! empty($conf->fournisseur->enabled))
|
||||||
|
{
|
||||||
|
// Import suppliers prices (note: this code is duplicated into module product)
|
||||||
|
$r++;
|
||||||
|
$this->import_code[$r]=$this->rights_class.'_supplierprices';
|
||||||
|
$this->import_label[$r]="SuppliersPricesOfProductsOrServices"; // 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('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'=>"ProductOrService*",
|
||||||
|
'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'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
|
{
|
||||||
|
// Import product multiprice
|
||||||
|
$r++;
|
||||||
|
$this->import_code[$r]=$this->rights_class.'_multiprice';
|
||||||
|
$this->import_label[$r]="ProductsOrServiceMultiPrice"; // 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('pr'=>MAIN_DB_PREFIX.'product_price');
|
||||||
|
$this->import_tables_creator_array[$r]=array('pr'=>'fk_user_author'); // Fields to store import user id
|
||||||
|
$this->import_fields_array[$r]=array('pr.fk_product'=>"ProductRowid*",
|
||||||
|
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||||
|
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||||
|
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||||
|
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||||
|
'pr.date_price'=>'DateCreation*');
|
||||||
|
$this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||||
|
$this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1",
|
||||||
|
'pr.price_base_type'=>"HT",'pr.price_level'=>"1",
|
||||||
|
'pr.price'=>"100",'pr.price_ttc'=>"110",
|
||||||
|
'pr.price_min'=>"100",'pr.price_min_ttc'=>"110",
|
||||||
|
'pr.tva_tx'=>'19.6',
|
||||||
|
'pr.date_price'=>'2013-04-10');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -352,10 +352,13 @@ if ($step == 1 || ! $datatoimport)
|
|||||||
{
|
{
|
||||||
foreach ($objimport->array_import_code as $key => $value)
|
foreach ($objimport->array_import_code as $key => $value)
|
||||||
{
|
{
|
||||||
|
//var_dump($objimport->array_import_code[$key]);
|
||||||
$val=!$val;
|
$val=!$val;
|
||||||
print '<tr '.$bc[$val].'><td nospan="nospan">';
|
print '<tr '.$bc[$val].'><td nospan="nospan">';
|
||||||
//print img_object($objimport->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' ';
|
$titleofmodule=$objimport->array_import_module[$key]->getName();
|
||||||
print $objimport->array_import_module[$key]->getName();
|
// Special cas for import common to module/services
|
||||||
|
if (in_array($objimport->array_import_code[$key], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||||
|
print $titleofmodule;
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
//print $value;
|
//print $value;
|
||||||
print img_object($objimport->array_import_module[$key]->getName(),$objimport->array_import_icon[$key]).' ';
|
print img_object($objimport->array_import_module[$key]->getName(),$objimport->array_import_icon[$key]).' ';
|
||||||
@ -407,8 +410,10 @@ if ($step == 2 && $datatoimport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print img_object($objimport->array_import_module[0]->getName(),$objimport->array_import_module[0]->picto).' ';
|
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||||
print $objimport->array_import_module[0]->getName();
|
// Special cas for import common to module/services
|
||||||
|
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||||
|
print $titleofmodule;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donnees a importer
|
// Lot de donnees a importer
|
||||||
@ -490,8 +495,10 @@ if ($step == 3 && $datatoimport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print img_object($objimport->array_import_module[0]->getName(),$objimport->array_import_module[0]->picto).' ';
|
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||||
print $objimport->array_import_module[0]->getName();
|
// Special cas for import common to module/services
|
||||||
|
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||||
|
print $titleofmodule;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donnees a importer
|
// Lot de donnees a importer
|
||||||
@ -695,8 +702,10 @@ if ($step == 4 && $datatoimport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print img_object($objimport->array_import_module[0]->getName(),$objimport->array_import_module[0]->picto).' ';
|
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||||
print $objimport->array_import_module[0]->getName();
|
// Special cas for import common to module/services
|
||||||
|
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||||
|
print $titleofmodule;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donnees a importer
|
// Lot de donnees a importer
|
||||||
@ -1144,8 +1153,10 @@ if ($step == 5 && $datatoimport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print img_object($objimport->array_import_module[0]->getName(),$objimport->array_import_module[0]->picto).' ';
|
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||||
print $objimport->array_import_module[0]->getName();
|
// Special cas for import common to module/services
|
||||||
|
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||||
|
print $titleofmodule;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donnees a importer
|
// Lot de donnees a importer
|
||||||
@ -1487,8 +1498,10 @@ if ($step == 6 && $datatoimport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print img_object($objimport->array_import_module[0]->getName(),$objimport->array_import_module[0]->picto).' ';
|
$titleofmodule=$objimport->array_import_module[0]->getName();
|
||||||
print $objimport->array_import_module[0]->getName();
|
// Special cas for import common to module/services
|
||||||
|
if (in_array($objimport->array_import_code[0], array('produit_supplierprices','produit_multiprice'))) $titleofmodule=$langs->trans("ProductOrService");
|
||||||
|
print $titleofmodule;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donnees a importer
|
// Lot de donnees a importer
|
||||||
|
|||||||
@ -179,6 +179,7 @@ ProductIsUsed=This product is used
|
|||||||
NewRefForClone=Ref. of new product/service
|
NewRefForClone=Ref. of new product/service
|
||||||
CustomerPrices=Customers prices
|
CustomerPrices=Customers prices
|
||||||
SuppliersPrices=Suppliers prices
|
SuppliersPrices=Suppliers prices
|
||||||
|
SuppliersPricesOfProductsOrServices=Suppliers prices (of products or services)
|
||||||
CustomCode=Customs code
|
CustomCode=Customs code
|
||||||
CountryOrigin=Origin country
|
CountryOrigin=Origin country
|
||||||
HiddenIntoCombo=Hidden into select lists
|
HiddenIntoCombo=Hidden into select lists
|
||||||
@ -208,6 +209,7 @@ CostPmpHT=Net total VWAP
|
|||||||
ProductUsedForBuild=Auto consumed by production
|
ProductUsedForBuild=Auto consumed by production
|
||||||
ProductBuilded=Production completed
|
ProductBuilded=Production completed
|
||||||
ProductsMultiPrice=Product multi-price
|
ProductsMultiPrice=Product multi-price
|
||||||
|
ProductsOrServiceMultiPrice=Customers prices (of products or services, multi-prices)
|
||||||
ProductSellByQuarterHT=Products turnover quarterly VWAP
|
ProductSellByQuarterHT=Products turnover quarterly VWAP
|
||||||
ServiceSellByQuarterHT=Services turnover quarterly VWAP
|
ServiceSellByQuarterHT=Services turnover quarterly VWAP
|
||||||
Quarter1=1st. Quarter
|
Quarter1=1st. Quarter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user