Fix/user feedback (#210)
* Add delete policies for provider consent tokens and provider OTC * Add trade name support for companies in settings and documents * Resolved currency selection issue * Enhance invoice line display with foreign currency support and update delivery date schema to allow empty values * Add currency display for journal entries and include currency metadata in transaction creation * Add trade_name column to company_settings for external display
This commit is contained in:
@@ -73,6 +73,13 @@ CREATE POLICY provider_consent_tokens_update ON provider_consent_tokens
|
||||
)
|
||||
));
|
||||
|
||||
CREATE POLICY provider_consent_tokens_delete ON provider_consent_tokens
|
||||
FOR DELETE USING (consent_id IN (
|
||||
SELECT id FROM provider_consents WHERE company_id IN (
|
||||
SELECT company_id FROM team_members WHERE user_id = auth.uid()
|
||||
)
|
||||
));
|
||||
|
||||
CREATE TRIGGER update_provider_consent_tokens_updated_at
|
||||
BEFORE UPDATE ON provider_consent_tokens
|
||||
FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();
|
||||
@@ -109,3 +116,10 @@ CREATE POLICY provider_otc_update ON provider_otc
|
||||
SELECT company_id FROM team_members WHERE user_id = auth.uid()
|
||||
)
|
||||
));
|
||||
|
||||
CREATE POLICY provider_otc_delete ON provider_otc
|
||||
FOR DELETE USING (consent_id IN (
|
||||
SELECT id FROM provider_consents WHERE company_id IN (
|
||||
SELECT company_id FROM team_members WHERE user_id = auth.uid()
|
||||
)
|
||||
));
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Add trade_name column to company_settings
|
||||
-- Allows companies to display a trade name (handelsnamn) on invoices
|
||||
-- and other external-facing documents instead of the legal company name.
|
||||
ALTER TABLE public.company_settings
|
||||
ADD COLUMN trade_name text;
|
||||
Reference in New Issue
Block a user