// tx_ok set here in case of online; TODO: mark the retry case before calling this func void edi_tracking_bean_check_ticket_status(edi_tracking_bean_t self) { inv_company_t company_bean; credentials_t credentials; buffer_t text_4_template_xml; buffer_t text_inc_as_json_data_ptr; buffer_t text_out; const char *template_name_4_verbosity; Err error; bool flag; flag = true; credentials = (credentials_t)objects_search(self-> app_objects, (int)credentials_free); company_bean = credentials_get_company_bean(credentials); // export_company_data_for_edi_ticket_status text_inc_as_json_data_ptr = inv_company_short_info_for_getting_ticket_status_to_json(company_bean, edi_tracking_bean_get_ticket_number(self)); if (!text_inc_as_json_data_ptr || (buffer_len(text_inc_as_json_data_ptr) < 1)) { fprintf(stderr, "Err\n edi_tracking_bean_check_ticket_status issue on inv_company_short_info_for_getting_ticket_status_to_json %s\n", (const char*)buffer_ptr(text_inc_as_json_data_ptr)); inv_error_bean_set_data_helper(contrErrElectronicInvoicePoliIssue, "edi_tracking_bean_check_ticket_status issue on inv_company_short_info_for_getting_ticket_status_to_json", &error); flag = false; } //get_line_content_template template_name_4_verbosity = "electronic_invoice_get_ticket_status"; text_out = buffer_alloc (DEFAULT_ARRAY_SIZE); text_4_template_xml = buffer_alloc( DEFAULT_ARRAY_SIZE ); contr_print_get_printer_resource_template_from_database(credentials_get_conn(credentials), template_name_4_verbosity, text_4_template_xml, &error); if (buffer_len(text_4_template_xml) < 1) { fprintf(stderr, "Err\n edi_tracking_bean_check_ticket_status issue on contr_print_get_printer_template_from_database %s\n", template_name_4_verbosity); inv_error_bean_set_data_helper(contrSaleErrPrintingIssue, "printer template is not present", &error); flag = false; } if (flag) { flag = contr_print_merge((const char*)buffer_ptr(text_inc_as_json_data_ptr), (const char*)buffer_ptr(text_4_template_xml), template_name_4_verbosity, text_out, &error); if (flag) { edi_tracking_bean_set_post_data_for_ticket_status(self, (const char*)buffer_ptr(text_out)); flag = _edi_tracking_bean_check_ticket_status_helper(self, credentials, &error); // send if (flag) { // if_ok, {printf log.info} {inspect and analyze xml_result -> } {0127|0|98|99} edi_tracking_bean_set_was_transaction_ok(self); } } } buffer_free(text_4_template_xml); buffer_free(text_out); }