public function updatePaymentLine($currentRecord, $saveHandler)
 {
     include_once "../simantz/class/Save_Data.inc.php";
     $save = new Save_Data();
     global $xoopsDB, $xoopsUser, $timestamp, $createdby, $uname, $uid;
     $tablename = "sim_simbiz_paymentline";
     $arrUpdateField = array("payment_id", "description", "accounts_id", "invoice_id", "tax_id", "branch_id", "track1_id", "track2_id", "track3_id", "amt", "chequeno", "updated", "updatedby");
     $arrUpdateFieldType = array("%d", "%s", "%d", "%d", "%d", "%d", "%s", "%s", "%s", "%f", "%s", "%s", "%d");
     $arrvalue = array($this->payment_id, $saveHandler->ReturnUpdateField($currentRecord, "description"), $saveHandler->ReturnUpdateField($currentRecord, "accounts_id"), $saveHandler->ReturnUpdateField($currentRecord, "invoice_id"), $saveHandler->ReturnUpdateField($currentRecord, "tax_id"), $saveHandler->ReturnUpdateField($currentRecord, "branch_id"), $saveHandler->ReturnUpdateField($currentRecord, "track1_id"), $saveHandler->ReturnUpdateField($currentRecord, "track2_id"), $saveHandler->ReturnUpdateField($currentRecord, "track3_id"), $saveHandler->ReturnUpdateField($currentRecord, "amt"), $saveHandler->ReturnUpdateField($currentRecord, "chequeno"), $timestamp, $createdby);
     $this->log->showLog(3, "***updating record({$currentRecord}), paymentline:subject" . $saveHandler->ReturnUpdateField($currentRecord, "subject"));
     $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, "subject");
     $save->UpdateRecord($tablename, "paymentline_id", $saveHandler->ReturnUpdateField($currentRecord, "paymentline_id"), $arrUpdateField, $arrvalue, $arrUpdateFieldType, $controlvalue);
     if ($save->failfeedback != "") {
         $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
         $this->failfeedback .= $save->failfeedback;
     }
 }
示例#2
0
 public function updateBPartnerBasicInfo()
 {
     global $xoopsDB, $saveHandler, $userid, $timestamp, $defaultorganization_id;
     $tablename = "sim_bpartner";
     $pkey = "bpartner_id";
     $keyword = "BPartner";
     $controlfieldname = "bpartner_no";
     $this->log->showLog(2, "Access into updateBPartnerBasicInfo() event");
     $arrfield = array($controlfieldname, "bpartner_name", "bpartnergroup_id", "industry_id", "companyno", "alternatename", "employeecount", "employee_id", "isdebtor", "iscreditor", "salespricelist_id", "purchasepricelist_id", "istransporter", "isdealer", "isprospect", "currency_id", "tooltips", "terms_id", "bpartner_url", "description", "isactive", "defaultlevel", "updated", "updatedby");
     $arrfieldtype = array('%s', '%s', '%d', '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%s', '%s', '%d', '%d', '%s', '%d');
     // Yes there are UPDATEs to perform...
     $arrvalue = array($this->bpartner_no, $this->bpartner_name, $this->bpartnergroup_id, $this->industry_id, $this->companyno, $this->alternatename, $this->employeecount, $this->employee_id, $this->isdebtor, $this->iscreditor, $this->salespricelist_id, $this->purchasepricelist_id, $this->istransporter, $this->isdealer, $this->isprospect, $this->currency_id, $this->tooltips, $this->terms_id, $this->bpartner_url, $this->description, $this->isactive, $this->defaultlevel, $userid, $timestamp);
     $controlvalue = $this->bpartner_no;
     include_once "class/Save_Data.inc.php";
     $save = new Save_Data();
     if ($save->UpdateRecord($tablename, $pkey, $this->bpartner_id, $arrfield, $arrvalue, $arrfieldtype, $controlvalue)) {
         $this->errormessage = "";
         return true;
     } else {
         $this->errormessage = $save->failfeedback;
         return false;
     }
 }
示例#3
0
 public function saveRegion()
 {
     $this->log->showLog(2, "Access saveRegion");
     include "../simantz/class/nitobi.xml.php";
     include_once "../simantz/class/Save_Data.inc.php";
     global $xoopsDB, $xoopsUser;
     $saveHandler = new EBASaveHandler();
     $saveHandler->ProcessRecords();
     $timestamp = date("Y-m-d H:i:s", time());
     $createdby = $xoopsUser->getVar('uid');
     $uname = $xoopsUser->getVar('uname');
     $uid = $xoopsUser->getVar('uid');
     $organization_id = $this->defaultorganization_id;
     $tablename = "sim_region";
     $save = new Save_Data();
     $insertCount = $saveHandler->ReturnInsertCount();
     $this->log->showLog(3, "Start Insert({$insertCount} records)");
     if ($insertCount > 0) {
         $arrfield = array("country_id", "region_name", "isactive", "seqno", "created", "createdby", "updated", "updatedby", "organization_id");
         $arrfieldtype = array('%d', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d');
         // Yes there are INSERTs to perform...
         for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, "country_id"), $saveHandler->ReturnInsertField($currentRecord, "region_name"), $saveHandler->ReturnInsertField($currentRecord, "isactive"), $saveHandler->ReturnInsertField($currentRecord, "seqno"), $timestamp, $createdby, $timestamp, $createdby, $organization_id);
             $controlvalue = $saveHandler->ReturnInsertField($currentRecord, "region_name");
             $save->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, "region_name");
             if ($save->failfeedback != "") {
                 $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                 $this->failfeedback .= $save->failfeedback;
             }
             // Now we execute this query
         }
     }
     $updateCount = $saveHandler->ReturnUpdateCount();
     $this->log->showLog(3, "Start update({$updateCount} records)");
     if ($updateCount > 0) {
         $arrfield = array("region_name", "isactive", "seqno", "updated", "updatedby");
         $arrfieldtype = array('%s', '%d', '%d', '%s', '%d');
         // Yes there are UPDATEs to perform...
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $this->log->showLog(3, "***updating record({$currentRecord}),new region_name:" . $saveHandler->ReturnUpdateField($currentRecord, "region_name") . ",id:" . $saveHandler->ReturnUpdateField($currentRecord, "region_id") . "\n");
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, "region_name");
         }
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, "region_name"), $saveHandler->ReturnUpdateField($currentRecord, "isactive"), $saveHandler->ReturnUpdateField($currentRecord, "seqno"), $timestamp, $createdby);
             $this->log->showLog(3, "***updating record({$currentRecord}),new region_name:" . $saveHandler->ReturnUpdateField($currentRecord, "region_name") . ",id:" . $saveHandler->ReturnUpdateField($currentRecord, "region_id") . "\n");
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, "region_name");
             $save->UpdateRecord($tablename, "region_id", $saveHandler->ReturnUpdateField($currentRecord, "region_id"), $arrfield, $arrvalue, $arrfieldtype, $controlvalue);
             if ($save->failfeedback != "") {
                 $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                 $this->failfeedback .= $save->failfeedback;
             }
         }
     }
     $ispurge = 0;
     $deleteCount = $saveHandler->ReturnDeleteCount();
     $this->log->showLog(3, "Start delete/purge({$deleteCount} records)");
     //include "class/Country.inc.php";
     //$o = new Country();
     if ($deleteCount > 0) {
         for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) {
             $record_id = $saveHandler->ReturnDeleteField($currentRecord);
             $this->fetchRegion($record_id);
             $controlvalue = $this->region_name;
             $isdeleted = $this->isdeleted;
             $save->DeleteRecord("sim_region", "region_id", $record_id, $controlvalue, 1);
             if ($save->failfeedback != "") {
                 $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                 $this->failfeedback .= $save->failfeedback;
             }
         }
     }
     if ($this->failfeedback != "") {
         $this->failfeedback = "Warning!<br/>\n" . $this->failfeedback;
     }
     $saveHandler->setErrorMessage($this->failfeedback);
     $saveHandler->CompleteSave();
 }
示例#4
0
 /**
  * Update existing year record
  *
  * @return bool
  * @access public
  */
 public function updateYear()
 {
     include "../simantz/class/Save_Data.inc.php";
     $timestamp = date("y/m/d H:i:s", time());
     $save = new Save_Data();
     $arrvalue = array($this->year_description, $this->year_name, $this->isactive, $timestamp, $this->updatedby);
     return $save->UpdateRecord($this->tablename, "year_id", $this->year_id, $this->arrUpdateField, $arrvalue, $this->arrUpdateFieldType, $this->year_name);
 }
 /**
  *
  * @return bool
  * @access public
  */
 public function updateOrganization()
 {
     $this->log->showLog(3, "Access updateOrganization");
     $timestamp = date("y/m/d H:i:s", time());
     include_once XOOPS_ROOT_PATH . "/modules/simantz/class/Save_Data.inc.php";
     $save = new Save_Data();
     $arrfield = array("organization_name", "organization_code", "tel_1", "tel_2", "fax", "url", "email", "updated", "updatedby", "isactive", "groupid", "currency_id", "street1", "street2", "street3", "postcode", "country_id", "city", "state", "seqno", "companyno", "companyname", "description");
     $arrfieldtype = array("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%d", "%d", "%d", "%d", "%s", "%s", "%s", "%s", "%d", "%s", "%s", "%d", "%s", "%s", "%s");
     $arrvalue = array($this->organization_name, $this->organization_code, $this->tel_1, $this->tel_2, $this->fax, $this->url, $this->email, $timestamp, $this->updatedby, $this->isactive, $this->groupid, $this->currency_id, $this->street1, $this->street2, $this->street3, $this->postcode, $this->country_id, $this->city, $this->state, $this->seqno, $this->companyno, $this->companyname, $this->description);
     $controlvalue = $this->organization_code;
     if ($save->UpdateRecord($this->tableorganization, "organization_id", $this->organization_id, $arrfield, $arrvalue, $arrfieldtype, $controlvalue)) {
         $this->log->showLog(3, "Update organization successfully.");
         return true;
     } else {
         $this->log->showLog(2, "Warning! Update organization failed");
         return false;
     }
 }
示例#6
0
        $isactive = 1;
    } else {
        $isactive = 0;
    }
    $save = $_REQUEST['save'];
    if ($save == 1) {
        include "../simantz/class/Save_Data.inc.php";
        $save = new Save_Data();
        $arrUpdateField = array('windowsetting', 'isactive', 'updated', 'updatedby', 'jrxml');
        $arrUpdateFieldType = array("%s", "%d", "%s", "%d", '%s');
        if (get_magic_quotes_gpc()) {
            $txt = stripslashes($txt);
            $jrxml = stripslashes($jrxml);
        }
        $arrvalue = array($txt, $isactive, date("Y-m-d H:i:s", time()), $xoopsUser->getVar('uid'), $jrxml);
        $save->UpdateRecord('sim_window', "window_id", $window_id, $arrUpdateField, $arrvalue, $arrUpdateFieldType, $window_name);
        //    return true;
        //else
        //  return false;
    }
    echo "<table>";
    eval($txt);
    echo "</table>";
    die;
}
include_once "menu.php";
$xoTheme->addStylesheet("{$url}/modules/simantz/include/jqueryui/themes/base/jquery.ui.all.css");
$xoTheme->addScript("{$url}/modules/simantz/include/jqueryui/jquery.min.js");
$xoTheme->addScript("{$url}/modules/simantz/include/jqueryui/ui/jquery.ui.core.js");
$xoTheme->addScript("{$url}/modules/simantz/include/jqueryui/ui/jquery.ui.widget.js");
$xoTheme->addScript("{$url}/modules/simantz/include/jqueryui/ui/jquery.ui.datepicker.js");
示例#7
0
 public function updateWorkflow()
 {
     include "../class/Save_Data.inc.php";
     $save = new Save_Data();
     $arrvalue = array($this->workflow_id, $this->sequence_no, $this->parentnode_id, $this->workflowstatus_id, $this->workflowuserchoice_id, $this->target_groupid, $this->target_uid, $this->targetparameter_name, $this->email_list, $this->sms_list, $this->workflow_procedure, $this->email_body, $this->sms_body, $this->isemail, $this->issms, $this->workflow_description, $this->parameter_used, $this->updated, $this->updatedby, $this->isactive, $this->workflow_sql, $this->workflow_bypass, $this->hyperlink, $this->issubmit_node, $this->iscomplete_node);
     return $save->UpdateRecord($this->tablename, "workflownode_id", $this->workflownode_id, $this->arrUpdateField, $arrvalue, $this->arrUpdateFieldType, $this->sequence_no);
 }
示例#8
0
 /**
  * Update existing batch record
  *
  * @return bool
  * @access public
  */
 public function updateBatch()
 {
     global $selectspliter;
     include include "../simantz/class/Save_Data.inc.php";
     $save = new Save_Data();
     $this->tablename = $this->tablebatch;
     $primarykeyfieldname = "batch_id";
     $primarykeyvalue = $this->batch_id;
     $controlvalue = $this->batchno;
     $this->updated = date("y/m/d H:i:s", time());
     $arrUpdateField = array("batch_name", "reuse", "period_id", "organization_id", "description", "batchno", "batchdate", "iscomplete", "totaldebit", "totalcredit", "updated", "updatedby");
     $arrUpdateFieldType = array("%s", "%d", "%d", "%d", "%s", "%d", "%s", "%d", "%d", "%d", "%s", "%d");
     $arrvalue = array($this->batch_name, $this->reuse, $this->period_id, $this->organization_id, $this->description, $this->batchno, $this->batchdate, $this->iscomplete, $this->totaldebit, $this->totalcredit, $this->updated, $this->updatedby);
     if ($save->UpdateRecord($this->tablename, $primarykeyfieldname, $primarykeyvalue, $arrUpdateField, $arrvalue, $arrUpdateFieldType, $accounts_name)) {
         return true;
     } else {
         return false;
     }
 }
示例#9
0
 public function saveQuotationLine()
 {
     global $xoopsDB, $userid, $defaultorganization_id, $xoopsUser;
     include_once "../simantz/class/Save_Data.inc.php";
     $timestamp = date("Y-m-d H:i:s", time());
     $createdby = $userid;
     $this->log->showLog("2", "Access saveLine with totalline:" . $_POST['totalline'] . ",quotationline_id:" . print_r($_POST['linequotationline_id'], true));
     $timestamp = date("Y-m-d H:i:s", time());
     $createdby = $xoopsUser->getVar('uid');
     $uname = $xoopsUser->getVar('uname');
     $uid = $userid;
     $exchangerate = $_REQUEST['exchangerate'];
     if (!$exchangerate > 0) {
         $exchangerate = 1;
     }
     $tablename = "sim_bpartner_quotationline";
     $save = new Save_Data();
     $arrInsertField = array("seqno", "subject", "description", "unitprice", "qty", "uom", "amt", "quotation_id", "created", "createdby", "updated", "updatedby");
     $arrInsertFieldType = array("%d", "%s", "%s", "%f", "%f", "%s", "%f", "%d", "%s", "%d", "%s", "%d");
     $arrUpdateField = array("seqno", "subject", "description", "unitprice", "qty", "uom", "amt", "updated", "updatedby");
     $arrUpdateFieldType = array("%d", "%s", "%s", "%f", "%f", "%s", "%f", "%s", "%d");
     $linequotationline_id = $_POST['linequotationline_id'];
     $lineaccount_id = $_POST['lineaccount_id'];
     $linedescription = $_POST['linedescription'];
     $linesubject = $_POST['linesubject'];
     $linebranch_id = $_POST['linebranch_id'];
     $lineamt = $_POST['lineamt'];
     $lineuom = $_POST['lineuom'];
     $lineqty = $_POST['lineqty'];
     $lineunitprice = $_POST['lineunitprice'];
     $linelocalamt = $_POST['linelocalamt'];
     $linetax_id = $_POST['linetax_id'];
     $linegstamt = $_POST['linegstamt'];
     $linegranttotalamt = $_POST['linegranttotalamt'];
     $linelocalgranttotalamt = $_POST['linelocalgranttotalamt'];
     $linetrack1_id = $_POST['linetrack1_id'];
     $linetrack2_id = $_POST['linetrack2_id'];
     $linetrack3_id = $_POST['linetrack3_id'];
     $lineseqno = $_POST['lineseqno'];
     $totalline = $_POST['totalline'];
     $this->log->showLog(4, "submited data=" . print_r($_POST, true));
     // Yes there are INSERTs to perform...
     for ($i = 0; $i < $totalline; $i++) {
         $quotationline_id = $linequotationline_id[$i];
         $accounts_id = $lineaccount_id[$i];
         $quotation_no = $linequotation_no[$i];
         $description = $linedescription[$i];
         $subject = $linesubject[$i];
         $branch_id = $defaultorganization_id;
         //$linebranch_id[$i];
         $tax_id = $linetax_id[$i];
         $unitprice = $lineunitprice[$i];
         $qty = $lineqty[$i];
         $uom = $lineuom[$i];
         $amt = $lineamt[$i];
         $localamt = $linelocalamt[$i];
         $gstamt = $linegstamt[$i];
         $granttotalamt = $linegranttotalamt[$i];
         $localgranttotalamt = $linelocalgranttotalamt[$i];
         $track1_id = $linetrack1_id[$i];
         $track2_id = $linetrack2_id[$i];
         $track3_id = $linetrack3_id[$i];
         $seqno = $lineseqno[$i];
         if ($quotationline_id > 0) {
             $arrvalue = array($seqno, $subject, $description, $unitprice, $qty, $uom, $amt, $timestamp, $createdby);
             $this->log->showLog(3, "***updating record({$currentRecord}), quotationline:subject" . $subject);
             $controlvalue = $subject;
             if ($save->UpdateRecord($tablename, "quotationline_id", $quotationline_id, $arrUpdateField, $arrvalue, $arrUpdateFieldType, $controlvalue)) {
                 if ($save->failfeedback != "") {
                     $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                     $this->failfeedback .= $save->failfeedback;
                 }
             } else {
                 $this->log->showLog("Cannot update quotation line for {$subject}");
                 return false;
             }
         } elseif ($quotationline_id == '') {
         } elseif ($quotationline_id == 0) {
             $arrvalue = array($seqno, $subject, $description, $unitprice, $qty, $uom, $amt, $this->quotation_id, $timestamp, $createdby, $timestamp, $createdby);
             $controlvalue = $subject;
             if ($save->InsertRecord($tablename, $arrInsertField, $arrvalue, $arrInsertFieldType, $controlvalue, "quotationline_id")) {
                 if ($save->failfeedback != "") {
                     $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                     $this->failfeedback .= $save->failfeedback;
                 }
             } else {
                 $this->log->showLog(2, "Cannot insert record for {$subject}");
                 return false;
             }
             // Now we execute this query
         }
     }
     $this->log->showLog(2, "Complete run savequotationline successfully");
     return true;
 }
示例#10
0
 public function updateAccounts()
 {
     global $selectspliter;
     include include "../simantz/class/Save_Data.inc.php";
     $save = new Save_Data();
     $arrUpdateField = array('accounts_name', 'description', 'updated', 'updatedby', 'defaultlevel', 'accountgroup_id', 'organization_id', 'parentaccounts_id', 'account_type', 'tax_id', 'placeholder', 'accountcode_full', 'ishide');
     $arrUpdateFieldType = array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d');
     $arrvalue = array($this->accounts_name, $this->description, $this->updated, $this->updatedby, $this->defaultlevel, $this->accountgroup_id . $selectspliter . $this->accountgroup_idname, $this->organization_id, $this->parentaccounts_id . $selectspliter . $this->parentaccounts_idname, $this->account_type . $selectspliter . $this->account_typename, $this->tax_id, $this->placeholder, $this->accountcode_full, $this->ishide);
     if ($save->UpdateRecord($this->tablename, "accounts_id", $this->accounts_id, $arrUpdateField, $arrvalue, $arrUpdateFieldType, $accounts_name)) {
         return true;
     } else {
         return false;
     }
 }
示例#11
0
 public function rollbackSubmitOperation($table_name, $field_name, $field_val, $field_update = "issubmit")
 {
     include_once "../simantz/class/Save_Data.inc.php";
     $save = new Save_Data();
     $arrUpdateField = array($field_update);
     $arrUpdateFieldType = array("%d");
     $arrvalue = array("0");
     $this->log->showLog(4, " rollbackSubmitOperation with SQL: {$field_update}");
     return $save->UpdateRecord($table_name, $field_name, $field_val, $arrUpdateField, $arrvalue, $arrUpdateFieldType, $field_val);
 }
示例#12
0
 public function saveBatchline()
 {
     $this->log->showLog(3, "Access saveBatchline");
     include "../simantz/class/nitobi.xml.php";
     include_once "../simantz/class/Save_Data.inc.php";
     global $xoopsDB, $xoopsUser, $defcurrencycode_id;
     $saveHandler = new EBASaveHandler();
     $saveHandler->ProcessRecords();
     $timestamp = date("Y-m-d H:i:s", time());
     $createdby = $xoopsUser->getVar('uid');
     $uname = $xoopsUser->getVar('uname');
     $uid = $xoopsUser->getVar('uid');
     $tablename = "sim_simbiz_transaction";
     $this->multiplyconversion = 1;
     $this->log->showLog(3, "Get batch_id:{$batch_id}");
     $save = new Save_Data();
     /* run update 1st */
     $updateCount = $saveHandler->ReturnUpdateCount();
     $this->log->showLog(3, "Start update({$updateCount} records)");
     if ($updateCount > 0) {
         $arrfield = array("document_no", "amt", "originalamt", "tax_id", "currency_id", "document_no2", "accounts_id", "multiplyconversion", "seqno", "bpartner_id", "isreconciled", "bankreconcilation_id", "transtype", "linedesc", "reconciledate", "branch_id", "track_id1", "track_id2", "track_id3", "created", "createdby", "row_typeline", "temp_parent_id");
         $arrfieldtype = array('%s', '%f', '%f', '%d', '%d', '%s', '%d', '%f', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d');
         // Yes there are UPDATEs to perform...
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $this->log->showLog(3, "***updating record({$currentRecord}),new batchline_details:" . $saveHandler->ReturnUpdateField($currentRecord, "batchline_details") . ",id:" . $saveHandler->ReturnUpdateField($currentRecord) . "\n");
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, "batchline_details");
         }
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             //            $reference_id = 0;
             $row_typeline = $saveHandler->ReturnUpdateField($currentRecord, "row_typeline");
             $temp_parent_id = $saveHandler->ReturnUpdateField($currentRecord, "temp_parent_id");
             //            if($row_typeline == 2)
             //            $reference_id = $this->getLatestGridParentID($temp_parent_id);
             $amt = $saveHandler->ReturnUpdateField($currentRecord, "amt_debit");
             if ($saveHandler->ReturnUpdateField($currentRecord, "amt_credit") > 0) {
                 $amt = -1 * $saveHandler->ReturnUpdateField($currentRecord, "amt_credit");
             }
             $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, "document_no"), $amt, $amt, $saveHandler->ReturnUpdateField($currentRecord, "tax_cell"), $defcurrencycode_id, $saveHandler->ReturnUpdateField($currentRecord, "document_no2"), $saveHandler->ReturnUpdateField($currentRecord, "accounts_cell"), $this->multiplyconversion, $saveHandler->ReturnUpdateField($currentRecord, "seqno"), $saveHandler->ReturnUpdateField($currentRecord, "bpartner_cell"), $this->isreconciled, $this->bankreconcilation_id, $this->transtype, $saveHandler->ReturnUpdateField($currentRecord, "linedesc"), $this->reconciledate, $saveHandler->ReturnUpdateField($currentRecord, "organization_cell"), $saveHandler->ReturnUpdateField($currentRecord, "track1_cell"), $saveHandler->ReturnUpdateField($currentRecord, "track2_cell"), $saveHandler->ReturnUpdateField($currentRecord, "track3_cell"), $timestamp, $createdby, $row_typeline, $temp_parent_id);
             $this->log->showLog(3, "***updating record({$currentRecord}),new batchline_details:" . $saveHandler->ReturnUpdateField($currentRecord, "batchline_details") . ",id:" . $saveHandler->ReturnUpdateField($currentRecord, "batchline_id") . "\n");
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, "trans_id");
             $save->UpdateRecord($tablename, "trans_id", $saveHandler->ReturnUpdateField($currentRecord, "trans_id"), $arrfield, $arrvalue, $arrfieldtype, $controlvalue);
             if ($save->failfeedback != "") {
                 $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                 $this->failfeedback .= $save->failfeedback;
             }
         }
     }
     /*run delete 1st*/
     $ispurge = 0;
     $deleteCount = $saveHandler->ReturnDeleteCount();
     $this->log->showLog(3, "Start delete/purge({$deleteCount} records)");
     //include "class/Country.inc.php";
     //$o = new Country();
     if ($deleteCount > 0) {
         for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) {
             $record_id = $saveHandler->ReturnDeleteField($currentRecord);
             // $this->fetchDisciplineline($record_id);
             $controlvalue = $this->trans_id;
             $isdeleted = 1;
             $save->DeleteRecord("sim_simbiz_transaction", "trans_id", $record_id, $controlvalue, $isdeleted);
         }
     }
     /* start insert after update all row*/
     $insertCount = $saveHandler->ReturnInsertCount();
     $this->log->showLog(3, "Start Insert({$insertCount} records)");
     if ($insertCount > 0) {
         $arrfield = array("batch_id", "document_no", "amt", "originalamt", "tax_id", "currency_id", "document_no2", "accounts_id", "multiplyconversion", "seqno", "reference_id", "bpartner_id", "isreconciled", "bankreconcilation_id", "transtype", "linedesc", "reconciledate", "branch_id", "track_id1", "track_id2", "track_id3", "created", "createdby", "row_typeline", "temp_parent_id");
         $arrfieldtype = array('%d', '%s', '%f', '%f', '%d', '%d', '%s', '%d', '%f', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d');
         // Yes there are INSERTs to perform... for parent
         for ($currentRecord = $insertCount - 1; $currentRecord >= 0; $currentRecord--) {
             $reference_id = 0;
             $row_typeline = $saveHandler->ReturnInsertField($currentRecord, "row_typeline");
             $temp_parent_id = $saveHandler->ReturnInsertField($currentRecord, "temp_parent_id");
             //         if($row_typeline == 2)
             //         $reference_id = $this->getLatestGridParentID($temp_parent_id);
             if ($row_typeline == 1) {
                 $amt = $saveHandler->ReturnInsertField($currentRecord, "amt_debit");
                 if ($saveHandler->ReturnInsertField($currentRecord, "amt_credit") > 0) {
                     $amt = -1 * $saveHandler->ReturnInsertField($currentRecord, "amt_credit");
                 }
                 $arrvalue = array($this->batch_id, $saveHandler->ReturnInsertField($currentRecord, "document_no"), $amt, $amt, $saveHandler->ReturnInsertField($currentRecord, "tax_cell"), $defcurrencycode_id, $saveHandler->ReturnInsertField($currentRecord, "document_no2"), $saveHandler->ReturnInsertField($currentRecord, "accounts_cell"), $this->multiplyconversion, $saveHandler->ReturnInsertField($currentRecord, "seqno"), $reference_id, $saveHandler->ReturnInsertField($currentRecord, "bpartner_cell"), $this->isreconciled, $this->bankreconcilation_id, $this->transtype, $saveHandler->ReturnInsertField($currentRecord, "linedesc"), $this->reconciledate, $saveHandler->ReturnInsertField($currentRecord, "organization_cell"), $saveHandler->ReturnInsertField($currentRecord, "track1_cell"), $saveHandler->ReturnInsertField($currentRecord, "track2_cell"), $saveHandler->ReturnInsertField($currentRecord, "track3_cell"), $timestamp, $createdby, $row_typeline, $temp_parent_id);
                 $controlvalue = $saveHandler->ReturnInsertField($currentRecord, "trans_id");
                 $save->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, "trans_id");
                 if ($save->failfeedback != "") {
                     $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                     $this->failfeedback .= $save->failfeedback;
                 }
             }
             // Now we execute this query
         }
         // Yes there are INSERTs to perform... for child
         for ($currentRecord = $insertCount - 1; $currentRecord >= 0; $currentRecord--) {
             $reference_id = 0;
             $row_typeline = $saveHandler->ReturnInsertField($currentRecord, "row_typeline");
             $temp_parent_id = $saveHandler->ReturnInsertField($currentRecord, "temp_parent_id");
             if ($row_typeline == 2) {
                 $reference_id = $this->getLatestGridParentID($temp_parent_id);
             }
             if ($row_typeline == 2) {
                 $amt = $saveHandler->ReturnInsertField($currentRecord, "amt_debit");
                 if ($saveHandler->ReturnInsertField($currentRecord, "amt_credit") > 0) {
                     $amt = number_format(-1 * $saveHandler->ReturnInsertField($currentRecord, "amt_credit"), 2);
                 }
                 $arrvalue = array($this->batch_id, $saveHandler->ReturnInsertField($currentRecord, "document_no"), $amt, $amt, $saveHandler->ReturnInsertField($currentRecord, "tax_cell"), $defcurrencycode_id, $saveHandler->ReturnInsertField($currentRecord, "document_no2"), $saveHandler->ReturnInsertField($currentRecord, "accounts_cell"), $this->multiplyconversion, $saveHandler->ReturnInsertField($currentRecord, "seqno"), $reference_id, $saveHandler->ReturnInsertField($currentRecord, "bpartner_cell"), $this->isreconciled, $this->bankreconcilation_id, $this->transtype, $saveHandler->ReturnInsertField($currentRecord, "linedesc"), $this->reconciledate, $saveHandler->ReturnInsertField($currentRecord, "organization_cell"), $saveHandler->ReturnInsertField($currentRecord, "track1_cell"), $saveHandler->ReturnInsertField($currentRecord, "track2_cell"), $saveHandler->ReturnInsertField($currentRecord, "track3_cell"), $timestamp, $createdby, $row_typeline, $temp_parent_id);
                 $controlvalue = $saveHandler->ReturnInsertField($currentRecord, "trans_id");
                 $save->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, "trans_id");
                 if ($save->failfeedback != "") {
                     $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                     $this->failfeedback .= $save->failfeedback;
                 }
             }
             // Now we execute this query
         }
     }
     /* end insert */
     if ($this->failfeedback != "") {
         $this->failfeedback = "Warning!<br/>\n" . $this->failfeedback;
     }
     $saveHandler->setErrorMessage($this->failfeedback);
     $saveHandler->CompleteSave();
 }
示例#13
0
 public function saveFollowUpLayer()
 {
     global $xoopsUser, $xoopsDB;
     include "../simantz/class/Save_Data.inc.php";
     $save = new Save_Data();
     //do your sql insert here using $this->employee_name method : return boolean true or false
     $timestamp = date("Y-m-d H:i:s", time());
     $createdby = $xoopsUser->getVar('uid');
     $uname = $xoopsUser->getVar('uname');
     $this->updatedby = $xoopsUser->getVar('uid');
     $tablename = "sim_followup";
     if ($_POST['followup_id'] > 0) {
         $arrfield = array("issuedate", "followup_name", "followuptype_id", "nextfollowupdate", "contactperson", "contactnumber", "description", "updated", "updatedby", "isactive", "employee_name");
         $arrfieldtype = array('%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%s');
         $controlvalue = $_POST["followup_name"];
         if ($_POST['isactive'] == "on") {
             $isactive = 1;
         } else {
             $isactive = 0;
         }
         $arrvalue = array($_POST["issuedate"], $_POST["followup_name"], $_POST["followuptype_id"], $_POST["nextfollowupdate"], $_POST["contactperson"], $_POST["contactnumber"], $_POST["description"], $timestamp, $createdby, $isactive, $_POST['employee_name']);
         if ($save->UpdateRecord($tablename, "followup_id", $_POST['followup_id'], $arrfield, $arrvalue, $arrfieldtype, $controlvalue)) {
             $arr = array("msg" => "Record save successfully", "status" => 1);
             echo json_encode($arr);
         } else {
             $arr = array("msg" => "Cannot save record", "status" => 0);
             echo json_encode($arr);
         }
     } else {
         $arrfield = array("issuedate", "followup_name", "followuptype_id", "nextfollowupdate", "contactperson", "contactnumber", "description", "created", "createdby", "updated", "updatedby", "isactive", "employee_name", "bpartner_id");
         $arrfieldtype = array('%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d', '%d', '%s', '%d');
         $controlvalue = $_POST["followup_name"];
         if ($_POST['isactive'] == "on") {
             $isactive = 1;
         } else {
             $isactive = 0;
         }
         $arrvalue = array($_POST["issuedate"], $_POST["followup_name"], $_POST["followuptype_id"], $_POST["nextfollowupdate"], $_POST["contactperson"], $_POST["contactnumber"], $_POST["description"], $timestamp, $createdby, $timestamp, $createdby, $isactive, $_POST['employee_name'], $_POST['bpartner_id']);
         if ($save->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $_POST["followup_name"], "followup_id")) {
             $arr = array("msg" => "Record save successfully", "status" => 1);
             echo json_encode($arr);
         } else {
             $arr = array("msg" => "Cannot save record", "status" => 0);
             echo json_encode($arr);
         }
     }
 }
示例#14
0
 public function saveInvoiceLine()
 {
     $this->log->showLog(3, "Access saveInvoiceLine");
     include "../simantz/class/nitobi.xml.php";
     include_once "../simantz/class/Save_Data.inc.php";
     global $xoopsDB, $xoopsUser;
     $saveHandler = new EBASaveHandler();
     $saveHandler->ProcessRecords();
     $timestamp = date("Y-m-d H:i:s", time());
     $createdby = $xoopsUser->getVar('uid');
     $uname = $xoopsUser->getVar('uname');
     $uid = $xoopsUser->getVar('uid');
     $tablename = "sim_simbiz_invoiceline";
     $save = new Save_Data();
     $insertCount = $saveHandler->ReturnInsertCount();
     $this->log->showLog(3, "Start Insert({$insertCount} records)");
     if ($insertCount > 0) {
         $arrInsertField = array("seqno", "subject", "description", "accounts_id", "uprice", "qty", "uom", "tax_id", "branch_id", "track1_id", "track2_id", "track3_id", "amt", "invoice_id", "gstamt", "granttotalamt", "created", "createdby", "updated", "updatedby");
         $arrInsertFieldType = array("%d", "%s", "%s", "%d", "%f", "%f", "%s", "%d", "%d", "%s", "%s", "%s", "%f", "%d", "%f", "%f", "%s", "%d", "%s", "%d");
         // Yes there are INSERTs to perform...
         for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, "seqno"), $saveHandler->ReturnInsertField($currentRecord, "subject"), $saveHandler->ReturnInsertField($currentRecord, "description"), $saveHandler->ReturnInsertField($currentRecord, "accounts_id"), $saveHandler->ReturnInsertField($currentRecord, "uprice"), $saveHandler->ReturnInsertField($currentRecord, "qty"), $saveHandler->ReturnInsertField($currentRecord, "uom"), $saveHandler->ReturnInsertField($currentRecord, "tax_id"), $saveHandler->ReturnInsertField($currentRecord, "branch_id"), $saveHandler->ReturnInsertField($currentRecord, "track1_id"), $saveHandler->ReturnInsertField($currentRecord, "track2_id"), $saveHandler->ReturnInsertField($currentRecord, "track3_id"), $saveHandler->ReturnInsertField($currentRecord, "amt"), $saveHandler->ReturnInsertField($currentRecord, "invoice_id"), $saveHandler->ReturnInsertField($currentRecord, "gstamt"), $saveHandler->ReturnInsertField($currentRecord, "granttotalamt"), $timestamp, $createdby, $timestamp, $createdby);
             $controlvalue = $saveHandler->ReturnInsertField($currentRecord, "subject");
             $save->InsertRecord($tablename, $arrInsertField, $arrvalue, $arrInsertFieldType, $controlvalue, "invoiceline_id");
             if ($save->failfeedback != "") {
                 $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                 $this->failfeedback .= $save->failfeedback;
             }
             // Now we execute this query
         }
     }
     $updateCount = $saveHandler->ReturnUpdateCount();
     $this->log->showLog(3, "Start update({$updateCount} records)");
     if ($updateCount > 0) {
         $arrUpdateField = array("seqno", "subject", "description", "accounts_id", "uprice", "qty", "uom", "tax_id", "branch_id", "track1_id", "track2_id", "track3_id", "amt", "gstamt", "granttotalamt", "updated", "updatedby");
         $arrUpdateFieldType = array("%d", "%s", "%s", "%d", "%f", "%f", "%s", "%d", "%d", "%s", "%s", "%s", "%f", "%f", "%f", "%s", "%d");
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, "seqno"), $saveHandler->ReturnUpdateField($currentRecord, "subject"), $saveHandler->ReturnUpdateField($currentRecord, "description"), $saveHandler->ReturnUpdateField($currentRecord, "accounts_id"), $saveHandler->ReturnUpdateField($currentRecord, "uprice"), $saveHandler->ReturnUpdateField($currentRecord, "qty"), $saveHandler->ReturnUpdateField($currentRecord, "uom"), $saveHandler->ReturnUpdateField($currentRecord, "tax_id"), $saveHandler->ReturnUpdateField($currentRecord, "branch_id"), $saveHandler->ReturnUpdateField($currentRecord, "track1_id"), $saveHandler->ReturnUpdateField($currentRecord, "track2_id"), $saveHandler->ReturnUpdateField($currentRecord, "track3_id"), $saveHandler->ReturnUpdateField($currentRecord, "amt"), $saveHandler->ReturnUpdateField($currentRecord, "gstamt"), $saveHandler->ReturnUpdateField($currentRecord, "granttotalamt"), $timestamp, $createdby);
             $this->log->showLog(3, "***updating record({$currentRecord}), invoiceline:subject" . $saveHandler->ReturnUpdateField($currentRecord, "subject"));
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, "subject");
             $save->UpdateRecord($tablename, "invoiceline_id", $saveHandler->ReturnUpdateField($currentRecord, "invoiceline_id"), $arrUpdateField, $arrvalue, $arrUpdateFieldType, $controlvalue);
             if ($save->failfeedback != "") {
                 $save->failfeedback = str_replace($this->failfeedback, "", $save->failfeedback);
                 $this->failfeedback .= $save->failfeedback;
             }
         }
     }
     $ispurge = 0;
     $deleteCount = $saveHandler->ReturnDeleteCount();
     $this->log->showLog(3, "Start delete/purge({$deleteCount} records)");
     if ($deleteCount > 0) {
         for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) {
             $record_id = $saveHandler->ReturnDeleteField($currentRecord);
             $this->log->showLog(3, "delete: {$currentRecord},{$record_id}");
             $controlvalue = $this->getInvoiceLineSubject($record_id);
             $save->DeleteRecord("sim_simbiz_invoiceline", "invoiceline_id", $record_id, $controlvalue, 1);
         }
     }
     if ($this->failfeedback != "") {
         $this->failfeedback = "Warning!<br/>\n" . $this->failfeedback;
     }
     $saveHandler->setErrorMessage($this->failfeedback);
     $saveHandler->CompleteSave();
 }
示例#15
0
 /**
  * Save new bpartner into database
  *
  * @return bool
  * @access public
  */
 public function insertBPartner()
 {
     include "../simantz/class/Save_Data.inc.php";
     $save = new Save_Data();
     //do your sql insert here using $this->employee_name method : return boolean true or false
     global $xoopsDB, $xoopsUser;
     $joindate = date("Y-m-d", time());
     $timestamp = date("Y-m-d H:i:s", time());
     $createdby = $xoopsUser->getVar('uid');
     $uname = $xoopsUser->getVar('uname');
     $this->updatedby = $xoopsUser->getVar('uid');
     $tablename = "sim_bpartner";
     if ($this->bpartner_id > 0) {
         //do update sql here
         $this->arrUpdateField = array("employeecount,alternatename,companyno,industry_id,tooltips,\r\n                            bpartnergroup_id,bpartner_no,bpartner_name,isactive,bpartner_url,\r\n\r\n                            description,currency_id,terms_id,organization_id,defaultlevel,\r\n                            updated,updatedby");
         $this->arrUpdateFieldType = array("%d", "%s", "%s", "%d", "%s", "%d", "%s", "%s", "%d", "%s", "%s", "%d", "%d", "%d", "%d", "%s", "%d", "%d");
         $arrvalue = array($this->employeecount, $this->alternatename, $this->companyno, $this->industry_id, $this->tooltips, $this->bpartnergroup_id, $this->bpartner_no, $this->bpartner_name, $this->isactive, $this->bpartner_url, $this->description, 0, 0, $this->organization_id, $this->defaultlevel, $this->updated, $this->updatedby);
         return $save->UpdateRecord($tablename, "bpartner_id", $this->bpartner_id, $this->arrUpdateField, $arrvalue, $this->arrUpdateFieldType, $this->bpartner_no);
     } else {
         //do insert sql here
         $this->arrInsertField = array("employeecount,alternatename,companyno,industry_id,tooltips,\r\n                            bpartnergroup_id,bpartner_no,bpartner_name,isactive,bpartner_url,\r\n\r\n                            description,currency_id,terms_id,organization_id,defaultlevel,\r\n                            created,createdby,updated,updatedby");
         $this->arrInsertFieldType = array("%d", "%s", "%s", "%d", "%s", "%d", "%s", "%s", "%d", "%s", "%s", "%d", "%d", "%d", "%d", "%s", "%d", "%s", "%d", "%d");
         $arrvalue = array($this->employeecount, $this->alternatename, $this->companyno, $this->industry_id, $this->tooltips, $this->bpartnergroup_id, $this->bpartner_no, $this->bpartner_name, $this->isactive, $this->bpartner_url, $this->description, 0, 0, $this->organization_id, $this->defaultlevel, $this->created, $this->createdby, $this->updated, $this->updatedby);
         return $save->InsertRecord($tablename, $this->arrInsertField, $arrvalue, $this->arrInsertFieldType, $this->bpartner_name, "bpartner_id");
     }
 }
示例#16
0
 public function updateWindow()
 {
     if (file_exists("../simantz/")) {
         include "../simantz/class/Save_Data.inc.php";
     } else {
         include "../class/Save_Data.inc.php";
     }
     $save = new Save_Data();
     $arrvalue = array($this->mid, $this->windowsetting, $this->seqno, $this->description, $this->parentwindows_id, $this->filename, $this->isactive, $this->window_name, $this->updated, $this->updatedby, $this->table_name, $this->helpurl, $this->jrxml);
     return $save->UpdateRecord($this->tablename, "window_id", $this->window_id, $this->arrUpdateField, $arrvalue, $this->arrUpdateFieldType, $this->window_name);
 }