Refactorred supplier order to match with objectline templates
This commit is contained in:
parent
174f1cb5f7
commit
f82df1e634
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class CommonOrder
|
* \class CommonOrder
|
||||||
@ -36,7 +37,7 @@ abstract class CommonOrder extends CommonObject
|
|||||||
* \class CommonOrderLine
|
* \class CommonOrderLine
|
||||||
* \brief Superclass for orders classes
|
* \brief Superclass for orders classes
|
||||||
*/
|
*/
|
||||||
abstract class CommonOrderLine extends CommonObject
|
abstract class CommonOrderLine extends CommonObjectLine
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,8 +88,12 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
var $extraparams=array();
|
var $extraparams=array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var CommandeFournisseurLigne[]
|
||||||
|
*/
|
||||||
|
public $lines = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
@ -98,7 +102,6 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->products = array();
|
$this->products = array();
|
||||||
$this->lines = array();
|
|
||||||
|
|
||||||
// List of language codes for status
|
// List of language codes for status
|
||||||
$this->statuts[0] = 'StatusOrderDraft';
|
$this->statuts[0] = 'StatusOrderDraft';
|
||||||
@ -237,6 +240,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$line = new CommandeFournisseurLigne($this->db);
|
$line = new CommandeFournisseurLigne($this->db);
|
||||||
|
|
||||||
$line->id = $objp->rowid;
|
$line->id = $objp->rowid;
|
||||||
|
$line->rowid = $objp->rowid;
|
||||||
$line->desc = $objp->description; // Description ligne
|
$line->desc = $objp->description; // Description ligne
|
||||||
$line->description = $objp->description; // Description ligne
|
$line->description = $objp->description; // Description ligne
|
||||||
$line->qty = $objp->qty;
|
$line->qty = $objp->qty;
|
||||||
@ -2206,6 +2210,18 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if ($nb === 0) return $langs->trans('Undefined');
|
if ($nb === 0) return $langs->trans('Undefined');
|
||||||
else return $nb.' '.$langs->trans('Days');
|
else return $nb.' '.$langs->trans('Days');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the rights used for this class
|
||||||
|
* @return stdClass
|
||||||
|
*/
|
||||||
|
public function getRights()
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
return $user->rights->fournisseur->commande;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2221,27 +2237,95 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
public $element='commande_fournisseurdet';
|
public $element='commande_fournisseurdet';
|
||||||
public $table_element='commande_fournisseurdet';
|
public $table_element='commande_fournisseurdet';
|
||||||
|
|
||||||
var $oldline;
|
/**
|
||||||
|
* Quantity
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
|
||||||
// From llx_commandedet
|
/**
|
||||||
var $qty;
|
* Unit price before taxes
|
||||||
var $tva_tx;
|
* @var float
|
||||||
var $localtax1_tx;
|
*/
|
||||||
var $localtax2_tx;
|
public $subprice;
|
||||||
var $localtax1_type;
|
|
||||||
var $localtax2_type;
|
/**
|
||||||
var $subprice;
|
* Type of the product. 0 for product 1 for service
|
||||||
var $remise_percent;
|
* @var int
|
||||||
var $desc; // Description ligne
|
*/
|
||||||
var $fk_product; // Id of predefined product
|
public $product_type = 0;
|
||||||
var $product_type = 0; // Type 0 = product, 1 = Service
|
|
||||||
var $total_ht;
|
/**
|
||||||
var $total_tva;
|
* Description of the line
|
||||||
var $total_localtax1;
|
* @var string
|
||||||
var $total_localtax2;
|
*/
|
||||||
var $total_ttc;
|
var $desc;
|
||||||
var $info_bits;
|
|
||||||
var $special_code;
|
/**
|
||||||
|
* Id of corresponding product
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $fk_product;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VAT %
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $tva_tx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Local tax 1 %
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $localtax1_tx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Local tax 2 %
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $localtax2_tx;
|
||||||
|
|
||||||
|
var $localtax1_type;
|
||||||
|
var $localtax2_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total amount before taxes
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $total_ht;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total VAT amount
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $total_tva;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total local tax 1 amount
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $total_localtax1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total local tax 2 amount
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $total_localtax2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total amount with taxes
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
public $total_ttc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liste d'options cumulables:
|
||||||
|
* Bit 0: 0 si TVA normal - 1 si TVA NPR
|
||||||
|
* Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $info_bits = 0;
|
||||||
|
|
||||||
|
var $special_code;
|
||||||
var $date_start;
|
var $date_start;
|
||||||
var $date_end;
|
var $date_end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user