function sell_edit()
{
    $session = Session::getInstance();
    if (!$session->checkLogin()) {
        return false;
    }
    $sell = new Sell();
    $sell->id = isset($_POST['sell']) ? $_POST['sell'] : "";
    $sell->status = isset($_POST['status']) ? $_POST['status'] : "";
    $sell->update();
    if (isset($_POST['payment']) && is_numeric($_POST['payment'])) {
        $sellPayment = new SellPayment();
        $sellPayment->sellid = isset($_POST['sell']) ? $_POST['sell'] : "";
        $sellPayment->amount = isset($_POST['payment']) ? $_POST['payment'] : "";
        $sellPayment->add();
    }
}
require 'inc/class.sell.php';
require 'inc/class.formatter.php';
$sellid = isset($_GET['sell']) && is_numeric($_GET['sell']) ? $_GET['sell'] : false;
$log = Log::getInstance();
$isValid = true;
if (!$sellid) {
    $log->addError("No existen datos de Venta solicitada.");
    $isValid = false;
}
$sell = new Sell();
if (!$sell->read($sellid, true)) {
    $log->addError("No existen datos de Venta solicitada.");
    $isValid = false;
}
$details = SellDetail::getAll($sellid);
$payments = SellPayment::getAll($sellid);
include 'inc/widget/error.php';
if ($isValid) {
    ?>
<table class="form">
<tr>
	<td class="label">Venta Nro.:</td>
	<td><?php 
    echo $sell->id;
    ?>
</td>
</tr>
<tr>
	<td class="label">Estado:</td>
	<td><?php 
    echo $PURCHASE_STATUS[$sell->status];