Example #1
0
function precio($precio, $obj)
{
    if ($obj["metodo_costeo"] === "costo") {
        return FormatMoney($obj["costo_estandar"]);
    }
    return FormatMoney($precio);
}
Example #2
0
function GenEtiqueta($id, $precio = 0)
{
    global $action;
    $ot = getTemplate("Etiqueta");
    if (!$ot) {
        error(__FILE__ . __LINE__, "Info: template busqueda no encontrado");
        echo "1!";
        return false;
    }
    $oProducto = new producto();
    if (!$oProducto->Load($id)) {
        error(__FILE__ . __LINE__, "Info: producto no encontrado");
        echo "2!";
        return false;
    }
    $bar = $oProducto->getCB();
    $nombre = $oProducto->getDescripcion();
    $marca = $oProducto->getMarcaTexto();
    $nombre = $nombre . ' ' . $marca;
    $cr = "&";
    $cad = "barcode=" . $bar . $cr;
    $cad .= "format=gif" . $cr;
    $cad .= "text={$bar}" . $cr;
    $cad .= "text=" . urlencode($nombre . " - " . $oProducto->get("Referencia")) . $cr;
    $cad .= "width=" . getParametro("AnchoBarras") . $cr;
    $cad .= "height=" . getParametro("AltoBarras") . $cr;
    $urlbarcode = "modulos/barcode/barcode.php?" . $cad;
    $ot->fijar("urlbarcode", $urlbarcode);
    $ot->fijar("precio", FormatMoney($precio));
    $ot->fijar("talla", $oProducto->getTextTalla());
    $ot->fijar("color", $oProducto->getTextColor());
    $ot->fijar("referencia", $oProducto->get("Referencia"));
    $ot->fijar("nombre", $nombre);
    echo $ot->Output();
}
Example #3
0
function renderRow($unixTime, $fullArray)
{
    $out = "";
    switch ($fullArray["tipo"]) {
        case "SeguimientoDeServicio":
            $ods = OrdenDeServicioDAO::getByPK($fullArray["id_orden_de_servicio"]);
            $s = ServicioDAO::getByPK($ods->getIdServicio());
            $out .= '<strong> Seguimiento De Orden ' . $s->getNombreServicio() . ' ' . $fullArray["id_orden_de_servicio"] . ' </strong>';
            $out .= $fullArray["estado"];
            $u = $fullArray["id_usuario"];
            break;
        case "ClienteSeguimiento":
            $out .= '<strong> Seguimiento </strong>';
            $out .= $fullArray["texto"];
            $u = $fullArray["id_usuario"];
            break;
        case "OrdenDeServicio":
            $ods = OrdenDeServicioDAO::getByPK($fullArray["id_orden_de_servicio"]);
            $s = ServicioDAO::getByPK($ods->getIdServicio());
            $out .= '<strong>Nueva Orden de Servicio</strong> ' . $s->getNombreServicio() . ' ' . $fullArray["id_orden_de_servicio"] . ' ';
            $out .= $fullArray["descripcion"];
            $u = $fullArray["id_usuario"];
            break;
        case "Venta":
            if ($fullArray["cancelada"]) {
                $out .= '<strong><strike>Venta Cancelada ' . $fullArray["id_venta"] . '</strike></strong>';
            } else {
                $out .= '<strong>Venta ' . $fullArray["id_venta"] . '</strong>';
            }
            $out .= '&nbsp;' . FormatMoney($fullArray["total"]) . ' ' . $fullArray["tipo_de_venta"];
            $u = $fullArray["id_usuario"];
            break;
        case "Cotizacion":
            $out .= '<strong>Venta ' . $fullArray["id_venta"] . '</strong>';
            $u = $fullArray["id_usuario"];
            break;
    }
    //return json_encode( $fullVo );
    $u = UsuarioDAO::getByPK($u)->getNombre();
    $out .= '<br><div style="text-align: right; font-size:10px; color:gray">' . FormatTime($fullArray["fecha"]) . ' por ' . $u . "</div>";
    return $out;
}
Example #4
0
function function_importe($foo, $obj)
{
    return FormatMoney((double) $obj["precio"] * (double) $obj["cantidad"]);
}
Example #5
0
            ?>
               <tr>
                  <td width="40%" align="left"   ><?php 
            print "{$ChurchName}";
            ?>
</td>
                  <td width="10%" align="center" ><?php 
            print "{$registered}";
            ?>
</td>
                  <td width="25%" align="center" ><?php 
            print "{$BalanceComment}";
            ?>
</td>
                  <td width="25%" align="left"   ><?php 
            print FormatMoney($costDetail["Balance"]);
            ?>
</td>
               </tr>
            <?php 
        }
    }
    ?>
         </table>
         <?php 
} else {
    ?>
            <center>
            <h1>No churches have been defined</h1>
            <h2>Expense report is empty</h2>
            </center>
Example #6
0
 static function MoneyFromDouble($foo)
 {
     return FormatMoney($foo);
 }
Example #7
0
?>
</td>
         </tr>
         <tr>
            <td width="50%" colspan=2>&nbsp;</td>
            <td width="25%" align="right">Total:</td>
            <td width="25%" align="right"><?php 
print FormatMoney($costTotal);
?>
</td>
         </tr>
         <tr>
            <td width="50%" colspan=2>&nbsp;</td>
            <td width="25%" align="right">Monies Received:</td>
            <td width="25%" align="right"><?php 
print FormatMoney($MoneyInOut);
?>
</td>
         </tr>
         <tr>
            <td width="50%" colspan=2>&nbsp;</td>
            <td width="25%" align="right">Balance:</td>
            <td width="25%" align="right"><?php 
print FormatMoney($costBalance);
?>
</td>
         </tr>
      </table>

   </body>
</html>
Example #8
0
    } else {
        echo "0.00";
    }
    ?>
&nbsp;</td>
	<td><?php 
    if ($xm_yffy111 != 0) {
        echo FormatMoney($xm_yffy111);
    } else {
        echo "0.00";
    }
    ?>
&nbsp;</td>
	<td><?php 
    if ($leijixm_yffy111 != 0) {
        echo FormatMoney($leijixm_yffy111);
    } else {
        echo "0.00";
    }
    ?>
&nbsp;</td>
</tr>
<?php 
} else {
    ?>
	<tr>
	<td colspan="10">
	<div>
		<span>暂无信息.</span>	
	</div>
	</td>
Example #9
0
function PrintReport($ChurchID)
{
    $ChurchName = ChurchName($ChurchID);
    $costDetail = ChurchExpenses($ChurchID);
    //-----------------------------------------------------------------------
    // Get the cost for various items
    //-----------------------------------------------------------------------
    $price = GetPrices();
    $RegCost = $price["Registration"];
    $ShirtCost = $price["Shirt"];
    $AdultMealCost = $price["AdultMeal"];
    $ChildMealCost = $price["ChildMeal"];
    //-----------------------------------------------------------------------
    // Get the Counts for various items purchased
    //-----------------------------------------------------------------------
    $ParticipantCount = $costDetail["ParticipantCount"];
    $ExtraAdultMealCount = $costDetail["ExtraAdultMealCount"];
    $ExtraChildMealCount = $costDetail["ExtraChildMealCount"];
    $ExtraShirtCount = $costDetail["ExtraShirtCount"];
    //-----------------------------------------------------------------------
    // Get the cost for various items Purchased
    //-----------------------------------------------------------------------
    $costParticipant = $costDetail["Participant"];
    $costExtraAdultMeals = $costDetail["ExtraAdultMeals"];
    $costExtraChildMeals = $costDetail["ExtraChildMeals"];
    $costExtraShirts = $costDetail["ExtraShirts"];
    $costTotal = $costDetail["Total"];
    $costBalance = $costDetail["Balance"];
    $MoneyInOut = $costDetail["MoneyInOut"];
    if ($costBalance > 0) {
        $balanceCarity = 'Due';
    } else {
        if ($costBalance < 0) {
            $balanceCarity = 'Credit';
        } else {
            $balanceCarity = '';
        }
    }
    //-----------------------------------------------------------------------
    // Display to the user
    //-----------------------------------------------------------------------
    ?>
      <h1 align="center">Expense Report</h1>
      <h1 align="center">For: <?php 
    print "{$ChurchName}";
    ?>
</h1>

      <table border="1" width="100%">
         <tr>
            <td width="25%">Registered Participants</td>
            <td width="25%" align="center"><?php 
    print $ParticipantCount;
    ?>
</td>
            <td width="25%" align="center">x <?php 
    print FormatMoney($RegCost);
    ?>
</td>
            <td width="25%" align="right"><?php 
    print FormatMoney($costParticipant);
    ?>
</td>
         </tr>
         <tr>
            <td width="25%">Extra Adult Meal Tickets</td>
            <td width="25%" align="center"><?php 
    print $ExtraAdultMealCount;
    ?>
</td>
            <td width="25%" align="center">x <?php 
    print FormatMoney($AdultMealCost);
    ?>
</td>
            <td width="25%" align="right"><?php 
    print FormatMoney($costExtraAdultMeals);
    ?>
</td>
         </tr>
         <tr>
            <td width="25%">Extra Child Meal Tickets</td>
            <td width="25%" align="center"><?php 
    print $ExtraChildMealCount;
    ?>
</td>
            <td width="25%" align="center">x <?php 
    print FormatMoney($ChildMealCost);
    ?>
</td>
            <td width="25%" align="right"><?php 
    print FormatMoney($costExtraChildMeals);
    ?>
</td>
         </tr>
         <tr>
            <td width="25%">Extra T-Shirts</td>
            <td width="25%" align="center"><?php 
    print $ExtraShirtCount;
    ?>
</td>
            <td width="25%" align="center">x <?php 
    print FormatMoney($ShirtCost);
    ?>
</td>
            <td width="25%" align="right"><?php 
    print FormatMoney($costExtraShirts);
    ?>
</td>
         </tr>
         <tr>
            <td width="50%" colspan=2>&nbsp;</td>
            <td width="25%" align="right">Total:</td>
            <td width="25%" align="right"><?php 
    print FormatMoney($costTotal);
    ?>
</td>
         </tr>
         <tr>
            <td width="50%" colspan=2>&nbsp;</td>
            <td width="25%" align="right">Monies Received:</td>
            <td width="25%" align="right"><?php 
    print FormatMoney($MoneyInOut);
    ?>
</td>
         </tr>
         <tr>
            <td width="50%" colspan=2>&nbsp;</td>
            <td width="25%" align="right">Balance <?php 
    print $balanceCarity;
    ?>
:</td>
            <td width="25%" align="right"><?php 
    print FormatMoney($costBalance);
    ?>
</td>
         </tr>
      </table>
      <?php 
}
Example #10
0
$table .= "    <td></td>";
$table .= "    <td style=\"border-bottom: 1px;border-bottom-color: black;border-style: solid;\">" . FormatMoney($total_efectivo_real) . "</td>";
$table .= "    <td></td>";
$table .= "  </tr>";
#------------------------------------
$table .= "  <tr>";
$table .= "    <td></td>";
$table .= "    <td></td>";
$table .= "    <td></td>";
$table .= "    <td></td>";
$table .= "    <td></td>";
$table .= "    <td></td>";
$table .= "    <td></td>";
$table .= "    <td></td>";
$table .= "  </tr>";
#------------------------------------
$flujo_efectivo = $total_efectivo_real - $total_efectivo_disponible;
$color = $flujo_efectivo >= 0 ? "black" : "red";
$table .= "  <tr style = \"background:#C4E8F8;\">";
$table .= "    <td colspan = \"7\"><b>Flujo de efectivo (Corto):</b></td>";
$table .= "    <td><b style = \"color:{$color};\">" . FormatMoney(abs($flujo_efectivo)) . "</b></td>";
$table .= "  </tr>";
#------------------------------------
$table .= "</table>";
$page->addComponent($table);
$submit = new ApiActionComponent("api/sucursal/corte");
$submit->SetCaption("Realizar corte");
$submit->setSuccessRedirection("corte.lista.php");
$submit->setArguments(array("fecha_final" => time(), "id_sucursal" => $_GET["sid"], "total_efectivo" => 99));
$page->addcomponent($submit);
$page->render();
?>
		<div style="border:1px solid #99BBE8;	;box-sizing: border-box;
		-moz-box-sizing: border-box;
		-ms-box-sizing: border-box;
		-webkit-box-sizing: border-box; 
		margin-bottom: 20px" id="ext-gen1079">


		<table style="margin-bottom: 0px;margin-left: 0px;" border=1>
			<tbody>
			<tr colspan=2>
				<td	rowspan=2 style="width:300px">
				<?php 
$este_servicio = ServicioDAO::getByPK($esta_orden->getIdServicio());
echo "<h3> " . $este_servicio->getNombreServicio() . "</h3>";
echo "<strong>Precio final</strong><div id='editarPrecioT1'> " . FormatMoney($esta_orden->getPrecio()) . "</div><br>";
$duracion = time() - $esta_orden->getFechaOrden();
$duracion /= 60;
$duracion = (int) $duracion;
$tiempos = "minutos";
if ($duracion > 60) {
    $duracion /= 60;
    $duracion = (int) $duracion;
    $tiempos = "horas";
}
echo "<strong>Duracion de la orden</strong><div>" . $duracion . " " . $tiempos . " </div>";
?>
				</td>
				<td >
				
					<!-- ------------------------------
 public function loan_item_list($where, $offset)
 {
     $loan_item = $this->getWidgetPages($where, $this->limit, $offset);
     if (!empty($loan_item)) {
         $count = $this->getWidgetTotal($where);
         $num = ceil($count / $this->limit);
         foreach ($loan_item as $key => &$list) {
             $list['time'] = date('Y-m-d', $list['created']);
             $list['extend'] = json_decode($list['extend'], true);
             $list['car_logo_url'] = !empty($list['extend']['car_info']['car_logo_url']) ? $list['extend']['car_info']['car_logo_url'] : '/assets/images/pic/cbdefault.png';
             $list['modelName'] = !empty($list['extend']['car_info']['modelName']) ? $list['extend']['car_info']['modelName'] : '';
             $list['store'] = $this->employee->stores[$list['stores']];
             $employee = $this->employee->getWidgetRow($list['employee']);
             $list['realname'] = $employee['realname'];
             if ($list['is_del'] == 0) {
                 $list['state'] = 'state-red';
                 $wind = $this->wind_bill->getWidgetRow(array('aid' => $list['id']));
                 $list['ui_list_info'] = '<h5><b class="fcolor_red">风控价:¥' . $wind['sug_money'] . '~¥' . $wind['max_money'] . '万</b></h5>';
                 $list['status'] = '已回收';
             } else {
                 switch ($list['status']) {
                     case 'appraise':
                         $list['state'] = 'state-orage';
                         $list['ui_list_info'] = '<h5 class="ui-nowrap"><b class="fcolor_orage">估值价:¥' . $list['extend']['car_info']['eval_price'] . '万元</b></h5>';
                         break;
                     case 'risktrol':
                         $list['state'] = 'state-purple';
                         $evaluate = $this->evaluate_bill->getWidgetRow(array('aid' => $list['id']));
                         $list['ui_list_info'] = '<h5 class="ui-nowrap"><b class="fcolor_purple">评估价:¥' . $evaluate['car_price'] . '万元</b></h5>';
                         break;
                     case 'subpact':
                         $list['state'] = 'state-blue';
                         $wind = $this->wind_bill->getWidgetRow(array('aid' => $list['id']));
                         $list['ui_list_info'] = '<h5><b class="fcolor_blue">风控价:¥' . $wind['sug_money'] . '~¥' . $wind['max_money'] . '万</b></h5>';
                         break;
                     case 'done':
                         $list['state'] = 'state-green';
                         $loan = $this->loan->getWidgetRow(array('aid' => $list['id']));
                         $list['ui_list_info'] = '<h5><b class="fcolor_green">放款金额:¥' . FormatMoney($loan['loan_amount']) . '万</b></h5>';
                         break;
                     case 'deny':
                         $list['state'] = 'state-red';
                         $evaluate = $this->evaluate_bill->getWidgetRow(array('aid' => $list['id']));
                         $list['ui_list_info'] = '<h5 class="ui-nowrap"><b class="fcolor_red">评估价:¥' . $evaluate['car_price'] . '万元</b></h5>';
                         break;
                 }
                 $list['status'] = $this->status[$list['status']];
             }
             switch ($list['deal_flag']) {
                 case 'pledge':
                     $list['deal_flag'] = '<i class="icon-zhi">质</i>';
                     break;
                 case 'mortgage':
                     $list['deal_flag'] = '<i class="icon-di">抵</i>';
                     break;
             }
             $b[] = date('Y-m-d', $list['created']);
         }
         $b = array_unique($b);
         foreach ($b as $v) {
             foreach ($loan_item as $value) {
                 if ($value['time'] == $v) {
                     $c['message'][$v][] = $value;
                 }
             }
         }
         $c['cnt'] = $count;
         $c['num'] = $num;
         return $c;
     } else {
         return array();
     }
 }
    echo '暂无';
} else {
    echo $zone['storesName'] . '-' . FormatMoney($zone['sum']) . '万';
}
?>
            </a>
        </h4>
        <span class="ui-panel-subtitle">查看详情</span>
    </li>
    <li data-url="/datashow/rank" class="ui-border-t click-list-link"  class="ui-border-tk" >
        <h4 class="ui-nowrap">
            <a href="javascript:void(0);">
                <?php 
if (empty($person)) {
    echo '暂无';
} else {
    echo $person['employee'] . '-' . $person['storesName'] . '-' . FormatMoney($person['sum']) . '万';
}
?>
            </a>
        </h4>
        <span class="ui-panel-subtitle">查看详情</span>
    </li>
</ul>
<!----------------个人资料--------------------->
<?php 
$data = array('username' => $realname, 'roleName' => $roleName, 'mobile' => $mobile);
echo load_widget('user/personal_data.php', $data);
?>
<script src="/assets/js/libs/frozen.min.js"></script>
</div>
Example #14
0
function ListadoModificableImpresionPorLote()
{
    $oProducto = new producto();
    global $action;
    $carrito = getSesionDato("CarritoCompras");
    $costescarrito = getSesionDato("CarroCostesCompra");
    $etiquetaIdProducto = array();
    $serie = 0;
    echo "<center><form method='post' action='{$action}?modo=impresionMultipleEjecutar'>";
    echo "<table class='listado' width='50%'><tbody>";
    echo "<tr>" . "<td class='lh'></td>" . "<td class='lh' width='5%'><nobr>" . _("Número de etiquetas") . "</nobr></td>" . "<td class='lh' style='min-width: 20em'><nobr>" . _("Producto") . "</nobr></td>" . "<td class='lh'>PV</td>" . "</tr>";
    foreach ($carrito as $key => $value) {
        $IdProducto = $key;
        $nombre = getDatosProductosExtra($key, 'nombrecb');
        $precio = getPrecioGenerico($IdProducto);
        if ($precio > 0) {
            $serie++;
            echo "<tr class='f'>" . "<td width='16'><img src='img/gpos_productos.png'></td>" . "<td  width='10%'><input type='text' name='Unidades_{$serie}' value='{$value}'>" . "<input type='hidden' name='Serie_IdProducto_{$serie}' value='" . $IdProducto . "'></td>" . "<td class='nombre' style='min-width: 20em'><nobr>{$nombre}</nobr></td>" . "<td class='precio'><nobr>" . FormatMoney($precio) . "</nobr></td>" . "<input type='hidden' name='Serie_Precio_{$serie}' value='" . $precio * 1 . "'>" . "</td>" . "</tr>";
        }
    }
    if ($serie > 0) {
        echo "<tr class='f'><td></td><td></td><td colspan='4'>" . "<input  class='btn item' type='submit' value='" . _("Imprimir múltiple") . "'>" . "</td></tr>";
    } else {
        echo "<tr class='f'><td></td><td></td>" . "<td colspan='4'>" . _("No se encontraron productos listos para etiquetar.") . "</td></tr>";
    }
    echo "</tbody></table>";
    echo "<input type='hidden' name='numSeries' value='{$serie}'>";
    echo "</form></center>";
}
//
$esta_orden->setFechaOrden(FormatTime($esta_orden->getFechaOrden()));
$a = $esta_orden->getIdUsuarioAsignado();
$asignado = UsuarioDAO::getByPK($a);
if (!is_null($asignado)) {
    $esta_orden->setIdUsuarioAsignado($asignado->getNombre());
} else {
    $esta_orden->setIdUsuarioAsignado("<img src='../../media/iconos/user_delete.png'> Nadie esta asignado");
}
//$form->createComboBoxJoin("id_servicio", "nombre_servicio", ServicioDAO::getAll(), $esta_orden->getIdServicio());
//$form->createComboBoxJoin("id_usuario", "nombre", UsuarioDAO::getAll(), $esta_orden->getIdUsuario());
$servicio = ServicioDAO::getByPK($esta_orden->getIdServicio());
$esta_orden->setIdServicio($servicio->getNombreServicio());
$agente = UsuarioDAO::getByPK($esta_orden->getIdUsuario());
$esta_orden->setIdUsuario($agente->getNombre());
$esta_orden->setPrecio(FormatMoney($esta_orden->getPrecio()));
$form = new DAOFormComponent($esta_orden);
$form->setEditable(false);
$form->hideField(array("id_orden_de_servicio", "id_usuario_venta", "extra_params", "motivo_cancelacion", "fecha_entrega", "cancelada", "adelanto", "activa", "descripcion"));
$form->setCaption("id_usuario", "Agente de venta");
$form->setCaption("id_usuario_asignado", "Tecnico asignado");
$form->setCaption("id_servicio", "Servicio");
//$form->createComboBoxJoinDistintName("id_usuario_venta", "id_usuario", "nombre", UsuarioDAO::getAll(), $esta_orden->getIdUsuarioVenta());
$page->addComponent($form);
$eP = $esta_orden->getExtraParams();
if (!is_null($eP)) {
    $ePObj = json_decode($eP);
    $page->addComponent("<table width=100%>");
    foreach ($ePObj as $obj) {
        $page->addComponent("<tr><td style='width:30%'><b>" . utf8_decode($obj->desc) . "</b></td>");
        $page->addComponent("<td>" . $obj->value . "</td></tr>");
    <h2><b><?php 
    echo $key;
    ?>
销售总额:<?php 
    echo FormatMoney($items['sum']);
    ?>
万</b></h2>
    <ul class="ui-list ui-list-text ui-list-link ui-border-tb ui-list-active" style="height: auto; margin-top: -1px;">
        <?php 
    foreach ($items['list'] as $k => $list) {
        ?>
        <li class="ui-border-t">
            <a href="javascript:void(0);">
                <b class="ui-nowrap"><?php 
        echo $list['sdate'];
        ?>
(<?php 
        echo FormatMoney($list['total']);
        ?>
万)</b>
            </a>
        </li>
        <?php 
    }
    ?>
    </ul>
<?php 
}
?>
</div>
 /**
  * @已完成
  */
 public function getDongList($page, $stores)
 {
     /*先给条件*/
     $where = array('order' => array('loan_time' => 'DESC'), 'status' => 1, 'cols' => array('id,loan_amount,aid,loan_time,stores,employee'));
     $where['in']['loan_status'] = array('pending', 'done', 'advance');
     if (empty($stores)) {
         if ($_SESSION['user']['office'] == 'manager' && !empty($_SESSION['user']['regionIndex'])) {
             $where['in']['stores'] = $_SESSION['user']['regionIndex'];
         } else {
             if ($_SESSION['user']['office'] == 'storemg') {
                 $where['stores'] = $_SESSION['user']['stores'];
             }
         }
     } else {
         $where['stores'] = $stores;
     }
     /*再查询数据*/
     $offset = ($page - 1) * $this->limit;
     $loan = $this->loan->getWidgetPages($where, $this->limit, $offset);
     if (!empty($loan)) {
         $count = $this->loan->getWidgetTotal($where);
         $num = ceil($count / $this->limit);
         foreach ($loan as $key => &$list) {
             $list['time'] = date('Y-m-d', $list['loan_time']);
             $list['store'] = $this->employee->stores[$list['stores']];
             $employee = $this->employee->getWidgetRow($list['employee']);
             $list['realname'] = $employee['realname'];
             $loan_item = $this->loan_item->getWidgetRow(array('id' => $list['aid']));
             $extend = json_decode($loan_item['extend'], true);
             $list['car_logo_url'] = !empty($extend['car_info']['car_logo_url']) ? $extend['car_info']['car_logo_url'] : '/assets/images/pic/cbdefault.png';
             $list['modelName'] = !empty($extend['car_info']['modelName']) ? $extend['car_info']['modelName'] : '';
             $list['state'] = 'state-green';
             $list['status'] = '放款完成';
             $loan_amount = FormatMoney($list['loan_amount']);
             $list['ui_list_info'] = '<h5><b class="fcolor_green">放款金额:¥' . $loan_amount . '万</b></h5>';
             switch ($loan_item['deal_flag']) {
                 case 'pledge':
                     $list['deal_flag'] = '<i class="icon-zhi">质</i>';
                     break;
                 case 'mortgage':
                     $list['deal_flag'] = '<i class="icon-di">抵</i>';
                     break;
             }
             $b[] = date('Y-m-d', $list['loan_time']);
         }
         $b = array_unique($b);
         foreach ($b as $v) {
             foreach ($loan as $value) {
                 if ($value['time'] == $v) {
                     $c['message'][$v][] = $value;
                 }
             }
         }
         $c['cnt'] = $count;
         $c['num'] = $num;
         return $c;
     } else {
         return '';
     }
 }
Example #18
0
function cImporte($foo, $obj)
{
    return FormatMoney($obj["precio"] * $obj["cantidad"]);
}
 /**
  * Crea un pdf con el estado de cuenta de el cliente especificado
  * @param Array $args,  $args['id_cliente'=>12[,'tipo_venta'=> 'credito | contado | saldo'] ], por default obtiene todas las compras del cliente
  */
 public static function imprimirEstadoCuentaCliente($args)
 {
     //verificamos que se haya especificado el id del cliente
     if (!isset($args['id_cliente'])) {
         Logger::log("Error al obtener el estado de cuenta, no se ha especificado un cliente.");
         die('{"success": false, "reason": "Error al obtener el estado de cuenta, no se ha especificado un cliente."}');
     }
     //verificamos que el cliente exista
     if (!($cliente = ClienteDAO::getByPK($args['id_cliente']))) {
         Logger::log("Error al obtener el estado de cuenta, no se tiene registro del cliente {$args['id_cliente']}.");
         die('{"success": false, "reason": "Error al obtener el estado de cuenta, no se tiene registro del cliente ' . $args['id_cliente'] . '"}');
     }
     //obtenemos los datos del emisor
     $estado_cuenta = estadoCuentaCliente($args);
     //buscar los datos del emisor
     if (!($emisor = PosConfigDAO::getByPK('emisor'))) {
         Logger::log("no encuentro los datos del emisor");
         die("no encuentro los datos del emisor");
     }
     $emisor = json_decode($emisor->getValue())->emisor;
     $sucursal = SucursalDAO::getByPK($_SESSION['sucursal']);
     if (!$sucursal) {
         die("Sucursal invalida");
     }
     include_once 'librerias/ezpdf/class.pdf.php';
     include_once 'librerias/ezpdf/class.ezpdf.php';
     $pdf = new Cezpdf();
     $pdf->selectFont('../server/librerias/ezpdf/fonts/Helvetica.afm');
     //margenes de un centimetro para toda la pagina
     $pdf->ezSetMargins(1, 1, 1, 1);
     /*
      * LOGO
      */
     if (!($logo = PosConfigDAO::getByPK('url_logo'))) {
         Logger::log("Verifique la configuracion del pos_config, no se encontro el camṕo 'url_logo'");
         die("Verifique la configuracion del POS, no se encontro el url del logo");
     }
     //addJpegFromFile(imgFileName,x,y,w,[h])
     //detectamos el tipo de imagen del logo
     if (substr($logo->getValue(), -3) == "jpg" || substr($logo->getValue(), -3) == "JPG" || substr($logo->getValue(), -4) == "jpeg" || substr($logo->getValue(), -4) == "JPEG") {
         $pdf->addJpegFromFile($logo->getValue(), puntos_cm(2), puntos_cm(25.5), puntos_cm(3.5));
     } elseif (substr($logo->getValue(), -3) == "png" || substr($logo->getValue(), -3) == "PNG") {
         $pdf->addPngFromFile($logo->getValue(), puntos_cm(2), puntos_cm(25.5), puntos_cm(3.5));
     } else {
         Logger::log("Verifique la configuracion del pos_config, la extension de la imagen del logo no es compatible");
         die("La extension de la imagen usada para el logo del negocio no es valida.");
     }
     /*     * ************************
      * ENCABEZADO
      * ************************* */
     $e = "<b>" . self::readableText($emisor->nombre) . "</b>\n";
     $e .= formatAddress($emisor);
     $e .= "RFC: " . $emisor->rfc . "\n\n";
     //datos de la sucursal
     $e .= "<b>Lugar de expedicion</b>\n";
     $e .= self::readableText($sucursal->getDescripcion()) . "\n";
     $e .= formatAddress($sucursal);
     $datos = array(array("emisor" => $e));
     $pdf->ezSetY(puntos_cm(28.6));
     $opciones_tabla = array();
     $opciones_tabla['showLines'] = 0;
     $opciones_tabla['showHeadings'] = 0;
     $opciones_tabla['shaded'] = 0;
     $opciones_tabla['fontSize'] = 8;
     $opciones_tabla['xOrientation'] = 'right';
     $opciones_tabla['xPos'] = puntos_cm(7.3);
     $opciones_tabla['width'] = puntos_cm(11);
     $opciones_tabla['textCol'] = array(0, 0, 0);
     $opciones_tabla['titleFontSize'] = 12;
     $opciones_tabla['rowGap'] = 3;
     $opciones_tabla['colGap'] = 3;
     $pdf->ezTable($datos, "", "", $opciones_tabla);
     $cajero = UsuarioDAO::getByPK($_SESSION['userid'])->getNombre();
     $datos = array(array("col" => "<b>Cajero</b>"), array("col" => self::readableText($cajero)), array("col" => "<b>Cliente</b>"), array("col" => self::readableText($cliente->getRazonSocial())), array("col" => "<b>Limite de  Credito</b>"), array("col" => FormatMoney($estado_cuenta->limite_credito, DONT_USE_HTML)), array("col" => "<b>Saldo</b>"), array("col" => FormatMoney($estado_cuenta->saldo, DONT_USE_HTML)));
     $pdf->ezSetY(puntos_cm(28.8));
     $opciones_tabla['xPos'] = puntos_cm(12.2);
     $opciones_tabla['width'] = puntos_cm(6);
     $opciones_tabla['showLines'] = 0;
     $opciones_tabla['shaded'] = 2;
     $opciones_tabla['shadeCol'] = array(1, 1, 1);
     //$opciones_tabla['shadeCol2'] = array(0.054901961, 0.756862745, 0.196078431);
     $opciones_tabla['shadeCol2'] = array(0.8984375, 0.95703125, 0.99609375);
     $pdf->ezTable($datos, "", "", $opciones_tabla);
     //roundRect($pdf, puntos_cm(12.2), puntos_cm(28.8), puntos_cm(6), puntos_cm(4.25));
     /**
      * ESTADO DE CUENTA
      */
     $elementos = array(array('id_venta' => 'Venta', 'fecha' => 'Fecha', 'sucursal' => 'Sucursal', 'cajero' => 'Cajero', 'tipo_venta' => 'Tipo', 'tipo_pago' => 'Pago', 'total' => 'Total', 'pagado' => 'Pagado', 'saldo' => 'Saldo'));
     foreach ($estado_cuenta->array_ventas as $venta) {
         $array_venta = array();
         $array_venta['id_venta'] = $venta['id_venta'];
         $array_venta['fecha'] = $venta['fecha'];
         $array_venta['sucursal'] = self::readableText($venta['sucursal']);
         $array_venta['cajero'] = self::readableText($venta['cajero']);
         $array_venta['cancelada'] = self::readableText($venta['cancelada']);
         $array_venta['tipo_venta'] = self::readableText($venta['tipo_venta']);
         $array_venta['tipo_pago'] = self::readableText($venta['tipo_pago']);
         $array_venta['total'] = FormatMoney($venta['total'], DONT_USE_HTML);
         $array_venta['pagado'] = FormatMoney($venta['pagado'], DONT_USE_HTML);
         $array_venta['saldo'] = FormatMoney($venta['saldo'], DONT_USE_HTML);
         array_push($elementos, $array_venta);
     }
     $pdf->ezText("", 8, array('justification' => 'center'));
     $pdf->ezSetY(puntos_cm(24));
     $opciones_tabla['xPos'] = puntos_cm(2);
     $opciones_tabla['width'] = puntos_cm(16.2);
     $pdf->ezTable($elementos, "", "Estado de Cuenta", $opciones_tabla);
     //roundRect($pdf, puntos_cm(2), puntos_cm(24.3), puntos_cm(16.2), puntos_cm(3.2));
     /*     * ************************
      * notas de abajo
      * ************************* */
     $pdf->setLineStyle(1);
     $pdf->setStrokeColor(0.3359375, 0.578125, 0.89453125);
     $pdf->line(puntos_cm(2), puntos_cm(1.3), puntos_cm(18.2), puntos_cm(1.3));
     $pdf->addText(puntos_cm(2), puntos_cm(1.0), 7, "Fecha de impresion: " . date("d/m/y") . " " . date("H:i:s"));
     //addJpegFromFile(imgFileName,x,y,w,[h])
     //$pdf->addJpegFromFile("../www/media/logo_simbolo.jpg", puntos_cm(15.9), puntos_cm(.25), 25);
     $pdf->addText(puntos_cm(16.7), puntos_cm(0.6), 8, "caffeina.mx");
     $pdf->ezStream();
 }
Example #20
0
        unset($campos[$key]);
    } else {
        $columns[$value] = ucwords(str_replace('_', ' ', $value));
    }
}
// sacar los productos correspondientes
function filter($product)
{
    return $product->getVisibleEnVc();
}
$products = array_filter(ProductosController::Lista(), "filter");
// dar formato a los campos como corresponda
foreach ($products as $product) {
    $product->setPrecio(FormatMoney($product->getPrecio()));
    $product->setCostoEstandar(FormatMoney($product->getCostoEstandar()));
    $product->setCostoExtraAlmacen(FormatMoney($product->getCostoExtraAlmacen()));
    if ($product->getCompraEnMostrador()) {
        $product->setCompraEnMostrador("S&iacute;");
    } else {
        $product->setCompraEnMostrador("No");
    }
    $unidad = UnidadMedidaDAO::getByPK($product->getIdUnidadCompra());
    if (!is_null($unidad)) {
        $product->setIdUnidadCompra($unidad->getDescripcion());
    }
    $unidad = UnidadMedidaDAO::getByPK($product->getIdUnidad());
    if (!is_null($unidad)) {
        $product->setIdUnidad($unidad->getDescripcion());
    }
}
$table = new TableComponent($columns, $products);
Example #21
0
     $Amount = $row['Amount'];
     $Annotation = $row['Annotation'];
     if ($Amount < 0) {
         $Type = "Credit";
         $Amount *= -1;
     } else {
         if ($Amount > 0) {
             $Type = "Refund";
         } else {
             $Type = "--";
         }
     }
     print "<tr>";
     print "   <td>{$Date}</td>";
     print "   <td>{$Type}</td>";
     print "   <td>" . FormatMoney($Amount) . "</td>";
     print "   <td>{$Annotation}</td>";
     print "</tr>";
 }
 ?>
         </table>
         <br>
         <?php 
 //==================================================================================
 // Now show the data entry form
 //==================================================================================
 if (isset($_POST['TxType'])) {
     if ($_POST['TxType'] == 'Credit') {
         $creditChecked = 'checked';
         $debitChecked = '';
     } else {
Example #22
0
function ListadoTiendasPrecios($IdProducto, $copias)
{
    global $action, $salida_funcion;
    $ot = getTemplate("SeleccionEtiqueta");
    if (!$ot) {
        error(__FILE__ . __LINE__, "Info: template busqueda no encontrado");
        echo "3!";
        return false;
    }
    $almacen = getSesionDato("Articulos");
    $cr = "<br>";
    $res = $almacen->Listado(false, $IdProducto, false);
    $out = "";
    $precioVarios = false;
    $precioold = "old";
    $numPreciosValidos = 0;
    while ($almacen->SiguienteArticulo()) {
        $ajustar = "";
        $vPrecio = $almacen->get("PrecioVenta");
        if ($vPrecio < 0.01) {
            continue;
        }
        $tPrecio = FormatMoney($vPrecio);
        if ($precioold == "old") {
            $precioold = $vPrecio;
        }
        //echo ("precioold $precioold, vprecio $vPrecio<br>");
        if ($precioold != $vPrecio) {
            $precioVarios = true;
        }
        $out .= "<tr>";
        $out .= g("td", $almacen->get("Identificacion"));
        //Nombre del local
        $id = $almacen->get("IdProducto");
        $ajustar .= "AjustarCampo(\"precio\",\"{$vPrecio}\");";
        //$ajustar .= "AjustarCampo(\"precio\",\"$vPrecio\");";
        $out .= g("td", "<input type=submit onclick='{$ajustar}' value='{$tPrecio}'>");
        $out .= "</tr>";
        $numPreciosValidos = $numPreciosValidos + 1;
    }
    if ($numPreciosValidos == 0) {
        echo gas("Aviso", _("Fije un Precio de Venta TPV, para imprimir etiquetas."));
        ?>
         <center>
	   <form action="selimpresion.php?modo=codigobarrasProductoGet" method="post">
	     <table class='forma'>
	       <tr>
		 <td class="lh">
		   <?php 
        echo _("Precio:");
        ?>
		 </td>
		 <td>
		   <input value="0" type="text" 
			  onkeypress="return soloNumerosBase(event,this.value)" name="precio">
		   </td>
		 </tr>
		 <tr>
		   <td class="lh"></td>
		   <td>
		     <input class="btn item" value="<?php 
        echo _("Enviar");
        ?>
" type=submit>
		   </td>
		 </tr>
	       </table>
	       <input type="hidden" name="copias" value="<?php 
        echo $copias;
        ?>
">	
	       <input type="hidden" name="IdProducto" value="<?php 
        echo $IdProducto;
        ?>
">	
	     </form>	 			
	   </center>
       <?php 
        return false;
    } else {
        if (!$precioVarios) {
            return floatval($precioold);
            //quickprecio o cero
        }
    }
    $ot->fijar("cuerpo", $out);
    $ot->fijar("action", $action . "?modo=codigobarrasProductoGet");
    $ot->fijar("IdProducto", $IdProducto);
    $ot->fijar("copias", $copias);
    echo $ot->Output();
    //$salida_funcion =  $ot->Output();
    return false;
    //Si hay mas de uno, no devuelve quickprecio
}
                    <?php 
foreach ($zone as $Key => $list) {
    ?>
                        <option <?php 
    if ($stores == $list['stores']) {
        echo 'selected';
    }
    ?>
  value="<?php 
    echo $list['stores'];
    ?>
"><?php 
    echo $list['storesName'];
    ?>
(<?php 
    echo FormatMoney($list['sum']);
    ?>
万)</option>
                    <?php 
}
?>
                </select>
            </div>
        </div>
    </form>
</div>
<h2><?php 
echo date('Y-m-d');
?>
<span id="stores"><?php 
echo $storesName;
Example #24
0
$um = UnidadMedidaDAO::getByPK($este_producto->getIdUnidad());
if (!is_null($um)) {
    $html .= sprintf("<tr><td colspan=2><h3>Existencias</h3></td></tr><tr><td> %.3f " . $um->getDescripcion() . "</td></tr></tr>", $nexistencias);
} else {
    $html .= "<tr><td colspan=2><h3>Existencias</h3></td></tr><tr><td> </td></tr></tr>";
}
$html .= "</table>";
if (is_null($este_producto->getFotoDelProducto())) {
    //$page->addComponent(" &iquest; Es esta una imagen descriptiva de su producto?");
}
$page->addComponent("\n\t<table  class=\"\">\n\n\t    <tr>\n\t        <td rowspan=2><div id=\"gimg\"></div></td>\n\t        <td><h2>" . $este_producto->getNombreProducto() . "</h2></td>\n\t    </tr>\n\t    <tr>\n\t        <td>" . $html . "</td>\n\t    </tr>\n\t</table>\n\t<script type=\"text/javascript\">\n\t    function gimgcb(a,b,c){\n\t        if(a.responseData.results.length > 0)\n\t            document.getElementById(\"gimg\").innerHTML = \"<img src='\" + a.responseData.results[0].tbUrl + \"'>\";\n\t    }\n\t</script>\n\t<script \n\t        type=\"text/javascript\" \n\t        src=\"https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=" . $este_producto->getCodigoProducto() . "&callback=gimgcb\">\n\t</script>");
$page->nextTab("General");
//
// Forma de producto
//
$este_producto->setCostoEstandar(FormatMoney($este_producto->getCostoEstandar()));
$um = UnidadMedidaDAO::getByPK($este_producto->getIdUnidadCompra());
if (!is_null($um)) {
    $este_producto->setIdUnidadCompra($um->getDescripcion());
}
$um = UnidadMedidaDAO::getByPK($este_producto->getIdUnidad());
if (!is_null($um)) {
    $este_producto->setIdUnidad($um->getDescripcion());
}
//$form->createComboBoxJoinDistintName("id_unidad_compra","id_unidad_medida" ,"descripcion", UnidadMedidaDAO::getAll(), $este_producto->getIdUnidadCompra());
//$form->createComboBoxJoinDistintName("id_unidad", "id_unidad_medida", "descripcion", UnidadMedidaDAO::getAll(), $este_producto->getIdUnidad());
$form = new DAOFormComponent($este_producto);
$form->setEditable(false);
$form->hideField(array("id_producto", "foto_del_producto", "precio", "control_de_existencia", "activo", "compra_en_mostrador"));
$form->setCaption("id_unidad", "Unidad de medida");
$form->setCaption("id_unidad_compra", "Unidad de medida al comprar");