<?php

namespace WPDesk\FakturyKSEF\Helpers;

class Invoice {

	public static function string_as_money_no_currency( float $value, string $thousand_separator = '', string $decimal_separator = '.', bool $is_correction = false ): string {
		$decimals = 2;
		$prefix   = '';
		if ( $is_correction ) {
			$value  = (float) str_replace( '-', '', (string) $value );
			$prefix = '-';
		}

		$value  = round( $value, $decimals );
		$result = $prefix . number_format( $value, $decimals, $decimal_separator, $thousand_separator );

		return \apply_filters( 'fir/core/export/string_as_money', $result, $value );
	}


	public function vat_rates(): array {
		return [
			'23' => '23',
			'8'  => '8',
			'7'  => '7',
			'5'  => '5',
			'4'  => '4',
			'3'  => '3',
			'0'  => '0',
			'zw' => '0',
			'oo' => '0',
			'np' => '0',
		];
	}
}
