-- Import contract clauses/templates generated from contract_clause_reference.xml
-- Idempotent PostgreSQL script for Tryton purchase_trade.
-- Run on the target database after the contract.* tables exist.
BEGIN;

CREATE OR REPLACE FUNCTION _pt_upsert_model_data(
    _fs_id text, _model text, _db_id integer)
RETURNS void AS $$
BEGIN
    INSERT INTO ir_model_data (
        create_uid, create_date, fs_id, model, module, db_id,
        noupdate)
    VALUES (0, now(), _fs_id, _model, 'purchase_trade', _db_id,
        FALSE)
    ON CONFLICT (fs_id, module, model) DO UPDATE
        SET db_id = EXCLUDED.db_id, write_uid = 0,
            write_date = now();
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION _pt_model_data_id(
    _fs_id text, _model text)
RETURNS integer AS $$
DECLARE _id integer;
BEGIN
    SELECT db_id INTO _id
    FROM ir_model_data
    WHERE module = 'purchase_trade'
        AND fs_id = _fs_id
        AND model = _model;
    IF _id IS NULL THEN
        RAISE EXCEPTION 'Missing purchase_trade.% for model %',
            _fs_id, _model;
    END IF;
    RETURN _id;
END;
$$ LANGUAGE plpgsql;

DO $$
DECLARE _id integer;
BEGIN
    -- clause_letter_of_credit
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_letter_of_credit' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Letter of Credit' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Letter of Credit', 'payment', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Letter of Credit Type:
By irrevocable Letter of Credit, issued for 100% of the Total Value of the Products, by the Buyer''s bank acceptable for the Seller''s bank and the Seller, and payable at the counters of the Seller''s bank at sight.
or
By irrevocable Letter of Credit, issued for 100% of the Total Value of the Products, by the Buyer''s bank acceptable for the Seller''s bank and the Seller, and payable at the counters of the Seller''s bank by deferred payment at [deferral] days after the shipment date.
or
By irrevocable Letter of Credit, issued for 100% of the Total Value of the Products, by the Buyer''s bank acceptable for the Seller''s bank and the Seller, and payable at the counters of the Seller''s bank at sight by usance Letter of Credit with [deferral] days deferred after the shipment date.
Letter of Credit Issuance:
The Letter of Credit shall be issued by the Buyer''s bank not later than [x].
The Letter of Credit must be issued according to the terms and conditions of this Sales Agreement. Any term and/or condition not stipulated in this Sales Agreement cannot be included in the Letter of Credit.
Letter of Credit to be subject to Uniform Customs and Practice for Documentary Credits, 2007 revision, ICC publication no. 600.
The Buyer shall nominate an issuing bank and advise the issuing bank''s name to the Seller not later than 5 (five) working days prior to the [x].
The Buyer shall submit the draft of the Letter of Credit, fulfilled according to the Letter of Credit template annexed to this Sales Agreement within 2 (two) working days after conclusion of the latter. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
or
The Buyer shall submit the draft of the Letter of Credit within 2 (two) working days after conclusion of this Sales Agreement. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
Should the Letter of Credit be issued before the Seller''s approval of the draft and/or without considering the remark(s) made by the Seller, any cost(s) resulting from amendment(s) required by the Seller shall be for Buyer''s account.
Letter of Credit Advising:
Once the issuing bank is advised by the Buyer to the Seller, the latter shall revert with the name of the advising bank to the Buyer by latest 3 (three) working days before [x].
The advising bank must be authorized to reimburse itself by authenticated message upon presentation at its counters of documents in conformity with the Letter of Credit terms and conditions.
Terms of the Letter of Credit:
Latest date of [x]: [x]
Validity date of the Letter of Credit: [x];
Transhipment in accordance with the Transport Conditions clause of this Sales Agreement;
partial shipment in accordance with the Transport Conditions clause of this Sales Agreement;
The Seller''s bank must be authorized to add its confirmation. Confirmation instructions must state "MAY ADD" or "CONFIRM". The related charges for Seller''s account;
The Letter of Credit shall be available by negotiation/payment at the counters of the advising bank nominated by the Seller;
Spelling and/or typing errors not affecting figures are not considered as discrepancies;
Documents, as defined under point [x] "Documents required" below, to be presented within 21 (twenty-one) days after B/L date;
All commissions and charges of the Buyer''s bank for the Buyer''s account. All commissions and charges of the Seller''s bank for the Seller''s account.
Terms to be under the additional conditions of the Letter of Credit:
Charter party Bill(s) of Lading acceptable;
Bill(s) of Lading with clauses such as "stored at open area", "partly rust stained", "wet before shipment", "quality and weight as per shippers declaration", "some coils partly windings pulled out and dent", "some strapping bands loose, broken, missing", "surface partly stained with black powder, grease spots and/or oil patches" or words of similar meaning are allowed;
All documents must be issued in English. In case documents issued in Russian language, such document must be translated in English. In case of conflict between English and Russian, English must prevail;
Stamps and/or seals in any language are acceptable.
Third party documents acceptable except for the commercial invoice and packing list.
Letter of Credit is payable at sight for the beneficiary, any interest, deferred payment or confirmation charges after sight payment to the beneficiary are for the applicant''s account.
Documents required:
signed Commercial Invoice in 1 original and 2 copies stating that the Products are of Russian origin;
2/3 charter party Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the issuing bank, notify [notify];
or
full set originals Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the issuing bank, notify [notify];
or
full set originals Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the applicant, notify [notify];
or
full set originals Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the final user, notify [notify];
or
Forwarder''s Certificate of Receipt (FCR) issued by forwarding agent at loading port, to the order of [to_order] showing that the Products are held at the irrevocable disposal of the Buyer after payment of 100% of the Total Value of the Products;
or
Forwarder''s Certificate of Receipt (FCR) issued by forwarding agent at loading port, to the order of [to_order] showing that the Products are held at the irrevocable disposal of the issuing bank after payment of 100% of the Total Value of the Products;
signed and stamped packing list showing gross and net weight and number of [x] in 3 (three) fold;
insurance certificate in negotiable form in 1 original and 2 copies covering the Products as per [x] for the Total Value of the Products plus 10%, indicating the name and telephone/fax number of a claim agent in the country of destination;
Acceptable documents to add to default list above
Beneficiary''s certificate certifying that the original certificate of origin signed and stamped by the Chamber of Commerce has been sent directly to the applicant by courier within 7 (seven) working days after B/L date;
Copy of beneficiary''s fax sent to applicant and/or his insurance company by fax no [fax] advising full shipping details, i.e. LC number, B/L number and date, name of vessel, ETD, ETA within 3 (three) working days after B/L date;
Copy or photocopy of Railway Bill(s), accepted as presented;
Copy or photocopy of Consignment Note mentioning applicant as receiver, accepted as presented.
Copy or photocopy of CMR (Truckway Bill), accepted as presented;
Beneficiary''s certificate certifying that the Consignment Note is travelling in Master''s bag
Beneficiary''s certificate certifying that the following documents have been sent to applicant by courier service outside L/C within 7 (seven) working days after B/L date:
full set of original Mill Test Certificates issued by the manufacturer;
one full set of non-negotiable documents;
original Certificate of Origin signed and stamped by Chamber of Commerce
Certificate from master or a named agent for or on behalf of the master stating that the goods are shipped on vessel, that is:
Allowed to call at any Arab ports in accordance with the rules and regulations of the Arab authorities;
Shipment is effected by chartered vessel of not more than [x] years of age
Shipment advice quoting the L/C reference number and referring to their policy number [policy_nb] to be sent by email or fax to [recipient] fax number [fax_nb] within 7 (seven) working days after shipment;
Beneficiary''s certificate certifying that a copy of invoice, packing list and Bill(s) of Lading have been sent to applicant by email or fax on their fax number [fax_nb] within 7 (seven) working days after shipment;
Certificate from master or their agent stating that vessel should be classed and its age must not be more than [x] years old;
Beneficiary''s certificate certifying that 1/3 B/L is in master''s bag;
Beneficiary''s certificate certifying that 1/3 B/L was sent directly to the applicant by courier service;
Certificate of Origin issued by the Beneficiary;
Beneficiary''s compliance certificate certifying that the goods comply with the letter of credit requirements and conforming to quality and quantity mentioned therein.
Certificate from owner, master, carrier, shipping company or their agent stating that the Products are shipped by a seaworthy vessel covered by Institute Classification Clause and not older than [x] years old and that the vessel has a valid International Safety Management Certificate.
Non-Radiation Certificate
Fumigation Certificate
Phytosanitary Certificate')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Letter of Credit', category = 'payment', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Letter of Credit Type:
By irrevocable Letter of Credit, issued for 100% of the Total Value of the Products, by the Buyer''s bank acceptable for the Seller''s bank and the Seller, and payable at the counters of the Seller''s bank at sight.
or
By irrevocable Letter of Credit, issued for 100% of the Total Value of the Products, by the Buyer''s bank acceptable for the Seller''s bank and the Seller, and payable at the counters of the Seller''s bank by deferred payment at [deferral] days after the shipment date.
or
By irrevocable Letter of Credit, issued for 100% of the Total Value of the Products, by the Buyer''s bank acceptable for the Seller''s bank and the Seller, and payable at the counters of the Seller''s bank at sight by usance Letter of Credit with [deferral] days deferred after the shipment date.
Letter of Credit Issuance:
The Letter of Credit shall be issued by the Buyer''s bank not later than [x].
The Letter of Credit must be issued according to the terms and conditions of this Sales Agreement. Any term and/or condition not stipulated in this Sales Agreement cannot be included in the Letter of Credit.
Letter of Credit to be subject to Uniform Customs and Practice for Documentary Credits, 2007 revision, ICC publication no. 600.
The Buyer shall nominate an issuing bank and advise the issuing bank''s name to the Seller not later than 5 (five) working days prior to the [x].
The Buyer shall submit the draft of the Letter of Credit, fulfilled according to the Letter of Credit template annexed to this Sales Agreement within 2 (two) working days after conclusion of the latter. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
or
The Buyer shall submit the draft of the Letter of Credit within 2 (two) working days after conclusion of this Sales Agreement. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
Should the Letter of Credit be issued before the Seller''s approval of the draft and/or without considering the remark(s) made by the Seller, any cost(s) resulting from amendment(s) required by the Seller shall be for Buyer''s account.
Letter of Credit Advising:
Once the issuing bank is advised by the Buyer to the Seller, the latter shall revert with the name of the advising bank to the Buyer by latest 3 (three) working days before [x].
The advising bank must be authorized to reimburse itself by authenticated message upon presentation at its counters of documents in conformity with the Letter of Credit terms and conditions.
Terms of the Letter of Credit:
Latest date of [x]: [x]
Validity date of the Letter of Credit: [x];
Transhipment in accordance with the Transport Conditions clause of this Sales Agreement;
partial shipment in accordance with the Transport Conditions clause of this Sales Agreement;
The Seller''s bank must be authorized to add its confirmation. Confirmation instructions must state "MAY ADD" or "CONFIRM". The related charges for Seller''s account;
The Letter of Credit shall be available by negotiation/payment at the counters of the advising bank nominated by the Seller;
Spelling and/or typing errors not affecting figures are not considered as discrepancies;
Documents, as defined under point [x] "Documents required" below, to be presented within 21 (twenty-one) days after B/L date;
All commissions and charges of the Buyer''s bank for the Buyer''s account. All commissions and charges of the Seller''s bank for the Seller''s account.
Terms to be under the additional conditions of the Letter of Credit:
Charter party Bill(s) of Lading acceptable;
Bill(s) of Lading with clauses such as "stored at open area", "partly rust stained", "wet before shipment", "quality and weight as per shippers declaration", "some coils partly windings pulled out and dent", "some strapping bands loose, broken, missing", "surface partly stained with black powder, grease spots and/or oil patches" or words of similar meaning are allowed;
All documents must be issued in English. In case documents issued in Russian language, such document must be translated in English. In case of conflict between English and Russian, English must prevail;
Stamps and/or seals in any language are acceptable.
Third party documents acceptable except for the commercial invoice and packing list.
Letter of Credit is payable at sight for the beneficiary, any interest, deferred payment or confirmation charges after sight payment to the beneficiary are for the applicant''s account.
Documents required:
signed Commercial Invoice in 1 original and 2 copies stating that the Products are of Russian origin;
2/3 charter party Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the issuing bank, notify [notify];
or
full set originals Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the issuing bank, notify [notify];
or
full set originals Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the applicant, notify [notify];
or
full set originals Bill(s) of Lading marked "Freight Payable as per C/P", consigned to the order of the final user, notify [notify];
or
Forwarder''s Certificate of Receipt (FCR) issued by forwarding agent at loading port, to the order of [to_order] showing that the Products are held at the irrevocable disposal of the Buyer after payment of 100% of the Total Value of the Products;
or
Forwarder''s Certificate of Receipt (FCR) issued by forwarding agent at loading port, to the order of [to_order] showing that the Products are held at the irrevocable disposal of the issuing bank after payment of 100% of the Total Value of the Products;
signed and stamped packing list showing gross and net weight and number of [x] in 3 (three) fold;
insurance certificate in negotiable form in 1 original and 2 copies covering the Products as per [x] for the Total Value of the Products plus 10%, indicating the name and telephone/fax number of a claim agent in the country of destination;
Acceptable documents to add to default list above
Beneficiary''s certificate certifying that the original certificate of origin signed and stamped by the Chamber of Commerce has been sent directly to the applicant by courier within 7 (seven) working days after B/L date;
Copy of beneficiary''s fax sent to applicant and/or his insurance company by fax no [fax] advising full shipping details, i.e. LC number, B/L number and date, name of vessel, ETD, ETA within 3 (three) working days after B/L date;
Copy or photocopy of Railway Bill(s), accepted as presented;
Copy or photocopy of Consignment Note mentioning applicant as receiver, accepted as presented.
Copy or photocopy of CMR (Truckway Bill), accepted as presented;
Beneficiary''s certificate certifying that the Consignment Note is travelling in Master''s bag
Beneficiary''s certificate certifying that the following documents have been sent to applicant by courier service outside L/C within 7 (seven) working days after B/L date:
full set of original Mill Test Certificates issued by the manufacturer;
one full set of non-negotiable documents;
original Certificate of Origin signed and stamped by Chamber of Commerce
Certificate from master or a named agent for or on behalf of the master stating that the goods are shipped on vessel, that is:
Allowed to call at any Arab ports in accordance with the rules and regulations of the Arab authorities;
Shipment is effected by chartered vessel of not more than [x] years of age
Shipment advice quoting the L/C reference number and referring to their policy number [policy_nb] to be sent by email or fax to [recipient] fax number [fax_nb] within 7 (seven) working days after shipment;
Beneficiary''s certificate certifying that a copy of invoice, packing list and Bill(s) of Lading have been sent to applicant by email or fax on their fax number [fax_nb] within 7 (seven) working days after shipment;
Certificate from master or their agent stating that vessel should be classed and its age must not be more than [x] years old;
Beneficiary''s certificate certifying that 1/3 B/L is in master''s bag;
Beneficiary''s certificate certifying that 1/3 B/L was sent directly to the applicant by courier service;
Certificate of Origin issued by the Beneficiary;
Beneficiary''s compliance certificate certifying that the goods comply with the letter of credit requirements and conforming to quality and quantity mentioned therein.
Certificate from owner, master, carrier, shipping company or their agent stating that the Products are shipped by a seaworthy vessel covered by Institute Classification Clause and not older than [x] years old and that the vessel has a valid International Safety Management Certificate.
Non-Radiation Certificate
Fumigation Certificate
Phytosanitary Certificate', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_letter_of_credit', 'contract.clause', _id);

    -- clause_first_demand_payment_guarantee
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_first_demand_payment_guarantee' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'First Demand Payment Guarantee' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'First Demand Payment Guarantee', 'payment', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall forward the full set of document defined herein to the Buyer by registered courier service within 5 (five) working days after shipment of the Products:
Commercial Invoice in one original;
Original of the Bill(s) of Lading;
2/3 charter party Bill(s) of Lading;
Mill''s Test Certificate in one original;
Certificate of Origin issued by the Russian Chamber of Commerce in one original;
Signed and stamped packing list in 3 (three) fold;
Insurance Certificate in negotiable form in accordance with this Sales Agreement
The Buyer shall proceed with the payment of the Total Amount of the Commercial Invoice to the Seller at its Bank''s account, within [deferral] days after the Commercial Invoice date.
As a security for the payment, a First Demand Payment Guarantee (FDPG), covering 110% of the Total Value of the Products of the present Sales Agreement, shall be issued by a Bank acceptable for the Seller not later than [x] and valid until [x].
The Buyer shall submit the draft of the FDPG and Buyer''s bank name, in accordance with the template annexed to this Sales Agreement within 2 (two) working days after conclusion of the latter. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
or
The Buyer shall submit the draft of the FDPG and Buyer''s bank name within 2 (two) working days after conclusion of the latter. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
Once the issuing bank is advised by the Buyer to the Seller, the latter shall revert with the name of the advising bank to the Buyer by latest 3 (three) working days.
Documents required under the FDPG:
copy of the unpaid Commercial Invoice;
copy of the transport documents (which will be a Railway Bill in case of land transportation or a Bill of Lading for maritime transportation unless otherwise agreed);
beneficiary''s certificate confirming that shipment has been effected in accordance with Sales Agreement number [Contract_Number] and that the payment has not been received at the due date.
Additional conditions of the FDPG
All commissions and charges outside the issuing bank''s country are for Seller''s account.
Partial drawings allowed;
FDPG to be subject to URDG no. 758;
FDPG must be submitted to Swiss or English law and regulations.
The FDPG must be issued according to the terms and conditions of this Sales Agreement. Any term and/or condition not stipulated in this Sales Agreement cannot be included in the FDPG.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'First Demand Payment Guarantee', category = 'payment', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall forward the full set of document defined herein to the Buyer by registered courier service within 5 (five) working days after shipment of the Products:
Commercial Invoice in one original;
Original of the Bill(s) of Lading;
2/3 charter party Bill(s) of Lading;
Mill''s Test Certificate in one original;
Certificate of Origin issued by the Russian Chamber of Commerce in one original;
Signed and stamped packing list in 3 (three) fold;
Insurance Certificate in negotiable form in accordance with this Sales Agreement
The Buyer shall proceed with the payment of the Total Amount of the Commercial Invoice to the Seller at its Bank''s account, within [deferral] days after the Commercial Invoice date.
As a security for the payment, a First Demand Payment Guarantee (FDPG), covering 110% of the Total Value of the Products of the present Sales Agreement, shall be issued by a Bank acceptable for the Seller not later than [x] and valid until [x].
The Buyer shall submit the draft of the FDPG and Buyer''s bank name, in accordance with the template annexed to this Sales Agreement within 2 (two) working days after conclusion of the latter. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
or
The Buyer shall submit the draft of the FDPG and Buyer''s bank name within 2 (two) working days after conclusion of the latter. The Seller shall approve the draft or revert with the eventual remarks within 2 (two) working days from the date of receipt of the said draft from the Buyer.
Once the issuing bank is advised by the Buyer to the Seller, the latter shall revert with the name of the advising bank to the Buyer by latest 3 (three) working days.
Documents required under the FDPG:
copy of the unpaid Commercial Invoice;
copy of the transport documents (which will be a Railway Bill in case of land transportation or a Bill of Lading for maritime transportation unless otherwise agreed);
beneficiary''s certificate confirming that shipment has been effected in accordance with Sales Agreement number [Contract_Number] and that the payment has not been received at the due date.
Additional conditions of the FDPG
All commissions and charges outside the issuing bank''s country are for Seller''s account.
Partial drawings allowed;
FDPG to be subject to URDG no. 758;
FDPG must be submitted to Swiss or English law and regulations.
The FDPG must be issued according to the terms and conditions of this Sales Agreement. Any term and/or condition not stipulated in this Sales Agreement cannot be included in the FDPG.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_first_demand_payment_guarantee', 'contract.clause', _id);

    -- clause_cash_against_documents
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cash_against_documents' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Cash against documents' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Cash against documents', 'payment', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller''s bank shall forward the full set of documents defined herein under Documentary Collection (in accordance with URC 522) to Buyer''s bank:
Signed Commercial Invoice in 1 (one) original and 2 (two) copies showing the Total Value of the Products;
Full set of Charter Party Bill(s) of Lading issued to the order of Buyer''s bank and notify the Buyer, marked Freight payable as per Charter Party;
Packing List in 1 (one) original and 2 (two) copies;
Insurance Certificate in negotiable form in accordance with this Sales Agreement;
The Buyer''s bank shall effect payment according to the instructions received by the Seller''s bank, not later than 3 (three) bank working days after receipt of the Documentary Collection at their counters. Partial payments are not allowed.
The Buyer''s bank is authorized to release original of documents to the Buyer only after receipt of confirmation by Seller''s bank that the Total Amount of the Commercial Invoice has been credited to the account of the Seller.
Additional Conditions:
Charter Party Bill(s) of Lading acceptable;
Bill of Lading with clauses such as "atmospheric rust", "stowed at open area before shipment", "surface wet before shipment", "cargo partly rusty before shipment", "surface partly stained with black powder, grease spots and/or oil patches" or words with similar meaning is allowed.
All banking commissions and/or charges at the Buyer''s bank for Buyer''s account, at Seller''s bank for Seller''s account;
All documents must be issued in English. In case documents issued in Russian and/or Russian language, such document must be translated in English. In case of conflict between English and Russian, English must prevail;
Stamps and/or seals in any language are acceptable.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Cash against documents', category = 'payment', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller''s bank shall forward the full set of documents defined herein under Documentary Collection (in accordance with URC 522) to Buyer''s bank:
Signed Commercial Invoice in 1 (one) original and 2 (two) copies showing the Total Value of the Products;
Full set of Charter Party Bill(s) of Lading issued to the order of Buyer''s bank and notify the Buyer, marked Freight payable as per Charter Party;
Packing List in 1 (one) original and 2 (two) copies;
Insurance Certificate in negotiable form in accordance with this Sales Agreement;
The Buyer''s bank shall effect payment according to the instructions received by the Seller''s bank, not later than 3 (three) bank working days after receipt of the Documentary Collection at their counters. Partial payments are not allowed.
The Buyer''s bank is authorized to release original of documents to the Buyer only after receipt of confirmation by Seller''s bank that the Total Amount of the Commercial Invoice has been credited to the account of the Seller.
Additional Conditions:
Charter Party Bill(s) of Lading acceptable;
Bill of Lading with clauses such as "atmospheric rust", "stowed at open area before shipment", "surface wet before shipment", "cargo partly rusty before shipment", "surface partly stained with black powder, grease spots and/or oil patches" or words with similar meaning is allowed.
All banking commissions and/or charges at the Buyer''s bank for Buyer''s account, at Seller''s bank for Seller''s account;
All documents must be issued in English. In case documents issued in Russian and/or Russian language, such document must be translated in English. In case of conflict between English and Russian, English must prevail;
Stamps and/or seals in any language are acceptable.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cash_against_documents', 'contract.clause', _id);

    -- clause_100_prepayment
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_100_prepayment' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = '100% Prepayment' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), '100% Prepayment', 'payment', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Buyer shall transfer 100% of the Total Value of the Products of this Sales Agreement within [deferral] working days upon receipt from the Seller of the copies (fax/email acceptable) of the Proforma Invoice mentioning Seller''s bank details, Products'' description and quantity issued by the Seller.
or
The Buyer shall transfer 100% of the Total Value of the Products of this Sales Agreement before/on [PP_due_date] against Proforma Invoice issued by the Seller.
Following original documents will be sent directly to Buyer''s office address within [deferral] working days after the date of the relevant shipping document(s), but only after 100% of the payment is received:
1 (one) original and 2 (two) copies of Commercial Invoice(s);
Signed and stamped packing list in 3 (three) folds showing number of pieces and actual weight as per Bill(s) of Lading;
Full set of Mill''s Test Certificate(s);
Certificate of Origin, signed and stamped by Chamber of Commerce;
Full set of Bill(s) of Lading.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = '100% Prepayment', category = 'payment', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Buyer shall transfer 100% of the Total Value of the Products of this Sales Agreement within [deferral] working days upon receipt from the Seller of the copies (fax/email acceptable) of the Proforma Invoice mentioning Seller''s bank details, Products'' description and quantity issued by the Seller.
or
The Buyer shall transfer 100% of the Total Value of the Products of this Sales Agreement before/on [PP_due_date] against Proforma Invoice issued by the Seller.
Following original documents will be sent directly to Buyer''s office address within [deferral] working days after the date of the relevant shipping document(s), but only after 100% of the payment is received:
1 (one) original and 2 (two) copies of Commercial Invoice(s);
Signed and stamped packing list in 3 (three) folds showing number of pieces and actual weight as per Bill(s) of Lading;
Full set of Mill''s Test Certificate(s);
Certificate of Origin, signed and stamped by Chamber of Commerce;
Full set of Bill(s) of Lading.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_100_prepayment', 'contract.clause', _id);

    -- clause_100_prepayment_in_two_parts_pp_fcr_nor
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_100_prepayment_in_two_parts_pp_fcr_nor' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = '100% Prepayment (in two parts: "PP + FCR/NOR")' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), '100% Prepayment (in two parts: "PP + FCR/NOR")', 'payment', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Buyer shall transfer [PP1_Percentage]% of the Total Value of the Products of this Sales Agreement before/on [PP_due_date] against Proforma Invoice issued by the Seller.
It is understood and agreed that the Seller has the irrevocable right to keep the above mentioned advance payment (as a penalty for non-fulfillment) in case the Buyer does not proceed with the payment of the remaining balance of this Sales Agreement within the terms, modalities and conditions set forth below.
Balance payment of [PP2_Percentage]% of the Total Value of the Products of this Sales Agreement shall be effected within [PP2_deferral] working days upon receipt from the Seller of the copies of the documents (fax/email acceptable) below:
Proforma Invoice mentioning Seller''s bank details, Products'' description and quantity;
FCR issued at the loading port by the forwarder for 100% of the quantity of the Products and showing as consignee the Buyer or the Buyer''s bank marked "Title and ownership passes to the Buyer only upon receipt by the Seller of the full payment of 100% of the Products".
or
Notice of Cargo Readiness (NOR) for 100% of the quantity.
Following original documents will be sent directly to Buyer''s office address within [deferral] working days after the loading of the vessel is finished, but only after 100% of the payment is received:
1 (one) original and 2 (two) copies of Commercial Invoice(s);
Signed and stamped packing list in 3 (three) folds showing number of pieces and actual weight as per Bill(s) of Lading;
Full set of Mill''s Test Certificate(s);
Certificate of Origin, signed and stamped by Chamber of Commerce;
Full set of Bill(s) of Lading.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = '100% Prepayment (in two parts: "PP + FCR/NOR")', category = 'payment', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Buyer shall transfer [PP1_Percentage]% of the Total Value of the Products of this Sales Agreement before/on [PP_due_date] against Proforma Invoice issued by the Seller.
It is understood and agreed that the Seller has the irrevocable right to keep the above mentioned advance payment (as a penalty for non-fulfillment) in case the Buyer does not proceed with the payment of the remaining balance of this Sales Agreement within the terms, modalities and conditions set forth below.
Balance payment of [PP2_Percentage]% of the Total Value of the Products of this Sales Agreement shall be effected within [PP2_deferral] working days upon receipt from the Seller of the copies of the documents (fax/email acceptable) below:
Proforma Invoice mentioning Seller''s bank details, Products'' description and quantity;
FCR issued at the loading port by the forwarder for 100% of the quantity of the Products and showing as consignee the Buyer or the Buyer''s bank marked "Title and ownership passes to the Buyer only upon receipt by the Seller of the full payment of 100% of the Products".
or
Notice of Cargo Readiness (NOR) for 100% of the quantity.
Following original documents will be sent directly to Buyer''s office address within [deferral] working days after the loading of the vessel is finished, but only after 100% of the payment is received:
1 (one) original and 2 (two) copies of Commercial Invoice(s);
Signed and stamped packing list in 3 (three) folds showing number of pieces and actual weight as per Bill(s) of Lading;
Full set of Mill''s Test Certificate(s);
Certificate of Origin, signed and stamped by Chamber of Commerce;
Full set of Bill(s) of Lading.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_100_prepayment_in_two_parts_pp_fcr_nor', 'contract.clause', _id);

    -- clause_open_terms_without_security_or_covered_by_credit_insurance
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_open_terms_without_security_or_covered_by_credit_insurance' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Open Terms (without security or covered by Credit Insurance)' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Open Terms (without security or covered by Credit Insurance)', 'payment', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Buyer shall proceed to the payment of 100% of the Total Amount of the Commercial Invoice, via bank transfer to the Seller''s bank account, within a period of maximum [deferral] days after the Commercial Invoice date.
The Seller shall forward the full set of documents defined herein to the Buyer by recommended courier service:
1 (one) original and 2 (two) copies of Commercial Invoice(s);
Signed and stamped packing list in 3 (three) folds showing number of pieces and actual weight as per Bill(s) of Lading;
Full set of Mill''s Test Certificate(s);
Certificate of Origin, signed and stamped by Chamber of Commerce;
Full set of Bill(s) of Lading.
Additional Conditions:
Charter Party Bill(s) of Lading acceptable;
Bill of Lading with clauses such as "atmospheric rust", "stowed at open area before shipment", "surface wet before shipment", "cargo partly rusty before shipment", "surface partly stained with black powder, grease spots and/or oil patches" or words with similar meaning is allowed.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Open Terms (without security or covered by Credit Insurance)', category = 'payment', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Buyer shall proceed to the payment of 100% of the Total Amount of the Commercial Invoice, via bank transfer to the Seller''s bank account, within a period of maximum [deferral] days after the Commercial Invoice date.
The Seller shall forward the full set of documents defined herein to the Buyer by recommended courier service:
1 (one) original and 2 (two) copies of Commercial Invoice(s);
Signed and stamped packing list in 3 (three) folds showing number of pieces and actual weight as per Bill(s) of Lading;
Full set of Mill''s Test Certificate(s);
Certificate of Origin, signed and stamped by Chamber of Commerce;
Full set of Bill(s) of Lading.
Additional Conditions:
Charter Party Bill(s) of Lading acceptable;
Bill of Lading with clauses such as "atmospheric rust", "stowed at open area before shipment", "surface wet before shipment", "cargo partly rusty before shipment", "surface partly stained with black powder, grease spots and/or oil patches" or words with similar meaning is allowed.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_open_terms_without_security_or_covered_by_credit_insurance', 'contract.clause', _id);

    -- clause_quality_cif_cfr_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quality_cif_cfr_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quality - CIF/CFR' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quality - CIF/CFR', 'quality', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products shall be accepted by the Buyer on the basis of the Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim arising, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of discharge at the discharge port;
visible defects - [x] days from the date of discharge at the discharge port.
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the discharge port and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the bill of lading.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing within a reasonable time. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of the Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Goods to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed at the discharge port, the Seller has the right to appoint a second independent surveyor (mutually agreed by the Parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the Parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject the Seller''s invoice, to delay payment or to make any deduction. In most cases the Total Amount due to the Seller shall, shall be paid in full without deduction or set off.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The Seller shall not be responsible for any qualitative changes or damages to the Products suffered during transportation of the Products by sea.
The total amount of any quality claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Sales Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quality - CIF/CFR', category = 'quality', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products shall be accepted by the Buyer on the basis of the Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim arising, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of discharge at the discharge port;
visible defects - [x] days from the date of discharge at the discharge port.
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the discharge port and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the bill of lading.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing within a reasonable time. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of the Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Goods to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed at the discharge port, the Seller has the right to appoint a second independent surveyor (mutually agreed by the Parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the Parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject the Seller''s invoice, to delay payment or to make any deduction. In most cases the Total Amount due to the Seller shall, shall be paid in full without deduction or set off.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The Seller shall not be responsible for any qualitative changes or damages to the Products suffered during transportation of the Products by sea.
The total amount of any quality claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Sales Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quality_cif_cfr_cif', 'contract.clause', _id);

    -- clause_quality_cif_cfr_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quality_cif_cfr_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quality - CIF/CFR' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quality - CIF/CFR', 'quality', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products shall be accepted by the Buyer on the basis of the Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim arising, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of discharge at the discharge port;
visible defects - [x] days from the date of discharge at the discharge port.
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the discharge port and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the bill of lading.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing within a reasonable time. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of the Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Goods to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed at the discharge port, the Seller has the right to appoint a second independent surveyor (mutually agreed by the Parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the Parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject the Seller''s invoice, to delay payment or to make any deduction. In most cases the Total Amount due to the Seller shall, shall be paid in full without deduction or set off.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The Seller shall not be responsible for any qualitative changes or damages to the Products suffered during transportation of the Products by sea.
The total amount of any quality claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Sales Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quality - CIF/CFR', category = 'quality', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products shall be accepted by the Buyer on the basis of the Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim arising, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of discharge at the discharge port;
visible defects - [x] days from the date of discharge at the discharge port.
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the discharge port and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the bill of lading.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing within a reasonable time. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of the Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Goods to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed at the discharge port, the Seller has the right to appoint a second independent surveyor (mutually agreed by the Parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the Parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject the Seller''s invoice, to delay payment or to make any deduction. In most cases the Total Amount due to the Seller shall, shall be paid in full without deduction or set off.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The Seller shall not be responsible for any qualitative changes or damages to the Products suffered during transportation of the Products by sea.
The total amount of any quality claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Sales Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quality_cif_cfr_cfr', 'contract.clause', _id);

    -- clause_quality_daf_daf
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quality_daf_daf' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quality - DAF' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quality - DAF', 'quality', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products shall be accepted by the Buyer on the basis of Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of delivery at the place of destination;
visible defects - [x] days from the date of delivery at the place of destination.
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
Claim should be submitted in two copies and should contain the following data:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
date and number of railway bill;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the cross-border station and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the Buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
original of the shipping documentation;
original of the commercial acts issued by representatives of railway during transportation of goods if damages have occurred during transportation of the products by railway;
copy of the Sales Agreement;
copy of the commercial invoice.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not to be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed, the Seller has the right to appoint second independent surveyor (mutually agreed by both parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment and/or to make any deduction. In most cases the Total Amount due to the Seller shall, shall be paid in full without deduction or set off
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The total amount of any quality claim of the goods shall not to exceed the Total Amount of the Products delivered under this Sales Agreement.', 'DAF', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quality - DAF', category = 'quality', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products shall be accepted by the Buyer on the basis of Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of delivery at the place of destination;
visible defects - [x] days from the date of delivery at the place of destination.
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
Claim should be submitted in two copies and should contain the following data:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
date and number of railway bill;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the cross-border station and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the Buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
original of the shipping documentation;
original of the commercial acts issued by representatives of railway during transportation of goods if damages have occurred during transportation of the products by railway;
copy of the Sales Agreement;
copy of the commercial invoice.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not to be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed, the Seller has the right to appoint second independent surveyor (mutually agreed by both parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment and/or to make any deduction. In most cases the Total Amount due to the Seller shall, shall be paid in full without deduction or set off
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The total amount of any quality claim of the goods shall not to exceed the Total Amount of the Products delivered under this Sales Agreement.', incoterm_code = 'DAF', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quality_daf_daf', 'contract.clause', _id);

    -- clause_quality_dap_ddu_dap
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quality_dap_ddu_dap' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quality - DAP/DDU' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quality - DAP/DDU', 'quality', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products shall be accepted by the Buyer on the basis of Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of delivery at the place of destination;
visible defects - [x] days from the date of delivery at the place of destination;
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
Claim should be submitted in two copies and should contain the following data:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
date and number of shipping documents;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the place of destination and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the Buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
original of the shipping documentation;
original of the commercial acts issued by representatives of railway during transportation of goods if damages have occurred during transportation of the products by railway;
copy of the Sales Agreement;
copy of the commercial invoice.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not to be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed, the Seller has the right to appoint second independent surveyor (mutually agreed by both parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment and/or to make any deduction. In most cases the Total Amount due to the Seller, shall be paid in full without deduction or set off
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The total amount of any quality claim of the goods shall not to exceed the Total Amount of the Products delivered under this Sales Agreement.', 'DAP', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quality - DAP/DDU', category = 'quality', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products shall be accepted by the Buyer on the basis of Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of delivery at the place of destination;
visible defects - [x] days from the date of delivery at the place of destination;
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
Claim should be submitted in two copies and should contain the following data:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
date and number of shipping documents;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the place of destination and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the Buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
original of the shipping documentation;
original of the commercial acts issued by representatives of railway during transportation of goods if damages have occurred during transportation of the products by railway;
copy of the Sales Agreement;
copy of the commercial invoice.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not to be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed, the Seller has the right to appoint second independent surveyor (mutually agreed by both parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment and/or to make any deduction. In most cases the Total Amount due to the Seller, shall be paid in full without deduction or set off
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The total amount of any quality claim of the goods shall not to exceed the Total Amount of the Products delivered under this Sales Agreement.', incoterm_code = 'DAP', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quality_dap_ddu_dap', 'contract.clause', _id);

    -- clause_quality_dap_ddu_ddu
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quality_dap_ddu_ddu' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quality - DAP/DDU' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quality - DAP/DDU', 'quality', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products shall be accepted by the Buyer on the basis of Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of delivery at the place of destination;
visible defects - [x] days from the date of delivery at the place of destination;
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
Claim should be submitted in two copies and should contain the following data:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
date and number of shipping documents;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the place of destination and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the Buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
original of the shipping documentation;
original of the commercial acts issued by representatives of railway during transportation of goods if damages have occurred during transportation of the products by railway;
copy of the Sales Agreement;
copy of the commercial invoice.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not to be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed, the Seller has the right to appoint second independent surveyor (mutually agreed by both parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment and/or to make any deduction. In most cases the Total Amount due to the Seller, shall be paid in full without deduction or set off
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The total amount of any quality claim of the goods shall not to exceed the Total Amount of the Products delivered under this Sales Agreement.', 'DDU', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quality - DAP/DDU', category = 'quality', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products shall be accepted by the Buyer on the basis of Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of delivery at the place of destination;
visible defects - [x] days from the date of delivery at the place of destination;
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
Claim should be submitted in two copies and should contain the following data:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
date and number of shipping documents;
the marking of the Products and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the place of destination and arranged at the Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the Buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
original of the shipping documentation;
original of the commercial acts issued by representatives of railway during transportation of goods if damages have occurred during transportation of the products by railway;
copy of the Sales Agreement;
copy of the commercial invoice.
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not to be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed, the Seller has the right to appoint second independent surveyor (mutually agreed by both parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and/or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment and/or to make any deduction. In most cases the Total Amount due to the Seller, shall be paid in full without deduction or set off
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The total amount of any quality claim of the goods shall not to exceed the Total Amount of the Products delivered under this Sales Agreement.', incoterm_code = 'DDU', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quality_dap_ddu_ddu', 'contract.clause', _id);

    -- clause_quality_fob_fob
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quality_fob_fob' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quality - FOB' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quality - FOB', 'quality', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products shall be accepted by the Buyer on the basis of the Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim arising, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of loading at the loading port;
visible defects - [x] days from the date of loading at the loading port;
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) at the Loading port during the process of loading and arranged at The Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the bill of lading
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing within a reasonable time. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed at the loading port, the Seller has the right to appoint a second independent surveyor (mutually agreed by the Parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the Parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject the Seller''s invoice, to delay payment or to make any deduction. In most cases the Total Price due to the Seller shall, be paid in full without deduction or set off.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The Seller shall not be responsible for any qualitative change or damage to the Products suffered during transportation of the Products by sea.
The total amount of any quality claim in relation to the Products shall not exceed the Total Price of the Products delivered under this Sales Agreement.', 'FOB', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quality - FOB', category = 'quality', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products shall be accepted by the Buyer on the basis of the Mill''s quality certificate(s) issued by the Producing Mill.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to inspect the quality of Products in accordance with provisions of the present Clause. The deliverable of such a quality inspection shall be a written survey report (supported by pictures and any other relevant evidence) containing the following, non-exhaustive, information:
detailed description of the steel product defects (mechanical damages, chemistry deviations, etc.);
assessment of the degree of non-conformity of the Products towards the deviations and/or tolerances deemed acceptable under this Sales Agreement, the specification of the Products, including all relevant (contractually stipulated) standards and regulations;
description of the processes, methods and technical standards with description of special instruments and tools used during throughout the inspection;
assessment of the storage condition and separation of the Products as required by the Sales Agreement.
Claims in respect of quality shall only arise if the quality of the Products is not in conformity with that stipulated in this Sales Agreement and/or the attached specification(s) based on mill''s quality certificates.
In the event of a quality claim arising, the Buyer must submit relevant claim to the Seller within the time limits set out below:
hidden defects - [x] days from the date of loading at the loading port;
visible defects - [x] days from the date of loading at the loading port;
The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and a detailed description of the defects and/or non-conformities of the Products with a detailed and evidenced calculation of the incurred loss(es)/cost(s).
The claim shall be supported by the following documents:
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) at the Loading port during the process of loading and arranged at The Buyer''s cost - for visible defects;
original survey report issued by SGS (or any other independent surveyor mutually agreed by the parties) made at the buyer''s premises and arranged at the Buyer''s cost - for hidden defects;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the bill of lading
All the aforementioned documents shall be translated into English.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing until the claim is settled, unless the Seller agrees otherwise in writing within a reasonable time. If Products are used in production, any claim shall be null and void. In the case of hidden defects revealed during production, the Buyer must inform the Seller immediately and stop further processing until the claim is settled.
In case the Parties agree that mutual survey inspection is necessary to determine the quality of Products, the Buyer shall send a written request to the Seller inviting representatives of the Seller and Producer of the Products to check the quality at the place of destination.
Should the Seller dispute the quality defect or non-conformity claimed at the loading port, the Seller has the right to appoint a second independent surveyor (mutually agreed by the Parties) to ascertain the final quality. The findings of that second independent surveyor shall be final and binding on the Parties. The cost of such survey shall be for the account of the party found to be wrong.
Should the Buyer fail to present a claim within the time limits and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claims in respect of the quality of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject the Seller''s invoice, to delay payment or to make any deduction. In most cases the Total Price due to the Seller shall, be paid in full without deduction or set off.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
The Seller shall not be responsible for any qualitative change or damage to the Products suffered during transportation of the Products by sea.
The total amount of any quality claim in relation to the Products shall not exceed the Total Price of the Products delivered under this Sales Agreement.', incoterm_code = 'FOB', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quality_fob_fob', 'contract.clause', _id);

    -- clause_quantity_actual_basis_cif_cfr_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_basis_cif_cfr_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual basis - CIF/CFR' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual basis - CIF/CFR', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Mill''s certificate(s) issued by the Producing Mill or the weight certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the actual quantity of the Products at the discharging port. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the Buyer''s discharge weight certificates and Mill''s certificate(s) or Seller''s load weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading;
Copy of the calibration certificate of weighing machinery at the discharging port.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual basis - CIF/CFR', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Mill''s certificate(s) issued by the Producing Mill or the weight certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the actual quantity of the Products at the discharging port. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the Buyer''s discharge weight certificates and Mill''s certificate(s) or Seller''s load weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading;
Copy of the calibration certificate of weighing machinery at the discharging port.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_basis_cif_cfr_cif', 'contract.clause', _id);

    -- clause_quantity_actual_basis_cif_cfr_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_basis_cif_cfr_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual basis - CIF/CFR' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual basis - CIF/CFR', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Mill''s certificate(s) issued by the Producing Mill or the weight certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the actual quantity of the Products at the discharging port. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the Buyer''s discharge weight certificates and Mill''s certificate(s) or Seller''s load weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading;
Copy of the calibration certificate of weighing machinery at the discharging port.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual basis - CIF/CFR', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Mill''s certificate(s) issued by the Producing Mill or the weight certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the actual quantity of the Products at the discharging port. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the Buyer''s discharge weight certificates and Mill''s certificate(s) or Seller''s load weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading;
Copy of the calibration certificate of weighing machinery at the discharging port.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_basis_cif_cfr_cfr', 'contract.clause', _id);

    -- clause_quantity_theoretical_basis_cif_cfr_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_theoretical_basis_cif_cfr_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Theoretical basis - CIF/CFR' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Theoretical basis - CIF/CFR', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Mill''s certificate(s) issued by the Producing Mill or the quantity certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products shipped, at the discharging port. The result of the inspection shall be defined in accordance to the formula specified in point [x] of this Sales Agreement and applied to each piece of the Products. In the event of a difference between the load and discharge quantity certificates, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Delivery of the Products shall be effected on theoretical weight, based on nominal dimensions and specific steel gravity of 7.85mt/dm3, in accordance to the formula [H x W x L x SG], where:
H = Nominal Height of the Products - applied to each piece;
W = Nominal Width of the Products - applied to each piece;
L = Nominal Length of the Products - applied to each piece;
SG = Specific Steel Gravity of 7.85mt/dm3
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Theoretical basis - CIF/CFR', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Mill''s certificate(s) issued by the Producing Mill or the quantity certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products shipped, at the discharging port. The result of the inspection shall be defined in accordance to the formula specified in point [x] of this Sales Agreement and applied to each piece of the Products. In the event of a difference between the load and discharge quantity certificates, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Delivery of the Products shall be effected on theoretical weight, based on nominal dimensions and specific steel gravity of 7.85mt/dm3, in accordance to the formula [H x W x L x SG], where:
H = Nominal Height of the Products - applied to each piece;
W = Nominal Width of the Products - applied to each piece;
L = Nominal Length of the Products - applied to each piece;
SG = Specific Steel Gravity of 7.85mt/dm3
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_theoretical_basis_cif_cfr_cif', 'contract.clause', _id);

    -- clause_quantity_theoretical_basis_cif_cfr_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_theoretical_basis_cif_cfr_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Theoretical basis - CIF/CFR' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Theoretical basis - CIF/CFR', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Mill''s certificate(s) issued by the Producing Mill or the quantity certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products shipped, at the discharging port. The result of the inspection shall be defined in accordance to the formula specified in point [x] of this Sales Agreement and applied to each piece of the Products. In the event of a difference between the load and discharge quantity certificates, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Delivery of the Products shall be effected on theoretical weight, based on nominal dimensions and specific steel gravity of 7.85mt/dm3, in accordance to the formula [H x W x L x SG], where:
H = Nominal Height of the Products - applied to each piece;
W = Nominal Width of the Products - applied to each piece;
L = Nominal Length of the Products - applied to each piece;
SG = Specific Steel Gravity of 7.85mt/dm3
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Theoretical basis - CIF/CFR', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Mill''s certificate(s) issued by the Producing Mill or the quantity certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products shipped, at the discharging port. The result of the inspection shall be defined in accordance to the formula specified in point [x] of this Sales Agreement and applied to each piece of the Products. In the event of a difference between the load and discharge quantity certificates, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection at the discharging port.
Delivery of the Products shall be effected on theoretical weight, based on nominal dimensions and specific steel gravity of 7.85mt/dm3, in accordance to the formula [H x W x L x SG], where:
H = Nominal Height of the Products - applied to each piece;
W = Nominal Width of the Products - applied to each piece;
L = Nominal Length of the Products - applied to each piece;
SG = Specific Steel Gravity of 7.85mt/dm3
Any quantity claim must be submitted within 30 (thirty) days of completion of discharge at the discharging port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the discharging port and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the discharge port, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a third independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the third independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_theoretical_basis_cif_cfr_cfr', 'contract.clause', _id);

    -- clause_quantity_actual_cif_cfr_pig_iron_with_franchise_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_cif_cfr_pig_iron_with_franchise_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual - CIF/CFR Pig Iron (with franchise)' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual - CIF/CFR Pig Iron (with franchise)', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) and arranged at the Seller''s cost shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
In the event of a difference between two Draft Survey Certificates issued on behalf of the Parties either by TCI or SGS or any other independent surveyor, deductible franchise of +/-0.5% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim.
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading Port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information: agreement number, description of the Products in accordance with the agreement, the weight of the Products in the respect of which the claim is submitted, the carrying ship''s name, the date and number of the B/L, the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate and the grounded calculation of the loses and damages.
The claim shall be supported by the following documents:
original survey report issued by TCI or SGS or any other independent Surveyor at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel);
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claim in respect of the quantity of the Products delivered under this Agreement, and /or any possible losses which may arise out of performance of the present contract shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Price due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Price of the Products delivered under this Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual - CIF/CFR Pig Iron (with franchise)', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) and arranged at the Seller''s cost shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
In the event of a difference between two Draft Survey Certificates issued on behalf of the Parties either by TCI or SGS or any other independent surveyor, deductible franchise of +/-0.5% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim.
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading Port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information: agreement number, description of the Products in accordance with the agreement, the weight of the Products in the respect of which the claim is submitted, the carrying ship''s name, the date and number of the B/L, the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate and the grounded calculation of the loses and damages.
The claim shall be supported by the following documents:
original survey report issued by TCI or SGS or any other independent Surveyor at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel);
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claim in respect of the quantity of the Products delivered under this Agreement, and /or any possible losses which may arise out of performance of the present contract shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Price due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Price of the Products delivered under this Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_cif_cfr_pig_iron_with_franchise_cif', 'contract.clause', _id);

    -- clause_quantity_actual_cif_cfr_pig_iron_with_franchise_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_cif_cfr_pig_iron_with_franchise_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual - CIF/CFR Pig Iron (with franchise)' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual - CIF/CFR Pig Iron (with franchise)', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) and arranged at the Seller''s cost shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
In the event of a difference between two Draft Survey Certificates issued on behalf of the Parties either by TCI or SGS or any other independent surveyor, deductible franchise of +/-0.5% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim.
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading Port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information: agreement number, description of the Products in accordance with the agreement, the weight of the Products in the respect of which the claim is submitted, the carrying ship''s name, the date and number of the B/L, the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate and the grounded calculation of the loses and damages.
The claim shall be supported by the following documents:
original survey report issued by TCI or SGS or any other independent Surveyor at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel);
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claim in respect of the quantity of the Products delivered under this Agreement, and /or any possible losses which may arise out of performance of the present contract shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Price due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Price of the Products delivered under this Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual - CIF/CFR Pig Iron (with franchise)', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) and arranged at the Seller''s cost shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
In the event of a difference between two Draft Survey Certificates issued on behalf of the Parties either by TCI or SGS or any other independent surveyor, deductible franchise of +/-0.5% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim.
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading Port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt stamp on the letter shall be considered the date of presentation of the claim.
The Claim shall be submitted in two copies and shall contain the following information: agreement number, description of the Products in accordance with the agreement, the weight of the Products in the respect of which the claim is submitted, the carrying ship''s name, the date and number of the B/L, the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate and the grounded calculation of the loses and damages.
The claim shall be supported by the following documents:
original survey report issued by TCI or SGS or any other independent Surveyor at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel);
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any eventual claim in respect of the quantity of the Products delivered under this Agreement, and /or any possible losses which may arise out of performance of the present contract shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Price due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Price of the Products delivered under this Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_cif_cfr_pig_iron_with_franchise_cfr', 'contract.clause', _id);

    -- clause_quantity_actual_cif_cfr_pig_iron_without_franchise_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_cif_cfr_pig_iron_without_franchise_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual - CIF/CFR Pig Iron (without franchise)' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual - CIF/CFR Pig Iron (without franchise)', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
The final weight will be considered the average weight between Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Seller at the loading port and Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Buyer at the discharging port.
If the Buyer has not appointed independent surveyor at the discharging port or has not sent to the Seller the respective Draft Survey Certificate issued by TCI or SGS or any other independent surveyor at the discharging port within 5 (five) working days after discharge completed, the weight indicated in the respective Bill of Loading to be considered to as the final weight of the Products. In this case no quantity claim could be submitted after issuance a respective Bill of Lading.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual - CIF/CFR Pig Iron (without franchise)', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
The final weight will be considered the average weight between Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Seller at the loading port and Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Buyer at the discharging port.
If the Buyer has not appointed independent surveyor at the discharging port or has not sent to the Seller the respective Draft Survey Certificate issued by TCI or SGS or any other independent surveyor at the discharging port within 5 (five) working days after discharge completed, the weight indicated in the respective Bill of Loading to be considered to as the final weight of the Products. In this case no quantity claim could be submitted after issuance a respective Bill of Lading.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_cif_cfr_pig_iron_without_franchise_cif', 'contract.clause', _id);

    -- clause_quantity_actual_cif_cfr_pig_iron_without_franchise_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_cif_cfr_pig_iron_without_franchise_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual - CIF/CFR Pig Iron (without franchise)' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual - CIF/CFR Pig Iron (without franchise)', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
The final weight will be considered the average weight between Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Seller at the loading port and Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Buyer at the discharging port.
If the Buyer has not appointed independent surveyor at the discharging port or has not sent to the Seller the respective Draft Survey Certificate issued by TCI or SGS or any other independent surveyor at the discharging port within 5 (five) working days after discharge completed, the weight indicated in the respective Bill of Loading to be considered to as the final weight of the Products. In this case no quantity claim could be submitted after issuance a respective Bill of Lading.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual - CIF/CFR Pig Iron (without franchise)', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The TCI or SGS or other independent surveyor weight inspection certificate issued at loading port carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel) shall be conclusive evidence of the quantity shipped provided it corresponds to the B/L''s quantity.
The Buyer has the right to appoint TCI or SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products at the port of discharge carried out through procedure of Draft Survey (fixing quantity loaded of the cargo on draft of the vessel). The Buyer shall arrange and pay for the surveyor''s inspection (draft survey) at the discharging port made on behalf of the Buyer.
The final weight will be considered the average weight between Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Seller at the loading port and Draft Survey Certificate issued by TCI or SGS or any other independent surveyor on behalf of the Buyer at the discharging port.
If the Buyer has not appointed independent surveyor at the discharging port or has not sent to the Seller the respective Draft Survey Certificate issued by TCI or SGS or any other independent surveyor at the discharging port within 5 (five) working days after discharge completed, the weight indicated in the respective Bill of Loading to be considered to as the final weight of the Products. In this case no quantity claim could be submitted after issuance a respective Bill of Lading.
The Seller shall not be responsible for any shortages of the Products suffered during transportation of the Products by sea.
The total amount of any quantity claim in relation to the Products shall not exceed the Total Amount of the Products delivered under this Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_cif_cfr_pig_iron_without_franchise_cfr', 'contract.clause', _id);

    -- clause_quantity_actual_basis_daf_daf
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_basis_daf_daf' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual basis - DAF' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual basis - DAF', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products are accepted by the Buyer in accordance with the quantity stated in Mill''s certificate(s) issued by the Producing Mill and shipping documentation.
The Buyer has the right to check the quantity of Products at the cross-border station by appointing SGS or any other independent surveyor mutually agreed by the Parties. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the quantity and/or weight stated in the shipping documentation and inspection certificate issued at the cross-border station, a franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Buyer shall arrange and pay for the surveyor''s inspection at the cross-border station.
Any quantity claim must be submitted within 30 (thirty) days from the date of the stamp of border crossing station. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the date and number of the shipping documents;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties made at the cross-border station and arranged at the Buyer''s cost with indication of numbers of transport/shipping documents, quantity stated in the transport/shipping documents and quantity found during inspection by weighing of loaded (gross weight) and unloaded (tare weight) wagons/cars (transport vehicles), the full description of used weighing system (including precision);
original of the Commercial Acts issued by the official authorities of the country of dispatch;
copy of the Certificate of Quality;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the calibration certificate of weighing machinery.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing. If the Products are used in production, any claim shall be null and void.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall be responsible for shortage of the Products occurring during transportation of the Products till [x] frontier only.
The total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'DAF', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual basis - DAF', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products are accepted by the Buyer in accordance with the quantity stated in Mill''s certificate(s) issued by the Producing Mill and shipping documentation.
The Buyer has the right to check the quantity of Products at the cross-border station by appointing SGS or any other independent surveyor mutually agreed by the Parties. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the quantity and/or weight stated in the shipping documentation and inspection certificate issued at the cross-border station, a franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Buyer shall arrange and pay for the surveyor''s inspection at the cross-border station.
Any quantity claim must be submitted within 30 (thirty) days from the date of the stamp of border crossing station. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the date and number of the shipping documents;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties made at the cross-border station and arranged at the Buyer''s cost with indication of numbers of transport/shipping documents, quantity stated in the transport/shipping documents and quantity found during inspection by weighing of loaded (gross weight) and unloaded (tare weight) wagons/cars (transport vehicles), the full description of used weighing system (including precision);
original of the Commercial Acts issued by the official authorities of the country of dispatch;
copy of the Certificate of Quality;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the calibration certificate of weighing machinery.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
All Products under claim must be stocked separately, clearly marked, and must not be used for further processing. If the Products are used in production, any claim shall be null and void.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject of the Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall be responsible for shortage of the Products occurring during transportation of the Products till [x] frontier only.
The total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'DAF', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_basis_daf_daf', 'contract.clause', _id);

    -- clause_quantity_actual_dap_dap
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_dap_dap' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual - DAP' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual - DAP', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products are accepted by the Buyer in accordance with the quantity stated in Mill''s certificate(s) issued by the Producing Mill and transport/shipping documentation.
The Buyer has the right to check the quantity of Products at the place of destination by appointing SGS or any other independent surveyor mutually agreed by the Parties. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the quantity and/or weight stated in the shipping documentation and inspection certificate issued at the place of destination, a franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Buyer shall arrange and pay for the surveyor''s inspection at the place of destination.
Any quantity claim must be submitted within 30 (thirty) days from the date of delivery at the place of destination. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the date and number of the shipping documents;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties made at the place of destination and arranged at the Buyer''s cost with indication of numbers of transport/shipping documents, quantity stated in the transport/shipping documents and quantity found during inspection by weighing of loaded (gross weight) and unloaded (tare weight) wagons/cars (transport vehicles), the full description of used weighing system (including precision);
original of the Commercial Acts issued by the official authorities of the country of dispatch;
copy of the Certificate of Quality;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the calibration certificate of weighing machinery.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the place of destination, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a second independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the second independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall be responsible for shortage of the Products occurring during transportation of the Products till [x] only.
The total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'DAP', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual - DAP', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products are accepted by the Buyer in accordance with the quantity stated in Mill''s certificate(s) issued by the Producing Mill and transport/shipping documentation.
The Buyer has the right to check the quantity of Products at the place of destination by appointing SGS or any other independent surveyor mutually agreed by the Parties. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the quantity and/or weight stated in the shipping documentation and inspection certificate issued at the place of destination, a franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Buyer shall arrange and pay for the surveyor''s inspection at the place of destination.
Any quantity claim must be submitted within 30 (thirty) days from the date of delivery at the place of destination. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the date and number of the shipping documents;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties made at the place of destination and arranged at the Buyer''s cost with indication of numbers of transport/shipping documents, quantity stated in the transport/shipping documents and quantity found during inspection by weighing of loaded (gross weight) and unloaded (tare weight) wagons/cars (transport vehicles), the full description of used weighing system (including precision);
original of the Commercial Acts issued by the official authorities of the country of dispatch;
copy of the Certificate of Quality;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the calibration certificate of weighing machinery.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the place of destination, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a second independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the second independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall be responsible for shortage of the Products occurring during transportation of the Products till [x] only.
The total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'DAP', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_dap_dap', 'contract.clause', _id);

    -- clause_quantity_actual_dap_pig_iron_dap
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_dap_pig_iron_dap' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual - DAP Pig Iron' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual - DAP Pig Iron', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Products are accepted by the Buyer in accordance with the Mill''s certificate(s) issued by the Producing Mill and transport/shipping documentation.
The Buyer has the right to check the quantity of Products at the place of destination by appointing SGS or any other independent surveyor mutually agreed by the Parties. During reweighing, all wagons/cars (transport vehicles) that constitute the Lot of Products should be weighed. In the event of a difference between the quantity and/or weight stated in the shipping documentation and inspection certificate issued at the place of destination, a franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Buyer shall arrange and pay for the surveyor''s inspection at the place of destination.
Any quantity claim must be submitted within 30 (thirty) days from the date of delivery at the place of destination. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
weight of the Products in the respect of which the claim is submitted;
the date and number of the shipping documents;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties made at the place of destination and arranged at the Buyer''s cost with indication of numbers of transport/shipping documents, quantity stated in the transport/shipping documents and quantity found during inspection by weighing of loaded (gross weight) and unloaded (tare weight) wagons/cars (transport vehicles), the full description of used weighing system (including precision);
original of the Commercial Acts issued by the official authorities of the country of dispatch;
copy of the Certificate of Quality;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the calibration certificate of weighing machinery.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the place of destination, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a second independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the second independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall be responsible for shortage of the Products occurring during transportation of the Products till [x] only.
The total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'DAP', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual - DAP Pig Iron', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Products are accepted by the Buyer in accordance with the Mill''s certificate(s) issued by the Producing Mill and transport/shipping documentation.
The Buyer has the right to check the quantity of Products at the place of destination by appointing SGS or any other independent surveyor mutually agreed by the Parties. During reweighing, all wagons/cars (transport vehicles) that constitute the Lot of Products should be weighed. In the event of a difference between the quantity and/or weight stated in the shipping documentation and inspection certificate issued at the place of destination, a franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Buyer shall arrange and pay for the surveyor''s inspection at the place of destination.
Any quantity claim must be submitted within 30 (thirty) days from the date of delivery at the place of destination. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
weight of the Products in the respect of which the claim is submitted;
the date and number of the shipping documents;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties made at the place of destination and arranged at the Buyer''s cost with indication of numbers of transport/shipping documents, quantity stated in the transport/shipping documents and quantity found during inspection by weighing of loaded (gross weight) and unloaded (tare weight) wagons/cars (transport vehicles), the full description of used weighing system (including precision);
original of the Commercial Acts issued by the official authorities of the country of dispatch;
copy of the Certificate of Quality;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the calibration certificate of weighing machinery.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Should the Seller dispute any differences in quantity claimed at the place of destination, the Seller has the right, within 2 (two) weeks period from the moment of the claim presentation, to appoint a second independent surveyor mutually agreed by the parties to ascertain the final quantity. During the said period, all Products under claim must be stocked separately, clearly marked and must not be used for further processing. If the Products are used in production, any claim(s) shall be null and void. The findings of the second independent surveyor shall be final and binding on the Parties. Storage and any related costs shall be for the account of the party found to be wrong.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall be responsible for shortage of the Products occurring during transportation of the Products till [x] only.
The total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'DAP', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_dap_pig_iron_dap', 'contract.clause', _id);

    -- clause_quantity_actual_basis_fob_fob
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_actual_basis_fob_fob' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Actual basis - FOB' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Actual basis - FOB', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Mill''s certificate(s) issued by the Producing Mill or the weight certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the actual quantity of the Products at the loading port during the process of loading. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the Buyer''s load weight certificates and Mill''s certificate(s) or Seller''s weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection appointed by him.
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the Loading port during the process of loading and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading;
copy of the calibration certificate of weighing machinery at the Loading port.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'FOB', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Actual basis - FOB', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Mill''s certificate(s) issued by the Producing Mill or the weight certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the actual quantity of the Products at the loading port during the process of loading. During reweighing, every unit shall be numbered and these numbers shall be quoted on the weight sheets. In the event of a difference between the Buyer''s load weight certificates and Mill''s certificate(s) or Seller''s weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection appointed by him.
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the Loading port during the process of loading and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading;
copy of the calibration certificate of weighing machinery at the Loading port.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'FOB', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_actual_basis_fob_fob', 'contract.clause', _id);

    -- clause_quantity_theoretical_basis_fob_fob
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_quantity_theoretical_basis_fob_fob' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Quantity Theoretical basis - FOB' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'Quantity Theoretical basis - FOB', 'quantity', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Mill''s certificate(s) issued by the Producing Mill or the quantity certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products (pre-shipment inspection) at the loading port. The result of the inspection shall be defined in accordance to the formula specified in point [x] of this Sales Agreement and applied to each piece of the Products. In the event of a difference between the Buyer''s load weight certificates and Mill''s certificate(s) or Seller''s weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection appointed by him.
Delivery of the Products shall be effected on theoretical weight, based on nominal dimensions and specific steel gravity of 7.85mt/dm3, in accordance to the formula [H x W x L x SG], where:
H = Nominal Height of the Products - applied to each piece;
W = Nominal Width of the Products - applied to each piece;
L = Nominal Length of the Products - applied to each piece;
SG = Specific Steel Gravity of 7.85mt/dm3
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the loading port during preloading operation and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', 'FOB', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Quantity Theoretical basis - FOB', category = 'quantity', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Mill''s certificate(s) issued by the Producing Mill or the quantity certificate issued by SGS or any other independent surveyor mutually agreed by the Parties at the loading port shall be conclusive evidence of the quantity shipped provided that it corresponds to the quantity set forth in the Bill(s) of Lading.
The Buyer has the right to appoint SGS or any other independent surveyor mutually agreed by the Parties to check the quantity of the Products (pre-shipment inspection) at the loading port. The result of the inspection shall be defined in accordance to the formula specified in point [x] of this Sales Agreement and applied to each piece of the Products. In the event of a difference between the Buyer''s load weight certificates and Mill''s certificate(s) or Seller''s weight certificates issued by independent surveyors, a deductible franchise of +/-[x]% shall be applied and only a difference in excess of +/-[x]% shall give rise to a claim. The Seller shall arrange and pay for the surveyor''s quantity inspection at the loading port and the Buyer shall arrange and pay for the surveyor''s inspection appointed by him.
Delivery of the Products shall be effected on theoretical weight, based on nominal dimensions and specific steel gravity of 7.85mt/dm3, in accordance to the formula [H x W x L x SG], where:
H = Nominal Height of the Products - applied to each piece;
W = Nominal Width of the Products - applied to each piece;
L = Nominal Length of the Products - applied to each piece;
SG = Specific Steel Gravity of 7.85mt/dm3
Any quantity claim must be submitted within 30 (thirty) days of completion of loading at the loading port. The claim shall be sent to the Seller by registered mail and the Seller''s receipt date of the claim letter shall be considered as the date of presentation of the claim.
The Claim shall be submitted in 2 (two) copies and shall contain the following information:
Sales Agreement number;
description of the Products in accordance with the Sales Agreement;
number of pieces and weight of the Products in the respect of which the claim is submitted;
the carrying ship''s name;
the date and number of the B/L;
the marking of the goods and the calculation of the eventual shortage based on the surveyor''s quantity inspection certificate with the franchise of [x]% deducted.
The claim shall be supported by the following documents:
original survey report issued by SGS or any other independent Surveyor mutually agreed by the parties at the loading port during preloading operation and arranged at the Buyer''s cost;
copy of the Sales Agreement;
copy of the commercial invoice;
copy of the Bill of Lading.
All the aforementioned documents shall be translated into English.
Should the Buyer fail to present a claim within the stipulated period of time and/or strictly in accordance with the manner stipulated in this Sales Agreement, then the claim shall be deemed extinguished and barred and the Seller shall be relieved of all responsibility in relation thereto.
Any claim lodged in accordance with the terms and conditions stipulated in this Sales Agreement if accepted by the Seller shall lead to the conclusion of a Settlement Agreement which shall formalize the compensation, if any, including but not limited to:
compensation amount (cash);
discount on next deal;
replacement of the deficient Products;
any other modality of compensation agreed by the Parties.
Any eventual claim in respect of the quantity of the Products delivered under this Sales Agreement, and /or any possible losses which may arise out of performance of the present Sales Agreement shall not entitle the Buyer to fully or partially reject Seller''s invoice, to delay payment or to make any deduction. In all cases, the Total Amount due to the Seller shall be paid in full without deduction or set off.
The Seller shall not be responsible for any shortage of the Products suffered during transportation of the Products by sea.
The Total Amount of any quantity claim in relation to the Products shall not exceed the Total Value of the Products delivered under this Sales Agreement.', incoterm_code = 'FOB', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_quantity_theoretical_basis_fob_fob', 'contract.clause', _id);

    -- clause_cif_fo_cqd_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cif_fo_cqd_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CIF FO - CQD' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'CIF FO - CQD', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Seller shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CIF FO - CQD', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Seller shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cif_fo_cqd_cif', 'contract.clause', _id);

    -- clause_cif_fo_at_rate_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cif_fo_at_rate_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CIF FO - At Rate' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'CIF FO - At Rate', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Seller shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge at the rate of [x] metric tons per weather working day of 24 (twenty-four) consecutive hours [x] [x]. Once on demurrage, always on demurrage.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
Laytime shall count, whether the vessel is in berth or not, from 1300 hours if Notice of Readiness for discharge is given before noon and from 0800 hours the following day if notice is given after noon. Saturdays from 1400 hours, Sundays and holidays (Thursdays from 1400, Fridays and holidays for Islamic countries) until Monday 0800 hours (Saturday 0800 for Islamic countries) shall not to count as laytime unless used. If used, actual time used shall count as laytime.
If the Buyer fails to discharge the vessel within the agreed laytime period referred to above, the Buyer shall pay demurrage at the rate agreed by both parties within the nomination of the vessel. Payment of demurrage shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email. No despatch.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CIF FO - At Rate', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Seller shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge at the rate of [x] metric tons per weather working day of 24 (twenty-four) consecutive hours [x] [x]. Once on demurrage, always on demurrage.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
Laytime shall count, whether the vessel is in berth or not, from 1300 hours if Notice of Readiness for discharge is given before noon and from 0800 hours the following day if notice is given after noon. Saturdays from 1400 hours, Sundays and holidays (Thursdays from 1400, Fridays and holidays for Islamic countries) until Monday 0800 hours (Saturday 0800 for Islamic countries) shall not to count as laytime unless used. If used, actual time used shall count as laytime.
If the Buyer fails to discharge the vessel within the agreed laytime period referred to above, the Buyer shall pay demurrage at the rate agreed by both parties within the nomination of the vessel. Payment of demurrage shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email. No despatch.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cif_fo_at_rate_cif', 'contract.clause', _id);

    -- clause_cif_lo_cqd_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cif_lo_cqd_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CIF LO - CQD' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'CIF LO - CQD', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Seller shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Seller shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Seller or Shipowner shall appoint an agent at the port of discharge.
The Seller shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Seller shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. The Seller shall be responsible for stevedoring only. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', 'CIF', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CIF LO - CQD', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Seller shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Seller shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Seller or Shipowner shall appoint an agent at the port of discharge.
The Seller shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Seller shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. The Seller shall be responsible for stevedoring only. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', incoterm_code = 'CIF', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cif_lo_cqd_cif', 'contract.clause', _id);

    -- clause_cif_container_shipment_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cif_container_shipment_cif' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CIF - Container shipment' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type, cargo_mode)
        VALUES (0, now(), 'CIF - Container shipment', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the goods to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products to the vessel. After delivery the risk of loss or damage to the goods, as well as any additional costs due to events occurring after the time of delivery, are transferred from the Seller to the Buyer.
The Seller shall procure marine insurance against the Buyer''s risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then the Buyer must make his claim against the Carrier.
The Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made by that time, the Seller shall not be liable for any loss arising out of the transport documents as issued.
The date of the transport document (which will be a Bill of Lading unless otherwise agreed) shall be considered the date of shipment.
Shipment shall be made in containers, the Seller paying all due freight to the Shipping Line. Shipment is subject to the Shipping Line''s standard bill of lading terms (copy available on request) which terms are incorporated into this Sales Agreement.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Within 5 (five) working days after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by telex, email or fax:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of goods shipped.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall be responsible for all costs in relation to discharge, including but not limited to, the cost of stevedores, shore cranes, forklifts, trucks and lighters.
Containers may not be removed from the discharge port except with the consent of the Shipping Line.
The Buyer is solely responsible for payment to the Shipping Line of any container demurrage incurred after discharge of the goods in accordance with the Shipping Line''s standard rates.
The Buyer undertakes to return the container to the Shipping Line in the same good order and condition within the period established by Shipping Line after completion of discharge operation at the port of discharge.', 'CIF', 'vessel', 'container')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CIF - Container shipment', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the goods to the Buyer on CIF basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products to the vessel. After delivery the risk of loss or damage to the goods, as well as any additional costs due to events occurring after the time of delivery, are transferred from the Seller to the Buyer.
The Seller shall procure marine insurance against the Buyer''s risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then the Buyer must make his claim against the Carrier.
The Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made by that time, the Seller shall not be liable for any loss arising out of the transport documents as issued.
The date of the transport document (which will be a Bill of Lading unless otherwise agreed) shall be considered the date of shipment.
Shipment shall be made in containers, the Seller paying all due freight to the Shipping Line. Shipment is subject to the Shipping Line''s standard bill of lading terms (copy available on request) which terms are incorporated into this Sales Agreement.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Within 5 (five) working days after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by telex, email or fax:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of goods shipped.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall be responsible for all costs in relation to discharge, including but not limited to, the cost of stevedores, shore cranes, forklifts, trucks and lighters.
Containers may not be removed from the discharge port except with the consent of the Shipping Line.
The Buyer is solely responsible for payment to the Shipping Line of any container demurrage incurred after discharge of the goods in accordance with the Shipping Line''s standard rates.
The Buyer undertakes to return the container to the Shipping Line in the same good order and condition within the period established by Shipping Line after completion of discharge operation at the port of discharge.', incoterm_code = 'CIF', transport_type = 'vessel', cargo_mode = 'container', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cif_container_shipment_cif', 'contract.clause', _id);

    -- clause_cfr_fo_cqd_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cfr_fo_cqd_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CFR FO - CQD' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'CFR FO - CQD', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CFR FO - CQD', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cfr_fo_cqd_cfr', 'contract.clause', _id);

    -- clause_cfr_fo_at_rate_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cfr_fo_at_rate_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CFR FO - At Rate' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'CFR FO - At Rate', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge at the rate of [x] metric tons per weather working day of 24 (twenty-four) consecutive hours [x] [x]. Once on demurrage, always on demurrage.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
Laytime shall count, whether the vessel is in berth or not, from 1300 hours if Notice of Readiness for discharge is given before noon and from 0800 hours the following day if notice is given after noon. Saturdays from 1400 hours, Sundays and holidays (Thursdays from 1400, Fridays and holidays for Islamic countries) until Monday 0800 hours (Saturday 0800 for Islamic countries) shall not to count as laytime unless used. If used, actual time used shall count as laytime.
If the Buyer fails to discharge the vessel within the agreed laytime period referred to above, the Buyer shall pay demurrage at the rate agreed by both parties within the nomination of the vessel. Payment of demurrage shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email. No despatch.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CFR FO - At Rate', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Buyer shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Where geared, and with sufficient capacity to safely lift the Products in accordance with all applicable regulations, the vessel shall provide use of all onboard cranes/derricks and all power/equipment onboard required for discharge, including the use of light to enable 24 (twenty-four) hours operations if required.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Shipowner may appoint an agent at the port of discharge.
The Buyer shall discharge the Products from the holds of the vessel at the port of discharge at the rate of [x] metric tons per weather working day of 24 (twenty-four) consecutive hours [x] [x]. Once on demurrage, always on demurrage.
The Buyer shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
The Buyer shall be liable for, and pay within 5 (five) banking days, any costs arising out of damage to the vessel caused by stevedores at the discharge port.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
Laytime shall count, whether the vessel is in berth or not, from 1300 hours if Notice of Readiness for discharge is given before noon and from 0800 hours the following day if notice is given after noon. Saturdays from 1400 hours, Sundays and holidays (Thursdays from 1400, Fridays and holidays for Islamic countries) until Monday 0800 hours (Saturday 0800 for Islamic countries) shall not to count as laytime unless used. If used, actual time used shall count as laytime.
If the Buyer fails to discharge the vessel within the agreed laytime period referred to above, the Buyer shall pay demurrage at the rate agreed by both parties within the nomination of the vessel. Payment of demurrage shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email. No despatch.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cfr_fo_at_rate_cfr', 'contract.clause', _id);

    -- clause_cfr_lo_cqd_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cfr_lo_cqd_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CFR LO - CQD' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'CFR LO - CQD', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Seller shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age.
insured for all hull and machinery risks;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Seller or Shipowner shall appoint an agent at the port of discharge.
The Seller shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Seller shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. The Seller shall be responsible for stevedoring only. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', 'CFR', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CFR LO - CQD', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery the risk of loss or damage to the Products, as well as any additional costs due to events occurring after the time of delivery, shall be transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance in respect of the risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then liability for the Buyer''s claim shall rest with the Carrier and the Buyer must make his claim against the Carrier.
Where the Payment Conditions as stipulated under the point [x] of this Sales Agreement are under Letter of Credit, any requests in relation to the form of the transport documents shall be defined under the Letter of Credit itself, for other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with the above stated the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The date of the transport documents (which will be a Bill of Lading unless otherwise agreed) shall be considered as the date of shipment.
The Seller shall arrange for discharge of the Products at his own risk and expense.
The Seller shall charter a carrying vessel which shall be:
a single deck bulk carrier, or a suitable open-hatch tween deck vessel with no stanchions or obstructions to discharge, suitable in all respects for carriage and discharge of the Products;
geared or gearless in the Seller''s option;
not in excess of [x] years of age.
insured for all hull and machinery risks;
ISM certified and compliant.
The Seller may appoint an agent at the port of loading.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Upon request the Seller shall provide full particulars of the vessel including:
the name and any former name of the vessel;
the flag, year of build;
the deadweight, draft, air draft, LOA and beam;
the number and size of holds and hatches;
the classification society, P&I and hull insurers.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall nominate one, or in the Buyer''s option more than one, safe berth for discharge AAAA. Where the Buyer nominates more than one berth, the Buyer shall take full responsibility for time taken to shift the vessel, including any time waiting for subsequent berths, and for all and any costs and expenses related to the Buyer''s election to nominate more than one berth.
Overtime shall be for the account of the party ordering the same, save for overtime of officers and crew which shall be for the Seller''s account. If ordered by the port, overtime shall be for the Buyer''s account.
Within 72 (seventy-two) hours after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by fax or email:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of the Products shipped.
The Seller or Shipowner shall appoint an agent at the port of discharge.
The Seller shall discharge the Products from the holds of the vessel at the port of discharge on CQD (Customary Quick Despatch) basis in accordance with the custom of the port.
The Seller shall be responsible for all costs incurred in relation to discharge of the Products from the vessel''s holds. The Buyer shall be responsible for all costs in relation to receiving the Products.
The Buyer shall be responsible for payment of all and any taxes or costs arising at the port of discharge, including but not limited to, taxes on the Products or freight, wharfage, shifting, storage of the Products and removal of dunnage material from the vessel''s holds.
Notice of Readiness to discharge shall be tendered within usual port working hours by email or fax WIPON/WIBON/WIFPON/WICCON.
The Buyer shall be liable for any delay to discharge caused by failure to submit all necessary import documentation for cargo clearance, cargo receivers not being ready prior to the vessel''s arrival at the port of discharge, time lost waiting for berth/barges/trucks to receive the cargo and any other reason beyond the control of the Seller. The Seller shall be responsible for stevedoring only. All delay to count as detention at the demurrage rate agreed by both parties within the nomination of the vessel. Payment of detention shall fall due within 5 (five) banking days of presentation of a claim by the Seller by fax or email.
Transhipment not allowed.
Partial shipment allowed.
Part Products/Cargo allowed.
Option
All other conditions in accordance with the relevant charter party between the Seller and the Shipowner, the terms of which are hereby fully incorporated into this Sales Agreement.', incoterm_code = 'CFR', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cfr_lo_cqd_cfr', 'contract.clause', _id);

    -- clause_cfr_container_shipment_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_cfr_container_shipment_cfr' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'CFR - Container shipment' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type, cargo_mode)
        VALUES (0, now(), 'CFR - Container shipment', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the goods to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products to the vessel. After delivery the risk of loss or damage to the goods, as well as any additional costs due to events occurring after the time of delivery, are transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance against the Buyer''s risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then the Buyer must make his claim against the Carrier.
The Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made by that time, the Seller shall not be liable for any loss arising out of the transport documents as issued.
The date of the transport document (which will be a Bill of Lading unless otherwise agreed) shall be considered the date of shipment.
Shipment shall be made in containers, the Seller paying all due freight to the Shipping Line. Shipment is subject to the Shipping Line''s standard bill of lading terms (copy available on request) which terms are incorporated into this Sales Agreement.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Within 5 (five) working days after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by telex, email or fax:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of goods shipped.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall be responsible for all costs in relation to discharge, including but not limited to, the cost of stevedores, shore cranes, forklifts, trucks and lighters.
Containers may not be removed from the discharge port except with the consent of the Shipping Line.
The Buyer is solely responsible for payment to the Shipping Line of any container demurrage incurred after discharge of the goods in accordance with the Shipping Line''s standard rates.
The Buyer undertakes to return the container to the Shipping Line in the same good order and condition within the period established by Shipping Line after completion of discharge operation at the port of discharge.', 'CFR', 'vessel', 'container')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'CFR - Container shipment', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the goods to the Buyer on CFR basis in accordance with Incoterms 2010. Delivery shall take place when the Products are on board the vessel.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products to the vessel. After delivery the risk of loss or damage to the goods, as well as any additional costs due to events occurring after the time of delivery, are transferred from the Seller to the Buyer.
The Buyer shall procure marine insurance against the Buyer''s risk of loss or damage to the Products during the carriage of the Products from the port of loading to the port of discharge. However, carriage shall remain the responsibility of the Carrier. Should any claim arise in respect of the carriage of the Products then the Buyer must make his claim against the Carrier.
The Buyer shall notify the Seller in writing of any requests in relation to the form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made by that time, the Seller shall not be liable for any loss arising out of the transport documents as issued.
The date of the transport document (which will be a Bill of Lading unless otherwise agreed) shall be considered the date of shipment.
Shipment shall be made in containers, the Seller paying all due freight to the Shipping Line. Shipment is subject to the Shipping Line''s standard bill of lading terms (copy available on request) which terms are incorporated into this Sales Agreement.
The vessel''s operations at the port of loading shall be governed by the applicable regulations and customs of the port.
Within 5 (five) working days after the date of shipment the Seller or his agent in port shall notify the Buyer of the following information by telex, email or fax:
name and description of the vessel;
number and date of the transport document(s);
description and quantity of goods shipped.
All discharge port limits, restrictions including but not limited to LOA, beam, draft and air draft shall be at the Buyer''s risk and responsibility.
The Buyer shall be responsible for all costs in relation to discharge, including but not limited to, the cost of stevedores, shore cranes, forklifts, trucks and lighters.
Containers may not be removed from the discharge port except with the consent of the Shipping Line.
The Buyer is solely responsible for payment to the Shipping Line of any container demurrage incurred after discharge of the goods in accordance with the Shipping Line''s standard rates.
The Buyer undertakes to return the container to the Shipping Line in the same good order and condition within the period established by Shipping Line after completion of discharge operation at the port of discharge.', incoterm_code = 'CFR', transport_type = 'vessel', cargo_mode = 'container', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_cfr_container_shipment_cfr', 'contract.clause', _id);

    -- clause_fob_st_lsd_cqd_fob
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_fob_st_lsd_cqd_fob' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'FOB ST LSD - CQD' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'FOB ST LSD - CQD', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Subject to acceptance by the Seller of the vessel nominated by the Buyer and subject to arrival of that vessel at the port of loading within the agreed laycan, the Seller shall deliver the Products under this Sales Agreement to the Buyer on FOB basis in accordance with Incoterms 2010.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery all risks and responsibilities in relation to the Products shall be transferred from the Seller to the Buyer.
Upon fixing and at all times while engaging a vessel for shipment of the Products under this Sales Agreement the Buyer shall ensure in all respects compliance with the limitations at the port of loading in relation to the dimensions and permissible draft of the vessel, all local port customs and regulations including but not limited to those relating to ballasting/de-ballasting of the vessel.
The Seller shall serve on the Buyer by fax or email Notice of Readiness of the Products for shipment (i.e. the Seller''s NOR) and shall request nomination of a suitable vessel for shipment of the Products detailing the Sales Agreement/Addenda number, the product and quantity, the estimated laycan and the port of loading.
Within 15 (fifteen) days of service of the Seller''s NOR, the Buyer shall nominate a vessel suitable in all respects to load and carry the Products specified in the NOR.
The vessel shall be a single deck bulk carrier, or a modern open-hatch tween deck vessel with no stanchions or obstructions to loading, height of between deck space to be a minimum of 4.5m, with bridge/engine aft, hatch openings to be a minimum 1m longer than the length of the Products to be shipped, geared or gearless in the Buyer''s option.
At the time of nomination the Buyer shall provide by fax or email full particulars of the vessel to the Seller including:
the name and any former name of the vessel;
the flag, port of registry, year and month of build;
the deadweight, maximum draft, LOA, beam and air draft;
the number and size of holds and hatches;
the hatch and tank top dimensions, tank top strength;
the number and capacity of the vessel''s cranes/derricks/gear;
laycan (not to exceed a span of 5 days) and ETA at the port of loading;
load port agents and special shipping instructions (if any);
the classification society, P&I and hull insurers of the vessel;
the full style and contact details of the owners, operators and managers of the vessel;
the vessel shall hold a gear certificate in conformity with the Occupational Safety and Health (Dock Work) Convention 1979 or any statutory modification or re-enactment of the same, covering the duration of the voyage and confirming that all gear has been duly tested;
when reasonably required by any Port Authority of [x] at a loading port the Buyer shall nominate a vessel capable of following an ice breaker and, upon request at all necessary times, provide the following additional vessel particulars: Ice class (if any), engine power, material of propeller, stores on board.
It is a condition of this Sales Agreement that the Buyer warrants neither the carrying vessel nor any party involved in the ownership, management or operation of the carrying vessel is blacklisted or otherwise subject to any sanction of the UN, US, EU, OFAC, any other country or similar entity in place during the period of shipment of any goods pursuant to this Sales Agreement.
If the Seller has any basis to believe that a carrying vessel nominated by the Buyer may be blacklisted or subject to sanctions (whether reasonably held or not), the Seller shall have the right to reject the nominated vessel on this basis.
In the event of a breach of this condition the Seller shall be entitled to bring this Sales Agreement to an end without further obligation to the Buyer and without prejudice to any other remedies available to the Seller under this Sales Agreement or in law.
The Buyer shall indemnify the Seller against all and any losses whatsoever arising out of a breach of this condition.
Within 2 (two) working days from the date of receipt of the Buyer''s fax or email as aforesaid, the Seller shall respond to the Buyer by fax or email regarding the suitability and the laycan of the vessel nominated by the Buyer. If the vessel is rejected by the Seller or the port, the reason for the same shall be communicated by the Seller to the Buyer. In that event the Buyer shall nominate an alternative vessel in accordance with provisions set out above as soon as possible and in any event within 2 (two) working days of receiving the Seller''s reason for rejection.
The Buyer shall pay the costs of storing the Products at the port of loading from 15 (fifteen) days after tender of the Seller''s NOR in accordance with the below mentioned tariffs.
[x].
Storage costs must be paid by the Buyer in full [x] hours before commencement of loading. Any delay to loading caused by the Buyer''s failure to comply with this provision shall be for the Buyer''s account.
The Buyer shall in any event provide a vessel ready to load not later than [x] days after receipt of the Seller''s NOR. Should the Buyer fail to provide a vessel ready to load within such period, the Seller shall be at liberty to sell the Products and reimburse the Buyer from the proceeds of such sale any pre-payment received for the Products, following which all and any liability of the Seller under this Sales Agreement shall cease.
The Seller has the right to appoint an agent at the port of loading.
The Seller shall appoint stevedores to deliver the Products on FOB basis stowed, lashed, secured and dunnaged on board the vessel. The Seller''s stevedores shall be responsible for loading and separation of consignments in accordance with each lot / bill of lading under the supervision of the Master of the vessel, always in accordance with the prevailing customs and regulations of the port.
Where geared, the vessel shall provide free of charge use of cranes/derricks/gear and all power/equipment onboard required for loading including light to enable 24 (twenty-four) hour operations if required. All the vessel''s gear and equipment to be maintained in good working order and condition and able to load into all the hatches/holds to be used for loading the Products under this Sales Agreement.
The Buyer shall ensure that empty bottom or flat space in the holds shall be provided to allow the Seller''s stevedores to operate fork lifts.
The vessel''s operations at the port of loading and all/any charges levied in relation thereto shall be governed by the applicable regulations and customs of the port and shall be in compliance with terms and conditions of this Sales Agreement.
Where the Payment Conditions as stipulated under the Clause [x] of this Sales Agreement are under Letter of Credit the form of the transport documents shall be defined under the Letter of Credit itself. In the case of other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the required form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with this Clause the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The Master of the vessel shall make available all the hatches for loading of the Products as per the stowage plan agreed in advance with the Seller''s stevedores.
The Seller shall load the Products on CQD (Customary Quick Despatch) basis, as fast as is possible in the circumstances prevailing at the time of loading. No cause of action shall arise against the Seller for any delay except where caused by a lack of reasonable diligence by the Seller.
NOR at the port of loading shall be tendered by email or fax WIPON/WIBON/WIFPON/WICCON. NOR may not be tendered before commencement of the agreed laycan.
The time used by the vessel waiting for berth, proceeding from the anchorage or usual place of waiting to the berth, shifting within port limits, inward and outward formalities shall be for the account of the shipowner.
Time lost as a result of breakdown of or damage to the vessel, her machinery, equipment or gear, or any other fault of or condition attributable to the vessel, the shipowner, master or crew whatsoever, shall be for the account of the shipowner.
The Seller shall not be responsible for time lost by reason of any force majeure event and/or any cause preventing loading of the Products, including but not limited to those causes set out below:
war, rebellion, turnout, political disturbances, insurrection;
lockout, strikes, riots, civil commotions;
epidemics, quarantine, land-slips, floods, frost, ice, snow, boretides, bad weather
stoppage of work, whether partial or general, by workmen / long-shoremen / tug-boatmen or other hands essential to the working of the vessel or loading of the Products into the vessel;
accidents at the berth or wharf;
intervention of sanitary, customs and/or other constituted authorities;
closure or restrictions, whether partial or total, of rivers, channels and canals;
any other cause whatsoever beyond the control of the Seller.
All taxes and/or dues on the Products levied in the port of loading shall be for the Seller''s account. However, the Seller shall under no circumstances be liable under this Sales Agreement for any costs, charges, liabilities of whatsoever nature arising subsequent to the delivery of the Products on FOB basis including but not limited to, ocean freight, insurance premiums, port dues, taxes including income taxes, customs duties, discharging, transshipment or handling charges, levies and fees, if any, of whatsoever nature and kind payable or falling due at the time of or by reason of importation of the Products into the country of import.
Stevedore damage at the port of loading shall be settled directly between the Master and the stevedores. Any alleged damage must be notified by the Master in writing within 24 (twenty-four) hours of its occurrence.
Opening and closing of the vessel''s hatches shall always be done by the vessel''s crew provided local regulations permit the same. The cost involved therein and the time used shall be for the account of the vessel.
The Master of the vessel shall deliver to the representative or agent of the Seller the final stowage plan in triplicate duly signed by him immediately after completion of loading.
A mate''s receipt and, if applicable, a bill of lading shall be issued to the Seller, his representative or agent, not later than 24 (twenty-four) hours after completion of loading of the Products.
The vessel shall not carry any other cargo that may be hazardous to the Products sold and delivered under this Sales Agreement in the same hatches/holds offered to the Seller.
Partial shipment not allowed.
The date of the mate''s receipt shall be considered the date of delivery.', 'FOB', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'FOB ST LSD - CQD', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Subject to acceptance by the Seller of the vessel nominated by the Buyer and subject to arrival of that vessel at the port of loading within the agreed laycan, the Seller shall deliver the Products under this Sales Agreement to the Buyer on FOB basis in accordance with Incoterms 2010.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery all risks and responsibilities in relation to the Products shall be transferred from the Seller to the Buyer.
Upon fixing and at all times while engaging a vessel for shipment of the Products under this Sales Agreement the Buyer shall ensure in all respects compliance with the limitations at the port of loading in relation to the dimensions and permissible draft of the vessel, all local port customs and regulations including but not limited to those relating to ballasting/de-ballasting of the vessel.
The Seller shall serve on the Buyer by fax or email Notice of Readiness of the Products for shipment (i.e. the Seller''s NOR) and shall request nomination of a suitable vessel for shipment of the Products detailing the Sales Agreement/Addenda number, the product and quantity, the estimated laycan and the port of loading.
Within 15 (fifteen) days of service of the Seller''s NOR, the Buyer shall nominate a vessel suitable in all respects to load and carry the Products specified in the NOR.
The vessel shall be a single deck bulk carrier, or a modern open-hatch tween deck vessel with no stanchions or obstructions to loading, height of between deck space to be a minimum of 4.5m, with bridge/engine aft, hatch openings to be a minimum 1m longer than the length of the Products to be shipped, geared or gearless in the Buyer''s option.
At the time of nomination the Buyer shall provide by fax or email full particulars of the vessel to the Seller including:
the name and any former name of the vessel;
the flag, port of registry, year and month of build;
the deadweight, maximum draft, LOA, beam and air draft;
the number and size of holds and hatches;
the hatch and tank top dimensions, tank top strength;
the number and capacity of the vessel''s cranes/derricks/gear;
laycan (not to exceed a span of 5 days) and ETA at the port of loading;
load port agents and special shipping instructions (if any);
the classification society, P&I and hull insurers of the vessel;
the full style and contact details of the owners, operators and managers of the vessel;
the vessel shall hold a gear certificate in conformity with the Occupational Safety and Health (Dock Work) Convention 1979 or any statutory modification or re-enactment of the same, covering the duration of the voyage and confirming that all gear has been duly tested;
when reasonably required by any Port Authority of [x] at a loading port the Buyer shall nominate a vessel capable of following an ice breaker and, upon request at all necessary times, provide the following additional vessel particulars: Ice class (if any), engine power, material of propeller, stores on board.
It is a condition of this Sales Agreement that the Buyer warrants neither the carrying vessel nor any party involved in the ownership, management or operation of the carrying vessel is blacklisted or otherwise subject to any sanction of the UN, US, EU, OFAC, any other country or similar entity in place during the period of shipment of any goods pursuant to this Sales Agreement.
If the Seller has any basis to believe that a carrying vessel nominated by the Buyer may be blacklisted or subject to sanctions (whether reasonably held or not), the Seller shall have the right to reject the nominated vessel on this basis.
In the event of a breach of this condition the Seller shall be entitled to bring this Sales Agreement to an end without further obligation to the Buyer and without prejudice to any other remedies available to the Seller under this Sales Agreement or in law.
The Buyer shall indemnify the Seller against all and any losses whatsoever arising out of a breach of this condition.
Within 2 (two) working days from the date of receipt of the Buyer''s fax or email as aforesaid, the Seller shall respond to the Buyer by fax or email regarding the suitability and the laycan of the vessel nominated by the Buyer. If the vessel is rejected by the Seller or the port, the reason for the same shall be communicated by the Seller to the Buyer. In that event the Buyer shall nominate an alternative vessel in accordance with provisions set out above as soon as possible and in any event within 2 (two) working days of receiving the Seller''s reason for rejection.
The Buyer shall pay the costs of storing the Products at the port of loading from 15 (fifteen) days after tender of the Seller''s NOR in accordance with the below mentioned tariffs.
[x].
Storage costs must be paid by the Buyer in full [x] hours before commencement of loading. Any delay to loading caused by the Buyer''s failure to comply with this provision shall be for the Buyer''s account.
The Buyer shall in any event provide a vessel ready to load not later than [x] days after receipt of the Seller''s NOR. Should the Buyer fail to provide a vessel ready to load within such period, the Seller shall be at liberty to sell the Products and reimburse the Buyer from the proceeds of such sale any pre-payment received for the Products, following which all and any liability of the Seller under this Sales Agreement shall cease.
The Seller has the right to appoint an agent at the port of loading.
The Seller shall appoint stevedores to deliver the Products on FOB basis stowed, lashed, secured and dunnaged on board the vessel. The Seller''s stevedores shall be responsible for loading and separation of consignments in accordance with each lot / bill of lading under the supervision of the Master of the vessel, always in accordance with the prevailing customs and regulations of the port.
Where geared, the vessel shall provide free of charge use of cranes/derricks/gear and all power/equipment onboard required for loading including light to enable 24 (twenty-four) hour operations if required. All the vessel''s gear and equipment to be maintained in good working order and condition and able to load into all the hatches/holds to be used for loading the Products under this Sales Agreement.
The Buyer shall ensure that empty bottom or flat space in the holds shall be provided to allow the Seller''s stevedores to operate fork lifts.
The vessel''s operations at the port of loading and all/any charges levied in relation thereto shall be governed by the applicable regulations and customs of the port and shall be in compliance with terms and conditions of this Sales Agreement.
Where the Payment Conditions as stipulated under the Clause [x] of this Sales Agreement are under Letter of Credit the form of the transport documents shall be defined under the Letter of Credit itself. In the case of other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the required form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with this Clause the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The Master of the vessel shall make available all the hatches for loading of the Products as per the stowage plan agreed in advance with the Seller''s stevedores.
The Seller shall load the Products on CQD (Customary Quick Despatch) basis, as fast as is possible in the circumstances prevailing at the time of loading. No cause of action shall arise against the Seller for any delay except where caused by a lack of reasonable diligence by the Seller.
NOR at the port of loading shall be tendered by email or fax WIPON/WIBON/WIFPON/WICCON. NOR may not be tendered before commencement of the agreed laycan.
The time used by the vessel waiting for berth, proceeding from the anchorage or usual place of waiting to the berth, shifting within port limits, inward and outward formalities shall be for the account of the shipowner.
Time lost as a result of breakdown of or damage to the vessel, her machinery, equipment or gear, or any other fault of or condition attributable to the vessel, the shipowner, master or crew whatsoever, shall be for the account of the shipowner.
The Seller shall not be responsible for time lost by reason of any force majeure event and/or any cause preventing loading of the Products, including but not limited to those causes set out below:
war, rebellion, turnout, political disturbances, insurrection;
lockout, strikes, riots, civil commotions;
epidemics, quarantine, land-slips, floods, frost, ice, snow, boretides, bad weather
stoppage of work, whether partial or general, by workmen / long-shoremen / tug-boatmen or other hands essential to the working of the vessel or loading of the Products into the vessel;
accidents at the berth or wharf;
intervention of sanitary, customs and/or other constituted authorities;
closure or restrictions, whether partial or total, of rivers, channels and canals;
any other cause whatsoever beyond the control of the Seller.
All taxes and/or dues on the Products levied in the port of loading shall be for the Seller''s account. However, the Seller shall under no circumstances be liable under this Sales Agreement for any costs, charges, liabilities of whatsoever nature arising subsequent to the delivery of the Products on FOB basis including but not limited to, ocean freight, insurance premiums, port dues, taxes including income taxes, customs duties, discharging, transshipment or handling charges, levies and fees, if any, of whatsoever nature and kind payable or falling due at the time of or by reason of importation of the Products into the country of import.
Stevedore damage at the port of loading shall be settled directly between the Master and the stevedores. Any alleged damage must be notified by the Master in writing within 24 (twenty-four) hours of its occurrence.
Opening and closing of the vessel''s hatches shall always be done by the vessel''s crew provided local regulations permit the same. The cost involved therein and the time used shall be for the account of the vessel.
The Master of the vessel shall deliver to the representative or agent of the Seller the final stowage plan in triplicate duly signed by him immediately after completion of loading.
A mate''s receipt and, if applicable, a bill of lading shall be issued to the Seller, his representative or agent, not later than 24 (twenty-four) hours after completion of loading of the Products.
The vessel shall not carry any other cargo that may be hazardous to the Products sold and delivered under this Sales Agreement in the same hatches/holds offered to the Seller.
Partial shipment not allowed.
The date of the mate''s receipt shall be considered the date of delivery.', incoterm_code = 'FOB', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_fob_st_lsd_cqd_fob', 'contract.clause', _id);

    -- clause_fob_st_lsd_at_rate_fob
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_fob_st_lsd_at_rate_fob' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'FOB ST LSD - At Rate' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'FOB ST LSD - At Rate', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Subject to acceptance by the Seller of the vessel nominated by the Buyer and subject to arrival of that vessel at the port of loading within the agreed laycan, the Seller shall deliver the Products under this Sales Agreement to the Buyer on FOB basis in accordance with Incoterms 2010.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery all risks and responsibilities in relation to the Products shall be transferred from the Seller to the Buyer.
Upon fixing and at all times while engaging a vessel for shipment of the Products under this Sales Agreement the Buyer shall ensure in all respects compliance with the limitations at the port of loading in relation to the dimensions and permissible draft of the vessel, all local port customs and regulations including but not limited to those relating to ballasting/de-ballasting of the vessel.
The Seller shall serve on the Buyer by fax or email Notice of Readiness of the Products for shipment (i.e. the Seller''s NOR) and shall request nomination of a suitable vessel for shipment of the Products detailing the Sales Agreement/Addenda number, the product and quantity, the estimated laycan and the port of loading.
Within 15 (fifteen) days of service of the Seller''s NOR, the Buyer shall nominate a vessel suitable in all respects to load and carry the Products specified in the NOR.
The vessel shall be a single deck bulk carrier or a modern open-hatch tween deck vessel with no stanchions or obstructions to loading, height of between deck space to be a minimum of 4.5m, with bridge/engine aft, hatch openings to be a minimum 1m longer than the length of the Products to be shipped, geared or gearless in the Buyer''s option.
At the time of nomination the Buyer shall provide by fax or email full particulars of the vessel to the Seller including:
the name and any former name of the vessel;
the flag, port of registry, year and month of build;
the deadweight, maximum draft, LOA, beam and air draft;
the number and size of holds and hatches;
the hatch and tank top dimensions, tank top strength;
the number and capacity of the vessel''s cranes/derricks/gear;
laycan (not to exceed a span of 5 days) and ETA at the port of loading;
load port agents and special shipping instructions (if any);
load, demurrage and despatch rates;
the classification society, P&I and hull insurers of the vessel;
the full style and contact details of the owners, operators and managers of the vessel;
the vessel shall hold a gear certificate in conformity with the Occupational Safety and Health (Dock Work) Convention 1979 or any statutory modification or re-enactment of the same, covering the duration of the voyage and confirming that all gear has been duly tested;
when reasonably required by any Port Authority of [x] at a loading port the Buyer shall nominate a vessel capable of following an ice breaker and, upon request at all necessary times, provide the following additional vessel particulars: Ice class (if any), engine power, material of propeller, stores on board.
It is a condition of this Sales Agreement that the Buyer warrants neither the carrying vessel nor any party involved in the ownership, management or operation of the carrying vessel is blacklisted or otherwise subject to any sanction of the UN, US, EU, OFAC, any other country or similar entity in place during the period of shipment of any goods pursuant to this Sales Agreement.
If the Seller has any basis to believe that a carrying vessel nominated by the Buyer may be blacklisted or subject to sanctions (whether reasonably held or not), the Seller shall have the right to reject the nominated vessel on this basis.
In the event of a breach of this condition the Seller shall be entitled to bring this Sales Agreement to an end without further obligation to the Buyer and without prejudice to any other remedies available to the Seller under this Sales Agreement or in law.
The Buyer shall indemnify the Seller against all and any losses whatsoever arising out of a breach of this condition.
Within 2 (two) working days from the date of receipt of the Buyer''s fax or email as aforesaid, the Seller shall respond to the Buyer by fax or email regarding the suitability of the vessel and the laycan of the vessel nominated by the Buyer. If the vessel is rejected by the Seller or the port, the reason for the same shall be communicated by the Seller to the Buyer. In that event the Buyer shall nominate an alternative vessel in accordance with provisions set out above as soon as possible and in any event within 2 (two) working days of receiving the Seller''s reason for rejection.
The Buyer shall pay the costs of storing the Products at the port of loading from 15 (fifteen) days after tender of the Seller''s NOR in accordance with the below mentioned tariffs.
[x].
Storage costs must be paid by the Buyer in full [x] hours before commencement of loading. Any delay to loading caused by the Buyer''s failure to comply with this provision shall be for the Buyer''s account.
The Buyer shall in any event provide a vessel ready to load not later than [x] days after receipt of the Seller''s NOR. Should the Buyer fail to provide a vessel ready to load within such period, the Seller shall be at liberty to sell the Products and reimburse the Buyer from the proceeds of such sale any pre-payment received for the Products, following which all and any liability of the Seller under this Sales Agreement shall cease.
The Seller has the right to appoint an agent at the port of loading.
The Seller shall appoint stevedores to deliver the Products on FOB basis stowed, lashed, secured and dunnaged on board the vessel. The Seller''s stevedores shall be responsible for loading and separation of consignments in accordance with each lot / bill of lading under the supervision of the Master of the vessel, always in accordance with the prevailing customs and regulations of the port.
Where geared, the vessel shall provide free of charge use of cranes/derricks/gear and all power/equipment onboard required for loading including light to enable 24 (twenty-four) hours operations if required. All the vessel''s gear and equipment to be maintained in good working order and condition and able to load into all the hatches/holds to be used for loading the Products under this Sales Agreement.
On arrival of the vessel nominated by the Buyer at the port of loading, if the Seller considers that the cranes/derricks/gear of the vessel are not capable of lifting the Products of the weights and dimensions indicated in the Sales Agreement, as a result of which the vessel may not be capable of maintaining the loading rate guaranteed by the Seller in this Sales Agreement, the Seller may appoint an independent marine surveyor at the port of loading to investigate and to assess the capabilities of the cranes/derricks/gear of the vessel and to establish the effective rate of loading which the vessel is capable of maintaining. The findings of the independent marine surveyor shall be final and binding on both the Buyer and the Seller. All survey costs incurred in this regard shall be for the Buyer''s account.
According to the findings of the independent marine surveyor as aforesaid, if the vessel is not found to be capable of maintaining the loading rate guaranteed by the Seller in this Sales Agreement, the effective rate of loading which the vessel is in fact found to be capable of maintaining, as per the findings of the independent marine surveyor, shall be recorded in the Statement of Facts. Computation of laytime used shall be based on the rate of loading as assessed by the independent marine surveyor instead of that agreed elsewhere in this Sales Agreement.
The Buyer shall ensure that empty bottom or flat space in the holds shall be provided to allow the Seller''s stevedores to operate fork lifts.
The vessel''s operations at the port of loading and all/any charges levied in relation thereto shall be governed by the applicable regulations and customs of the port and shall be in compliance with terms and conditions of this Sales Agreement.
Where the Payment Conditions as stipulated under Clause [x] of this Sales Agreement are under Letter of Credit the form of the transport documents shall be defined under the Letter of Credit itself. In the case of other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the required form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with this Clause the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The Master of the vessel shall make available all the hatches for loading of the Products as per the stowage plan agreed in advance with the Seller''s stevedores.
The Seller shall load the Products at the rate of [x] mt per weather working day as agreed at the time of acceptance of the nominated vessel by the Seller.
NOR at the port of loading shall be tendered by email or fax WIPON/WIBON/WIFPON/WICCON. NOR may not be tendered before commencement of the agreed laycan.
Laytime shall run from 1300 if the Master''s NOR is validly tendered before noon and from 0800 the next day if notice is validly tendered after noon. Saturday from 1400, Sundays and holidays until Monday 0800 or the day following a holiday 0800 shall not count as laytime or demurrage even if used.
The time used by the vessel in proceeding from the anchorage or usual place of waiting to the berth shall not count as laytime or demurrage.
Time lost shifting within the port limits shall not count as laytime or demurrage.
Time lost waiting for berth, inward and outward formalities, shall not count as laytime or demurrage.
Time lost as a result of breakdown of or damage to the vessel, her machinery, equipment or gear, or any other fault of or condition attributable to the vessel, the shipowner, master or crew whatsoever, shall not count as laytime or demurrage.
Time lost by reason of any force majeure event and/or any cause preventing loading of the Products, including but not limited to those causes set out below, shall not count as laytime or demurrage:
war, rebellion, turnout, political disturbances, insurrection;
lockout, strikes, riots, civil commotions;
epidemics, quarantine, land-slips, floods, frost, ice, snow, boretides, bad weather;
stoppage of work, whether partial or general, by workmen / long-shoremen / tug-boatmen or other hands essential to the working of the vessel or loading of the Products into the vessel;
accidents at the berth or wharf;
intervention of sanitary, customs and/or other constituted authorities;
closure or restrictions, whether partial or total, of rivers, channels and canals;
any other cause whatsoever beyond the control of the Seller.
The computation of laytime allowed and used shall be based on the provisions set out in this Sales Agreement. The rate of demurrage shall be agreed at the time of acceptance of the nominated vessel by the Seller. Despatch for all time saved shall be payable by the Buyer at half the demurrage rate.
The Seller shall remit to the Buyer any undisputed demurrage falling due under this Sales Agreement within 30 (thirty) days from the date of receipt of the claim together with all supporting documents (NOR, SOF and time sheet) from the Buyer. The Buyer shall remit to the Seller any despatch falling due under this Sales Agreement within 30 (thirty) days from the date of receipt of the claim together with supporting documents (NOR, SOF and time sheet) from the Seller.
Overtime shall be for the account of the party ordering the same, unless ordered by the port, in which case overtime shall be for the Seller''s account. Overtime of the officers and crew shall be for the Buyer''s account in any event.
All taxes and/or dues on the Products levied in the port of loading shall be for the Seller''s account. However, the Seller shall under no circumstances be liable under this Sales Agreement for any costs, charges, liabilities of whatsoever nature arising subsequent to the delivery of the Products on FOB basis including but not limited to, ocean freight, insurance premiums, port dues, taxes including income taxes, customs duties, discharging, transshipment or handling charges, levies and fees, if any, of whatsoever nature and kind payable or falling due at the time of or by reason of importation of the Products into the country of import.
Stevedore damage at the port of loading shall be settled directly between the Master and the stevedores. Any alleged damage must be notified by the Master in writing within 24 (twenty-four) hours of its occurrence.
Opening and closing of the vessel''s hatches shall always be done by the vessel''s crew provided local regulations permit the same. The cost involved therein and the time used shall be for the account of the vessel.
The Master of the vessel shall deliver to the representative or agent of the Seller the final stowage plan in triplicate duly signed by him immediately after completion of loading.
A mate''s receipt and, if applicable, a bill of lading shall be issued to the Seller, his representative or agent, not later than 24 (twenty-four) hours after completion of loading of the Products.
The vessel shall not carry any other cargo that may be hazardous to the Products sold and delivered under this Sales Agreement in the same hatches/holds offered to the Seller.
Partial shipment not allowed.
The date of the mate''s receipt shall be considered the date of delivery.', 'FOB', 'vessel')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'FOB ST LSD - At Rate', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Subject to acceptance by the Seller of the vessel nominated by the Buyer and subject to arrival of that vessel at the port of loading within the agreed laycan, the Seller shall deliver the Products under this Sales Agreement to the Buyer on FOB basis in accordance with Incoterms 2010.
The Seller''s responsibility in connection with the Products shall cease upon delivery of the Products on board the vessel. After delivery all risks and responsibilities in relation to the Products shall be transferred from the Seller to the Buyer.
Upon fixing and at all times while engaging a vessel for shipment of the Products under this Sales Agreement the Buyer shall ensure in all respects compliance with the limitations at the port of loading in relation to the dimensions and permissible draft of the vessel, all local port customs and regulations including but not limited to those relating to ballasting/de-ballasting of the vessel.
The Seller shall serve on the Buyer by fax or email Notice of Readiness of the Products for shipment (i.e. the Seller''s NOR) and shall request nomination of a suitable vessel for shipment of the Products detailing the Sales Agreement/Addenda number, the product and quantity, the estimated laycan and the port of loading.
Within 15 (fifteen) days of service of the Seller''s NOR, the Buyer shall nominate a vessel suitable in all respects to load and carry the Products specified in the NOR.
The vessel shall be a single deck bulk carrier or a modern open-hatch tween deck vessel with no stanchions or obstructions to loading, height of between deck space to be a minimum of 4.5m, with bridge/engine aft, hatch openings to be a minimum 1m longer than the length of the Products to be shipped, geared or gearless in the Buyer''s option.
At the time of nomination the Buyer shall provide by fax or email full particulars of the vessel to the Seller including:
the name and any former name of the vessel;
the flag, port of registry, year and month of build;
the deadweight, maximum draft, LOA, beam and air draft;
the number and size of holds and hatches;
the hatch and tank top dimensions, tank top strength;
the number and capacity of the vessel''s cranes/derricks/gear;
laycan (not to exceed a span of 5 days) and ETA at the port of loading;
load port agents and special shipping instructions (if any);
load, demurrage and despatch rates;
the classification society, P&I and hull insurers of the vessel;
the full style and contact details of the owners, operators and managers of the vessel;
the vessel shall hold a gear certificate in conformity with the Occupational Safety and Health (Dock Work) Convention 1979 or any statutory modification or re-enactment of the same, covering the duration of the voyage and confirming that all gear has been duly tested;
when reasonably required by any Port Authority of [x] at a loading port the Buyer shall nominate a vessel capable of following an ice breaker and, upon request at all necessary times, provide the following additional vessel particulars: Ice class (if any), engine power, material of propeller, stores on board.
It is a condition of this Sales Agreement that the Buyer warrants neither the carrying vessel nor any party involved in the ownership, management or operation of the carrying vessel is blacklisted or otherwise subject to any sanction of the UN, US, EU, OFAC, any other country or similar entity in place during the period of shipment of any goods pursuant to this Sales Agreement.
If the Seller has any basis to believe that a carrying vessel nominated by the Buyer may be blacklisted or subject to sanctions (whether reasonably held or not), the Seller shall have the right to reject the nominated vessel on this basis.
In the event of a breach of this condition the Seller shall be entitled to bring this Sales Agreement to an end without further obligation to the Buyer and without prejudice to any other remedies available to the Seller under this Sales Agreement or in law.
The Buyer shall indemnify the Seller against all and any losses whatsoever arising out of a breach of this condition.
Within 2 (two) working days from the date of receipt of the Buyer''s fax or email as aforesaid, the Seller shall respond to the Buyer by fax or email regarding the suitability of the vessel and the laycan of the vessel nominated by the Buyer. If the vessel is rejected by the Seller or the port, the reason for the same shall be communicated by the Seller to the Buyer. In that event the Buyer shall nominate an alternative vessel in accordance with provisions set out above as soon as possible and in any event within 2 (two) working days of receiving the Seller''s reason for rejection.
The Buyer shall pay the costs of storing the Products at the port of loading from 15 (fifteen) days after tender of the Seller''s NOR in accordance with the below mentioned tariffs.
[x].
Storage costs must be paid by the Buyer in full [x] hours before commencement of loading. Any delay to loading caused by the Buyer''s failure to comply with this provision shall be for the Buyer''s account.
The Buyer shall in any event provide a vessel ready to load not later than [x] days after receipt of the Seller''s NOR. Should the Buyer fail to provide a vessel ready to load within such period, the Seller shall be at liberty to sell the Products and reimburse the Buyer from the proceeds of such sale any pre-payment received for the Products, following which all and any liability of the Seller under this Sales Agreement shall cease.
The Seller has the right to appoint an agent at the port of loading.
The Seller shall appoint stevedores to deliver the Products on FOB basis stowed, lashed, secured and dunnaged on board the vessel. The Seller''s stevedores shall be responsible for loading and separation of consignments in accordance with each lot / bill of lading under the supervision of the Master of the vessel, always in accordance with the prevailing customs and regulations of the port.
Where geared, the vessel shall provide free of charge use of cranes/derricks/gear and all power/equipment onboard required for loading including light to enable 24 (twenty-four) hours operations if required. All the vessel''s gear and equipment to be maintained in good working order and condition and able to load into all the hatches/holds to be used for loading the Products under this Sales Agreement.
On arrival of the vessel nominated by the Buyer at the port of loading, if the Seller considers that the cranes/derricks/gear of the vessel are not capable of lifting the Products of the weights and dimensions indicated in the Sales Agreement, as a result of which the vessel may not be capable of maintaining the loading rate guaranteed by the Seller in this Sales Agreement, the Seller may appoint an independent marine surveyor at the port of loading to investigate and to assess the capabilities of the cranes/derricks/gear of the vessel and to establish the effective rate of loading which the vessel is capable of maintaining. The findings of the independent marine surveyor shall be final and binding on both the Buyer and the Seller. All survey costs incurred in this regard shall be for the Buyer''s account.
According to the findings of the independent marine surveyor as aforesaid, if the vessel is not found to be capable of maintaining the loading rate guaranteed by the Seller in this Sales Agreement, the effective rate of loading which the vessel is in fact found to be capable of maintaining, as per the findings of the independent marine surveyor, shall be recorded in the Statement of Facts. Computation of laytime used shall be based on the rate of loading as assessed by the independent marine surveyor instead of that agreed elsewhere in this Sales Agreement.
The Buyer shall ensure that empty bottom or flat space in the holds shall be provided to allow the Seller''s stevedores to operate fork lifts.
The vessel''s operations at the port of loading and all/any charges levied in relation thereto shall be governed by the applicable regulations and customs of the port and shall be in compliance with terms and conditions of this Sales Agreement.
Where the Payment Conditions as stipulated under Clause [x] of this Sales Agreement are under Letter of Credit the form of the transport documents shall be defined under the Letter of Credit itself. In the case of other payment conditions the Buyer shall notify the Seller in writing of any requests in relation to the required form of the transport documents at least 3 (three) working days prior to commencement of loading of the vessel. If such requests are not made in compliance with this Clause the Seller shall not be liable for any loss arising out of the form of the transport documents as issued.
The Master of the vessel shall make available all the hatches for loading of the Products as per the stowage plan agreed in advance with the Seller''s stevedores.
The Seller shall load the Products at the rate of [x] mt per weather working day as agreed at the time of acceptance of the nominated vessel by the Seller.
NOR at the port of loading shall be tendered by email or fax WIPON/WIBON/WIFPON/WICCON. NOR may not be tendered before commencement of the agreed laycan.
Laytime shall run from 1300 if the Master''s NOR is validly tendered before noon and from 0800 the next day if notice is validly tendered after noon. Saturday from 1400, Sundays and holidays until Monday 0800 or the day following a holiday 0800 shall not count as laytime or demurrage even if used.
The time used by the vessel in proceeding from the anchorage or usual place of waiting to the berth shall not count as laytime or demurrage.
Time lost shifting within the port limits shall not count as laytime or demurrage.
Time lost waiting for berth, inward and outward formalities, shall not count as laytime or demurrage.
Time lost as a result of breakdown of or damage to the vessel, her machinery, equipment or gear, or any other fault of or condition attributable to the vessel, the shipowner, master or crew whatsoever, shall not count as laytime or demurrage.
Time lost by reason of any force majeure event and/or any cause preventing loading of the Products, including but not limited to those causes set out below, shall not count as laytime or demurrage:
war, rebellion, turnout, political disturbances, insurrection;
lockout, strikes, riots, civil commotions;
epidemics, quarantine, land-slips, floods, frost, ice, snow, boretides, bad weather;
stoppage of work, whether partial or general, by workmen / long-shoremen / tug-boatmen or other hands essential to the working of the vessel or loading of the Products into the vessel;
accidents at the berth or wharf;
intervention of sanitary, customs and/or other constituted authorities;
closure or restrictions, whether partial or total, of rivers, channels and canals;
any other cause whatsoever beyond the control of the Seller.
The computation of laytime allowed and used shall be based on the provisions set out in this Sales Agreement. The rate of demurrage shall be agreed at the time of acceptance of the nominated vessel by the Seller. Despatch for all time saved shall be payable by the Buyer at half the demurrage rate.
The Seller shall remit to the Buyer any undisputed demurrage falling due under this Sales Agreement within 30 (thirty) days from the date of receipt of the claim together with all supporting documents (NOR, SOF and time sheet) from the Buyer. The Buyer shall remit to the Seller any despatch falling due under this Sales Agreement within 30 (thirty) days from the date of receipt of the claim together with supporting documents (NOR, SOF and time sheet) from the Seller.
Overtime shall be for the account of the party ordering the same, unless ordered by the port, in which case overtime shall be for the Seller''s account. Overtime of the officers and crew shall be for the Buyer''s account in any event.
All taxes and/or dues on the Products levied in the port of loading shall be for the Seller''s account. However, the Seller shall under no circumstances be liable under this Sales Agreement for any costs, charges, liabilities of whatsoever nature arising subsequent to the delivery of the Products on FOB basis including but not limited to, ocean freight, insurance premiums, port dues, taxes including income taxes, customs duties, discharging, transshipment or handling charges, levies and fees, if any, of whatsoever nature and kind payable or falling due at the time of or by reason of importation of the Products into the country of import.
Stevedore damage at the port of loading shall be settled directly between the Master and the stevedores. Any alleged damage must be notified by the Master in writing within 24 (twenty-four) hours of its occurrence.
Opening and closing of the vessel''s hatches shall always be done by the vessel''s crew provided local regulations permit the same. The cost involved therein and the time used shall be for the account of the vessel.
The Master of the vessel shall deliver to the representative or agent of the Seller the final stowage plan in triplicate duly signed by him immediately after completion of loading.
A mate''s receipt and, if applicable, a bill of lading shall be issued to the Seller, his representative or agent, not later than 24 (twenty-four) hours after completion of loading of the Products.
The vessel shall not carry any other cargo that may be hazardous to the Products sold and delivered under this Sales Agreement in the same hatches/holds offered to the Seller.
Partial shipment not allowed.
The date of the mate''s receipt shall be considered the date of delivery.', incoterm_code = 'FOB', transport_type = 'vessel', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_fob_st_lsd_at_rate_fob', 'contract.clause', _id);

    -- clause_daf_daf
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_daf_daf' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'DAF' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'DAF', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products under this Sales Agreement to the Buyer on DAF basis as per Incoterms 2000. Delivery date shall be in accordance with the same terms.
Transport Instructions shall be presented by the Buyer to the Seller within 7 (seven) days from the moment of the signature of the present Sales Agreement.
The Buyer shall provide to the Seller, within 7 (seven) days from the signature of the present Sales Agreement, the following information:
name of consignee;
country of destination;
cross-border station;
station of final destination.
The Buyer shall present transport instructions according to the rules and requirements of SMGS. Transport instruction shall include the following obligatory information:
paragraph 5: consignee;
paragraph 4: forwarder on the cross boarder;
paragraph 7: cross-border station(s);
paragraph 8: station of final destination;
paragraph 20: payment of transit (in case of transit through third countries). The Seller shall advise the Buyer with the number of request from Russian railway authorities for transportation plan, and the Buyer shall get the written acceptance of consignee upon the aforementioned request.
Upon each shipment of the Products from the works the Seller shall advise, within 48 (fourty-eight) hours, the Buyer with the following information:
number of railway cars and Railway Bill(s);
quantity of shipped Products;
specification number of shipped Products;
date of shipment.
Upon final shipment of the Products from the works the Seller shall advise the Buyer within 2 (two) working days with the above details and total quantity of the Products shipped from the works under the present Sales Agreement.
The date of stamp of the loading station/point in the transport/shipping documents is to be considered as the shipment date.', 'DAF', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'DAF', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products under this Sales Agreement to the Buyer on DAF basis as per Incoterms 2000. Delivery date shall be in accordance with the same terms.
Transport Instructions shall be presented by the Buyer to the Seller within 7 (seven) days from the moment of the signature of the present Sales Agreement.
The Buyer shall provide to the Seller, within 7 (seven) days from the signature of the present Sales Agreement, the following information:
name of consignee;
country of destination;
cross-border station;
station of final destination.
The Buyer shall present transport instructions according to the rules and requirements of SMGS. Transport instruction shall include the following obligatory information:
paragraph 5: consignee;
paragraph 4: forwarder on the cross boarder;
paragraph 7: cross-border station(s);
paragraph 8: station of final destination;
paragraph 20: payment of transit (in case of transit through third countries). The Seller shall advise the Buyer with the number of request from Russian railway authorities for transportation plan, and the Buyer shall get the written acceptance of consignee upon the aforementioned request.
Upon each shipment of the Products from the works the Seller shall advise, within 48 (fourty-eight) hours, the Buyer with the following information:
number of railway cars and Railway Bill(s);
quantity of shipped Products;
specification number of shipped Products;
date of shipment.
Upon final shipment of the Products from the works the Seller shall advise the Buyer within 2 (two) working days with the above details and total quantity of the Products shipped from the works under the present Sales Agreement.
The date of stamp of the loading station/point in the transport/shipping documents is to be considered as the shipment date.', incoterm_code = 'DAF', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_daf_daf', 'contract.clause', _id);

    -- clause_dap_dap
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_dap_dap' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'DAP' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text, incoterm_code, transport_type)
        VALUES (0, now(), 'DAP', 'transport', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Seller shall deliver the Products under this Sales Agreement to the Buyer on DAP basis as per Incoterms 2010. Delivery date shall be in accordance with the same terms.
Transport Instructions shall be presented by the Buyer to the Seller within 7 (seven) days from the moment of the signature of the present Sales Agreement.
The Buyer shall provide to the Seller, within 7 (seven) days from the signature of the present Sales Agreement, the following information:
name of consignee;
country of destination;
cross-border station;
station of final destination.
The Buyer shall present transport instructions according to the rules and requirements of SMGS. Transport instructions shall include the following obligatory information:
paragraph 5: consignee;
paragraph 4: forwarder on the cross-border;
paragraph 7: cross-border station(s);
paragraph 8: station of final destination;
paragraph 20: payment of transit (in case of transit through third countries).
The Seller shall advise the Buyer with the number of request from Russian railway authorities for transportation plan, and the Buyer shall get the written acceptance of consignee upon the aforementioned request.
Upon each shipment of the Products from the works the Seller shall advise, within 48 (fourty-eight) hours, the Buyer with the following information:
Numbers of railway cars and Railway Bill(s);
quantity of shipped Products;
specification number of shipped Products;
date of shipment.
Upon final shipment of the Products from the works the Seller shall advise the Buyer within 2 (two) working days with the above details and total quantity of the Products shipped from the works under the present Sales Agreement.
The date of stamp of the loading station/point in the transport/shipping documents is to be considered as the shipment date.', 'DAP', 'truck')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'DAP', category = 'transport', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Seller shall deliver the Products under this Sales Agreement to the Buyer on DAP basis as per Incoterms 2010. Delivery date shall be in accordance with the same terms.
Transport Instructions shall be presented by the Buyer to the Seller within 7 (seven) days from the moment of the signature of the present Sales Agreement.
The Buyer shall provide to the Seller, within 7 (seven) days from the signature of the present Sales Agreement, the following information:
name of consignee;
country of destination;
cross-border station;
station of final destination.
The Buyer shall present transport instructions according to the rules and requirements of SMGS. Transport instructions shall include the following obligatory information:
paragraph 5: consignee;
paragraph 4: forwarder on the cross-border;
paragraph 7: cross-border station(s);
paragraph 8: station of final destination;
paragraph 20: payment of transit (in case of transit through third countries).
The Seller shall advise the Buyer with the number of request from Russian railway authorities for transportation plan, and the Buyer shall get the written acceptance of consignee upon the aforementioned request.
Upon each shipment of the Products from the works the Seller shall advise, within 48 (fourty-eight) hours, the Buyer with the following information:
Numbers of railway cars and Railway Bill(s);
quantity of shipped Products;
specification number of shipped Products;
date of shipment.
Upon final shipment of the Products from the works the Seller shall advise the Buyer within 2 (two) working days with the above details and total quantity of the Products shipped from the works under the present Sales Agreement.
The date of stamp of the loading station/point in the transport/shipping documents is to be considered as the shipment date.', incoterm_code = 'DAP', transport_type = 'truck', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_dap_dap', 'contract.clause', _id);

    -- clause_anti_dumping
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_anti_dumping' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Anti-Dumping' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Anti-Dumping', 'tax', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Buyer shall remain fully responsible for observing anti-dumping norms, rules and procedures in its own national market and/or any other market(s) in which it may sell the Products. The Buyer agrees not to sell the Products at prices which may be regarded as being at a dumping level under the laws of [x] and international agreements current at the date of this Sales Agreement and applicable to the country to be supplied. It is expressly agreed between the Parties that the Buyer alone shall be the defendant in the event of any suit or claim should the Seller and/or its supplier become involved in anti-dumping proceedings commenced in/or by a country to which the Buyer has supplied, the Buyer shall indemnify the Seller and/or its supplier against all and any costs and expenses incurred in relation thereto.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Anti-Dumping', category = 'tax', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Buyer shall remain fully responsible for observing anti-dumping norms, rules and procedures in its own national market and/or any other market(s) in which it may sell the Products. The Buyer agrees not to sell the Products at prices which may be regarded as being at a dumping level under the laws of [x] and international agreements current at the date of this Sales Agreement and applicable to the country to be supplied. It is expressly agreed between the Parties that the Buyer alone shall be the defendant in the event of any suit or claim should the Seller and/or its supplier become involved in anti-dumping proceedings commenced in/or by a country to which the Buyer has supplied, the Buyer shall indemnify the Seller and/or its supplier against all and any costs and expenses incurred in relation thereto.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_anti_dumping', 'contract.clause', _id);

    -- clause_risk_and_ownership
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_risk_and_ownership' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Risk and Ownership' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Risk and Ownership', 'title_transfer', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Risk and responsibility for the Products shall pass from the Seller to the Buyer in accordance with the [x] incorporated into this Sales Agreement.
Ownership of the Products shall not pass to the Buyer until the Seller has received payment in full of the Total Value of the Products due to be paid by the Buyer to the Seller under this Sales Agreement and after delivery of the Products as per conditions under this Sales Agreement.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Risk and Ownership', category = 'title_transfer', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Risk and responsibility for the Products shall pass from the Seller to the Buyer in accordance with the [x] incorporated into this Sales Agreement.
Ownership of the Products shall not pass to the Buyer until the Seller has received payment in full of the Total Value of the Products due to be paid by the Buyer to the Seller under this Sales Agreement and after delivery of the Products as per conditions under this Sales Agreement.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_risk_and_ownership', 'contract.clause', _id);

    -- clause_confidentiality
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_confidentiality' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Confidentiality' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Confidentiality', 'other', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Each Party undertakes to keep confidential all information in any form or medium, whether or not specifically labeled or identified as confidential, concerning the business and affairs of the other which it has obtained or received as a result of discussions leading up to or during the course of their activities connected with this Sales Agreement, except any information which is:
required to be disclosed by law, by any competent regulatory authority, by notice or otherwise; or
already in its possession and not acquired directly or indirectly from the disclosing Party; or
becomes publicly known through no fault or omission attributable to the receiving Party; or
rightfully acquired by the receiving Party from third party sources independent to the disclosing party through no wrongful act on the part of the receiving Party or such third party sources.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Confidentiality', category = 'other', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Each Party undertakes to keep confidential all information in any form or medium, whether or not specifically labeled or identified as confidential, concerning the business and affairs of the other which it has obtained or received as a result of discussions leading up to or during the course of their activities connected with this Sales Agreement, except any information which is:
required to be disclosed by law, by any competent regulatory authority, by notice or otherwise; or
already in its possession and not acquired directly or indirectly from the disclosing Party; or
becomes publicly known through no fault or omission attributable to the receiving Party; or
rightfully acquired by the receiving Party from third party sources independent to the disclosing party through no wrongful act on the part of the receiving Party or such third party sources.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_confidentiality', 'contract.clause', _id);

    -- clause_buyer_s_default
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_buyer_s_default' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Buyer''s Default' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Buyer''s Default', 'other', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The Buyer shall be in default of this Sales Agreement upon the occurrence of any of the following events:
the Buyer fails to make any payment under this Sales Agreement as it falls due or to comply with any other material condition of this Sales Agreement; and/or
the Buyer becomes insolvent or unable to pay its debts as they mature or is generally not paying its debts as they mature; and/or
the Buyer makes a general assignment for the benefit of its creditors without authorization of the Seller; and/or
a trustee, receiver or other custodian is appointed in relation to the Products and/or all or a substantial portion of the Buyer''s property.
If the Buyer is in default hereunder, the Seller shall, in addition to any other rights available to it by law, have the contractual right to take immediately one or more of the following steps:
cease or suspend its performance under this Sales Agreement;
terminate this Sales Agreement in relation to any undelivered Products;
declare immediately due and owing, without demand or notice of any kind, the entire outstanding balance due from the Buyer for the Products already delivered under this Sales Agreement, whereupon the same shall become immediately due and owing;
recover without limitation all and any losses arising from the Buyer''s default, interest and legal costs, including the costs of any enforcement proceedings;
exercise a lien over, withhold delivery or stop the Products in transit until the Buyer has paid in full all amounts due and owing, (whether such right would otherwise exist by law or not);
re-sell the Products;
repossess the Products. The Buyer hereby waives all and any rights to notice and/or a hearing prior to repossession or seizure of the Products.
The Seller''s rights hereunder shall be cumulative to all and any other rights available to the Seller by law.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Buyer''s Default', category = 'other', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The Buyer shall be in default of this Sales Agreement upon the occurrence of any of the following events:
the Buyer fails to make any payment under this Sales Agreement as it falls due or to comply with any other material condition of this Sales Agreement; and/or
the Buyer becomes insolvent or unable to pay its debts as they mature or is generally not paying its debts as they mature; and/or
the Buyer makes a general assignment for the benefit of its creditors without authorization of the Seller; and/or
a trustee, receiver or other custodian is appointed in relation to the Products and/or all or a substantial portion of the Buyer''s property.
If the Buyer is in default hereunder, the Seller shall, in addition to any other rights available to it by law, have the contractual right to take immediately one or more of the following steps:
cease or suspend its performance under this Sales Agreement;
terminate this Sales Agreement in relation to any undelivered Products;
declare immediately due and owing, without demand or notice of any kind, the entire outstanding balance due from the Buyer for the Products already delivered under this Sales Agreement, whereupon the same shall become immediately due and owing;
recover without limitation all and any losses arising from the Buyer''s default, interest and legal costs, including the costs of any enforcement proceedings;
exercise a lien over, withhold delivery or stop the Products in transit until the Buyer has paid in full all amounts due and owing, (whether such right would otherwise exist by law or not);
re-sell the Products;
repossess the Products. The Buyer hereby waives all and any rights to notice and/or a hearing prior to repossession or seizure of the Products.
The Seller''s rights hereunder shall be cumulative to all and any other rights available to the Seller by law.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_buyer_s_default', 'contract.clause', _id);

    -- clause_liquidated_damages
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_liquidated_damages' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Liquidated Damages' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Liquidated Damages', 'other', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Should the Buyer be in default within the meaning of Clause [x] "Buyer''s Default", the Seller shall be entitled to liquidated lump-sum damages at a rate of 20% of the Total Value of the Products.
The Parties expressly agree, that:
such liquidated damages are a genuine estimate of the commercial losses suffered by the Seller and are not a penalty; and
the said liquidated damages can be enforced before the relevant court or arbitration tribunal. This clause shall not apply in relation of demurrage claims.
The Buyer undertakes to proceed with the payment of the liquidated damages within 10 calendar days after the date of the corresponding debit note issued by the Seller.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Liquidated Damages', category = 'other', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Should the Buyer be in default within the meaning of Clause [x] "Buyer''s Default", the Seller shall be entitled to liquidated lump-sum damages at a rate of 20% of the Total Value of the Products.
The Parties expressly agree, that:
such liquidated damages are a genuine estimate of the commercial losses suffered by the Seller and are not a penalty; and
the said liquidated damages can be enforced before the relevant court or arbitration tribunal. This clause shall not apply in relation of demurrage claims.
The Buyer undertakes to proceed with the payment of the liquidated damages within 10 calendar days after the date of the corresponding debit note issued by the Seller.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_liquidated_damages', 'contract.clause', _id);

    -- clause_impossibility_of_supply_and_shipment_carriage
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_impossibility_of_supply_and_shipment_carriage' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Impossibility of Supply and Shipment/Carriage' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Impossibility of Supply and Shipment/Carriage', 'other', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'In the event of a problem with supply of raw materials, non-performance by the Producing Mill, unavailability of transport means or any other cause whatsoever beyond the Seller''s control which makes it impossible for the Seller to supply in time or at all the Products to the Buyer, the Seller shall be released from all and any responsibility for a failure to supply (partially or wholly) or a delay in supply. In such circumstances, the time for fulfillment of the Seller''s obligations under this Sales Agreement shall be extended for the period during which such circumstances last (and the Buyer shall, if necessary, extend the letter of credit during such period). Alternatively, the Seller may choose to treat this Sales Agreement as being brought to an end by such circumstances and shall be under no further liability under this Sales Agreement whatsoever.
In the event that the loading port is frozen and not accessible due to ice situation within all shipment period by vessel on her own or with any special assistance (tugs, ice-breakers) or due to waiting for convoy, ice-breakers, turn in connection with such ice situation, the time allowed for shipment shall be extended for the same period, without any Sellers'' liability or reimbursement from their side. In case the loading port is still not accessible due to ice situation by vessel in ordinary and customarily way within the extended shipment period, the shipment period shall be extended till the termination of such cause which also means the necessity to wait on roads for convoy, ice-breakers, turn, without any Sellers'' liability or reimbursement from their side. In such circumstances, the Buyer shall extend the letter of credit during such period of shipment extension.
Where appropriate and feasible, the confirmation/verification issued by Chamber of Commerce and Industry (CCI) or any other relevant authority of the country where such circumstance occurs, shall be conclusive evidence of the existence of such circumstances and their duration.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Impossibility of Supply and Shipment/Carriage', category = 'other', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'In the event of a problem with supply of raw materials, non-performance by the Producing Mill, unavailability of transport means or any other cause whatsoever beyond the Seller''s control which makes it impossible for the Seller to supply in time or at all the Products to the Buyer, the Seller shall be released from all and any responsibility for a failure to supply (partially or wholly) or a delay in supply. In such circumstances, the time for fulfillment of the Seller''s obligations under this Sales Agreement shall be extended for the period during which such circumstances last (and the Buyer shall, if necessary, extend the letter of credit during such period). Alternatively, the Seller may choose to treat this Sales Agreement as being brought to an end by such circumstances and shall be under no further liability under this Sales Agreement whatsoever.
In the event that the loading port is frozen and not accessible due to ice situation within all shipment period by vessel on her own or with any special assistance (tugs, ice-breakers) or due to waiting for convoy, ice-breakers, turn in connection with such ice situation, the time allowed for shipment shall be extended for the same period, without any Sellers'' liability or reimbursement from their side. In case the loading port is still not accessible due to ice situation by vessel in ordinary and customarily way within the extended shipment period, the shipment period shall be extended till the termination of such cause which also means the necessity to wait on roads for convoy, ice-breakers, turn, without any Sellers'' liability or reimbursement from their side. In such circumstances, the Buyer shall extend the letter of credit during such period of shipment extension.
Where appropriate and feasible, the confirmation/verification issued by Chamber of Commerce and Industry (CCI) or any other relevant authority of the country where such circumstance occurs, shall be conclusive evidence of the existence of such circumstances and their duration.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause', _id);

    -- clause_force_majeure
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_force_majeure' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Force-Majeure' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Force-Majeure', 'force_majeure', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'In the event of Force Majeure circumstances such as, but not limited to:
acts of God, flood, earthquake, windstorm or other natural disaster;
epidemic or pandemic;
war, threat of or preparation for war, armed conflict, imposition of sanctions, embargo, breaking off of diplomatic relations or similar actions;
terrorist attack, civil war, civil commotion or riots;
nuclear, chemical or biological contamination or sonic boom;
any law or government order, rule, regulation or direction, or any action taken by a government or public authority, including but not limited to imposing an embargo, export or import restriction, quota or other restriction or prohibition, or failing to grant a necessary license or consent;
fire, explosion or accidental damage;
loss at sea, loss or breakdown of carrying vessel;
extreme adverse weather conditions;
interruption or failure of utility service, including but not limited to electric power, gas or water;
any labour dispute, including but not limited to strikes, industrial action or lockouts;
unavailability of goods;
collapse of building structures, failure of plant machinery, machinery, computers or vehicles;
any other cause whatsoever beyond the reasonable control of the Parties which directly affect the execution of this Sales Agreement, the Parties shall be released from responsibility for a failure to fulfill completely or partially their obligations under this Sales Agreement. In such circumstances, the time for the fulfillment of the Parties'' obligations under this Sales Agreement shall be extended for a reasonable period of time, in order to be able to resume performing the obligations. If such circumstances last for more than 2 months the Parties shall have the right to refuse further fulfillment of its obligations under this Sales Agreement and in that case neither Party shall have the right to claim compensation for losses suffered from the other Party. Where a Party cannot meet its obligations under this Sales Agreement due to any circumstance mentioned above, that Party must promptly, after its awareness of the Force Majeure event, advise the other Party of the commencement and cessation of the circumstance preventing fulfillment of its obligations. Certificates issued by the Chamber of Commerce and/or any other relevant state authority of the country where such circumstance occurs shall be conclusive evidence of the existence of such contingencies and their duration.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Force-Majeure', category = 'force_majeure', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'In the event of Force Majeure circumstances such as, but not limited to:
acts of God, flood, earthquake, windstorm or other natural disaster;
epidemic or pandemic;
war, threat of or preparation for war, armed conflict, imposition of sanctions, embargo, breaking off of diplomatic relations or similar actions;
terrorist attack, civil war, civil commotion or riots;
nuclear, chemical or biological contamination or sonic boom;
any law or government order, rule, regulation or direction, or any action taken by a government or public authority, including but not limited to imposing an embargo, export or import restriction, quota or other restriction or prohibition, or failing to grant a necessary license or consent;
fire, explosion or accidental damage;
loss at sea, loss or breakdown of carrying vessel;
extreme adverse weather conditions;
interruption or failure of utility service, including but not limited to electric power, gas or water;
any labour dispute, including but not limited to strikes, industrial action or lockouts;
unavailability of goods;
collapse of building structures, failure of plant machinery, machinery, computers or vehicles;
any other cause whatsoever beyond the reasonable control of the Parties which directly affect the execution of this Sales Agreement, the Parties shall be released from responsibility for a failure to fulfill completely or partially their obligations under this Sales Agreement. In such circumstances, the time for the fulfillment of the Parties'' obligations under this Sales Agreement shall be extended for a reasonable period of time, in order to be able to resume performing the obligations. If such circumstances last for more than 2 months the Parties shall have the right to refuse further fulfillment of its obligations under this Sales Agreement and in that case neither Party shall have the right to claim compensation for losses suffered from the other Party. Where a Party cannot meet its obligations under this Sales Agreement due to any circumstance mentioned above, that Party must promptly, after its awareness of the Force Majeure event, advise the other Party of the commencement and cessation of the circumstance preventing fulfillment of its obligations. Certificates issued by the Chamber of Commerce and/or any other relevant state authority of the country where such circumstance occurs shall be conclusive evidence of the existence of such contingencies and their duration.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_force_majeure', 'contract.clause', _id);

    -- clause_late_shipment
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_late_shipment' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Late Shipment' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Late Shipment', 'delivery', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'In the event that shipment has not been made 30 days after the date stipulated in this Sales Agreement (save as provided for in Clause [x] "Force-Majeure" and in Clause [x] "Impossibility of Supply"), the Buyer may:
terminate this Sales Agreement and present a claim for damages; or alternatively
extend in writing the delivery date for a further 60 days. In such circumstances the Buyer shall confirm the extension in writing and shall agree to accept the latest shipment date as due and proper shipment in accordance with this Sales Agreement. The buyer (if necessary) shall extend the Letter of Credit during this period.
Unless the parties otherwise agree, this Sales Agreement shall be automatically terminated if shipment is not effected within the agreed extension period. In such circumstances any prepayment shall be returned immediately to the Buyer without prejudice to the Buyer''s right to pursue a claim for damages.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Late Shipment', category = 'delivery', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'In the event that shipment has not been made 30 days after the date stipulated in this Sales Agreement (save as provided for in Clause [x] "Force-Majeure" and in Clause [x] "Impossibility of Supply"), the Buyer may:
terminate this Sales Agreement and present a claim for damages; or alternatively
extend in writing the delivery date for a further 60 days. In such circumstances the Buyer shall confirm the extension in writing and shall agree to accept the latest shipment date as due and proper shipment in accordance with this Sales Agreement. The buyer (if necessary) shall extend the Letter of Credit during this period.
Unless the parties otherwise agree, this Sales Agreement shall be automatically terminated if shipment is not effected within the agreed extension period. In such circumstances any prepayment shall be returned immediately to the Buyer without prejudice to the Buyer''s right to pursue a claim for damages.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_late_shipment', 'contract.clause', _id);

    -- clause_import_export_licenses
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_import_export_licenses' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Import-Export Licenses' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Import-Export Licenses', 'tax', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'The procurement of any Import License, if required, shall be the Buyer''s responsibility.
The procurement of any Export License, if required, shall be the Seller''s responsibility')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Import-Export Licenses', category = 'tax', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'The procurement of any Import License, if required, shall be the Buyer''s responsibility.
The procurement of any Export License, if required, shall be the Seller''s responsibility', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_import_export_licenses', 'contract.clause', _id);

    -- clause_entire_agreement
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_entire_agreement' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Entire Agreement' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Entire Agreement', 'law', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'This Sales Agreement constitutes the entire agreement between the Parties in connection with its subject matter and supersedes any prior communications, representations or agreements.
Neither Party has relied on any statement, representation or promise made by the other except as expressly set out in this Sales Agreement.
If any of the provisions of this Sales Agreement are found to be null and void, the remaining provisions of this Sales Agreement shall remain valid and shall continue to bind the Parties.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Entire Agreement', category = 'law', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'This Sales Agreement constitutes the entire agreement between the Parties in connection with its subject matter and supersedes any prior communications, representations or agreements.
Neither Party has relied on any statement, representation or promise made by the other except as expressly set out in this Sales Agreement.
If any of the provisions of this Sales Agreement are found to be null and void, the remaining provisions of this Sales Agreement shall remain valid and shall continue to bind the Parties.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_entire_agreement', 'contract.clause', _id);

    -- clause_assignment
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_assignment' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Assignment' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Assignment', 'law', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Neither Party shall, without the prior written consent of the other Party (such content not to be unreasonably refused or withheld), assign, transfer, subcontract, charge or deal in any other similar manner with this Sales Agreement of the rights and obligations or any part of them hereunder, or purport to do so.
Notwithstanding the above, the Seller shall have the right to assign the Sales Agreement and/or any proceeds under this Sales Agreement to its financing bank without expressly notifying the Buyer about such an assignment.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Assignment', category = 'law', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Neither Party shall, without the prior written consent of the other Party (such content not to be unreasonably refused or withheld), assign, transfer, subcontract, charge or deal in any other similar manner with this Sales Agreement of the rights and obligations or any part of them hereunder, or purport to do so.
Notwithstanding the above, the Seller shall have the right to assign the Sales Agreement and/or any proceeds under this Sales Agreement to its financing bank without expressly notifying the Buyer about such an assignment.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_assignment', 'contract.clause', _id);

    -- clause_arbitration_and_governing_law
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_arbitration_and_governing_law' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Arbitration and Governing Law' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Arbitration and Governing Law', 'law', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'This Sales Agreement shall be governed by and construed in all respects in accordance with English law.
Subject to the other provisions of this Sales Agreement, in the event of a dispute, controversy or claim, arising out or in connection with this Sales Agreement, including any question regarding its existence, validity or termination, the sales director and/or CEO and/or their authorized representatives of both Parties might, at their own discretion and on the basis of mutual agreement, use their best endeavors to resolve the dispute amicably within a reasonable period.
If the Parties fail to resolve the dispute, it shall be referred exclusively to arbitration in London in accordance with the Arbitration Act of 1996 or any statutory modification or re-enactment thereof.
The arbitration shall be conducted in accordance with the London Maritime Arbitrators Association (LMAA) Terms current at the time when the arbitration proceedings are commenced.
The reference shall be to 3 (three) arbitrators. A Party wishing to refer a dispute to arbitration shall appoint its arbitrator and send notice of such appointment in writing to the other Party requiring the other Party to appoint its own arbitrator within 14 (fourteen) calendar days of that notice failing which the first Party may appoint its arbitrator as sole arbitrator. The award of a sole arbitrator shall be binding on both Parties as if he had been appointed by agreement.
The arbitration award shall be final, binding upon the Parties.
Smaller claims as defined in the LMAA Small Claims Procedure shall be dealt with according to those Rules.
Provided always that a similar dispute subject to English law / London arbitration already exists between the Seller and a third party in relation to the performance of the Sales Agreement, then the Seller shall have the option of referring their dispute with the Buyer to the same Tribunal as has been constituted between the Seller and the third party, hence the Buyer hereby submits to the jurisdiction of such Tribunal.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Arbitration and Governing Law', category = 'law', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'This Sales Agreement shall be governed by and construed in all respects in accordance with English law.
Subject to the other provisions of this Sales Agreement, in the event of a dispute, controversy or claim, arising out or in connection with this Sales Agreement, including any question regarding its existence, validity or termination, the sales director and/or CEO and/or their authorized representatives of both Parties might, at their own discretion and on the basis of mutual agreement, use their best endeavors to resolve the dispute amicably within a reasonable period.
If the Parties fail to resolve the dispute, it shall be referred exclusively to arbitration in London in accordance with the Arbitration Act of 1996 or any statutory modification or re-enactment thereof.
The arbitration shall be conducted in accordance with the London Maritime Arbitrators Association (LMAA) Terms current at the time when the arbitration proceedings are commenced.
The reference shall be to 3 (three) arbitrators. A Party wishing to refer a dispute to arbitration shall appoint its arbitrator and send notice of such appointment in writing to the other Party requiring the other Party to appoint its own arbitrator within 14 (fourteen) calendar days of that notice failing which the first Party may appoint its arbitrator as sole arbitrator. The award of a sole arbitrator shall be binding on both Parties as if he had been appointed by agreement.
The arbitration award shall be final, binding upon the Parties.
Smaller claims as defined in the LMAA Small Claims Procedure shall be dealt with according to those Rules.
Provided always that a similar dispute subject to English law / London arbitration already exists between the Seller and a third party in relation to the performance of the Sales Agreement, then the Seller shall have the option of referring their dispute with the Buyer to the same Tribunal as has been constituted between the Seller and the third party, hence the Buyer hereby submits to the jurisdiction of such Tribunal.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_arbitration_and_governing_law', 'contract.clause', _id);

    -- clause_costs_and_expenses
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_costs_and_expenses' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Costs and Expenses' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Costs and Expenses', 'other', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Except as otherwise provided in this Sales Agreement, each Party shall pay its own costs and expenses in relation to the negotiation, preparation, execution and implementation of this Sales Agreement.
All expenses connected with legalization of the documents outside the territory of Switzerland and the country of origin, if required, shall be paid by the Buyer.
All expenses connected with legalization of the documents in the country of discharge, if required, shall be paid by the Buyer.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Costs and Expenses', category = 'other', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Except as otherwise provided in this Sales Agreement, each Party shall pay its own costs and expenses in relation to the negotiation, preparation, execution and implementation of this Sales Agreement.
All expenses connected with legalization of the documents outside the territory of Switzerland and the country of origin, if required, shall be paid by the Buyer.
All expenses connected with legalization of the documents in the country of discharge, if required, shall be paid by the Buyer.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_costs_and_expenses', 'contract.clause', _id);

    -- clause_amendments
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_amendments' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Amendments' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Amendments', 'law', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'No variation of or amendment to this Sales Agreement shall be effective unless it is made in writing, refers specifically to this Sales Agreement and is signed by the authorized representatives of the Parties.
Any hand-written amendments made to this Sales Agreement shall be considered null and void and shall have no contractual effect.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Amendments', category = 'law', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'No variation of or amendment to this Sales Agreement shall be effective unless it is made in writing, refers specifically to this Sales Agreement and is signed by the authorized representatives of the Parties.
Any hand-written amendments made to this Sales Agreement shall be considered null and void and shall have no contractual effect.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_amendments', 'contract.clause', _id);

    -- clause_notices
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_notices' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Notices' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Notices', 'other', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'Any notice or other communication to be given under this Sales Agreement shall be in writing and in the English language and must be sent by registered mail or fax to the other Party at that Party''s registered office or last known trading address.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Notices', category = 'other', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'Any notice or other communication to be given under this Sales Agreement shall be in writing and in the English language and must be sent by registered mail or fax to the other Party at that Party''s registered office or last known trading address.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_notices', 'contract.clause', _id);

    -- clause_text_of_the_sales_agreement
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'clause_text_of_the_sales_agreement' AND model = 'contract.clause';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_clause WHERE name = 'Text of the Sales Agreement' AND source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_clause (create_uid, create_date, name, category, direction, active, version, language, source, text)
        VALUES (0, now(), 'Text of the Sales Agreement', 'other', 'sale', TRUE, '2012', 'en', 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', 'This Sales Agreement is made up in [x] originals in English.
This Sales Agreement once signed could be exchanged by fax or scanned copy via email.
This Sales Agreement is effective upon signing.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_clause SET name = 'Text of the Sales Agreement', category = 'other', direction = 'sale', active = TRUE, version = '2012', language = 'en', source = 'STANDARDIZED CONTRACTS - REFERENCE BOOK 2012 (Official version)', text = 'This Sales Agreement is made up in [x] originals in English.
This Sales Agreement once signed could be exchanged by fax or scanned copy via email.
This Sales Agreement is effective upon signing.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('clause_text_of_the_sales_agreement', 'contract.clause', _id);

    -- template_sale_steel_lc_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif' AND model = 'contract.template';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template WHERE name = 'Sale - Steel - CIF - Letter of Credit' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template (create_uid, create_date, name, direction, active, incoterm_code, notes)
        VALUES (0, now(), 'Sale - Steel - CIF - Letter of Credit', 'sale', TRUE, 'CIF', 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template SET name = 'Sale - Steel - CIF - Letter of Credit', direction = 'sale', active = TRUE, incoterm_code = 'CIF', notes = 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif', 'contract.template', _id);

    -- template_sale_steel_lc_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr' AND model = 'contract.template';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template WHERE name = 'Sale - Steel - CFR - Letter of Credit' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template (create_uid, create_date, name, direction, active, incoterm_code, notes)
        VALUES (0, now(), 'Sale - Steel - CFR - Letter of Credit', 'sale', TRUE, 'CFR', 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template SET name = 'Sale - Steel - CFR - Letter of Credit', direction = 'sale', active = TRUE, incoterm_code = 'CFR', notes = 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr', 'contract.template', _id);

    -- template_sale_steel_cad_cfr
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr' AND model = 'contract.template';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template WHERE name = 'Sale - Steel - CFR - Cash Against Documents' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template (create_uid, create_date, name, direction, active, incoterm_code, notes)
        VALUES (0, now(), 'Sale - Steel - CFR - Cash Against Documents', 'sale', TRUE, 'CFR', 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template SET name = 'Sale - Steel - CFR - Cash Against Documents', direction = 'sale', active = TRUE, incoterm_code = 'CFR', notes = 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr', 'contract.template', _id);

    -- template_sale_steel_prepayment_fob
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob' AND model = 'contract.template';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template WHERE name = 'Sale - Steel - FOB - 100% Prepayment' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template (create_uid, create_date, name, direction, active, incoterm_code, notes)
        VALUES (0, now(), 'Sale - Steel - FOB - 100% Prepayment', 'sale', TRUE, 'FOB', 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template SET name = 'Sale - Steel - FOB - 100% Prepayment', direction = 'sale', active = TRUE, incoterm_code = 'FOB', notes = 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob', 'contract.template', _id);

    -- template_sale_steel_open_terms_dap
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap' AND model = 'contract.template';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template WHERE name = 'Sale - Steel - DAP - Open Terms' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template (create_uid, create_date, name, direction, active, incoterm_code, notes)
        VALUES (0, now(), 'Sale - Steel - DAP - Open Terms', 'sale', TRUE, 'DAP', 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template SET name = 'Sale - Steel - DAP - Open Terms', direction = 'sale', active = TRUE, incoterm_code = 'DAP', notes = 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap', 'contract.template', _id);

    -- template_sale_steel_fdpg_cif
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif' AND model = 'contract.template';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template WHERE name = 'Sale - Steel - CIF - First Demand Payment Guarantee' LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template (create_uid, create_date, name, direction, active, incoterm_code, notes)
        VALUES (0, now(), 'Sale - Steel - CIF - First Demand Payment Guarantee', 'sale', TRUE, 'CIF', 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.')
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template SET name = 'Sale - Steel - CIF - First Demand Payment Guarantee', direction = 'sale', active = TRUE, incoterm_code = 'CIF', notes = 'Seed template generated from the 2012 standardized contracts reference book. Review selected clauses and variables before issuing a contract.', write_uid = 0, write_date = now() WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif', 'contract.template', _id);

    -- template_sale_steel_lc_cif_line_010
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_010' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_letter_of_credit', 'contract.clause') AND sequence = 10 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 10, _pt_model_data_id('clause_letter_of_credit', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 10, clause = _pt_model_data_id('clause_letter_of_credit', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_010', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_020
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_020' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_quality_cif_cfr_cif', 'contract.clause') AND sequence = 20 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 20, _pt_model_data_id('clause_quality_cif_cfr_cif', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 20, clause = _pt_model_data_id('clause_quality_cif_cfr_cif', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_020', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_030
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_030' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cif', 'contract.clause') AND sequence = 30 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 30, _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cif', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 30, clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cif', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_030', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_040
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_040' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_cif_fo_cqd_cif', 'contract.clause') AND sequence = 40 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 40, _pt_model_data_id('clause_cif_fo_cqd_cif', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 40, clause = _pt_model_data_id('clause_cif_fo_cqd_cif', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_040', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_050
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_050' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause') AND sequence = 50 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 50, _pt_model_data_id('clause_anti_dumping', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 50, clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_050', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_060
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_060' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause') AND sequence = 60 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 60, _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 60, clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_060', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_070
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_070' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_confidentiality', 'contract.clause') AND sequence = 70 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 70, _pt_model_data_id('clause_confidentiality', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 70, clause = _pt_model_data_id('clause_confidentiality', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_070', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_080
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_080' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause') AND sequence = 80 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 80, _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 80, clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_080', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_090
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_090' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause') AND sequence = 90 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 90, _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 90, clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_090', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_100
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_100' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause') AND sequence = 100 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 100, _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 100, clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_100', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_110
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_110' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_force_majeure', 'contract.clause') AND sequence = 110 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 110, _pt_model_data_id('clause_force_majeure', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 110, clause = _pt_model_data_id('clause_force_majeure', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_110', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_120
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_120' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_late_shipment', 'contract.clause') AND sequence = 120 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 120, _pt_model_data_id('clause_late_shipment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 120, clause = _pt_model_data_id('clause_late_shipment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_120', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_130
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_130' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause') AND sequence = 130 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 130, _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 130, clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_130', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_140
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_140' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause') AND sequence = 140 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 140, _pt_model_data_id('clause_entire_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 140, clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_140', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_150
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_150' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_assignment', 'contract.clause') AND sequence = 150 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 150, _pt_model_data_id('clause_assignment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 150, clause = _pt_model_data_id('clause_assignment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_150', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_160
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_160' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause') AND sequence = 160 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 160, _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 160, clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_160', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_170
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_170' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause') AND sequence = 170 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 170, _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 170, clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_170', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_180
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_180' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_amendments', 'contract.clause') AND sequence = 180 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 180, _pt_model_data_id('clause_amendments', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 180, clause = _pt_model_data_id('clause_amendments', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_180', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_190
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_190' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_notices', 'contract.clause') AND sequence = 190 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 190, _pt_model_data_id('clause_notices', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 190, clause = _pt_model_data_id('clause_notices', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_190', 'contract.template.line', _id);

    -- template_sale_steel_lc_cif_line_200
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cif_line_200' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template') AND clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause') AND sequence = 200 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), 200, _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cif', 'contract.template'), sequence = 200, clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cif_line_200', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_010
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_010' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_letter_of_credit', 'contract.clause') AND sequence = 10 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 10, _pt_model_data_id('clause_letter_of_credit', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 10, clause = _pt_model_data_id('clause_letter_of_credit', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_010', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_020
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_020' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_quality_cif_cfr_cfr', 'contract.clause') AND sequence = 20 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 20, _pt_model_data_id('clause_quality_cif_cfr_cfr', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 20, clause = _pt_model_data_id('clause_quality_cif_cfr_cfr', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_020', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_030
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_030' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cfr', 'contract.clause') AND sequence = 30 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 30, _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cfr', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 30, clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cfr', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_030', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_040
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_040' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_cfr_fo_cqd_cfr', 'contract.clause') AND sequence = 40 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 40, _pt_model_data_id('clause_cfr_fo_cqd_cfr', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 40, clause = _pt_model_data_id('clause_cfr_fo_cqd_cfr', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_040', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_050
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_050' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause') AND sequence = 50 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 50, _pt_model_data_id('clause_anti_dumping', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 50, clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_050', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_060
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_060' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause') AND sequence = 60 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 60, _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 60, clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_060', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_070
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_070' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_confidentiality', 'contract.clause') AND sequence = 70 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 70, _pt_model_data_id('clause_confidentiality', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 70, clause = _pt_model_data_id('clause_confidentiality', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_070', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_080
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_080' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause') AND sequence = 80 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 80, _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 80, clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_080', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_090
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_090' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause') AND sequence = 90 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 90, _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 90, clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_090', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_100
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_100' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause') AND sequence = 100 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 100, _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 100, clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_100', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_110
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_110' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_force_majeure', 'contract.clause') AND sequence = 110 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 110, _pt_model_data_id('clause_force_majeure', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 110, clause = _pt_model_data_id('clause_force_majeure', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_110', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_120
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_120' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_late_shipment', 'contract.clause') AND sequence = 120 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 120, _pt_model_data_id('clause_late_shipment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 120, clause = _pt_model_data_id('clause_late_shipment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_120', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_130
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_130' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause') AND sequence = 130 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 130, _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 130, clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_130', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_140
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_140' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause') AND sequence = 140 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 140, _pt_model_data_id('clause_entire_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 140, clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_140', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_150
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_150' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_assignment', 'contract.clause') AND sequence = 150 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 150, _pt_model_data_id('clause_assignment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 150, clause = _pt_model_data_id('clause_assignment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_150', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_160
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_160' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause') AND sequence = 160 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 160, _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 160, clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_160', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_170
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_170' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause') AND sequence = 170 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 170, _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 170, clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_170', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_180
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_180' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_amendments', 'contract.clause') AND sequence = 180 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 180, _pt_model_data_id('clause_amendments', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 180, clause = _pt_model_data_id('clause_amendments', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_180', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_190
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_190' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_notices', 'contract.clause') AND sequence = 190 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 190, _pt_model_data_id('clause_notices', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 190, clause = _pt_model_data_id('clause_notices', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_190', 'contract.template.line', _id);

    -- template_sale_steel_lc_cfr_line_200
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_lc_cfr_line_200' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause') AND sequence = 200 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), 200, _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_lc_cfr', 'contract.template'), sequence = 200, clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_lc_cfr_line_200', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_010
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_010' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_cash_against_documents', 'contract.clause') AND sequence = 10 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 10, _pt_model_data_id('clause_cash_against_documents', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 10, clause = _pt_model_data_id('clause_cash_against_documents', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_010', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_020
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_020' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_quality_cif_cfr_cfr', 'contract.clause') AND sequence = 20 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 20, _pt_model_data_id('clause_quality_cif_cfr_cfr', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 20, clause = _pt_model_data_id('clause_quality_cif_cfr_cfr', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_020', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_030
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_030' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cfr', 'contract.clause') AND sequence = 30 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 30, _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cfr', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 30, clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cfr', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_030', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_040
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_040' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_cfr_fo_cqd_cfr', 'contract.clause') AND sequence = 40 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 40, _pt_model_data_id('clause_cfr_fo_cqd_cfr', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 40, clause = _pt_model_data_id('clause_cfr_fo_cqd_cfr', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_040', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_050
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_050' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause') AND sequence = 50 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 50, _pt_model_data_id('clause_anti_dumping', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 50, clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_050', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_060
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_060' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause') AND sequence = 60 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 60, _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 60, clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_060', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_070
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_070' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_confidentiality', 'contract.clause') AND sequence = 70 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 70, _pt_model_data_id('clause_confidentiality', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 70, clause = _pt_model_data_id('clause_confidentiality', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_070', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_080
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_080' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause') AND sequence = 80 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 80, _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 80, clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_080', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_090
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_090' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause') AND sequence = 90 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 90, _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 90, clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_090', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_100
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_100' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause') AND sequence = 100 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 100, _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 100, clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_100', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_110
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_110' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_force_majeure', 'contract.clause') AND sequence = 110 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 110, _pt_model_data_id('clause_force_majeure', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 110, clause = _pt_model_data_id('clause_force_majeure', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_110', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_120
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_120' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_late_shipment', 'contract.clause') AND sequence = 120 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 120, _pt_model_data_id('clause_late_shipment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 120, clause = _pt_model_data_id('clause_late_shipment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_120', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_130
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_130' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause') AND sequence = 130 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 130, _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 130, clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_130', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_140
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_140' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause') AND sequence = 140 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 140, _pt_model_data_id('clause_entire_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 140, clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_140', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_150
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_150' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_assignment', 'contract.clause') AND sequence = 150 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 150, _pt_model_data_id('clause_assignment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 150, clause = _pt_model_data_id('clause_assignment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_150', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_160
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_160' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause') AND sequence = 160 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 160, _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 160, clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_160', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_170
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_170' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause') AND sequence = 170 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 170, _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 170, clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_170', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_180
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_180' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_amendments', 'contract.clause') AND sequence = 180 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 180, _pt_model_data_id('clause_amendments', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 180, clause = _pt_model_data_id('clause_amendments', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_180', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_190
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_190' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_notices', 'contract.clause') AND sequence = 190 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 190, _pt_model_data_id('clause_notices', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 190, clause = _pt_model_data_id('clause_notices', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_190', 'contract.template.line', _id);

    -- template_sale_steel_cad_cfr_line_200
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_cad_cfr_line_200' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template') AND clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause') AND sequence = 200 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), 200, _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_cad_cfr', 'contract.template'), sequence = 200, clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_cad_cfr_line_200', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_010
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_010' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_100_prepayment', 'contract.clause') AND sequence = 10 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 10, _pt_model_data_id('clause_100_prepayment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 10, clause = _pt_model_data_id('clause_100_prepayment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_010', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_020
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_020' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_quality_fob_fob', 'contract.clause') AND sequence = 20 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 20, _pt_model_data_id('clause_quality_fob_fob', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 20, clause = _pt_model_data_id('clause_quality_fob_fob', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_020', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_030
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_030' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_quantity_actual_basis_fob_fob', 'contract.clause') AND sequence = 30 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 30, _pt_model_data_id('clause_quantity_actual_basis_fob_fob', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 30, clause = _pt_model_data_id('clause_quantity_actual_basis_fob_fob', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_030', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_040
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_040' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_fob_st_lsd_cqd_fob', 'contract.clause') AND sequence = 40 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 40, _pt_model_data_id('clause_fob_st_lsd_cqd_fob', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 40, clause = _pt_model_data_id('clause_fob_st_lsd_cqd_fob', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_040', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_050
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_050' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause') AND sequence = 50 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 50, _pt_model_data_id('clause_anti_dumping', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 50, clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_050', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_060
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_060' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause') AND sequence = 60 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 60, _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 60, clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_060', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_070
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_070' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_confidentiality', 'contract.clause') AND sequence = 70 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 70, _pt_model_data_id('clause_confidentiality', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 70, clause = _pt_model_data_id('clause_confidentiality', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_070', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_080
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_080' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause') AND sequence = 80 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 80, _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 80, clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_080', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_090
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_090' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause') AND sequence = 90 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 90, _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 90, clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_090', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_100
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_100' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause') AND sequence = 100 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 100, _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 100, clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_100', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_110
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_110' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_force_majeure', 'contract.clause') AND sequence = 110 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 110, _pt_model_data_id('clause_force_majeure', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 110, clause = _pt_model_data_id('clause_force_majeure', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_110', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_120
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_120' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_late_shipment', 'contract.clause') AND sequence = 120 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 120, _pt_model_data_id('clause_late_shipment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 120, clause = _pt_model_data_id('clause_late_shipment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_120', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_130
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_130' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause') AND sequence = 130 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 130, _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 130, clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_130', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_140
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_140' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause') AND sequence = 140 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 140, _pt_model_data_id('clause_entire_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 140, clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_140', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_150
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_150' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_assignment', 'contract.clause') AND sequence = 150 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 150, _pt_model_data_id('clause_assignment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 150, clause = _pt_model_data_id('clause_assignment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_150', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_160
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_160' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause') AND sequence = 160 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 160, _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 160, clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_160', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_170
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_170' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause') AND sequence = 170 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 170, _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 170, clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_170', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_180
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_180' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_amendments', 'contract.clause') AND sequence = 180 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 180, _pt_model_data_id('clause_amendments', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 180, clause = _pt_model_data_id('clause_amendments', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_180', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_190
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_190' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_notices', 'contract.clause') AND sequence = 190 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 190, _pt_model_data_id('clause_notices', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 190, clause = _pt_model_data_id('clause_notices', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_190', 'contract.template.line', _id);

    -- template_sale_steel_prepayment_fob_line_200
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_prepayment_fob_line_200' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template') AND clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause') AND sequence = 200 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), 200, _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_prepayment_fob', 'contract.template'), sequence = 200, clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_prepayment_fob_line_200', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_010
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_010' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_open_terms_without_security_or_covered_by_credit_insurance', 'contract.clause') AND sequence = 10 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 10, _pt_model_data_id('clause_open_terms_without_security_or_covered_by_credit_insurance', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 10, clause = _pt_model_data_id('clause_open_terms_without_security_or_covered_by_credit_insurance', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_010', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_020
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_020' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_quality_dap_ddu_dap', 'contract.clause') AND sequence = 20 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 20, _pt_model_data_id('clause_quality_dap_ddu_dap', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 20, clause = _pt_model_data_id('clause_quality_dap_ddu_dap', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_020', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_030
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_030' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_quantity_actual_dap_dap', 'contract.clause') AND sequence = 30 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 30, _pt_model_data_id('clause_quantity_actual_dap_dap', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 30, clause = _pt_model_data_id('clause_quantity_actual_dap_dap', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_030', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_040
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_040' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_quality_dap_ddu_dap', 'contract.clause') AND sequence = 40 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 40, _pt_model_data_id('clause_quality_dap_ddu_dap', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 40, clause = _pt_model_data_id('clause_quality_dap_ddu_dap', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_040', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_050
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_050' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause') AND sequence = 50 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 50, _pt_model_data_id('clause_anti_dumping', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 50, clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_050', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_060
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_060' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause') AND sequence = 60 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 60, _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 60, clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_060', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_070
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_070' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_confidentiality', 'contract.clause') AND sequence = 70 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 70, _pt_model_data_id('clause_confidentiality', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 70, clause = _pt_model_data_id('clause_confidentiality', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_070', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_080
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_080' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause') AND sequence = 80 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 80, _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 80, clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_080', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_090
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_090' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause') AND sequence = 90 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 90, _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 90, clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_090', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_100
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_100' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause') AND sequence = 100 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 100, _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 100, clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_100', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_110
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_110' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_force_majeure', 'contract.clause') AND sequence = 110 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 110, _pt_model_data_id('clause_force_majeure', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 110, clause = _pt_model_data_id('clause_force_majeure', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_110', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_120
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_120' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_late_shipment', 'contract.clause') AND sequence = 120 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 120, _pt_model_data_id('clause_late_shipment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 120, clause = _pt_model_data_id('clause_late_shipment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_120', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_130
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_130' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause') AND sequence = 130 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 130, _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 130, clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_130', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_140
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_140' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause') AND sequence = 140 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 140, _pt_model_data_id('clause_entire_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 140, clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_140', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_150
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_150' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_assignment', 'contract.clause') AND sequence = 150 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 150, _pt_model_data_id('clause_assignment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 150, clause = _pt_model_data_id('clause_assignment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_150', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_160
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_160' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause') AND sequence = 160 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 160, _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 160, clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_160', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_170
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_170' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause') AND sequence = 170 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 170, _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 170, clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_170', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_180
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_180' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_amendments', 'contract.clause') AND sequence = 180 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 180, _pt_model_data_id('clause_amendments', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 180, clause = _pt_model_data_id('clause_amendments', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_180', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_190
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_190' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_notices', 'contract.clause') AND sequence = 190 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 190, _pt_model_data_id('clause_notices', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 190, clause = _pt_model_data_id('clause_notices', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_190', 'contract.template.line', _id);

    -- template_sale_steel_open_terms_dap_line_200
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_open_terms_dap_line_200' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template') AND clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause') AND sequence = 200 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), 200, _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_open_terms_dap', 'contract.template'), sequence = 200, clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_open_terms_dap_line_200', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_010
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_010' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_first_demand_payment_guarantee', 'contract.clause') AND sequence = 10 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 10, _pt_model_data_id('clause_first_demand_payment_guarantee', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 10, clause = _pt_model_data_id('clause_first_demand_payment_guarantee', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_010', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_020
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_020' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_quality_cif_cfr_cif', 'contract.clause') AND sequence = 20 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 20, _pt_model_data_id('clause_quality_cif_cfr_cif', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 20, clause = _pt_model_data_id('clause_quality_cif_cfr_cif', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_020', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_030
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_030' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cif', 'contract.clause') AND sequence = 30 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 30, _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cif', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 30, clause = _pt_model_data_id('clause_quantity_actual_basis_cif_cfr_cif', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_030', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_040
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_040' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_cif_fo_cqd_cif', 'contract.clause') AND sequence = 40 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 40, _pt_model_data_id('clause_cif_fo_cqd_cif', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 40, clause = _pt_model_data_id('clause_cif_fo_cqd_cif', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_040', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_050
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_050' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause') AND sequence = 50 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 50, _pt_model_data_id('clause_anti_dumping', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 50, clause = _pt_model_data_id('clause_anti_dumping', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_050', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_060
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_060' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause') AND sequence = 60 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 60, _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 60, clause = _pt_model_data_id('clause_risk_and_ownership', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_060', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_070
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_070' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_confidentiality', 'contract.clause') AND sequence = 70 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 70, _pt_model_data_id('clause_confidentiality', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 70, clause = _pt_model_data_id('clause_confidentiality', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_070', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_080
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_080' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause') AND sequence = 80 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 80, _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 80, clause = _pt_model_data_id('clause_buyer_s_default', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_080', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_090
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_090' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause') AND sequence = 90 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 90, _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 90, clause = _pt_model_data_id('clause_liquidated_damages', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_090', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_100
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_100' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause') AND sequence = 100 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 100, _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 100, clause = _pt_model_data_id('clause_impossibility_of_supply_and_shipment_carriage', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_100', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_110
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_110' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_force_majeure', 'contract.clause') AND sequence = 110 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 110, _pt_model_data_id('clause_force_majeure', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 110, clause = _pt_model_data_id('clause_force_majeure', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_110', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_120
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_120' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_late_shipment', 'contract.clause') AND sequence = 120 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 120, _pt_model_data_id('clause_late_shipment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 120, clause = _pt_model_data_id('clause_late_shipment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_120', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_130
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_130' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause') AND sequence = 130 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 130, _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 130, clause = _pt_model_data_id('clause_import_export_licenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_130', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_140
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_140' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause') AND sequence = 140 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 140, _pt_model_data_id('clause_entire_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 140, clause = _pt_model_data_id('clause_entire_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_140', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_150
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_150' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_assignment', 'contract.clause') AND sequence = 150 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 150, _pt_model_data_id('clause_assignment', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 150, clause = _pt_model_data_id('clause_assignment', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_150', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_160
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_160' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause') AND sequence = 160 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 160, _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 160, clause = _pt_model_data_id('clause_arbitration_and_governing_law', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_160', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_170
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_170' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause') AND sequence = 170 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 170, _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 170, clause = _pt_model_data_id('clause_costs_and_expenses', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_170', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_180
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_180' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_amendments', 'contract.clause') AND sequence = 180 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 180, _pt_model_data_id('clause_amendments', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 180, clause = _pt_model_data_id('clause_amendments', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_180', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_190
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_190' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_notices', 'contract.clause') AND sequence = 190 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 190, _pt_model_data_id('clause_notices', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 190, clause = _pt_model_data_id('clause_notices', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_190', 'contract.template.line', _id);

    -- template_sale_steel_fdpg_cif_line_200
    SELECT db_id INTO _id FROM ir_model_data WHERE module = 'purchase_trade' AND fs_id = 'template_sale_steel_fdpg_cif_line_200' AND model = 'contract.template.line';
    IF _id IS NULL THEN
        SELECT id INTO _id FROM contract_template_line
        WHERE template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template') AND clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause') AND sequence = 200 LIMIT 1;
    END IF;
    IF _id IS NULL THEN
        INSERT INTO contract_template_line (create_uid, create_date, template, sequence, clause, optional)
        VALUES (0, now(), _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), 200, _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), FALSE)
        RETURNING id INTO _id;
    ELSE
        UPDATE contract_template_line
        SET template = _pt_model_data_id('template_sale_steel_fdpg_cif', 'contract.template'), sequence = 200, clause = _pt_model_data_id('clause_text_of_the_sales_agreement', 'contract.clause'), optional = FALSE, write_uid = 0, write_date = now()
        WHERE id = _id;
    END IF;
    PERFORM _pt_upsert_model_data('template_sale_steel_fdpg_cif_line_200', 'contract.template.line', _id);

END $$;

DROP FUNCTION _pt_model_data_id(text, text);
DROP FUNCTION _pt_upsert_model_data(text, text, integer);

COMMIT;
