Merge branch 'CI4-Application' of bitbucket.org:venbainformationtechnology/ria into CI4-Application
This commit is contained in:
commit
7e95754e6a
@ -1271,7 +1271,7 @@ class User extends BaseController
|
||||
}
|
||||
|
||||
function zohobooks_api_fetch_all(){
|
||||
// print_r($_GET);
|
||||
// print_r($_GET);
|
||||
// echo isset($_GET['from']) ? $_GET['from'] : 'n';
|
||||
// echo isset($_GET['to']) ? $_GET['to'] : 'n';
|
||||
// die();
|
||||
@ -1307,7 +1307,6 @@ class User extends BaseController
|
||||
// $token = generateNewToken(); $tokendata['token'] = $token;
|
||||
//$Zohobook_model->update($tokendata , 1,'zohobook_accesstoken');
|
||||
$result = getheringInvoiceDetails($date_today , $date_yesterday , $token);
|
||||
// echo json_encode($result);die;
|
||||
$headers_new = $result['headers_new'];
|
||||
$res = json_decode($result['data'],true);
|
||||
$inv_array = $res['invoices'];
|
||||
@ -1354,8 +1353,8 @@ class User extends BaseController
|
||||
{
|
||||
log_message('error', 'No data => Data fetch failed DB : ip_clients '.$gst_no);
|
||||
$gst_no_data['client_tax_code'] = $gst_no;
|
||||
$gst_sql = $Zohobook_model->customInsert($gst_no_data,'ip_clients');
|
||||
$client_id = $gst_sql[0]['tax_rate_id'];
|
||||
$gst_inserted_id = $Zohobook_model->customInsert($gst_no_data,'ip_clients');
|
||||
$client_id = $gst_inserted_id;
|
||||
log_message('error', 'New Data Created : DB : ip_clients , client_id : '.$client_id);
|
||||
}
|
||||
|
||||
@ -1388,11 +1387,11 @@ class User extends BaseController
|
||||
|
||||
$batch_no = isset($rs['custom_fields'][5]['value']) ? $rs['custom_fields'][5]['value'] : "";
|
||||
// $batch_no = "";
|
||||
$vehicle_number = $rs['custom_field_hash']['cf_vehicle_number'];
|
||||
$transport_mode =$rs['custom_field_hash']['cf_transport_mode'];
|
||||
$purchase_order_date = $rs['custom_field_hash']['cf_purchase_order_date'];
|
||||
$driver = $rs['custom_field_hash']['cf_driver'];
|
||||
$place_of_supply = $rs['custom_field_hash']['cf_place_of_supply'];
|
||||
$vehicle_number = isset($rs['custom_field_hash']['cf_vehicle_number']) ? $rs['custom_field_hash']['cf_vehicle_number']: '';
|
||||
$transport_mode =isset($rs['custom_field_hash']['cf_transport_mode']) ? $rs['custom_field_hash']['cf_transport_mode'] : '';
|
||||
$purchase_order_date = isset($rs['custom_field_hash']['cf_purchase_order_date'])?$rs['custom_field_hash']['cf_purchase_order_date']:'';
|
||||
$driver = isset($rs['custom_field_hash']['cf_driver']) ? $rs['custom_field_hash']['cf_driver'] : '';
|
||||
$place_of_supply = isset($rs['custom_field_hash']['cf_place_of_supply']) ? $rs['custom_field_hash']['cf_place_of_supply']:'';
|
||||
// batch_no
|
||||
$ip_invoice_custom_b['invoice_id'] = $invoice_insert_id;
|
||||
$ip_invoice_custom_b['invoice_custom_fieldid'] = 62;
|
||||
@ -1481,7 +1480,7 @@ class User extends BaseController
|
||||
log_message('error', 'No data => Data fetch failed DB : ip_tax_rates '. $cgst);
|
||||
$cgst_data['tax_rate_percent'] = $cgst;
|
||||
$getcgsttax = $Zohobook_model->customInsert($cgst_data,'ip_tax_rates');
|
||||
$cgsttaxid = $getcgsttax[0]['tax_rate_id'];
|
||||
$cgsttaxid = $getcgsttax;
|
||||
log_message('error', 'New Data Created : DB : ip_tax_rates , tax_rate_id : '.$cgsttaxid);
|
||||
}
|
||||
|
||||
@ -1497,7 +1496,7 @@ class User extends BaseController
|
||||
log_message('error', 'No data => Data fetch failed DB : ip_tax_rates '. $sgst);
|
||||
$sgst_data['tax_rate_percent'] = $sgst;
|
||||
$getsgsttax = $Zohobook_model->customInsert($sgst_data,'ip_tax_rates');
|
||||
$sgsttaxid = $getsgsttax[0]['tax_rate_id'];
|
||||
$sgsttaxid = $getsgsttax;
|
||||
log_message('error', 'New Data Created : DB : ip_tax_rates , tax_rate_id : '.$sgsttaxid);
|
||||
}
|
||||
|
||||
@ -1515,7 +1514,7 @@ class User extends BaseController
|
||||
|
||||
|
||||
$sku_sql = $Zohobook_model->ip_products($sku);
|
||||
if($sku_sql)
|
||||
if(!empty($sku_sql))
|
||||
{
|
||||
$product_id = $sku_sql[0]['product_id'];
|
||||
log_message('error', 'Data fetch success DB : ip_products , product_id : '.$product_id);
|
||||
@ -1526,8 +1525,10 @@ class User extends BaseController
|
||||
$sku_data['product_name'] = $item_name;
|
||||
$sku_data['product_description'] = $item_description;
|
||||
$sku_data['sku'] = $sku;
|
||||
$sku_sql = $Zohobook_model->customInsert($sku_data,'ip_products');
|
||||
$product_id = $sku_sql[0]['sku'];
|
||||
$sku_inserted_id = $Zohobook_model->customInsert($sku_data,'ip_products');
|
||||
$product_id = $sku_inserted_id;
|
||||
log_message('error', '$sku_sql => Data fetch failed DB : ip_products '. $sku_sql);
|
||||
|
||||
log_message('error', 'sku'.$sku);
|
||||
log_message('error', 'New Data Created : DB : product_id , product_id : '.$product_id);
|
||||
}
|
||||
@ -1620,7 +1621,7 @@ class User extends BaseController
|
||||
$Zohobook_model->customInsert($data,'zohobook_api_err');
|
||||
log_message('error', "Data insertion failed : " . $e->getMessage());
|
||||
|
||||
return json_encode($response);
|
||||
return json_encode("Data insertion failed : " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
// END zoho API
|
||||
|
||||
Loading…
Reference in New Issue
Block a user