X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=upgrade%2F1.0.1%2F13_payments.sql;h=6252fbd4f40aa9d1f3b966f43588ed9dd222e5eb;hb=cc9dc1ddd643ad6ff206643ffc1e94559ffd27b2;hp=590434e082608f548dd9cd4f8482ee2a8ff24795;hpb=aaec4238902202b314f567803045a082398e06a6;p=platal.git diff --git a/upgrade/1.0.1/13_payments.sql b/upgrade/1.0.1/13_payments.sql index 590434e..6252fbd 100644 --- a/upgrade/1.0.1/13_payments.sql +++ b/upgrade/1.0.1/13_payments.sql @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS payment_bankaccounts; CREATE TABLE payment_bankaccounts ( id integer PRIMARY KEY auto_increment, asso_id integer NOT NULL, @@ -40,11 +41,13 @@ INSERT INTO payment_bankaccounts VALUES (NULL,248,"12548029983443030151039","X-R INSERT INTO payment_bankaccounts VALUES (NULL,179,"30066106410001050600128","X-Sursaut H Levy-Lambert","used"); INSERT INTO payment_bankaccounts VALUES (NULL,223,"30066100410001126780124","X-Theatre","used"); +DROP TABLE IF EXISTS payment_reconcilations; CREATE TABLE payment_reconcilations ( id INTEGER PRIMARY KEY auto_increment, method_id INTEGER NOT NULL, period_start DATE NOT NULL, period_end DATE NOT NULL, + recongroup_id INTEGER DEFAULT NULL, status ENUM('pending','transfering','closed') NOT NULL DEFAULT 'pending', payment_count INTEGER NOT NULL, sum_amounts DECIMAL(9,2) NOT NULL, # transaction amount, before taking the commission @@ -67,23 +70,26 @@ UPDATE payment_transactions SET status = 'confirmed'; UPDATE payment_transactions SET amount=CONVERT(REPLACE(REPLACE(amount_tmp," EUR",""),",","."),DECIMAL(9,2)); ALTER TABLE payment_transactions ADD KEY method_id (method_id); ALTER TABLE payment_transactions ADD KEY ref (ref); -ALTER TABLE payment_transactions ADD UNIQUE KEY fullref (fullref); +# ALTER TABLE payment_transactions ADD UNIQUE KEY fullref (fullref); #fullref dupliqués : #select t1.* from payment_transactions as t1 join payment_transactions as t2 using(fullref) group by(t1.id) having count(*)!=1 order by fullref; ALTER TABLE payment_transactions DROP amount_tmp; +DROP TABLE IF EXISTS payment_transfers; CREATE TABLE payment_transfers ( - id integer PRIMARY KEY auto_increment, - payment_id integer NOT NULL, + id INTEGER PRIMARY KEY auto_increment, + recongroup_id INTEGER NOT NULL, + payment_id INTEGER NOT NULL, amount DECIMAL(9,2) NOT NULL, + account_id INTEGER DEFAULT NULL, message VARCHAR(255) NOT NULL, - date DATE # NULL = not done + date DATE DEFAULT NULL # NULL = not done ) ENGINE=InnoDB, CHARSET=utf8; -CREATE TABLE payment_recon_transfer ( - recon_id INTEGER NOT NULL, - transfer_id INTEGER NOT NULL, - PRIMARY KEY (recon_id,transfer_id) -) ENGINE=InnoDB, CHARSET=utf8; +ALTER TABLE payment_methods ADD short_name VARCHAR(10) NOT NULL; +ALTER TABLE payment_methods ADD flags SET('deferred_com') DEFAULT ''; +UPDATE payment_methods SET short_name='paypal', flags='' WHERE id=1; +UPDATE payment_methods SET short_name='bplc2', flags='deferred_com' WHERE id=2; -- vim:set syntax=mysql: +