Primer commit del sistema avantika sin cambios
This commit is contained in:
59
modules/cuentas-pagar.php
Executable file
59
modules/cuentas-pagar.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
$empresa->AuthUser();
|
||||
|
||||
if(!$usuario->AllowPage($page, $_SESSION['loginKey'])){
|
||||
header('Location: '.WEB_ROOT);
|
||||
exit;
|
||||
}
|
||||
/*
|
||||
$cuentaPagar->setPage($_GET['p']);
|
||||
$resCuenta = $cuentaPagar->Enumerate();
|
||||
|
||||
$items = array();
|
||||
foreach($resCuenta['items'] as $res){
|
||||
|
||||
if(preg_match('/FOLIO/i',$res['folioProv']))
|
||||
continue;
|
||||
|
||||
$proveedor->setProveedorId($res['proveedorId']);
|
||||
$res['proveedor'] = $proveedor->GetNameById();
|
||||
|
||||
//Obtenemos los abonos realizados
|
||||
$cuentaPagar->setPedidoId($res['pedidoId']);
|
||||
$res['abonos'] = $cuentaPagar->GetTotalPagos();
|
||||
|
||||
$totalDesc = $res['totalPub'] + $res['totalDes'] + $res['totalFlete'] + $res['totalEsp'];
|
||||
$res['totalDescuentos'] = number_format($totalDesc,2,'.','');
|
||||
|
||||
$res['saldo'] = $res['total'] - $res['abonos'] - $res['bonificaciones'] - $res['devoluciones'] - $res['totalDescuentos'];
|
||||
|
||||
$cuentaPagar->setPedidoId($res['pedidoId']);
|
||||
$resPagos = $cuentaPagar->EnumPagos();
|
||||
|
||||
$pagos = array();
|
||||
foreach($resPagos as $val){
|
||||
|
||||
$cuentaBancaria->setCuentaBancariaId($val['cuentaBancariaId']);
|
||||
$val['cuentaBancaria'] = $cuentaBancaria->GetNameById();
|
||||
|
||||
$metodoPago->setMetodoPagoId($val['metodoPagoId']);
|
||||
$val['metodoPago'] = $metodoPago->GetNameById();
|
||||
|
||||
$val['fecha'] = date('d-m-Y',strtotime($val['fecha']));
|
||||
|
||||
$pagos[] = $val;
|
||||
}
|
||||
$res['pagos'] = $pagos;
|
||||
|
||||
$items[] = $res;
|
||||
}
|
||||
$resCuenta['items'] = $items;
|
||||
*/
|
||||
$proveedores = $proveedor->EnumerateAll();
|
||||
|
||||
$smarty->assign('msg', $msg);
|
||||
$smarty->assign('proveedores', $proveedores);
|
||||
$smarty->assign('cuentasPagar', $resCuenta);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user