827 query.bindValue(":prop3_volume", round(prod->prop_volume[2] * 1000) / 1000); |
827 query.bindValue(":prop3_volume", round(prod->prop_volume[2] * 1000) / 1000); |
828 query.bindValue(":prop4_type", prod->prop_type[3]); |
828 query.bindValue(":prop4_type", prod->prop_type[3]); |
829 query.bindValue(":prop4_volume", round(prod->prop_volume[3] * 1000) / 1000); |
829 query.bindValue(":prop4_volume", round(prod->prop_volume[3] * 1000) / 1000); |
830 query.bindValue(":divide_type", prod->divide_type); |
830 query.bindValue(":divide_type", prod->divide_type); |
831 query.bindValue(":divide_size", round(prod->divide_size * 10) / 10); |
831 query.bindValue(":divide_size", round(prod->divide_size * 10) / 10); |
832 query.bindValue(":divide_factor", round(prod->divide_factor * 100) / 100); |
832 query.bindValue(":divide_factor", round(prod->divide_factor * 10000) / 10000); |
833 query.bindValue(":divide_parts", prod->divide_parts); |
833 query.bindValue(":divide_parts", prod->divide_parts); |
834 query.bindValue(":divide_part", prod->divide_part); |
834 query.bindValue(":divide_part", prod->divide_part); |
835 |
835 |
836 if (prod->fermentables.size() == 0) { |
836 if (prod->fermentables.size() == 0) { |
837 query.bindValue(":json_fermentables", "[]"); |
837 query.bindValue(":json_fermentables", "[]"); |
875 QJsonArray array; |
875 QJsonArray array; |
876 for (int i = 0; i < prod->hops.size(); i++) { |
876 for (int i = 0; i < prod->hops.size(); i++) { |
877 QJsonObject obj; |
877 QJsonObject obj; |
878 obj.insert("h_name", prod->hops.at(i).h_name); |
878 obj.insert("h_name", prod->hops.at(i).h_name); |
879 obj.insert("h_origin", prod->hops.at(i).h_origin); |
879 obj.insert("h_origin", prod->hops.at(i).h_origin); |
880 obj.insert("h_amount", round(prod->hops.at(i).h_amount * 10000) / 10000); |
880 obj.insert("h_amount", round(prod->hops.at(i).h_amount * 100000) / 100000); |
881 obj.insert("h_cost", round(prod->hops.at(i).h_cost * 100) / 100); |
881 obj.insert("h_cost", round(prod->hops.at(i).h_cost * 100) / 100); |
882 obj.insert("h_type", prod->hops.at(i).h_type); |
882 obj.insert("h_type", prod->hops.at(i).h_type); |
883 obj.insert("h_form", prod->hops.at(i).h_form); |
883 obj.insert("h_form", prod->hops.at(i).h_form); |
884 obj.insert("h_useat", prod->hops.at(i).h_useat); |
884 obj.insert("h_useat", prod->hops.at(i).h_useat); |
885 obj.insert("h_time", round(prod->hops.at(i).h_time)); |
885 obj.insert("h_time", round(prod->hops.at(i).h_time)); |
904 } else { |
904 } else { |
905 QJsonArray array; |
905 QJsonArray array; |
906 for (int i = 0; i < prod->miscs.size(); i++) { |
906 for (int i = 0; i < prod->miscs.size(); i++) { |
907 QJsonObject obj; |
907 QJsonObject obj; |
908 obj.insert("m_name", prod->miscs.at(i).m_name); |
908 obj.insert("m_name", prod->miscs.at(i).m_name); |
909 obj.insert("m_amount", round(prod->miscs.at(i).m_amount * 10000) / 10000); |
909 obj.insert("m_amount", round(prod->miscs.at(i).m_amount * 100000) / 100000); |
910 obj.insert("m_type", prod->miscs.at(i).m_type); |
910 obj.insert("m_type", prod->miscs.at(i).m_type); |
911 obj.insert("m_use_use", prod->miscs.at(i).m_use_use); |
911 obj.insert("m_use_use", prod->miscs.at(i).m_use_use); |
912 obj.insert("m_time", round(prod->miscs.at(i).m_time)); |
912 obj.insert("m_time", round(prod->miscs.at(i).m_time)); |
913 obj.insert("m_amount_is_weight", prod->miscs.at(i).m_amount_is_weight ? 1:0); |
913 obj.insert("m_amount_is_weight", prod->miscs.at(i).m_amount_is_weight ? 1:0); |
914 obj.insert("m_cost", round(prod->miscs.at(i).m_cost * 10000) / 10000); |
914 obj.insert("m_cost", round(prod->miscs.at(i).m_cost * 10000) / 10000); |
927 for (int i = 0; i < prod->yeasts.size(); i++) { |
927 for (int i = 0; i < prod->yeasts.size(); i++) { |
928 QJsonObject obj; |
928 QJsonObject obj; |
929 obj.insert("y_name", prod->yeasts.at(i).y_name); |
929 obj.insert("y_name", prod->yeasts.at(i).y_name); |
930 obj.insert("y_laboratory", prod->yeasts.at(i).y_laboratory); |
930 obj.insert("y_laboratory", prod->yeasts.at(i).y_laboratory); |
931 obj.insert("y_product_id", prod->yeasts.at(i).y_product_id); |
931 obj.insert("y_product_id", prod->yeasts.at(i).y_product_id); |
932 obj.insert("y_amount", round(prod->yeasts.at(i).y_amount * 10000) / 10000); |
932 obj.insert("y_amount", round(prod->yeasts.at(i).y_amount * 100000) / 100000); |
933 obj.insert("y_type", prod->yeasts.at(i).y_type); |
933 obj.insert("y_type", prod->yeasts.at(i).y_type); |
934 obj.insert("y_form", prod->yeasts.at(i).y_form); |
934 obj.insert("y_form", prod->yeasts.at(i).y_form); |
935 obj.insert("y_min_temperature", round(prod->yeasts.at(i).y_min_temperature * 10) / 10); |
935 obj.insert("y_min_temperature", round(prod->yeasts.at(i).y_min_temperature * 10) / 10); |
936 obj.insert("y_max_temperature", round(prod->yeasts.at(i).y_max_temperature * 10) / 10); |
936 obj.insert("y_max_temperature", round(prod->yeasts.at(i).y_max_temperature * 10) / 10); |
937 obj.insert("y_flocculation", prod->yeasts.at(i).y_flocculation); |
937 obj.insert("y_flocculation", prod->yeasts.at(i).y_flocculation); |