Fix: reorder the lines correctly
This commit is contained in:
parent
1216e08521
commit
1c89213caf
@ -311,6 +311,7 @@ class Propal extends CommonObject
|
|||||||
if (empty($qty)) $qty=0;
|
if (empty($qty)) $qty=0;
|
||||||
if (empty($info_bits)) $info_bits=0;
|
if (empty($info_bits)) $info_bits=0;
|
||||||
if (empty($rang)) $rang=0;
|
if (empty($rang)) $rang=0;
|
||||||
|
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||||
|
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
|
|||||||
@ -913,6 +913,7 @@ class Commande extends CommonObject
|
|||||||
if (empty($txtva)) $txtva=0;
|
if (empty($txtva)) $txtva=0;
|
||||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||||
|
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||||
|
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
|
|||||||
@ -1717,6 +1717,7 @@ class Facture extends CommonObject
|
|||||||
if (empty($txtva)) $txtva=0;
|
if (empty($txtva)) $txtva=0;
|
||||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||||
|
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||||
|
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
|
|||||||
@ -47,7 +47,8 @@ top_httphead();
|
|||||||
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
|
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
|
||||||
|
|
||||||
// Registering the location of boxes
|
// Registering the location of boxes
|
||||||
if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['element']) && !empty($_GET['element'])))
|
if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['table_element_line']) && !empty($_GET['table_element_line']))
|
||||||
|
&& (isset($_GET['fk_element']) && !empty($_GET['fk_element'])) && (isset($_GET['element_id']) && !empty($_GET['element_id'])) )
|
||||||
{
|
{
|
||||||
$roworder = explode(',',$_GET['roworder']);
|
$roworder = explode(',',$_GET['roworder']);
|
||||||
|
|
||||||
@ -64,8 +65,11 @@ if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['elem
|
|||||||
dol_syslog("AjaxRow roworder=".$_GET['roworder']." neworder=".$roworder." element=".$_GET['element'], LOG_DEBUG);
|
dol_syslog("AjaxRow roworder=".$_GET['roworder']." neworder=".$roworder." element=".$_GET['element'], LOG_DEBUG);
|
||||||
|
|
||||||
$row=new CommonObject($db);
|
$row=new CommonObject($db);
|
||||||
$row->table_element_line = $_GET['element'];
|
$row->table_element_line = $_GET['table_element_line'];
|
||||||
|
$row->fk_element = $_GET['fk_element'];
|
||||||
|
$row->id = $_GET['element_id'];
|
||||||
$result=$row->line_ajaxorder($roworder);
|
$result=$row->line_ajaxorder($roworder);
|
||||||
|
$result=$row->line_order(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -22,11 +22,7 @@
|
|||||||
* \file htdocs/core/class/commonobject.class.php
|
* \file htdocs/core/class/commonobject.class.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...)
|
* \brief Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...)
|
||||||
<<<<<<< commonobject.class.php
|
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
=======
|
|
||||||
* \version $Id$
|
|
||||||
>>>>>>> 1.107
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -34,8 +34,10 @@ jQuery(document).ready(function(){
|
|||||||
jQuery("#tablelines").tableDnD({
|
jQuery("#tablelines").tableDnD({
|
||||||
onDrop: function(table, row) {
|
onDrop: function(table, row) {
|
||||||
var roworder = cleanSerialize(jQuery("#tablelines").tableDnDSerialize());
|
var roworder = cleanSerialize(jQuery("#tablelines").tableDnDSerialize());
|
||||||
var element = "<?php echo $object->table_element_line; ?>";
|
var table_element_line = "<?php echo $object->table_element_line; ?>";
|
||||||
jQuery.get("<?php echo DOL_URL_ROOT; ?>/core/ajaxrow.php?roworder="+roworder+"&element="+element);
|
var fk_element = "<?php echo $object->fk_element; ?>";
|
||||||
|
var element_id = "<?php echo $object->id; ?>";
|
||||||
|
jQuery.get("<?php echo DOL_URL_ROOT; ?>/core/ajaxrow.php?roworder="+roworder+"&table_element_line="+table_element_line+"&fk_element="+fk_element+"&element_id="+element_id);
|
||||||
jQuery("#tablelines .drag").each(
|
jQuery("#tablelines .drag").each(
|
||||||
function( intIndex ){
|
function( intIndex ){
|
||||||
jQuery(this).removeClass("pair impair");
|
jQuery(this).removeClass("pair impair");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user