NEW: Accountancy Use clean_account to remove 0 at the right when we create an account in chart of accounts
This commit is contained in:
parent
4145874d34
commit
98a46fd335
@ -1,6 +1,6 @@
|
|||||||
<?PHP
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -18,9 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/admin/card.php
|
* \file htdocs/accountancy/admin/card.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Advanced accountancy
|
||||||
* \brief Card accounting account
|
* \brief Card of accounting account
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
@ -56,10 +56,13 @@ if ($action == 'add') {
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
|
// Clean code
|
||||||
|
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
||||||
|
|
||||||
$accounting->fk_pcg_version = $obj->pcg_version;
|
$accounting->fk_pcg_version = $obj->pcg_version;
|
||||||
$accounting->pcg_type = GETPOST('pcg_type');
|
$accounting->pcg_type = GETPOST('pcg_type');
|
||||||
$accounting->pcg_subtype = GETPOST('pcg_subtype');
|
$accounting->pcg_subtype = GETPOST('pcg_subtype');
|
||||||
$accounting->account_number = GETPOST('account_number');
|
$accounting->account_number = $account_number;
|
||||||
$accounting->account_parent = GETPOST('account_parent', 'int');
|
$accounting->account_parent = GETPOST('account_parent', 'int');
|
||||||
$accounting->label = GETPOST('label', 'alpha');
|
$accounting->label = GETPOST('label', 'alpha');
|
||||||
$accounting->active = 1;
|
$accounting->active = 1;
|
||||||
@ -89,10 +92,13 @@ if ($action == 'add') {
|
|||||||
$result2 = $db->query($sql);
|
$result2 = $db->query($sql);
|
||||||
$obj = $db->fetch_object($result2);
|
$obj = $db->fetch_object($result2);
|
||||||
|
|
||||||
|
// Clean code
|
||||||
|
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
||||||
|
|
||||||
$accounting->fk_pcg_version = $obj->pcg_version;
|
$accounting->fk_pcg_version = $obj->pcg_version;
|
||||||
$accounting->pcg_type = GETPOST('pcg_type');
|
$accounting->pcg_type = GETPOST('pcg_type');
|
||||||
$accounting->pcg_subtype = GETPOST('pcg_subtype');
|
$accounting->pcg_subtype = GETPOST('pcg_subtype');
|
||||||
$accounting->account_number = GETPOST('account_number');
|
$accounting->account_number = $account_number;
|
||||||
$accounting->account_parent = GETPOST('account_parent', 'int');
|
$accounting->account_parent = GETPOST('account_parent', 'int');
|
||||||
$accounting->label = GETPOST('label', 'alpha');
|
$accounting->label = GETPOST('label', 'alpha');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user