Works on product canvas and templates
!! WARNING : not stable !!
This commit is contained in:
parent
ea691a9e31
commit
16446edca4
@ -1520,9 +1520,22 @@ class Form
|
|||||||
* \param htmlname Nom de la zone select
|
* \param htmlname Nom de la zone select
|
||||||
*/
|
*/
|
||||||
function select_PriceBaseType($selected='',$htmlname='price_base_type')
|
function select_PriceBaseType($selected='',$htmlname='price_base_type')
|
||||||
|
{
|
||||||
|
print $this->load_PriceBaseType($selected,$htmlname);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Selection HT ou TTC
|
||||||
|
* \param selected Id pre-selectionne
|
||||||
|
* \param htmlname Nom de la zone select
|
||||||
|
*/
|
||||||
|
function load_PriceBaseType($selected='',$htmlname='price_base_type')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
print '<select class="flat" name="'.$htmlname.'">';
|
|
||||||
|
$return='';
|
||||||
|
|
||||||
|
$return.= '<select class="flat" name="'.$htmlname.'">';
|
||||||
$options = array(
|
$options = array(
|
||||||
'HT'=>$langs->trans("HT"),
|
'HT'=>$langs->trans("HT"),
|
||||||
'TTC'=>$langs->trans("TTC")
|
'TTC'=>$langs->trans("TTC")
|
||||||
@ -1531,15 +1544,17 @@ class Form
|
|||||||
{
|
{
|
||||||
if ($selected == $id)
|
if ($selected == $id)
|
||||||
{
|
{
|
||||||
print '<option value="'.$id.'" selected="true">'.$value;
|
$return.= '<option value="'.$id.'" selected="true">'.$value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<option value="'.$id.'">'.$value;
|
$return.= '<option value="'.$id.'">'.$value;
|
||||||
}
|
}
|
||||||
print '</option>';
|
$return.= '</option>';
|
||||||
}
|
}
|
||||||
print '</select>';
|
$return.= '</select>';
|
||||||
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2192,7 +2207,6 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Output an HTML select vat rate
|
* \brief Output an HTML select vat rate
|
||||||
* \param name Nom champ html
|
* \param name Nom champ html
|
||||||
@ -2208,9 +2222,31 @@ class Form
|
|||||||
* Sinon la TVA proposee par defaut=0. Fin de regle.
|
* Sinon la TVA proposee par defaut=0. Fin de regle.
|
||||||
*/
|
*/
|
||||||
function select_tva($name='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $taux_produit='', $info_bits=0)
|
function select_tva($name='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $taux_produit='', $info_bits=0)
|
||||||
|
{
|
||||||
|
print $this->load_tva($name, $selectedrate, $societe_vendeuse, $societe_acheteuse, $taux_produit, $info_bits);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Output an HTML select vat rate
|
||||||
|
* \param name Nom champ html
|
||||||
|
* \param selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage.
|
||||||
|
* \param societe_vendeuse Objet societe vendeuse
|
||||||
|
* \param societe_acheteuse Objet societe acheteuse
|
||||||
|
* \param taux_produit Taux par defaut du produit vendu
|
||||||
|
* \param info_bits Miscellanous information on line
|
||||||
|
* \remarks Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle.
|
||||||
|
* Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle.
|
||||||
|
* Si (vendeur et acheteur dans Communaute europeenne) et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle.
|
||||||
|
* Si (vendeur et acheteur dans Communaute europeenne) et bien vendu autre que transport neuf alors la TVA par defaut=TVA du produit vendu. Fin de regle.
|
||||||
|
* Sinon la TVA proposee par defaut=0. Fin de regle.
|
||||||
|
*/
|
||||||
|
function load_tva($name='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $taux_produit='', $info_bits=0)
|
||||||
{
|
{
|
||||||
global $langs,$conf,$mysoc;
|
global $langs,$conf,$mysoc;
|
||||||
|
|
||||||
|
$return='';
|
||||||
|
|
||||||
$txtva=array();
|
$txtva=array();
|
||||||
$libtva=array();
|
$libtva=array();
|
||||||
$nprtva=array();
|
$nprtva=array();
|
||||||
@ -2225,13 +2261,13 @@ class Form
|
|||||||
{
|
{
|
||||||
if ($societe_vendeuse->id == $mysoc->id)
|
if ($societe_vendeuse->id == $mysoc->id)
|
||||||
{
|
{
|
||||||
print '<font class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</div>';
|
$return.= '<font class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<font class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</div>';
|
$return.= '<font class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</div>';
|
||||||
}
|
}
|
||||||
return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($societe_vendeuse))
|
if (is_object($societe_vendeuse))
|
||||||
@ -2274,12 +2310,12 @@ class Form
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<font class="error">'.$langs->trans("ErrorNoVATRateDefinedForSellerCountry",$code_pays).'</font>';
|
$return.= '<font class="error">'.$langs->trans("ErrorNoVATRateDefinedForSellerCountry",$code_pays).'</font>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<font class="error">'.$this->db->error().'</font>';
|
$return.= '<font class="error">'.$this->db->error().'</font>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
|
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
|
||||||
@ -2299,28 +2335,30 @@ class Form
|
|||||||
|
|
||||||
if (sizeof($txtva))
|
if (sizeof($txtva))
|
||||||
{
|
{
|
||||||
print '<select class="flat" name="'.$name.'">';
|
$return.= '<select class="flat" name="'.$name.'">';
|
||||||
|
|
||||||
for ($i = 0 ; $i < $nbdetaux ; $i++)
|
for ($i = 0 ; $i < $nbdetaux ; $i++)
|
||||||
{
|
{
|
||||||
//print "xxxxx".$txtva[$i]."-".$nprtva[$i];
|
//print "xxxxx".$txtva[$i]."-".$nprtva[$i];
|
||||||
print '<option value="'.$txtva[$i];
|
$return.= '<option value="'.$txtva[$i];
|
||||||
print $nprtva[$i] ? '*': '';
|
$return.= $nprtva[$i] ? '*': '';
|
||||||
print '"';
|
$return.= '"';
|
||||||
if ($txtva[$i] == $defaulttx && $nprtva[$i] == $defaultnpr)
|
if ($txtva[$i] == $defaulttx && $nprtva[$i] == $defaultnpr)
|
||||||
{
|
{
|
||||||
print ' selected="true"';
|
$return.= ' selected="true"';
|
||||||
}
|
}
|
||||||
print '>'.vatrate($libtva[$i]);
|
$return.= '>'.vatrate($libtva[$i]);
|
||||||
print $nprtva[$i] ? ' *': '';
|
$return.= $nprtva[$i] ? ' *': '';
|
||||||
print '</option>';
|
$return.= '</option>';
|
||||||
|
|
||||||
$this->tva_taux_value[$i] = $txtva[$i];
|
$this->tva_taux_value[$i] = $txtva[$i];
|
||||||
$this->tva_taux_libelle[$i] = $libtva[$i];
|
$this->tva_taux_libelle[$i] = $libtva[$i];
|
||||||
$this->tva_taux_npr[$i] = $nprtva[$i];
|
$this->tva_taux_npr[$i] = $nprtva[$i];
|
||||||
}
|
}
|
||||||
print '</select>';
|
$return.= '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2028,6 +2028,19 @@ function print_titre($titre)
|
|||||||
print '<div class="titre">'.$titre.'</div>';
|
print '<div class="titre">'.$titre.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Show a title with picto
|
||||||
|
* \param titre Title to show
|
||||||
|
* \param mesg Added message to show on right
|
||||||
|
* \param picto Icon to use before title (should be a 32x32 transparent png file)
|
||||||
|
* \param pictoisfullpath 1=Icon name is a full absolute url of image
|
||||||
|
* \param id To force an id on html objects
|
||||||
|
*/
|
||||||
|
function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='')
|
||||||
|
{
|
||||||
|
print load_fiche_titre($titre, $mesg, $picto, $pictoisfullpath, $id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load a title with picto
|
* \brief Load a title with picto
|
||||||
* \param titre Title to show
|
* \param titre Title to show
|
||||||
@ -2060,19 +2073,6 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Show a title with picto
|
|
||||||
* \param titre Title to show
|
|
||||||
* \param mesg Added message to show on right
|
|
||||||
* \param picto Icon to use before title (should be a 32x32 transparent png file)
|
|
||||||
* \param pictoisfullpath 1=Icon name is a full absolute url of image
|
|
||||||
* \param id To force an id on html objects
|
|
||||||
*/
|
|
||||||
function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='')
|
|
||||||
{
|
|
||||||
print load_fiche_titre($titre, $mesg, $picto, $pictoisfullpath, $id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Print a title with navigation controls for pagination
|
* \brief Print a title with navigation controls for pagination
|
||||||
* \param titre Title to show (required)
|
* \param titre Title to show (required)
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class ProductDefault extends Product
|
|||||||
$this->module = "produit";
|
$this->module = "produit";
|
||||||
$this->canvas = "default";
|
$this->canvas = "default";
|
||||||
$this->name = "default";
|
$this->name = "default";
|
||||||
$this->description = "Canvas des produits (défaut)";
|
$this->definition = "Canvas des produits (défaut)";
|
||||||
$this->fieldListName = "product_default";
|
$this->fieldListName = "product_default";
|
||||||
|
|
||||||
$this->next_prev_filter = "canvas='default'";
|
$this->next_prev_filter = "canvas='default'";
|
||||||
@ -77,7 +77,9 @@ class ProductDefault extends Product
|
|||||||
*/
|
*/
|
||||||
function assign_values($action='')
|
function assign_values($action='')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$html;
|
global $conf,$langs;
|
||||||
|
global $html;
|
||||||
|
global $formproduct;
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
$this->tpl['ref'] = $this->ref;
|
$this->tpl['ref'] = $this->ref;
|
||||||
@ -95,7 +97,7 @@ class ProductDefault extends Product
|
|||||||
$this->tpl['note'] = nl2br($this->note);
|
$this->tpl['note'] = nl2br($this->note);
|
||||||
|
|
||||||
// Hidden
|
// Hidden
|
||||||
if ($user->rights->produit->hidden)
|
if ($this->user->rights->produit->hidden)
|
||||||
{
|
{
|
||||||
$this->tpl['hidden'] = yn($this->hidden);
|
$this->tpl['hidden'] = yn($this->hidden);
|
||||||
}
|
}
|
||||||
@ -112,6 +114,17 @@ class ProductDefault extends Product
|
|||||||
// Title
|
// Title
|
||||||
$this->tpl['title'] = load_fiche_titre($langs->trans("NewProduct"));
|
$this->tpl['title'] = load_fiche_titre($langs->trans("NewProduct"));
|
||||||
|
|
||||||
|
// Price
|
||||||
|
$this->tpl['price'] = $this->price;
|
||||||
|
$this->tpl['price_min'] = $this->price_min;
|
||||||
|
$this->tpl['price_base_type'] = $html->load_PriceBaseType($this->price_base_type, "price_base_type");
|
||||||
|
|
||||||
|
// VAT
|
||||||
|
$this->tpl['tva_tx'] = $html->load_tva("tva_tx",$conf->defaulttx,$mysoc,'');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'create' || $action == 'edit')
|
||||||
|
{
|
||||||
// Status
|
// Status
|
||||||
$statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell"));
|
$statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell"));
|
||||||
$this->tpl['status'] = $html->selectarray('statut',$statutarray,$this->status);
|
$this->tpl['status'] = $html->selectarray('statut',$statutarray,$this->status);
|
||||||
@ -119,24 +132,51 @@ class ProductDefault extends Product
|
|||||||
// Finished
|
// Finished
|
||||||
$statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
|
$statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
|
||||||
$this->tpl['finished'] = $html->selectarray('finished',$statutarray,$this->finished);
|
$this->tpl['finished'] = $html->selectarray('finished',$statutarray,$this->finished);
|
||||||
|
|
||||||
|
// Weight
|
||||||
|
$this->tpl['weight'] = $this->weight;
|
||||||
|
$this->tpl['weight_units'] = $formproduct->load_measuring_units("weight_units","weight",$this->weight_units);
|
||||||
|
|
||||||
|
// Length
|
||||||
|
$this->tpl['length'] = $this->length;
|
||||||
|
$this->tpl['length_units'] = $formproduct->load_measuring_units("length_units","size",$this->length_units);
|
||||||
|
|
||||||
|
// Surface
|
||||||
|
$this->tpl['surface'] = $this->surface;
|
||||||
|
$this->tpl['surface_units'] = $formproduct->load_measuring_units("surface_units","surface",$this->surface_units);
|
||||||
|
|
||||||
|
// Volume
|
||||||
|
$this->tpl['volume'] = $this->volume;
|
||||||
|
$this->tpl['volume_units'] = $formproduct->load_measuring_units("volume_units","volume",$this->volume_units);
|
||||||
|
|
||||||
|
// Hidden
|
||||||
|
if ($this->user->rights->produit->hidden)
|
||||||
|
{
|
||||||
|
$this->tpl['hidden'] = $html->selectyesno('hidden',$this->hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'create' || $action == 'edit')
|
|
||||||
{
|
|
||||||
// TODO creer fonction
|
// TODO creer fonction
|
||||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
$doleditor=new DolEditor('desc',$product->description,160,'dolibarr_notes','',false);
|
|
||||||
$this->tpl['doleditor'] = $doleditor;
|
$doleditor=new DolEditor('desc',$this->description,160,'dolibarr_notes','',false);
|
||||||
|
$this->tpl['doleditor_description'] = $doleditor;
|
||||||
|
|
||||||
|
$doleditor=new DolEditor('note',$this->note,180,'dolibarr_notes','',false);
|
||||||
|
$this->tpl['doleditor_note'] = $doleditor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$textarea = '<textarea name="desc" rows="4" cols="90">';
|
$textarea = '<textarea name="desc" rows="4" cols="90">';
|
||||||
$textarea.= $product->description;
|
$textarea.= $this->description;
|
||||||
$textarea.= '</textarea>';
|
$textarea.= '</textarea>';
|
||||||
|
$this->tpl['textarea_description'] = $textarea;
|
||||||
|
|
||||||
$this->tpl['textarea'] = $textarea;
|
$textarea = '<textarea name="note" rows="8" cols="70">';
|
||||||
|
$textarea.= $this->note;
|
||||||
|
$textarea.= '</textarea>';
|
||||||
|
$this->tpl['textarea_note'] = $textarea;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,10 +55,10 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<tr><td valign="top"><?php echo $langs->trans("Description"); ?></td><td>
|
<tr><td valign="top"><?php echo $langs->trans("Description"); ?></td><td>
|
||||||
<?php if (! $product->tpl['textarea']) {
|
<?php if (! $product->tpl['textarea_description']) {
|
||||||
$product->tpl['doleditor']->Create();
|
$product->tpl['doleditor_description']->Create();
|
||||||
}else{
|
}else{
|
||||||
echo $product->tpl['textarea'];
|
echo $product->tpl['textarea_description'];
|
||||||
}?>
|
}?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
@ -67,85 +67,60 @@ echo $product->tpl['textarea'];
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td><?php echo $langs->trans("Weight"); ?></td><td>
|
<tr><td><?php echo $langs->trans("Weight"); ?></td><td>
|
||||||
<input name="weight" size="4" value="<?php echo $_POST["weight"]; ?>">
|
<input name="weight" size="4" value="<?php echo $product->tpl['weight']; ?>">
|
||||||
print $formproduct->select_measuring_units("weight_units","weight");
|
<?php echo $product->tpl['weight_units']; ?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td><?php echo $langs->trans("Length"); ?></td><td>
|
<tr><td><?php echo $langs->trans("Length"); ?></td><td>
|
||||||
<input name="size" size="4" value="<?php echo $_POST["size"]; ?>">
|
<input name="size" size="4" value="<?php echo $product->tpl['length']; ?>">
|
||||||
print $formproduct->select_measuring_units("size_units","size");
|
<?php echo $product->tpl['length_units']; ?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td><?php echo $langs->trans("Surface"); ?></td><td>
|
<tr><td><?php echo $langs->trans("Surface"); ?></td><td>
|
||||||
<input name="surface" size="4" value="<?php echo $_POST["surface"]; ?>">
|
<input name="surface" size="4" value="<?php echo $product->tpl['surface']; ?>">
|
||||||
print $formproduct->select_measuring_units("surface_units","surface");
|
<?php echo $product->tpl['surface_units']; ?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td><?php echo $langs->trans("Volume"); ?></td><td>
|
<tr><td><?php echo $langs->trans("Volume"); ?></td><td>
|
||||||
<input name="volume" size="4" value="<?php echo $_POST["volume"]; ?>">
|
<input name="volume" size="4" value="<?php echo $product->tpl['volume']; ?>">
|
||||||
print $formproduct->select_measuring_units("volume_units","volume");
|
<?php echo $product->tpl['volume_units']; ?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
// Hidden
|
<tr><td><?php echo $langs->trans("Hidden"); ?></td>
|
||||||
if (($_GET["type"] != 1 && $user->rights->produit->hidden)
|
<td><?php echo $product->tpl['hidden']; ?></td></tr>
|
||||||
|| ($_GET["type"] == 1 && $user->rights->service->hidden))
|
|
||||||
{
|
|
||||||
<tr><td><?php echo $langs->trans("Hidden"); ?></td><td>
|
|
||||||
print $html->selectyesno('hidden',$product->hidden);
|
|
||||||
</td></tr>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print yn("No");
|
|
||||||
}
|
|
||||||
|
|
||||||
<tr><td valign="top"><?php echo $langs->trans("NoteNotVisibleOnBill"); ?></td><td>
|
<tr><td valign="top"><?php echo $langs->trans("NoteNotVisibleOnBill"); ?></td><td>
|
||||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
|
<?php if (! $product->tpl['textarea_note']) {
|
||||||
{
|
$product->tpl['doleditor_note']->Create();
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
}else{
|
||||||
$doleditor=new DolEditor('note',$_POST["note"],180,'dolibarr_notes','',false);
|
echo $product->tpl['textarea_note'];
|
||||||
$doleditor->Create();
|
}?>
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<textarea name="note" rows="8" cols="70">';
|
|
||||||
print $_POST["note"];
|
|
||||||
print '</textarea>';
|
|
||||||
}
|
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
if ($conf->global->PRODUIT_MULTIPRICES)
|
<?php if (! $conf->global->PRODUIT_MULTIPRICES) { ?>
|
||||||
{
|
|
||||||
// We do no show price array on create when multiprices enabled.
|
|
||||||
// We must set them on prices tab.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
// PRIX
|
<table class="border" width="100%">
|
||||||
print '<tr><td>'.$langs->trans("SellingPrice").'</td>';
|
|
||||||
print '<td><input name="price" size="10" value="'.$product->price.'">';
|
|
||||||
print $html->select_PriceBaseType($product->price_base_type, "price_base_type");
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// MIN PRICE
|
<tr><td><?php echo $langs->trans("SellingPrice"); ?></td>
|
||||||
print '<tr><td>'.$langs->trans("MinPrice").'</td>';
|
<td><input name="price" size="10" value="<?php echo $product->tpl['price']; ?>">
|
||||||
print '<td><input name="price_min" size="10" value="'.$product->price_min.'">';
|
<?php echo $product->tpl['price_base_type']; ?>
|
||||||
print '</td></tr>';
|
</td></tr>
|
||||||
|
|
||||||
// VAT
|
<tr><td><?php echo $langs->trans("MinPrice"); ?></td>
|
||||||
print '<tr><td width="20%">'.$langs->trans("VATRate").'</td><td>';
|
<td><input name="price_min" size="10" value="<?php echo $product->tpl['price_min']; ?>">
|
||||||
print $html->select_tva("tva_tx",$conf->defaulttx,$mysoc,'');
|
</td></tr>
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
<tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td>
|
||||||
|
<?php echo $product->tpl['tva_tx']; ?>
|
||||||
|
</td></tr>
|
||||||
|
|
||||||
print '<br>';
|
</table>
|
||||||
}
|
|
||||||
|
<br>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<center><input type="submit" class="button" value="<?php echo $langs->trans("Create"); ?>"></center>
|
<center><input type="submit" class="button" value="<?php echo $langs->trans("Create"); ?>"></center>
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,6 @@ class FormProduct
|
|||||||
print '</select>';
|
print '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Selection des unites de mesure
|
* \brief Selection des unites de mesure
|
||||||
* \param name Nom champ html
|
* \param name Nom champ html
|
||||||
@ -127,10 +126,24 @@ class FormProduct
|
|||||||
* \remarks pour l'instant on ne definit pas les unites dans la base
|
* \remarks pour l'instant on ne definit pas les unites dans la base
|
||||||
*/
|
*/
|
||||||
function select_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0)
|
function select_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0)
|
||||||
|
{
|
||||||
|
print $this->load_measuring_units($name, $measuring_style, $default, $adddefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Selection des unites de mesure
|
||||||
|
* \param name Nom champ html
|
||||||
|
* \param measuring_style Le style de mesure : weight, volume,...
|
||||||
|
* \param default Forcage de l'unite
|
||||||
|
* \remarks pour l'instant on ne definit pas les unites dans la base
|
||||||
|
*/
|
||||||
|
function load_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0)
|
||||||
{
|
{
|
||||||
global $langs,$conf,$mysoc;
|
global $langs,$conf,$mysoc;
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
|
$return='';
|
||||||
|
|
||||||
if ($measuring_style == 'weight')
|
if ($measuring_style == 'weight')
|
||||||
{
|
{
|
||||||
$measuring_units[3] = $langs->trans("WeightUnitton");
|
$measuring_units[3] = $langs->trans("WeightUnitton");
|
||||||
@ -160,19 +173,21 @@ class FormProduct
|
|||||||
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<select class="flat" name="'.$name.'">';
|
$return.= '<select class="flat" name="'.$name.'">';
|
||||||
if ($adddefault) print '<option value="0">'.$langs->trans("Default").'</option>';
|
if ($adddefault) $return.= '<option value="0">'.$langs->trans("Default").'</option>';
|
||||||
|
|
||||||
foreach ($measuring_units as $key => $value)
|
foreach ($measuring_units as $key => $value)
|
||||||
{
|
{
|
||||||
print '<option value="'.$key.'"';
|
$return.= '<option value="'.$key.'"';
|
||||||
if ($key == $default)
|
if ($key == $default)
|
||||||
{
|
{
|
||||||
print ' selected="true"';
|
$return.= ' selected="true"';
|
||||||
}
|
}
|
||||||
print '>'.$value.'</option>';
|
$return.= '>'.$value.'</option>';
|
||||||
}
|
}
|
||||||
print '</select>';
|
$return.= '</select>';
|
||||||
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user