HEX
Server: Apache/2.2.15 (CentOS)
System: Linux ip-10-0-2-146.eu-west-1.compute.internal 2.6.32-754.35.1.el6.centos.plus.x86_64 #1 SMP Sat Nov 7 11:33:42 UTC 2020 x86_64
User: root (0)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /www/exchange0old/cmws/samples/client-transaction-edit.php
<?php

/* required includes */
require_once("../../exchange/Bin/constants.php");
require_once("../../exchange/Bin/init.php");
require_once(ROOT_FOLDER."Bin/Security.php");
require_once(ROOT_FOLDER."admin/classes/Model/base_actions.php");
require_once(ROOT_FOLDER."admin/classes/Model/CMSync.php");

/* SAMPLE DATA for editing existing TTE Transaction */
$tteArray = array(
    "exchange_ref_id" => "211215162951",
    "face_value" => "200.03",
    // * "status_id" => "Traded",
    "field_values" => array(
        CM_SYNC_TTE_FIELD_REFERENCE => "DT005-Inv05",
        CM_SYNC_TTE_FIELD_ISSUED_ON => "2021-12-15",
        CM_SYNC_TTE_FIELD_POSTED_ON => "2021-12-15",
        CM_SYNC_TTE_FIELD_TRADED_ON => "2021-12-15",
        CM_SYNC_TTE_FIELD_PURCHASE_PRICE => "0.90",
        CM_SYNC_TTE_FIELD_EDSO => "60",
        CM_SYNC_TTE_FIELD_RDSO => "2",
        CM_SYNC_TTE_FIELD_PERIOD_TYPE => "1",
        CM_SYNC_TTE_FIELD_PERIOD => "60",
        CM_SYNC_TTE_FIELD_SELL_RATE => "0.00845",
        CM_SYNC_TTE_FIELD_LDC_PREMIUM => "0.00",
        CM_SYNC_TTE_FIELD_AGENT_PREMIUM => "0",
        CM_SYNC_TTE_FIELD_TRADE_COMMISSION => "2.50",
        CM_SYNC_TTE_FIELD_PROCESSING_COMMISSION => "10.00",
        CM_SYNC_TTE_FIELD_DISABLE_180_DAYS => "0",
        CM_SYNC_TTE_FIELD_FINANCE_TYPE => CM_SYNC_TTE_FINANCE_TYPE_VARIABLE,
        CM_SYNC_TTE_FIELD_FIXED_CHARGE => "0",
        CM_SYNC_TTE_FIELD_TAXID_ON_SALES => "3",
        CM_SYNC_TTE_FIELD_TAXID_ON_PURCHASE => "3",
        CM_SYNC_TTE_FIELD_TAXTYPE_INC_OR_EXC => "1"));

$cmSync = new CMSync();
if (!$cmSync->cmSyncTransactionEnable) {
    exit;
}

/* Test Adding New Organisation */
$cmSync->setTransactionData($tteArray, CM_SYNC_TTETRANS_DETR_TRADE, CM_SYNC_TTETRANS_EDIT);
$stat = $cmSync->doEditTransaction($tteArray['exchange_ref_id']);
if ($stat) {
    $cmSync->printResponse();
} else {
    echo $cmSync->getErrorMessage();
}