1 -- @tag: payment_terms_for_invoices
2 -- @description: Unterscheidung in Zahlungsbedingungen für Angebote/Aufträge und Rechnungen
3 -- @depends: release_3_4_0
4 ALTER TABLE payment_terms ADD COLUMN description_long_invoice TEXT;
5 UPDATE payment_terms SET description_long_invoice = description_long;
7 INSERT INTO generic_translations (translation_type, language_id, translation_id, translation)
8 SELECT translation_type || '_invoice', language_id, translation_id, translation
9 FROM generic_translations
10 WHERE translation_type = 'SL::DB::PaymentTerm/description_long';
12 CREATE OR REPLACE FUNCTION generic_translations_delete_on_payment_terms_delete_trigger()
15 DELETE FROM generic_translations
16 WHERE (translation_id = OLD.id)
17 AND (translation_type IN ('SL::DB::PaymentTerm/description_long', 'SL::DB::PaymentTerm/description_long_invoice'));