noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ajax_payment_status.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19*/
20// Copyright Author Dany De Bontridder danydb@aevalys.eu 22/10/23
21
22
23/**
24 * @file
25 * @brief set the operation paid of unpaid
26 */
27if (!defined('ALLOWED')) die('Appel direct ne sont pas permis');
28
29global $g_user;
30try {
31 $ac=$http->post("ac");
32 $operation_id=$http->post("operation_id");
33 $state=$http->post("state");
34} catch (Exception $exc) {
35 record_log($exc);
36 return;
37}
38$a_module=explode("/",$ac);
39
40// stop if user cannot access this module
41if ($g_user->check_module($a_module[count($a_module)-1]) == 0) { return ; }
42
43// var $jr_id must be the JRN.JR_ID
44$jr_id=str_replace("rd_paid", "", $operation_id);
45
46// stop if $jr_id is not a number
47if (isNumber($jr_id) == 0 ) {
48 return;
49}
50
51// User can access this operation in writing
52$ledger_id=$cn->get_value("select jr_def_id from jrn where jr_id=$1",[$jr_id]);
53
54// stop if user cannot access this ledger
55if ( $g_user->get_ledger_access($ledger_id) != "W") { return;}
56
57if ( $state == "true") {
58 $cn->exec_sql("update jrn set jr_rapt='paid' where jr_id=$1",[$jr_id]);
59 echo 1;
60} elseif( $state == "false") {
61 $cn->exec_sql("update jrn set jr_rapt=null where jr_id=$1",[$jr_id]);
62 echo 0;
63} else {
64 echo "ERROR : unknown state [$state]";
65}
isNumber($p_int)
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...
global $g_user
if no group available , then stop
$jr_id
catch(Exception $exc) $a_module
if(isNumber($jr_id)==0) $ledger_id
if(isset( $_REQUEST[ 'show'])) if(isset($_REQUEST['del'])) $ac
if( $delta< 0) elseif( $delta==0)