Add php files
This commit is contained in:
74
modules/EcmFkVatKinds/controller.php
Executable file
74
modules/EcmFkVatKinds/controller.php
Executable file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
// ini_set('display_errors', '1');
|
||||
// error_reporting(E_ALL);
|
||||
|
||||
class EcmFkVatKindsController extends SugarController {
|
||||
|
||||
/**
|
||||
* Get kind.
|
||||
*/
|
||||
public function action_get_kind() {
|
||||
$id = @$_REQUEST['id'];
|
||||
$ignore = @$_REQUEST['ignore'];
|
||||
$except = @$_REQUEST['except'];
|
||||
|
||||
// dump($_REQUEST, $id);
|
||||
// exit;
|
||||
|
||||
if($id) {
|
||||
require_once 'modules/EcmFkVatKinds/EcmFkVatKind.php';
|
||||
|
||||
$kind = new EcmFkVatKind();
|
||||
$kind->retrieve($id);
|
||||
|
||||
// dump($kind->toArray());
|
||||
// exit;
|
||||
|
||||
require_once 'modules/EcmIdentifiers/EcmIdentifier.php';
|
||||
|
||||
$identifier = new EcmIdentifier();
|
||||
$identifier->retrieve($kind->ident_k);
|
||||
|
||||
// dump($identifier->toArray());
|
||||
// exit;
|
||||
|
||||
require_once 'modules/EcmBankAccounts/EcmBankAccount.php';
|
||||
|
||||
$account = new EcmBankAccount();
|
||||
$account->retrieve($kind->acc);
|
||||
|
||||
|
||||
$data = array(
|
||||
'start' => $account->getBO($except),
|
||||
//
|
||||
'reg_acc' => $kind->acc,
|
||||
'reg_acc_name' => $kind->acc_name,
|
||||
'reg_acc_code' => $kind->acc_code,
|
||||
'reg_acc_kind' => $kind->acc_kind,
|
||||
'reg_acc_type' => $kind->acc_type
|
||||
);
|
||||
|
||||
if($ignore == '0') {
|
||||
|
||||
$data['ident_k_id'] = $identifier->id;
|
||||
$data['ident_k_name'] = $identifier->name;
|
||||
|
||||
}
|
||||
|
||||
$json = getJSONobj();
|
||||
echo $json->encode($data);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update translations.
|
||||
*/
|
||||
public function action_update_transaltions() {
|
||||
echo 1;
|
||||
sugar_die();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user