mise jour de Prototype : version 1.6.0_rc0
dbut gestion taux de marge (encore en dev mais dsactiv par dfaut)
This commit is contained in:
parent
8fd18a08bc
commit
059352a192
@ -1027,7 +1027,7 @@ if ($_GET['propalid'] > 0)
|
||||
|
||||
$sql = 'SELECT pt.rowid, pt.description, pt.fk_product, pt.fk_remise_except,';
|
||||
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
|
||||
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.marge_tx, pt.marque_tx,';
|
||||
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.marge_tx, pt.marque_tx,pt.pa_ht,';
|
||||
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid,';
|
||||
$sql.= ' p.description as product_desc';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
|
||||
@ -1044,7 +1044,14 @@ if ($_GET['propalid'] > 0)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Description').'</td>';
|
||||
if ($conf->global->PRODUIT_USE_MARKUP) print '<td align="right" width="80">'.$langs->trans('Markup').'</td>';
|
||||
if ($conf->global->PRODUIT_USE_MARKUP)
|
||||
{
|
||||
if ($_GET["action"] == 'editmarkup')
|
||||
{
|
||||
print '<td align="right" width="80">'.$langs->trans('PuchasePrice').'</td>';
|
||||
}
|
||||
print '<td align="right" width="80">'.$langs->trans('Markup').'</td>';
|
||||
}
|
||||
print '<td align="right" width="50">'.$langs->trans('VAT').'</td>';
|
||||
print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
||||
@ -1060,7 +1067,7 @@ if ($_GET['propalid'] > 0)
|
||||
$var=!$var;
|
||||
|
||||
// Ligne en mode visu
|
||||
if ($_GET['action'] != 'editline' || $_GET['ligne'] != $objp->rowid)
|
||||
if (($_GET['action'] != 'editline' && $_GET['action'] != 'editmarkup') || $_GET['ligne'] != $objp->rowid)
|
||||
{
|
||||
print '<tr '.$bc[$var].'>';
|
||||
if ($objp->fk_product > 0)
|
||||
@ -1078,7 +1085,7 @@ if ($_GET['propalid'] > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $html->textwithtooltip($text,$objp->description,4,'','',$i,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
|
||||
print $html->textwithtooltip($text,$objp->description,3,'','',$i,500,100,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
|
||||
}
|
||||
print_date_range($objp->date_start,$objp->date_end);
|
||||
|
||||
@ -1126,18 +1133,52 @@ if ($_GET['propalid'] > 0)
|
||||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
if ($conf->global->PRODUIT_USE_MARKUP && $conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX)
|
||||
if ($conf->global->PRODUIT_USE_MARKUP && $conf->use_ajax)
|
||||
{
|
||||
print '<div id="calc_markup'.$i.'" style="display:none">';
|
||||
$html->select_product_fourn_price($objp->fk_product,'productfournpriceid');
|
||||
|
||||
$formMarkup = '<form id="formMarkup" action="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'" method="post">'."\n";
|
||||
$formMarkup.= '<table class="border" width="100%">'."\n";
|
||||
$formMarkup.= '<tr><td align="left" colspan="2"> </td></tr>'."\n";
|
||||
$formMarkup.= '<tr><td align="left" width="25%" height="19"> '.$langs->trans('SupplierPrice').'</td>'."\n";
|
||||
$formMarkup.= '<td align="left">'.$html->select_product_fourn_price($objp->fk_product,'productfournpriceid').'</td></tr>'."\n";
|
||||
$formMarkup.= '<tr><td align="left" colspan="2"> </td></tr>'."\n";
|
||||
$formMarkup.= '<tr><td align="left" width="25%" height="19"> '.$langs->trans('PurchasePrice').' '.$langs->trans('HT').'</td>'."\n";
|
||||
$formMarkup.= '<td align="left"><input size="10" type="text" class="flat" name="purchaseprice_ht" value=""></td></tr>'."\n";
|
||||
$formMarkup.= '<tr><td align="left" width="25%" height="19"> '.$langs->trans('MarkupRate').'</td>'."\n";
|
||||
$formMarkup.= '<td><input size="10" type="text" class="flat" id="markuprate'.$i.'" name="markuprate'.$i.'" value=""></td></tr>'."\n";
|
||||
$formMarkup.= '<tr><td align="left" width="25%" height="19"> '.$langs->trans('SellingPrice').' '.$langs->trans('HT').'</td>'."\n";
|
||||
//$formMarkup.= '<td><div id="sellingprice_ht'.$i.'"><input size="10" type="text" class="flat" id="sellingdata_ht'.$i.'" name="sellingdata_ht'.$i.'" value=""></div></td></tr>'."\n";
|
||||
$formMarkup.= '<td nowrap="nowrap"><div id="sellingprice_ht'.$i.'"><div></td></tr>'."\n";
|
||||
$formMarkup.= '<tr><td align="left" width="25%" height="19"> '.$langs->trans('CashFlow').' '.$langs->trans('HT').'</td>'."\n";
|
||||
$formMarkup.= '<td nowrap="nowrap"><div id="cashflow'.$i.'"></div></td></tr>'."\n";
|
||||
$formMarkup.= '<tr><td align="center" colspan="2">'."\n";
|
||||
$formMarkup.= '<input type="submit" class="button" name="validate" value="'.$langs->trans('Validate').'">'."\n";
|
||||
//$formMarkup.= ' <input onClick="Dialog.closeInfo()" type="button" class="button" name="cancel" value="'.$langs->trans('Cancel').'">'."\n";
|
||||
$formMarkup.= '</td></tr></table></form>'."\n";
|
||||
$formMarkup.= ajax_updaterWithID("rate".$i,"markup","sellingprice_ht".$i,"/product/ajaxproducts.php","&count=".$i,"working")."\n";
|
||||
|
||||
|
||||
print '<td align="right">'."\n";
|
||||
|
||||
print '<div id="calc_markup'.$i.'" style="display:none">'."\n";
|
||||
print $formMarkup."\n";
|
||||
print '</div>'."\n";
|
||||
|
||||
print '<td align="right">';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%"><tr class="nocellnopadd">';
|
||||
print '<td class="nobordernopadding" nowrap="nowrap" align="left">';
|
||||
print '<a href="#" onClick="dialogInfo($(\'calc_markup'.$i.'\').innerHTML)">';
|
||||
print img_calc($langs->trans("ToCalculateMarkup"));
|
||||
print '</a></td>';
|
||||
if (($objp->info_bits & 2) == 2)
|
||||
{
|
||||
// Ligne remise prédéfinie, on ne permet pas modif
|
||||
}
|
||||
else
|
||||
{
|
||||
$picto = '<a href="#" onClick="dialogWindow($(\'calc_markup'.$i.'\').innerHTML,\''.$langs->trans('ToCalculateMarkup').'\')">';
|
||||
$picto.= img_calc();
|
||||
$picto.= '</a>';
|
||||
print $html->textwithtooltip($picto,$langs->trans("ToCalculateMarkup"),4,'','',$i);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="nobordernopadding" nowrap="nowrap" align="right">'.vatrate($objp->marge_tx).'% </td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
@ -1244,24 +1285,34 @@ if ($_GET['propalid'] > 0)
|
||||
print ' - '.nl2br($objp->product);
|
||||
print '<br>';
|
||||
}
|
||||
// éditeur wysiwyg
|
||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS)
|
||||
if ($_GET["action"] == 'editline')
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('desc',$objp->description,164,'dolibarr_details');
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<textarea name="desc" cols="70" class="flat" rows="'.ROWS_2.'">'.$objp->description.'</textarea>';
|
||||
// éditeur wysiwyg
|
||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('desc',$objp->description,164,'dolibarr_details');
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<textarea name="desc" cols="70" class="flat" rows="'.ROWS_2.'">'.$objp->description.'</textarea>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if ($conf->global->PRODUIT_USE_MARKUP) print '<td> </td>';
|
||||
if ($conf->global->PRODUIT_USE_MARKUP)
|
||||
{
|
||||
print '<td align="right">'.vatrate($objp->marge_tx).'%</td>';
|
||||
}
|
||||
print '<td align="right">';
|
||||
if($societe->tva_assuj == "0")
|
||||
print '<input type="hidden" name="tva_tx" value="0">0';
|
||||
{
|
||||
print '<input type="hidden" name="tva_tx" value="0">0';
|
||||
}
|
||||
else
|
||||
print $html->select_tva("tva_tx",$objp->tva_tx,$mysoc,$societe);
|
||||
{
|
||||
print $html->select_tva("tva_tx",$objp->tva_tx,$mysoc,$societe);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right"><input size="6" type="text" class="flat" name="subprice" value="'.price($objp->subprice,0,'',0).'"></td>';
|
||||
print '<td align="right">';
|
||||
|
||||
@ -73,7 +73,7 @@ class Form
|
||||
\param img Code img du picto
|
||||
\return string Code html du texte,picto
|
||||
*/
|
||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$option='')
|
||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$width='200',$shiftX='10',$option='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -95,7 +95,7 @@ class Form
|
||||
$s.= $htmltext."\n";
|
||||
$s.= '</div>'."\n";
|
||||
$s.= '<script type=\'text/javascript\'>'."\n";
|
||||
$s.= 'TooltipManager.init("","",{width:500, shiftX:100});'."\n";
|
||||
$s.= 'TooltipManager.init("","",{width:'.$width.', shiftX:'.$shiftX.'});'."\n";
|
||||
$s.= 'TooltipManager.addHTML("tip'.$i.'", "tooltip_content");'."\n";
|
||||
$s.= '</script>'."\n";
|
||||
}
|
||||
@ -1264,15 +1264,15 @@ class Form
|
||||
{
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
$form = '<select class="flat" name="'.$htmlname.'">';
|
||||
|
||||
if (! $num)
|
||||
{
|
||||
print '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
|
||||
$form.= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="0"> </option>';
|
||||
$form.= '<option value="0"> </option>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
@ -1288,7 +1288,7 @@ class Form
|
||||
$opt.= $langs->trans("Currency".$conf->monnaie)."/";
|
||||
}
|
||||
|
||||
$opt.= $objp->quantity;
|
||||
$opt.= $objp->quantity.' ';
|
||||
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
@ -1306,13 +1306,14 @@ class Form
|
||||
if ($objp->duration) $opt .= " - ".$objp->duration;
|
||||
$opt .= "</option>\n";
|
||||
|
||||
print $opt;
|
||||
$form.= $opt;
|
||||
$i++;
|
||||
}
|
||||
print '</select>';
|
||||
$form.= '</select>';
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
2429
htdocs/includes/scriptaculous/lib/prototype.js
vendored
2429
htdocs/includes/scriptaculous/lib/prototype.js
vendored
File diff suppressed because it is too large
Load Diff
@ -2905,6 +2905,48 @@ function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working')
|
||||
return $script;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Récupère la valeur d'un champ, effectue un traitement Ajax et affiche le résultat
|
||||
\param htmlname nom et id du champ
|
||||
\param keysearch nom et id complémentaire du champ de collecte
|
||||
\param id ID du champ à modifier
|
||||
\param url chemin du fichier de réponse : /chemin/fichier.php
|
||||
\param option champ supplémentaire de recherche dans les paramètres
|
||||
\param indicator Nom de l'image gif sans l'extension
|
||||
\return script script complet
|
||||
*/
|
||||
function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator='working')
|
||||
{
|
||||
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="">';
|
||||
if ($indicator) $script.=ajax_indicator($htmlname,$indicator);
|
||||
$script.='<script type="text/javascript">';
|
||||
$script.='var myIndicator'.$htmlname.' = {
|
||||
onCreate: function(){
|
||||
if($F("'.$keysearch.$htmlname.'")){
|
||||
Element.show(\'indicator'.$htmlname.'\');
|
||||
}
|
||||
},
|
||||
|
||||
onComplete: function() {
|
||||
if(Ajax.activeRequestCount == 0){
|
||||
Element.hide(\'indicator'.$htmlname.'\');
|
||||
}
|
||||
}
|
||||
};';
|
||||
$script.='Ajax.Responders.register(myIndicator'.$htmlname.');';
|
||||
$script.='new Form.Element.DelayedObserver($("'.$keysearch.$htmlname.'"), 1,
|
||||
function(){
|
||||
var elementHTML = $(\''.$id.'\');
|
||||
var url = \''.DOL_URL_ROOT.$url.'\';
|
||||
o_options = new Object();
|
||||
o_options = {method: \'get\',parameters: "'.$keysearch.'="+$F("'.$keysearch.$htmlname.'")+"'.$option.'"};
|
||||
var myAjax = new Ajax.Updater(elementHTML,url,o_options);
|
||||
});';
|
||||
$script.='</script>';
|
||||
|
||||
return $script;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Récupère la valeur d'un champ, effectue un traitement Ajax et affiche le résultat
|
||||
\param htmlname nom et id du champ
|
||||
|
||||
@ -677,4 +677,27 @@ function dialogConfirm(linkurl,message,ok,cancel,objectID) {
|
||||
==================================================================*/
|
||||
function dialogInfo(message) {
|
||||
Dialog.info(message, {width:700});
|
||||
}
|
||||
|
||||
/*=================================================================
|
||||
Purpose: Affiche une fenetre
|
||||
Input: message
|
||||
Author: Regis Houssin
|
||||
Licence: GPL
|
||||
==================================================================*/
|
||||
function dialogWindow(message,windowTitle) {
|
||||
var win = new Window({className: "dialog",
|
||||
width:600,
|
||||
height:400,
|
||||
zIndex: 100,
|
||||
resizable: false,
|
||||
title: windowTitle,
|
||||
showEffect:Effect.BlindDown,
|
||||
hideEffect: Effect.SwitchOff,
|
||||
draggable:true
|
||||
})
|
||||
/*win.setHTMLContent(message);*/
|
||||
/*win.getContent().innerHTML = message;*/
|
||||
win.getContent().update(message);
|
||||
win.showCenter();
|
||||
}
|
||||
@ -49,6 +49,20 @@ if(isset($_GET['keysearch']) && !empty($_GET['keysearch']))
|
||||
$form->select_produits_fournisseurs_do($_GET["socid"],"",$_GET["htmlname"],"","",$_GET["keysearch"]);
|
||||
}
|
||||
}
|
||||
else if(isset($_GET['markup']) && !empty($_GET['markup']))
|
||||
{
|
||||
print $_GET['markup'];
|
||||
//print $_GET['count'];
|
||||
//$field = "<input size='10' type='text' class='flat' id='sellingdata_ht".$_GET['count']."' name='sellingdata_ht".$_GET['count']."' value='".$_GET['markup']."'>";
|
||||
//print '<input size="10" type="text" class="flat" id="sellingdata_ht'.$_GET['count'].'" name="sellingdata_ht'.$_GET['count'].'" value="'.$field.'">';
|
||||
//print $field;
|
||||
}
|
||||
else if(isset($_GET['selling']) && !empty($_GET['selling']))
|
||||
{
|
||||
//print $_GET['markup'];
|
||||
//print $_GET['count'];
|
||||
print '<input size="10" type="text" class="flat" name="cashflow'.$_GET['count'].'" value="'.$_GET['selling'].'">';
|
||||
}
|
||||
|
||||
print "</body>";
|
||||
print "</html>";
|
||||
|
||||
@ -108,10 +108,10 @@
|
||||
|
||||
.dialog_content {
|
||||
overflow:auto;
|
||||
color: #DDD;
|
||||
color: #000;
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-size: 10px;
|
||||
background-color:#123;
|
||||
font-size: 12px;
|
||||
background-color:#e6ebed;
|
||||
}
|
||||
|
||||
.top_draggable, .bottom_draggable {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user