|
@@ -808,13 +808,14 @@ int OCPP_insert_transaction_msg(uint8_t isStartTransaction, char *transactionMsg
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-int OCPP_insert_deduct_info(int txId, char *creditNo, uint8_t deductResult, uint8_t isDonateInvoice, double amount, char *vemData)
|
|
|
+int OCPP_insert_deduct_info(int txId, char *creditNo, uint8_t deductResult, uint8_t isDonateInvoice, double amount, char *vemData, char *ROC, char *RRN, char *approvalNo, char *storeId)
|
|
|
{
|
|
|
int result = PASS;
|
|
|
char* errMsg = NULL;
|
|
|
char sqlStr[8192];
|
|
|
|
|
|
- sprintf(sqlStr, "insert into report_deduct_info(txId, creditNo, deductResult, isDonateInvoice, amount, vemData, isUploaded) values('%d', '%s', '%d', '%d', '%.2f', '%s', '0');", txId, creditNo, deductResult, isDonateInvoice, amount, vemData);
|
|
|
+ sprintf(sqlStr, "insert into report_deduct_info(txId, creditNo, deductResult, isDonateInvoice, amount, vemData, ROC, RRN, approvalNo, storeId, isUploaded) values('%d', '%s', '%d', '%d', '%.2f', '%s', '%s', '%s', '%s', '%s', '0');",
|
|
|
+ txId, creditNo, deductResult, isDonateInvoice, amount, vemData, ROC, RRN, approvalNo, storeId);
|
|
|
|
|
|
if (sqlite3_exec(db, sqlStr, 0, 0, &errMsg) != SQLITE_OK)
|
|
|
{
|
|
@@ -853,12 +854,13 @@ int queryDeductCallBack(void *data, int columenCount, char **columnValue, char *
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].VendorId, "%s", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].MessageId,"%s","ID_CreditDeductResult");
|
|
|
- sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].Data, "{\\\"txId\\\":%d,\\\"creditNo\\\":\\\"%s\\\",\\\"deductResult\\\":%s,\\\"isDonateInvoice\\\":%s,\\\"amount\\\":%s}",
|
|
|
+ sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].Data, "{\\\"txId\\\":%d,\\\"creditNo\\\":\\\"%s\\\",\\\"deductResult\\\":%s,\\\"isDonateInvoice\\\":%s,\\\"amount\\\":%s,\\\"approvalNo\\\":%s}",
|
|
|
atoi(columnValue[1]),
|
|
|
columnValue[2],
|
|
|
atoi(columnValue[3])==1?"true":"false",
|
|
|
atoi(columnValue[4])==1?"true":"false",
|
|
|
- columnValue[5]);
|
|
|
+ columnValue[5],
|
|
|
+ columnValue[9]);
|
|
|
|
|
|
ShmOCPP16DataPH->CsMsg.bits[0].DataTransferReq = 1;
|
|
|
|
|
@@ -4026,7 +4028,11 @@ void CheckSystemValue(void)
|
|
|
//===============================
|
|
|
if(ShmOCPP16DataPH->TcciCustomData.ReportCreditDeductReq)
|
|
|
{
|
|
|
- OCPP_insert_deduct_info(ShmOCPP16DataPH->TcciCustomData.DeductInfo.txId, (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.creditNo, ShmOCPP16DataPH->TcciCustomData.DeductInfo.deductResult, ShmOCPP16DataPH->TcciCustomData.DeductInfo.isDonateInvoice, ShmOCPP16DataPH->TcciCustomData.DeductInfo.amount, (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.vemData);
|
|
|
+ OCPP_insert_deduct_info(ShmOCPP16DataPH->TcciCustomData.DeductInfo.txId, (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.creditNo,
|
|
|
+ ShmOCPP16DataPH->TcciCustomData.DeductInfo.deductResult, ShmOCPP16DataPH->TcciCustomData.DeductInfo.isDonateInvoice,
|
|
|
+ ShmOCPP16DataPH->TcciCustomData.DeductInfo.amount, (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.vemData,
|
|
|
+ (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.ROC,(char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.RRN,
|
|
|
+ (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.approvalNo,(char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.storeId);
|
|
|
|
|
|
ShmOCPP16DataPH->TcciCustomData.ReportCreditDeductReq = FALSE;
|
|
|
}
|