string ConvertHugeNumeral (vector<CRusSemWord>::const_iterator Start, vector<CRusSemWord>::const_iterator End, QWORD Order) { string OrderStr = FindByNumber(Order); string Result; if (Order == 1) { Result = IntToStr(ConvertNumeralByTable (Start, End)); if( Result == "-1") Result = ""; //"$200 тыс." } else { vector<CRusSemWord>::const_iterator Word = Start; for (; Word < End;Word++) if (Word->m_Lemma == OrderStr) break; if (Word < End) if (Word == Start) Result = IntToStr(Order+atoi(ConvertHugeNumeral (Word+1, End, Order/1000).c_str() )); else Result = IntToStr(Order*ConvertNumeralByTable (Start,Word)+atof(ConvertHugeNumeral (Word+1, End, Order/1000).c_str())); else Result = ConvertHugeNumeral (Start, End, Order/1000); } return Result; };
static bool TestWarehouseReceiptsIntegrity() { const auto whr_list = db::warehouse_receipt::GetList(); return std::all_of(begin(whr_list), end(whr_list), [&whr_list] (ref<CWarehouseReceipt> const& whr) { const auto found_mbr = whr_list->FindByNumber(whr->GetNumber()); if (found_mbr.is_nil() || found_mbr->obj != whr) { text_out("warehouse receipt not found in list by number"); return false; } return TestWarehouseReceiptIntegrity(whr); }); }