$params = array_merge($defaults, $params);
- if (strlen($params['title']) > 13) {
- $params['title'] = substr($params['title'], 0, 13);
- }
-
//have a crack @ deleting it first in the hope this will prevent derailing our tests
$this->callAPISuccess('custom_group', 'get', array(
'title' => $params['title'],
$var = TRUE;
CRM_Member_BAO_Membership::createRelatedMemberships($var, $var, TRUE);
$this->disableTaxAndInvoicing();
+ $this->setCurrencySeparators(',');
+ CRM_Core_PseudoConstant::flush('taxRates');
System::singleton()->flushProcessors();
}
return $form;
}
+ /**
+ * Get possible thousand separators.
+ *
+ * @return array
+ */
+ public function getThousandSeparators() {
+ return array(array('.'), array(','));
+ }
+
+ /**
+ * Set the separators for thousands and decimal points.
+ *
+ * @param string $thousandSeparator
+ */
+ protected function setCurrencySeparators($thousandSeparator) {
+ Civi::settings()->set('monetaryThousandSeparator', $thousandSeparator);
+ Civi::settings()
+ ->set('monetaryDecimalPoint', ($thousandSeparator === ',' ? '.' : ','));
+ }
+
+ /**
+ * Format money as it would be input.
+ *
+ * @param string $amount
+ *
+ * @return string
+ */
+ protected function formatMoneyInput($amount) {
+ return CRM_Utils_Money::format($amount, NULL, '%a');
+ }
+
}