From 05d38bf2f137c464d244759a56410fa710a1b14f Mon Sep 17 00:00:00 2001 From: Phuoc CAO Date: Thu, 28 Sep 2017 10:26:25 +0200 Subject: [PATCH] ajout spinning button dans update portfolio button --- bd_mesavoirs.sql | 57 ++++++------------- caotek_mesavoirs/__init__.py | 4 +- caotek_mesavoirs/static/css/style.less | 41 +++++++++++++ .../templates/actifs/actifs_list.pt | 11 +++- .../templates/actifs/allocation_edit.pt | 2 +- .../templates/actifs/histo_list.pt | 7 ++- caotek_mesavoirs/views/actifs.py | 2 + 7 files changed, 75 insertions(+), 49 deletions(-) diff --git a/bd_mesavoirs.sql b/bd_mesavoirs.sql index 3de2d3c..1156012 100644 --- a/bd_mesavoirs.sql +++ b/bd_mesavoirs.sql @@ -1,3 +1,5 @@ +CREATE DATABASE IF NOT EXISTS `bd_mesavoirs` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `bd_mesavoirs`; -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64) -- -- Host: localhost Database: bd_mesavoirs @@ -41,8 +43,10 @@ CREATE TABLE `actifs` ( `devise` char(3) DEFAULT 'EUR', `parite` decimal(6,4) DEFAULT '1.0000', PRIMARY KEY (`no_id`), - KEY `SYMBOLE` (`symbole`) -) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; + KEY `SYMBOLE` (`symbole`), + KEY `fk_classes_actifs_idx` (`classe`), + CONSTRAINT `fk_classes_actifs` FOREIGN KEY (`classe`) REFERENCES `classes` (`classe`) +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -51,7 +55,7 @@ CREATE TABLE `actifs` ( LOCK TABLES `actifs` WRITE; /*!40000 ALTER TABLE `actifs` DISABLE KEYS */; -INSERT INTO `actifs` VALUES (3,'VEUR.AS','VANGUARD FTSE EUR','Europe Large',1190,30.140,28.077,35866.60,2454.97,6.8,1119.04,3.12,20.2,0.12,0.000,'EUR',1.0000),(5,'SMC.PA','SPDR EU SM.CAP','Europe Small',30,217.220,204.582,6516.60,379.14,5.8,0.00,0.00,3.7,0.30,0.000,'EUR',1.0000),(6,'CSPX.AS','iSHR S&P500 B A','US Large',95,200.240,204.846,19022.80,-437.57,-2.3,0.00,0.00,10.7,0.07,0.000,'EUR',1.0000),(7,'VYM','Vanguard High Dividend Yield ET','US Large',70,79.520,71.703,4715.30,-303.91,-6.4,136.74,2.90,2.6,0.08,0.000,'USD',0.8471),(9,'R2US.PA','SPDR RUSSELL 2K','US Small',338,32.440,33.833,10964.72,-470.83,-4.3,0.00,0.00,6.2,0.30,0.000,'EUR',1.0000),(10,'SHLD','Sears Holdings Corporation','US Small',750,8.480,8.762,5387.56,-1183.94,-22.0,0.00,0.00,3.0,0.00,0.000,'USD',0.8471),(11,'VER','VEREIT, Inc.','US REIT',1000,8.460,8.085,7166.47,-918.53,-12.8,472.99,6.60,4.0,0.00,0.000,'USD',0.8471),(12,'VNQ','Vanguard REIT ETF - DNQ','US REIT',210,84.640,72.762,15056.69,-223.33,-1.5,662.49,4.40,8.5,0.12,0.000,'USD',0.8471),(13,'LIVRETS','Livrets A, LDD, etc ....','Monétaires',1000,14.530,14.530,14530.00,0.00,0.0,108.98,0.75,8.2,0.00,0.000,'EUR',1.0000),(14,'BOURSO.VIE1','Boursorama Vie CTP','Obligations',1000,22.005,21.000,22005.00,1005.00,4.6,506.12,2.30,12.4,0.00,0.000,'EUR',1.0000),(15,'BOURSO.VIE2','Boursorama Vie CKT','Obligations',1000,20.122,19.300,20122.00,822.00,4.1,462.81,2.30,11.3,0.00,0.000,'EUR',1.0000),(16,'CASH','Liquidité CTO','Monétaires',1000,11.634,11.634,11634.00,0.00,0.0,0.00,0.00,6.5,0.00,0.000,'EUR',1.0000),(20,'FORTNEO.VIE','Fortuneo Vie CTP','Obligations',1000,5.000,5.000,5000.00,0.00,0.0,160.00,3.20,2.8,0.00,0.000,'EUR',1.0000); +INSERT INTO `actifs` VALUES (3,'VEUR.AS','VANGUARD FTSE EUR','Actions Europe',1323,30.400,28.289,40219.20,2792.85,6.9,1254.84,3.12,24.0,0.12,0.000,'EUR',1.0000),(5,'SMC.PA','SPDR EU SM.CAP','Actions Europe',30,221.950,204.582,6658.50,521.04,7.8,0.00,0.00,4.0,0.30,0.000,'EUR',1.0000),(6,'CSPX.AS','iSHR S&P500 B A','Actions US',95,204.500,204.846,19427.50,-32.87,-0.2,0.00,0.00,11.6,0.07,0.000,'EUR',1.0000),(7,'VYM','VANGUARD WHITEHALL HIGH DIVIDEN','Actions US',70,80.820,71.703,4812.75,-206.46,-4.3,139.57,2.90,2.9,0.08,0.000,'USD',0.8507),(10,'SHLD','Sears Holdings Corporation','Actions US',750,7.280,8.762,4644.82,-1926.68,-41.5,0.00,0.00,2.8,0.00,0.000,'USD',0.8507),(11,'VER','VEREIT, Inc.','Actions US REIT',1000,8.350,8.085,7103.35,-981.65,-13.8,468.82,6.60,4.2,0.00,0.000,'USD',0.8507),(12,'VNQ','VANGUARD INDEX FDS VANGUARD REI','Actions US REIT',210,82.360,72.762,14713.37,-566.65,-3.9,647.39,4.40,8.8,0.12,0.000,'USD',0.8507),(14,'BOURSO.VIE1','Boursorama Vie CTP','Obligations',1000,22.005,21.000,22005.00,1005.00,4.6,506.12,2.30,13.2,0.00,0.000,'EUR',1.0000),(15,'BOURSO.VIE2','Boursorama Vie CKT','Obligations',1000,20.122,19.300,20122.00,822.00,4.1,462.81,2.30,12.0,0.00,0.000,'EUR',1.0000),(16,'CASH','Liquidité CTO','Monétaires',1000,7.580,7.580,7580.00,0.00,0.0,0.00,0.00,4.5,0.00,0.000,'EUR',1.0000),(20,'FORTNEO.VIE','Fortuneo Vie CTP','Obligations',1000,5.000,5.000,5000.00,0.00,0.0,160.00,3.20,3.0,0.00,0.000,'EUR',1.0000),(21,'EUDV.PA','SPDR EUR DIV ARIST','Actions Europe',170,23.090,23.039,3925.30,8.67,0.2,90.28,2.30,2.3,0.30,0.000,'EUR',1.0000),(22,'VJPN.AS','VANGUARD FTSE JPN','Actions JPN',265,25.120,24.500,6656.80,164.30,2.5,199.70,3.00,4.0,0.19,0.000,'EUR',1.0000),(23,'VTI','Vanguard Total Stock Market ETF','Actions US',40,128.890,108.047,4385.87,63.99,1.5,96.49,2.20,2.6,0.04,0.000,'USD',0.8507); /*!40000 ALTER TABLE `actifs` ENABLE KEYS */; UNLOCK TABLES; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -115,8 +119,9 @@ CREATE TABLE `allocation` ( `pc_atteint` decimal(5,1) DEFAULT '0.0', `valeur` decimal(11,2) DEFAULT '0.00', PRIMARY KEY (`no_cat`), - KEY `categorie` (`classe`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; + KEY `categorie` (`classe`), + CONSTRAINT `fk_classe` FOREIGN KEY (`classe`) REFERENCES `classes` (`classe`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -125,7 +130,7 @@ CREATE TABLE `allocation` ( LOCK TABLES `allocation` WRITE; /*!40000 ALTER TABLE `allocation` DISABLE KEYS */; -INSERT INTO `allocation` VALUES (1,'Europe Large',22,20.2,35866.60),(2,'US Large',18,13.3,23738.10),(3,'US REIT',8,12.5,22223.16),(4,'Monétaires',5,14.7,26164.00),(5,'Obligations',30,26.5,47127.00),(8,'Europe Small',8,3.7,6516.60),(9,'US Small',9,9.2,16352.28); +INSERT INTO `allocation` VALUES (1,'Actions Europe',30,30.4,50803.00),(2,'Actions US',27,19.9,33270.94),(3,'Actions US REIT',8,13.0,21816.72),(5,'Obligations',30,28.2,47127.00),(10,'Actions JPN',5,4.0,6656.80),(11,'Monétaires',0,4.5,7580.00); /*!40000 ALTER TABLE `allocation` ENABLE KEYS */; UNLOCK TABLES; @@ -152,7 +157,7 @@ CREATE TABLE `classes` ( LOCK TABLES `classes` WRITE; /*!40000 ALTER TABLE `classes` DISABLE KEYS */; -INSERT INTO `classes` VALUES ('Emergents','ACTION',30,'warning'),('Europe Large','ACTION',1,'info'),('Europe REIT','ACTION',3,'info'),('Europe Small','ACTION',2,'info'),('Monétaires','AUTRE',50,'success'),('Obligations','AUTRE',40,'success'),('US Large','ACTION',10,'danger'),('US REIT','ACTION',12,'danger'),('US Small','ACTION',11,'danger'); +INSERT INTO `classes` VALUES ('Actions Europe','ACTION',1,'info'),('Actions JPN','ACTION',30,'warning'),('Actions US','ACTION',10,'danger'),('Actions US REIT','ACTION',12,'danger'),('Monétaires','AUTRE',50,'success'),('Obligations','AUTRE',40,'success'),('US REIT','ACTION',12,'danger'); /*!40000 ALTER TABLE `classes` ENABLE KEYS */; UNLOCK TABLES; @@ -222,7 +227,7 @@ CREATE TABLE `histo` ( `cours_ref` decimal(9,3) DEFAULT '0.000', `val_part_ref` decimal(9,3) DEFAULT '0.000', PRIMARY KEY (`no_id`,`date`) -) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -231,7 +236,7 @@ CREATE TABLE `histo` ( LOCK TABLES `histo` WRITE; /*!40000 ALTER TABLE `histo` DISABLE KEYS */; -INSERT INTO `histo` VALUES (1,'2012-01-01',0.00,53950.00,539.500,100.000,813160.000,100.000),(2,'2012-01-01',0.00,53950.00,539.500,100.000,813.160,100.000),(3,'2012-02-01',0.00,55145.26,539.500,102.215,856.604,105.343),(4,'2012-02-25',0.00,57677.72,539.500,106.910,890.157,109.469),(5,'2012-04-04',0.00,56619.82,539.500,104.949,872.208,107.262),(6,'2012-05-01',0.00,55364.61,539.500,102.622,856.121,105.283),(7,'2012-06-01',0.00,55319.73,539.500,102.539,854.014,105.024),(8,'2012-06-29',0.00,57539.57,539.500,106.654,833.411,102.490),(9,'2012-07-26',3000.00,62356.72,566.767,110.022,852.890,104.886),(10,'2012-07-31',0.00,63181.67,566.767,111.477,864.443,106.307),(11,'2012-08-31',0.00,63293.25,566.767,111.674,847.570,104.232),(12,'2012-09-30',0.00,61808.83,566.767,109.055,877.620,107.927),(13,'2012-11-01',0.00,61670.32,566.767,108.811,860.404,105.810),(14,'2012-11-30',0.00,61768.50,566.767,108.984,876.050,107.734),(15,'2012-12-31',0.00,61572.99,566.767,108.639,876.960,107.846),(16,'2013-02-01',0.00,62983.57,566.767,111.128,904.630,111.249),(17,'2013-02-22',3000.00,66843.62,593.400,112.645,896.240,110.217),(18,'2013-02-28',0.00,67749.27,593.400,114.171,901.240,110.832),(19,'2013-03-19',3000.00,72109.77,619.159,116.464,927.200,114.024),(20,'2013-03-29',0.00,73521.87,619.159,118.745,931.070,114.500),(21,'2013-04-30',0.00,74918.09,619.159,121.000,936.820,115.207),(22,'2013-06-01',0.00,73060.36,619.159,117.999,957.870,117.796),(23,'2013-06-06',3000.00,74879.53,645.000,116.092,921.930,113.376),(24,'2013-06-29',0.00,74038.76,645.000,114.789,903.570,111.118),(25,'2013-07-31',0.00,74358.74,645.000,115.285,926.030,113.880),(26,'2013-08-31',0.00,72347.78,645.000,112.167,920.240,113.168),(27,'2013-09-30',0.00,74465.15,645.000,115.450,946.420,116.388),(28,'2013-10-31',0.00,77198.07,645.000,119.687,971.900,119.521),(29,'2013-11-30',0.00,76842.48,645.000,119.136,991.550,121.938),(30,'2013-12-23',0.00,75689.64,645.000,117.348,991.600,121.944),(31,'2013-12-31',3000.00,76580.41,671.298,114.078,1001.930,123.214),(32,'2013-12-31',0.00,79730.62,671.298,118.771,1001.930,123.214),(33,'2014-01-31',0.00,77970.27,671.298,116.149,967.290,118.954),(34,'2014-02-28',0.00,80050.85,671.298,119.248,982.990,120.885),(35,'2014-03-07',2000.00,81465.33,688.193,118.376,992.720,122.082),(36,'2014-03-31',0.00,83179.98,688.193,120.867,968.530,119.107),(37,'2014-04-30',0.00,84958.13,688.193,123.451,965.020,118.675),(38,'2014-05-30',0.00,87931.27,688.193,127.771,993.910,122.228),(39,'2014-06-29',0.00,87413.29,688.193,127.019,1013.190,124.599),(40,'2014-07-20',2500.00,91931.86,707.431,129.952,1002.160,123.243),(41,'2014-09-30',0.00,90768.83,707.431,128.308,1047.560,128.826),(42,'2014-10-17',2500.00,89614.90,727.733,123.143,1003.530,123.411),(43,'2014-10-31',0.00,94990.34,727.733,130.529,1057.520,130.051),(44,'2014-12-31',0.00,97002.85,727.733,133.295,1109.250,136.412),(45,'2015-01-31',0.00,105928.92,727.733,145.560,1194.770,146.929),(46,'2015-02-28',0.00,111207.76,727.733,152.814,1244.210,153.009),(47,'2015-03-08',2000.00,114736.95,740.643,154.915,1277.020,157.044),(48,'2015-04-01',0.00,118303.56,740.643,159.731,1297.400,159.550),(49,'2015-04-30',0.00,112769.03,740.643,152.258,1289.820,158.618),(50,'2015-05-30',0.00,117850.06,740.643,159.119,1305.880,160.593),(51,'2015-06-01',0.00,117710.07,740.643,158.930,1291.480,158.822),(52,'2015-06-24',3000.00,114176.64,760.629,150.108,1298.130,159.640),(53,'2015-06-30',0.00,110825.37,760.629,145.702,1252.610,154.042),(54,'2015-07-31',0.00,113151.13,760.629,148.760,1267.310,155.850),(55,'2015-08-26',600.00,102191.84,765.121,133.563,1092.400,134.340),(56,'2015-09-01',0.00,104910.02,765.121,137.116,1116.900,137.353),(57,'2015-09-30',0.00,103261.28,765.121,134.961,1059.130,130.249),(58,'2015-12-31',0.00,109198.88,765.121,142.721,1127.820,138.696),(59,'2016-01-19',2000.00,101815.25,780.452,130.457,1057.730,130.076),(60,'2016-03-31',0.00,105908.74,780.452,135.702,1062.850,130.706),(61,'2016-04-30',0.00,108008.04,780.452,138.392,1075.170,132.221),(62,'2016-05-31',0.00,108973.48,780.452,139.629,1098.260,135.061),(63,'2016-06-30',0.00,110238.80,780.452,141.250,1098.180,135.051),(64,'2016-07-18',37800.00,153179.23,1036.140,147.836,1142.160,140.459),(65,'2016-07-29',0.00,154011.09,1036.140,148.639,1150.190,141.447),(66,'2016-09-30',0.00,150172.30,1036.140,144.934,1131.510,139.150),(67,'2016-10-07',2000.00,151820.61,1049.971,144.595,1130.520,139.028),(68,'2016-11-30',0.00,156471.07,1049.971,149.024,1117.890,137.475),(69,'2016-12-27',2000.00,156845.04,1063.533,147.475,1163.700,143.108),(70,'2016-12-31',0.00,159667.80,1063.533,150.130,1160.380,142.700),(71,'2017-03-31',0.00,164060.54,1063.533,154.260,1195.630,147.035),(72,'2017-04-29',0.00,163249.09,1063.533,153.497,1208.870,148.663),(73,'2017-07-02',0.00,156437.30,1063.533,147.092,1205.620,148.264),(74,'2017-07-12',16000.00,166505.02,1176.596,141.514,1222.860,150.384),(75,'2017-07-21',0.00,174328.48,1176.596,148.163,1234.690,151.839),(137,'2017-08-02',5000.00,177987.74,1210.604,147.024,1238.610,152.321); +INSERT INTO `histo` VALUES (1,'2012-01-01',0.00,53950.00,539.500,100.000,813160.000,100.000),(2,'2012-01-01',0.00,53950.00,539.500,100.000,813.160,100.000),(3,'2012-02-01',0.00,55145.26,539.500,102.215,856.604,105.343),(4,'2012-02-25',0.00,57677.72,539.500,106.910,890.157,109.469),(5,'2012-04-04',0.00,56619.82,539.500,104.949,872.208,107.262),(6,'2012-05-01',0.00,55364.61,539.500,102.622,856.121,105.283),(7,'2012-06-01',0.00,55319.73,539.500,102.539,854.014,105.024),(8,'2012-06-29',0.00,57539.57,539.500,106.654,833.411,102.490),(9,'2012-07-26',3000.00,62356.72,566.767,110.022,852.890,104.886),(10,'2012-07-31',0.00,63181.67,566.767,111.477,864.443,106.307),(11,'2012-08-31',0.00,63293.25,566.767,111.674,847.570,104.232),(12,'2012-09-30',0.00,61808.83,566.767,109.055,877.620,107.927),(13,'2012-11-01',0.00,61670.32,566.767,108.811,860.404,105.810),(14,'2012-11-30',0.00,61768.50,566.767,108.984,876.050,107.734),(15,'2012-12-31',0.00,61572.99,566.767,108.639,876.960,107.846),(16,'2013-02-01',0.00,62983.57,566.767,111.128,904.630,111.249),(17,'2013-02-22',3000.00,66843.62,593.400,112.645,896.240,110.217),(18,'2013-02-28',0.00,67749.27,593.400,114.171,901.240,110.832),(19,'2013-03-19',3000.00,72109.77,619.159,116.464,927.200,114.024),(20,'2013-03-29',0.00,73521.87,619.159,118.745,931.070,114.500),(21,'2013-04-30',0.00,74918.09,619.159,121.000,936.820,115.207),(22,'2013-06-01',0.00,73060.36,619.159,117.999,957.870,117.796),(23,'2013-06-06',3000.00,74879.53,645.000,116.092,921.930,113.376),(24,'2013-06-29',0.00,74038.76,645.000,114.789,903.570,111.118),(25,'2013-07-31',0.00,74358.74,645.000,115.285,926.030,113.880),(26,'2013-08-31',0.00,72347.78,645.000,112.167,920.240,113.168),(27,'2013-09-30',0.00,74465.15,645.000,115.450,946.420,116.388),(28,'2013-10-31',0.00,77198.07,645.000,119.687,971.900,119.521),(29,'2013-11-30',0.00,76842.48,645.000,119.136,991.550,121.938),(30,'2013-12-23',0.00,75689.64,645.000,117.348,991.600,121.944),(31,'2013-12-31',3000.00,76580.41,671.298,114.078,1001.930,123.214),(32,'2013-12-31',0.00,79730.62,671.298,118.771,1001.930,123.214),(33,'2014-01-31',0.00,77970.27,671.298,116.149,967.290,118.954),(34,'2014-02-28',0.00,80050.85,671.298,119.248,982.990,120.885),(35,'2014-03-07',2000.00,81465.33,688.193,118.376,992.720,122.082),(36,'2014-03-31',0.00,83179.98,688.193,120.867,968.530,119.107),(37,'2014-04-30',0.00,84958.13,688.193,123.451,965.020,118.675),(38,'2014-05-30',0.00,87931.27,688.193,127.771,993.910,122.228),(39,'2014-06-29',0.00,87413.29,688.193,127.019,1013.190,124.599),(40,'2014-07-20',2500.00,91931.86,707.431,129.952,1002.160,123.243),(41,'2014-09-30',0.00,90768.83,707.431,128.308,1047.560,128.826),(42,'2014-10-17',2500.00,89614.90,727.733,123.143,1003.530,123.411),(43,'2014-10-31',0.00,94990.34,727.733,130.529,1057.520,130.051),(44,'2014-12-31',0.00,97002.85,727.733,133.295,1109.250,136.412),(45,'2015-01-31',0.00,105928.92,727.733,145.560,1194.770,146.929),(46,'2015-02-28',0.00,111207.76,727.733,152.814,1244.210,153.009),(47,'2015-03-08',2000.00,114736.95,740.643,154.915,1277.020,157.044),(48,'2015-04-01',0.00,118303.56,740.643,159.731,1297.400,159.550),(49,'2015-04-30',0.00,112769.03,740.643,152.258,1289.820,158.618),(50,'2015-05-30',0.00,117850.06,740.643,159.119,1305.880,160.593),(51,'2015-06-01',0.00,117710.07,740.643,158.930,1291.480,158.822),(52,'2015-06-24',3000.00,114176.64,760.629,150.108,1298.130,159.640),(53,'2015-06-30',0.00,110825.37,760.629,145.702,1252.610,154.042),(54,'2015-07-31',0.00,113151.13,760.629,148.760,1267.310,155.850),(55,'2015-08-26',600.00,102191.84,765.121,133.563,1092.400,134.340),(56,'2015-09-01',0.00,104910.02,765.121,137.116,1116.900,137.353),(57,'2015-09-30',0.00,103261.28,765.121,134.961,1059.130,130.249),(58,'2015-12-31',0.00,109198.88,765.121,142.721,1127.820,138.696),(59,'2016-01-19',2000.00,101815.25,780.452,130.457,1057.730,130.076),(60,'2016-03-31',0.00,105908.74,780.452,135.702,1062.850,130.706),(61,'2016-04-30',0.00,108008.04,780.452,138.392,1075.170,132.221),(62,'2016-05-31',0.00,108973.48,780.452,139.629,1098.260,135.061),(63,'2016-06-30',0.00,110238.80,780.452,141.250,1098.180,135.051),(64,'2016-07-18',37800.00,153179.23,1036.140,147.836,1142.160,140.459),(65,'2016-07-29',0.00,154011.09,1036.140,148.639,1150.190,141.447),(66,'2016-09-30',0.00,150172.30,1036.140,144.934,1131.510,139.150),(67,'2016-10-07',2000.00,151820.61,1049.971,144.595,1130.520,139.028),(68,'2016-11-30',0.00,156471.07,1049.971,149.024,1117.890,137.475),(69,'2016-12-27',2000.00,156845.04,1063.533,147.475,1163.700,143.108),(70,'2016-12-31',0.00,159667.80,1063.533,150.130,1160.380,142.700),(71,'2017-03-31',0.00,164060.54,1063.533,154.260,1195.630,147.035),(72,'2017-04-29',0.00,163249.09,1063.533,153.497,1208.870,148.663),(73,'2017-07-02',0.00,156437.30,1063.533,147.092,1205.620,148.264),(74,'2017-07-12',16000.00,166505.02,1176.596,141.514,1222.860,150.384),(75,'2017-07-21',0.00,174328.48,1176.596,148.163,1234.690,151.839),(137,'2017-08-02',5000.00,177987.74,1210.604,147.024,1238.610,152.321),(138,'2017-08-15',4000.00,177273.00,1238.560,143.128,1196.430,147.133); /*!40000 ALTER TABLE `histo` ENABLE KEYS */; UNLOCK TABLES; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -258,36 +263,6 @@ BEGIN SET @cours_ref_1 = (SELECT cours_ref FROM histo order by date DESC LIMIT 1); SET NEW.val_part_ref = NEW.cours_ref * @val_part_ref_1 / @cours_ref_1; -END */;; -DELIMITER ; -/*!50003 SET sql_mode = @saved_sql_mode */ ; -/*!50003 SET character_set_client = @saved_cs_client */ ; -/*!50003 SET character_set_results = @saved_cs_results */ ; -/*!50003 SET collation_connection = @saved_col_connection */ ; -/*!50003 SET @saved_cs_client = @@character_set_client */ ; -/*!50003 SET @saved_cs_results = @@character_set_results */ ; -/*!50003 SET @saved_col_connection = @@collation_connection */ ; -/*!50003 SET character_set_client = utf8 */ ; -/*!50003 SET character_set_results = utf8 */ ; -/*!50003 SET collation_connection = utf8_general_ci */ ; -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; -DELIMITER ;; -/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`127.0.0.1`*/ /*!50003 TRIGGER `bd_mesavoirs`.`histo_BEFORE_UPDATE` BEFORE UPDATE ON `histo` FOR EACH ROW -BEGIN - - -- valeur N-1 - SET @valeur_pf_1 = (SELECT valeur_pf FROM histo order by date DESC LIMIT 1); - SET @nb_part_1 = (SELECT nb_part FROM histo order by date DESC LIMIT 1); - -- valeur PF N - SET NEW.valeur_pf = (SELECT SUM(valeur) FROM allocation); - SET NEW.nb_part = @nb_part_1 + NEW.mvt_cash / ((NEW.valeur_pf - NEW.mvt_cash)/@nb_part_1); - SET NEW.val_part = NEW.valeur_pf / NEW.nb_part; - -- valeur part ref N-1 - SET @val_part_ref_1 = (SELECT val_part_ref FROM histo order by date DESC LIMIT 1); - SET @cours_ref_1 = (SELECT cours_ref FROM histo order by date DESC LIMIT 1); - SET NEW.val_part_ref = NEW.cours_ref * @val_part_ref_1 / @cours_ref_1; - END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -330,7 +305,7 @@ CREATE TABLE `members` ( LOCK TABLES `members` WRITE; /*!40000 ALTER TABLE `members` DISABLE KEYS */; -INSERT INTO `members` VALUES ('ctphuoc@gmail.com','CAO ','Thien Phuoc',177987.74,1123.00,0.6,3629.17,2.0,0.0,'a12ecaa430207687ad18a72564609d4f313184bd',NULL,NULL,'ADMIN',NULL,'2017-07-23 08:08:31','2017-08-02 06:10:30','2017-08-02 07:36:59'),('phuoc@caotek.fr','MEMBER','Lambda-One',0.00,NULL,NULL,NULL,NULL,0.0,'a12ecaa430207687ad18a72564609d4f313184bd',NULL,NULL,'MEMBRE',NULL,'2017-07-23 08:35:47','2017-07-23 06:38:28','2017-07-23 08:38:28'),('toa.armorial@gmail.com','CAO ','Thien-An',0.00,NULL,NULL,NULL,NULL,0.0,'a12ecaa430207687ad18a72564609d4f313184bd',NULL,NULL,'ADMIN',NULL,'2017-07-22 17:18:51','2017-07-26 08:31:49','2017-07-26 10:31:49'); +INSERT INTO `members` VALUES ('ctphuoc@gmail.com','CAO ','Thien Phuoc',167254.46,1663.54,1.0,4026.02,2.4,0.0,'a12ecaa430207687ad18a72564609d4f313184bd',NULL,NULL,'ADMIN',NULL,'2017-07-23 08:08:31','2017-09-28 07:54:28','2017-09-28 07:26:28'),('phuoc@caotek.fr','MEMBER','Lambda-One',0.00,NULL,NULL,NULL,NULL,0.0,'a12ecaa430207687ad18a72564609d4f313184bd',NULL,NULL,'MEMBRE',NULL,'2017-07-23 08:35:47','2017-07-23 06:38:28','2017-07-23 08:38:28'),('toa.armorial@gmail.com','CAO ','Thien-An',0.00,NULL,NULL,NULL,NULL,0.0,'a12ecaa430207687ad18a72564609d4f313184bd',NULL,NULL,'ADMIN',NULL,'2017-07-22 17:18:51','2017-07-26 08:31:49','2017-07-26 10:31:49'); /*!40000 ALTER TABLE `members` ENABLE KEYS */; UNLOCK TABLES; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -515,4 +490,4 @@ DELIMITER ; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2017-08-02 17:57:33 +-- Dump completed on 2017-09-28 10:07:41 diff --git a/caotek_mesavoirs/__init__.py b/caotek_mesavoirs/__init__.py index f8ffa16..34322e4 100644 --- a/caotek_mesavoirs/__init__.py +++ b/caotek_mesavoirs/__init__.py @@ -12,8 +12,8 @@ def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ # declarations - session_factory = UnencryptedCookieSessionFactoryConfig('Ty6sIUf1') - authn_policy = AuthTktAuthenticationPolicy('Ty6sIUe8', callback=groupfinder, hashalg='sha512') + session_factory = UnencryptedCookieSessionFactoryConfig('df53ktTE1G') + authn_policy = AuthTktAuthenticationPolicy('5D9Phu1xyP', callback=groupfinder, hashalg='sha512') authz_policy = ACLAuthorizationPolicy() mailer_factory_from_settings(settings) diff --git a/caotek_mesavoirs/static/css/style.less b/caotek_mesavoirs/static/css/style.less index 5baa756..59bda39 100644 --- a/caotek_mesavoirs/static/css/style.less +++ b/caotek_mesavoirs/static/css/style.less @@ -105,3 +105,44 @@ .logo-small { font-size: 50px; } + +.gly-spin { + -webkit-animation: spin 2s infinite linear; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + } +} +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + } +} +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg); + } + 100% { + -o-transform: rotate(359deg); + } +} +@keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} \ No newline at end of file diff --git a/caotek_mesavoirs/templates/actifs/actifs_list.pt b/caotek_mesavoirs/templates/actifs/actifs_list.pt index b683675..5acfd01 100644 --- a/caotek_mesavoirs/templates/actifs/actifs_list.pt +++ b/caotek_mesavoirs/templates/actifs/actifs_list.pt @@ -6,8 +6,8 @@
- + Nouvel actif
@@ -81,6 +81,13 @@
+ + diff --git a/caotek_mesavoirs/templates/actifs/allocation_edit.pt b/caotek_mesavoirs/templates/actifs/allocation_edit.pt index 08510bd..ea775ed 100644 --- a/caotek_mesavoirs/templates/actifs/allocation_edit.pt +++ b/caotek_mesavoirs/templates/actifs/allocation_edit.pt @@ -13,7 +13,7 @@
-
diff --git a/caotek_mesavoirs/templates/actifs/histo_list.pt b/caotek_mesavoirs/templates/actifs/histo_list.pt index b831bbf..96a1224 100644 --- a/caotek_mesavoirs/templates/actifs/histo_list.pt +++ b/caotek_mesavoirs/templates/actifs/histo_list.pt @@ -5,14 +5,14 @@ Retour - Maj valeur part + Entrée / Sortie cash

- + @@ -44,7 +44,8 @@ return '' + data + ''; }, }, - ] + ], + order: [[ 0, "desc" ]] }); }); diff --git a/caotek_mesavoirs/views/actifs.py b/caotek_mesavoirs/views/actifs.py index 144549b..0ce7b95 100644 --- a/caotek_mesavoirs/views/actifs.py +++ b/caotek_mesavoirs/views/actifs.py @@ -36,6 +36,7 @@ from ..views.default import ( ) import json +import time @view_config(route_name='actifs_list', renderer='../templates/actifs/actifs_list.pt', permission='view') def actifs_list(request): @@ -58,6 +59,7 @@ def actifs_list(request): sym = Share(item.symbole) # import pdb;pdb.set_trace() update_actif_valeur(request, item.symbole, sym.get_price()) + time.sleep(2) # attendre 2 secondes # update du portefeuille update_portefeuille(request, logged_in)
DateMvt CashE/S Cash Valeur Pf Nb Part Valeur Part