Fix: restore deprecated files
This commit is contained in:
parent
07a10d3984
commit
7ca0aa8a78
127
htdocs/core/tpl/freeproductline_create.tpl.php
Normal file
127
htdocs/core/tpl/freeproductline_create.tpl.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Need to have following variables defined:
|
||||
* $conf
|
||||
* $langs
|
||||
* $dateSelector
|
||||
* $this (invoice, order, ...)
|
||||
* $line defined
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE freeproductline_create.tpl.php -->
|
||||
<tr class="liste_titre nodrag nodrop">
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>><div id="add"></div><?php echo $langs->trans('AddNewLine').' - '.$langs->trans("FreeZone"); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('VAT'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('PriceUHT'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('Qty'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right"><?php echo $langs->trans('BuyingPrice'); ?></td>
|
||||
<?php
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
$colspan++;
|
||||
if($conf->global->DISPLAY_MARK_RATES)
|
||||
$colspan++;
|
||||
}
|
||||
?>
|
||||
<td colspan="<?php echo $colspan; ?>"> </td>
|
||||
</tr>
|
||||
|
||||
<form name="addproduct" id="addproduct" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add" method="POST">
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||
<input type="hidden" name="action" value="addline" />
|
||||
<input type="hidden" name="id" value="<?php echo $this->id; ?>" />
|
||||
|
||||
<tr <?php echo $bcnd[$var]; ?>>
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
|
||||
<?php
|
||||
echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1);
|
||||
if (($conf->product->enabled && $conf->service->enabled) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '<br>';
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
// Editor wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$nbrows=ROWS_2;
|
||||
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
|
||||
$doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
|
||||
$doleditor->Create();
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td align="right">
|
||||
<?php
|
||||
if ($buyer->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
|
||||
else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer);
|
||||
?>
|
||||
</td>
|
||||
<td align="right"><input type="text" size="5" name="np_price" value="<?php echo (isset($_POST["np_price"])?$_POST["np_price"]:''); ?>"></td>
|
||||
<td align="right"><input type="text" size="2" name="qty" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>"></td>
|
||||
<td align="right" nowrap><input type="text" size="1" value="<?php echo $buyer->remise_client; ?>" name="remise_percent">%</td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right"><input type="text" size="5" name="np_buying_price" value="<?php echo (isset($_POST["np_buying_price"])?$_POST["np_buying_price"]:''); ?>"></td>
|
||||
<?php
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
$colspan++;
|
||||
if($conf->global->DISPLAY_MARK_RATES)
|
||||
$colspan++;
|
||||
}
|
||||
?>
|
||||
<td align="center" valign="middle" colspan="<?php echo $colspan; ?>"><input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php if ($conf->service->enabled && $dateSelector) {
|
||||
if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
$colspan = 10;
|
||||
else
|
||||
$colspan = 9;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
$colspan++;
|
||||
if($conf->global->DISPLAY_MARK_RATES)
|
||||
$colspan++;
|
||||
}
|
||||
?>
|
||||
<tr <?php echo $bcnd[$var]; ?>>
|
||||
<td colspan="<?php echo $colspan; ?>">
|
||||
<?php
|
||||
echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
|
||||
echo $form->select_date('','date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct");
|
||||
echo ' '.$langs->trans('to').' ';
|
||||
echo $form->select_date('','date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
<!-- END PHP TEMPLATE freeproductline_create.tpl.php -->
|
||||
101
htdocs/core/tpl/freeproductline_edit.tpl.php
Normal file
101
htdocs/core/tpl/freeproductline_edit.tpl.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Need to have following variables defined:
|
||||
* $conf
|
||||
* $langs
|
||||
* $dateSelector
|
||||
* $this (invoice, order, ...)
|
||||
* $line defined
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE freeproductline_edit.tpl.php -->
|
||||
<form action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id; ?>" method="POST">
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
|
||||
<input type="hidden" name="action" value="updateligne">
|
||||
<input type="hidden" name="id" value="<?php echo $this->id; ?>">
|
||||
<input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
|
||||
<input type="hidden" name="type" value="<?php echo $line->product_type; ?>">
|
||||
|
||||
<tr <?php echo $bc[$var]; ?>>
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
|
||||
<div id="<?php echo $line->id; ?>"></div>
|
||||
|
||||
<?php
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('line'=>$line,'fk_parent_line'=>$line->fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
|
||||
$reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
|
||||
}
|
||||
|
||||
// editeur wysiwyg
|
||||
$nbrows=ROWS_2;
|
||||
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
|
||||
$doleditor->Create();
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td align="right"><?php echo $form->load_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?></td>
|
||||
|
||||
<td align="right"><input size="6" type="text" class="flat" name="subprice" value="<?php echo price($line->subprice,0,'',0); ?>"></td>
|
||||
|
||||
<td align="right">
|
||||
<?php if (($line->info_bits & 2) != 2) { ?>
|
||||
<input size="2" type="text" class="flat" name="qty" value="<?php echo $line->qty; ?>">
|
||||
<?php } else { ?>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<td align="right" nowrap>
|
||||
<?php if (($line->info_bits & 2) != 2) { ?>
|
||||
<input size="1" type="text" class="flat" name="remise_percent" value="<?php echo $line->remise_percent; ?>">%
|
||||
<?php } else { ?>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<?php
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right"><input type="text" size="5" name="buying_price" value="<?php echo price($line->pa_ht,0,'',0); ?>"></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td align="center" colspan="5" valign="middle"><input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">
|
||||
<br><input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"></td>
|
||||
</tr>
|
||||
|
||||
<?php if ($conf->service->enabled && $dateSelector && $line->product_type == 1) { ?>
|
||||
<tr <?php echo $bc[$var]; ?>>
|
||||
<td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
|
||||
<?php
|
||||
echo $form->select_date($line->date_start,'date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_start?0:1,"updateligne");
|
||||
echo ' '.$langs->trans('to').' ';
|
||||
echo $form->select_date($line->date_end,'date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_end?0:1,"updateligne");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
<!-- END PHP TEMPLATE freeproductline_edit.tpl.php -->
|
||||
142
htdocs/core/tpl/freeproductline_view.tpl.php
Normal file
142
htdocs/core/tpl/freeproductline_view.tpl.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE freeproductline_view.tpl.php -->
|
||||
<tr <?php echo 'id="row-'.$line->id.'" '.$bcdd[$var]; ?>>
|
||||
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td align="center"><?php echo ($i+1); ?></td>
|
||||
<?php } ?>
|
||||
<td><div id="<?php echo $line->rowid; ?>"></div>
|
||||
<?php if (($line->info_bits & 2) == 2) { ?>
|
||||
<a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
|
||||
<?php
|
||||
$txt='';
|
||||
print img_object($langs->trans("ShowReduc"),'reduc').' ';
|
||||
if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
|
||||
//else $txt=$langs->trans("Discount");
|
||||
print $txt;
|
||||
?>
|
||||
</a>
|
||||
<?php
|
||||
if ($line->description)
|
||||
{
|
||||
if ($line->description == '(CREDIT_NOTE)')
|
||||
{
|
||||
$discount=new DiscountAbsolute($this->db);
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
||||
}
|
||||
elseif ($line->description == '(DEPOSIT)')
|
||||
{
|
||||
$discount=new DiscountAbsolute($this->db);
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
|
||||
// Add date of deposit
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ($txt?' - ':'').dol_htmlentitiesbr($line->description);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
|
||||
if ($type==1) $text = img_object($langs->trans('Service'),'service');
|
||||
else $text = img_object($langs->trans('Product'),'product');
|
||||
echo $text.' '.dol_htmlentitiesbr($line->description);
|
||||
// Show range
|
||||
print_date_range($line->date_start,$line->date_end);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td align="right" nowrap="nowrap"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
|
||||
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->subprice); ?></td>
|
||||
|
||||
<td align="right" nowrap="nowrap">
|
||||
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty;
|
||||
else echo ' '; ?>
|
||||
</td>
|
||||
|
||||
<?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
|
||||
<td align="right"><?php echo dol_print_reduction($line->remise_percent,$langs); ?></td>
|
||||
<?php } else { ?>
|
||||
<td> </td>
|
||||
<?php }
|
||||
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->pa_ht); ?></td>
|
||||
<?php if($conf->global->DISPLAY_MARGIN_RATES) {?>
|
||||
<td align="right" nowrap="nowrap"><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?></td>
|
||||
<?php
|
||||
}
|
||||
if($conf->global->DISPLAY_MARK_RATES) {?>
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->marque_tx).'%'; ?></td>
|
||||
<?php } } ?>
|
||||
|
||||
<?php if ($line->special_code == 3) { ?>
|
||||
<td align="right" nowrap="nowrap"><?php echo $langs->trans('Option'); ?></td>
|
||||
<?php } else { ?>
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->total_ht); ?></td>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->statut == 0 && $user->rights->$element->creer) { ?>
|
||||
<td align="center">
|
||||
<?php if (($line->info_bits & 2) == 2) { ?>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#'.$line->id; ?>">
|
||||
<?php echo img_edit(); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<td align="center">
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&lineid='.$line->id; ?>">
|
||||
<?php echo img_delete(); ?>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<?php if ($num > 1) { ?>
|
||||
<td align="center" class="tdlineupdown">
|
||||
<?php if ($i > 0) { ?>
|
||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
||||
<?php echo img_up(); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if ($i < $num-1) { ?>
|
||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
||||
<?php echo img_down(); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td align="center" class="tdlineupdown"> </td>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<td colspan="3"> </td>
|
||||
<?php } ?>
|
||||
|
||||
</tr>
|
||||
<!-- END PHP TEMPLATE freeproductline_view.tpl.php -->
|
||||
173
htdocs/core/tpl/predefinedproductline_create.tpl.php
Normal file
173
htdocs/core/tpl/predefinedproductline_create.tpl.php
Normal file
@ -0,0 +1,173 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Need to have following variables defined:
|
||||
* $conf
|
||||
* $langs
|
||||
* $dateSelector
|
||||
* $this (invoice, order, ...)
|
||||
* $line defined
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE predefinedproductline_create.tpl.php -->
|
||||
|
||||
<tr class="liste_titre nodrag nodrop">
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>>
|
||||
<?php
|
||||
echo $langs->trans("AddNewLine").' - ';
|
||||
if ($conf->service->enabled)
|
||||
echo $langs->trans('RecordedProductsAndServices');
|
||||
else
|
||||
echo $langs->trans('RecordedProducts');
|
||||
?>
|
||||
</td>
|
||||
<td align="right"><?php echo $langs->trans('Qty'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right"><?php echo $langs->trans('BuyingPrice'); ?></td>
|
||||
<?php
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
$colspan++;
|
||||
if($conf->global->DISPLAY_MARK_RATES)
|
||||
$colspan++;
|
||||
}
|
||||
?>
|
||||
<td colspan="<?php echo $colspan; ?>"> </td>
|
||||
</tr>
|
||||
|
||||
<form name="addpredefinedproduct" id="addpredefinedproduct" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add" method="POST">
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||
<input type="hidden" name="action" value="addline" />
|
||||
<input type="hidden" name="id" value="<?php echo $this->id; ?>" />
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('#idprod').change(function() {
|
||||
jQuery('#np_desc').focus();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<tr <?php echo $bcnd[$var]; ?>>
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>>
|
||||
<?php
|
||||
|
||||
$form->select_produits('','idprod','',$conf->product->limit_size,$buyer->price_level);
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]);
|
||||
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
// Editor wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$nbrows=ROWS_2;
|
||||
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
|
||||
$doleditor=new DolEditor('np_desc',$_POST["np_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
|
||||
$doleditor->Create();
|
||||
?>
|
||||
</td>
|
||||
<td align="right"><input type="text" size="2" name="qty" value="1"></td>
|
||||
<td align="right" nowrap><input type="text" size="1" name="remise_percent" value="<?php echo $buyer->remise_client; ?>">%</td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right">
|
||||
<select id="np_fournprice" name="np_fournprice" style="display: none;"></select>
|
||||
<input type="text" size="5" id="np_buying_price" name="np_buying_price" value="<?php echo (isset($_POST["np_buying_price"])?$_POST["np_buying_price"]:''); ?>">
|
||||
</td>
|
||||
<?php
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
$colspan++;
|
||||
if($conf->global->DISPLAY_MARK_RATES)
|
||||
$colspan++;
|
||||
}
|
||||
?>
|
||||
<td align="center" valign="middle" colspan="<?php echo $colspan; ?>"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>" name="addline"></td>
|
||||
</tr>
|
||||
|
||||
<?php if (! empty($conf->service->enabled) && $dateSelector) {
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
$colspan = 10;
|
||||
else
|
||||
$colspan = 9;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
$colspan++;
|
||||
if($conf->global->DISPLAY_MARK_RATES)
|
||||
$colspan++;
|
||||
}
|
||||
?>
|
||||
<tr <?php echo $bcnd[$var]; ?>>
|
||||
<td colspan="<?php echo $colspan; ?>">
|
||||
<?php
|
||||
echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
|
||||
echo $form->select_date('','date_start_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct");
|
||||
echo ' '.$langs->trans('to').' ';
|
||||
echo $form->select_date('','date_end_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$("#idprod").change(function() {
|
||||
$("#np_fournprice options").remove();
|
||||
$("#np_buying_price").show();
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': $(this).val()}, function(data) {
|
||||
if (data.length > 0) {
|
||||
var options = '';
|
||||
var i = 0;
|
||||
$(data).each(function() {
|
||||
i++;
|
||||
options += '<option value="'+this.id+'" price="'+this.price+'"';
|
||||
if (i == 1) {
|
||||
options += ' selected';
|
||||
$("#np_buying_price").val(this.price);
|
||||
}
|
||||
options += '>'+this.label+'</option>';
|
||||
});
|
||||
options += '<option value=null><?php echo $langs->trans("InputPrice"); ?></option>';
|
||||
$("#np_fournprice").html(options);
|
||||
$("#np_buying_price").hide();
|
||||
$("#np_fournprice").show();
|
||||
$("#np_fournprice").change(function() {
|
||||
var selval = $(this).find('option:selected').attr("price");
|
||||
if (selval)
|
||||
$("#np_buying_price").val(selval).hide();
|
||||
else
|
||||
$('#np_buying_price').show();
|
||||
});
|
||||
}
|
||||
},
|
||||
'json');
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<!-- END PHP TEMPLATE predefinedproductline_create.tpl.php -->
|
||||
164
htdocs/core/tpl/predefinedproductline_edit.tpl.php
Normal file
164
htdocs/core/tpl/predefinedproductline_edit.tpl.php
Normal file
@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Need to have following variables defined:
|
||||
* $conf
|
||||
* $langs
|
||||
* $dateSelector
|
||||
* $this (invoice, order, ...)
|
||||
* $line defined
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE predefinedproductline_edit.tpl.php -->
|
||||
<form action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id; ?>" method="POST">
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||
<input type="hidden" name="action" value="updateligne" />
|
||||
<input type="hidden" name="id" value="<?php echo $this->id; ?>" />
|
||||
<input type="hidden" name="lineid" value="<?php echo $line->id; ?>" />
|
||||
|
||||
<tr <?php echo $bc[$var]; ?>>
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
|
||||
<div id="<?php echo $line->id; ?>"></div>
|
||||
<input type="hidden" name="productid" value="<?php echo $line->fk_product; ?>" />
|
||||
<a href="<?php echo DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product; ?>">
|
||||
<?php
|
||||
if ($line->product_type==1) echo img_object($langs->trans('ShowService'),'service');
|
||||
else print img_object($langs->trans('ShowProduct'),'product');
|
||||
echo ' '.$line->ref;
|
||||
?>
|
||||
</a>
|
||||
<?php
|
||||
echo ' - '.nl2br($line->product_label);
|
||||
echo '<br>';
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line);
|
||||
$parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
|
||||
$reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
|
||||
}
|
||||
|
||||
// editeur wysiwyg
|
||||
$nbrows=ROWS_2;
|
||||
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
|
||||
$doleditor->Create();
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td align="right"><?php echo $form->load_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?></td>
|
||||
|
||||
<td align="right">
|
||||
<input size="6" type="text" class="flat" name="subprice" value="<?php echo price($line->subprice,0,'',0); ?>" />
|
||||
</td>
|
||||
|
||||
<td align="right">
|
||||
<?php if (($line->info_bits & 2) != 2) { ?>
|
||||
<input size="2" type="text" class="flat" name="qty" value="<?php echo $line->qty; ?>" />
|
||||
<?php } else { ?> <?php } ?>
|
||||
</td>
|
||||
|
||||
<td align="right" nowrap>
|
||||
<?php if (($line->info_bits & 2) != 2) { ?>
|
||||
<input size="1" type="text" class="flat" name="remise_percent" value="<?php echo $line->remise_percent; ?>" />%
|
||||
<?php } else { ?>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right">
|
||||
<select id="fournprice" name="fournprice"></select>
|
||||
<input type="text" size="5" id="buying_price" name="buying_price" style="display: none;" value="<?php echo price($line->pa_ht,0,'',0); ?>">
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<td align="center" colspan="5" valign="middle">
|
||||
<input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
|
||||
<input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ($conf->service->enabled && $dateSelector && $line->product_type == 1) { ?>
|
||||
<tr <?php echo $bc[$var]; ?>>
|
||||
<td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
|
||||
<?php
|
||||
echo $form->select_date($line->date_start,'date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_start?0:1,"updateligne");
|
||||
echo ' '.$langs->trans('to').' ';
|
||||
echo $form->select_date($line->date_end,'date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_end?0:1,"updateligne");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?></form>
|
||||
<?php
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product; ?>}, function(data) {
|
||||
if (data.length > 0) {
|
||||
var options = '';
|
||||
var trouve=false;
|
||||
$(data).each(function() {
|
||||
options += '<option value="'+this.id+'" price="'+this.price+'"';
|
||||
<?php
|
||||
if ($line->fk_fournprice > 0) {
|
||||
?>
|
||||
if (this.id == <?php echo $line->fk_fournprice; ?>) {
|
||||
options += ' selected';
|
||||
$("#buying_price").val(this.price);
|
||||
trouve = true;
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
options += '>'+this.label+'</option>';
|
||||
});
|
||||
options += '<option value=null'+(trouve?'':' selected')+'><?php echo $langs->trans("InputPrice"); ?></option>';
|
||||
$("#fournprice").html(options);
|
||||
if (trouve) {
|
||||
$("#buying_price").hide();
|
||||
$("#fournprice").show();
|
||||
}
|
||||
else {
|
||||
$("#buying_price").show();
|
||||
}
|
||||
$("#fournprice").change(function() {
|
||||
var selval = $(this).find('option:selected').attr("price");
|
||||
if (selval)
|
||||
$("#buying_price").val(selval).hide();
|
||||
else
|
||||
$('#buying_price').show();
|
||||
});
|
||||
}
|
||||
else {
|
||||
$("#fournprice").hide();
|
||||
$('#buying_price').show();
|
||||
}
|
||||
},
|
||||
'json');
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<!-- END PHP TEMPLATE predefinedproductline_edit.tpl.php -->
|
||||
111
htdocs/core/tpl/predefinedproductline_view.tpl.php
Normal file
111
htdocs/core/tpl/predefinedproductline_view.tpl.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE predefinedproductline_view.tpl.php -->
|
||||
<tr <?php echo 'id="row-'.$line->id.'" '.$bcdd[$var]; ?>>
|
||||
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td align="center"><?php echo ($i+1); ?></td>
|
||||
<?php } ?>
|
||||
<td><div id="<?php echo $line->id; ?>"></div>
|
||||
<?php
|
||||
echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
|
||||
|
||||
// Show range
|
||||
print_date_range($line->date_start, $line->date_end);
|
||||
|
||||
// Add description in form
|
||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
print ($line->description && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td align="right" nowrap="nowrap"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
|
||||
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->subprice); ?></td>
|
||||
|
||||
<td align="right" nowrap="nowrap">
|
||||
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty;
|
||||
else echo ' '; ?>
|
||||
</td>
|
||||
|
||||
<?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
|
||||
<td align="right"><?php echo dol_print_reduction($line->remise_percent,$langs); ?></td>
|
||||
<?php } else { ?>
|
||||
<td> </td>
|
||||
<?php }
|
||||
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->pa_ht); ?></td>
|
||||
<?php if($conf->global->DISPLAY_MARGIN_RATES) {?>
|
||||
<td align="right" nowrap="nowrap"><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?></td>
|
||||
<?php
|
||||
}
|
||||
if($conf->global->DISPLAY_MARK_RATES) {?>
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->marque_tx).'%'; ?></td>
|
||||
<?php } } ?>
|
||||
|
||||
<?php if ($line->special_code == 3) { ?>
|
||||
<td align="right" nowrap="nowrap"><?php echo $langs->trans('Option'); ?></td>
|
||||
<?php } else { ?>
|
||||
<td align="right" nowrap="nowrap"><?php echo price($line->total_ht); ?></td>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->statut == 0 && $user->rights->$element->creer) { ?>
|
||||
<td align="center">
|
||||
<?php if (($line->info_bits & 2) == 2) { ?>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#'.$line->id; ?>">
|
||||
<?php echo img_edit(); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<td align="center">
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&lineid='.$line->id; ?>">
|
||||
<?php echo img_delete(); ?>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<?php if ($num > 1) { ?>
|
||||
<td align="center" class="tdlineupdown">
|
||||
<?php if ($i > 0) { ?>
|
||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
||||
<?php echo img_up(); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if ($i < $num-1) { ?>
|
||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
||||
<?php echo img_down(); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td align="center" class="tdlineupdown"> </td>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<td colspan="3"> </td>
|
||||
<?php } ?>
|
||||
|
||||
</tr>
|
||||
<!-- END PHP TEMPLATE predefinedproductline_view.tpl.php -->
|
||||
Loading…
Reference in New Issue
Block a user