﻿INSERT INTO yaction (numaction) VALUES (50059);
UPDATE yaction SET liste = 'xtypeaction' WHERE numaction = '50059';
UPDATE yaction SET caption = 'action' WHERE numaction = '50059';
UPDATE yaction SET orderdefault = 'xtypaction.bbmindex' WHERE numaction = '50059';
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '50059', '1', 'xtypeaction', NULL, NULL, NULL, 'INNER');
UPDATE yaction SET orderdefault = 'xtypeaction.bbmindex' WHERE numaction = '50059';
UPDATE yaction SET action = 'tous' WHERE numaction = '50059';
INSERT INTO yactionimport (numaction, cle, nomchamp, alias) VALUES ('50059', '1', '$_POST[dossier]', 'dossier');
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50059', '1', 'bbmindex', 'xtypeaction', NULL);
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50059', '2', '$_POST[dossier]', 'dossier', NULL);
INSERT INTO yaction (numaction) VALUES (50060);
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('50059', '1', '50060', NULL, NULL);
UPDATE yactionlink SET icone = 'style/common/icones/hand2.gif' WHERE numaction = '50059' AND cle = '1';
UPDATE yaction SET type = 'SELECT' WHERE numaction = '50060';
UPDATE yaction SET liste = 'xtypeaction' WHERE numaction = '50060';
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50060', '1', 'xtypeaction.libelleaction', 'libelleaction', NULL);
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50060', '1', NULL, NULL, NULL, 'xtypeaction.bbmindex', '=', '$_POST[xtypeaction]');
INSERT INTO yaction (numaction) VALUES (50061);
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('50060', '1', '50061', NULL, NULL);
UPDATE yaction SET type = 'UPDATE' WHERE numaction = '50061';
UPDATE yaction SET liste = 'dossier' WHERE numaction = '50061';
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50061', '1', 'dossier.commentairefin', '$_PARAM[50059.commentairefin]', NULL, NULL, 0, 'Toujours');
UPDATE yaction SET type = 'SELECT' WHERE numaction = '50061';
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50061', '1', 'dossier.commentairefin', 'commentairefin', NULL);
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50061', '1', NULL, NULL, NULL, 'dossier.bbmindex', '=', '$_POST[dossier]');
INSERT INTO yaction (numaction) VALUES (50062);
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('50061', '1', '50062', NULL, NULL);
UPDATE yaction SET type = 'UPDATE' WHERE numaction = '50062';
UPDATE yaction SET liste = 'dossier' WHERE numaction = '50062';
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50062', '1', 'dossier.commentairefin', '$_PARAM[50061.commentairefin] - $_PARAM[50061.libelleaction]', NULL, NULL, 0, 'Toujours');
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50062', '1', NULL, NULL, NULL, 'dossier.bbmindex', '=', '$_POST[dossier]');
INSERT INTO yaction (numaction) VALUES (50063);
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('50062', '1', '50063', NULL, NULL);
UPDATE yaction SET type = 'TAB' WHERE numaction = '50063';
UPDATE yaction SET action = 'Fermer' WHERE numaction = '50063';
UPDATE yactionupdate SET `right` = '$_PARAM[50061.commentairefin] - $_PARAM[50060.libelleaction]' WHERE numaction = '50062' AND cle = '1';
INSERT INTO yaction (numaction) VALUES (50073);
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50066', '1', NULL, NULL, NULL, '1', '=', '1');
UPDATE yactionlink SET icone = 'style/common/icones/actiondeleteok.gif' WHERE numaction = '50174' AND cle = '1';
DELETE FROM yactionlink WHERE numaction = '50174' AND cle = '1';
DELETE FROM yactionimport WHERE numaction = '50174' AND cle = '1';
DELETE FROM yactionexport WHERE numaction = '50174' AND cle = '1';
DELETE FROM yactionexport WHERE numaction = '50174' AND cle = '2';
DELETE FROM ylientable WHERE numaction = '50174' AND cle = '1';
DELETE FROM yactionexport WHERE numaction = '60001' AND cle = '6';
DELETE FROM yactionexport WHERE numaction = '60001' AND cle = '7';
DELETE FROM yactionupdate WHERE numaction = '60002' AND cle = '6';
DELETE FROM yactionupdate WHERE numaction = '60002' AND cle = '7';
INSERT INTO yactionimport (numaction, cle, nomchamp, alias) VALUES ('60001', '1', '$_POST[client]', 'client');
INSERT INTO yactionimport (numaction, cle, nomchamp, alias) VALUES ('60001', '2', '$_POST[dossier]', 'dossier');
UPDATE yactionexport SET nomchamp = 'client.bbmindex' WHERE numaction = '60000' AND cle = '2';
UPDATE yaction SET commentaire = 'on selectionne le client a facturer' WHERE numaction = '60000';
UPDATE yaction SET commentaire = 'on exporte les donnees client' WHERE numaction = '60001';
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '60001', '7', '$_POST[dossier]', 'dossier', NULL);
UPDATE ycontrainte SET `right` = '$_PARAM[60000.client]' WHERE numaction = '60001' AND cle = '1';
UPDATE ycontrainte SET `right` = '$_PARAM[60000.dossier]' WHERE numaction = '60002' AND cle = '1';
UPDATE yactionexport SET nomchamp = 'bbmindex' WHERE numaction = '60000' AND cle = '2';
UPDATE ycontrainte SET `right` = '$_PARAM[60000.bbmindex]' WHERE numaction = '60001' AND cle = '1';
UPDATE ycontrainte SET `right` = '$_POST[dossier]' WHERE numaction = '60002' AND cle = '1';
UPDATE ycontrainte SET `right` = '$_POST[client]' WHERE numaction = '60001' AND cle = '1';
DELETE FROM yactionexport WHERE numaction = '60001' AND cle = '7';
DELETE FROM yactionimport WHERE numaction = '60001' AND cle = '1';
DELETE FROM yactionimport WHERE numaction = '60001' AND cle = '2';
INSERT INTO yactionimport (numaction, cle, nomchamp, alias) VALUES ('60002', '1', '$POST[dossier]', 'dossier');
DELETE FROM yactionimport WHERE numaction = '60002' AND cle = '1';
INSERT INTO yactionimport (numaction, cle, nomchamp, alias) VALUES ('60002', '1', '$_POST[dossier]', 'dossier');
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '60002', '1', 'client', NULL, NULL, NULL, 'INNER');
DELETE FROM ylientable WHERE numaction = '50071' AND cle = '3';
DELETE FROM ylientable WHERE numaction = '50071' AND cle = '2';
DELETE FROM ylientable WHERE numaction = '50071' AND cle = '1';
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '50071', '5', 'facturefourniture', 'numfacture', 'facture', 'bbmindex', 'INNER');
DELETE FROM ylientable WHERE numaction = '50071' AND cle = '4';
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '50071', '6', 'facture', 'tva', 'xcodetva', 'tva', 'INNER');
UPDATE yactionexport SET nomchamp = 'xcodetva.comptevente' WHERE numaction = '50071' AND cle = '1';
UPDATE yactionexport SET alias = 'codevente' WHERE numaction = '50071' AND cle = '1';
UPDATE yactionexport SET nomchamp = 'xcodetva.comptetvavente' WHERE numaction = '50071' AND cle = '3';
UPDATE yactionupdate SET `right` = '$_PARAM[50071.codevente]' WHERE numaction = '50072' AND cle = '1';
UPDATE yactionupdate SET `right` = 'VTE' WHERE numaction = '50089' AND cle = '1';
UPDATE yactionupdate SET `right` = '$_PARAM[50099.valeurencours]' WHERE numaction = '50100' AND cle = '1';
UPDATE yaction SET action = 'tous' WHERE numaction = '60043';
UPDATE yaction SET action = 'tous' WHERE numaction = '60043';
UPDATE ycontrainte SET `actif` = 'SiNonVide' WHERE numaction = '60037' AND cle = '1';
DELETE FROM yactionlink WHERE numaction = '60048' AND cle = '1';
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('60048', '1', '60031', NULL, NULL);
UPDATE yactionexport SET nomchamp = 'client.nomclient' WHERE numaction = '60041' AND cle = '3';
UPDATE yactionexport SET nomchamp = 'client.nomclientlivraison' WHERE numaction = '60041' AND cle = '3';

-- 21/06
INSERT INTO yaction (numaction) VALUES (60067);
UPDATE yaction SET type = 'SELECT' WHERE numaction = '60067';
UPDATE yaction SET liste = 'devisdossier' WHERE numaction = '60067';
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '60067', '1', NULL, NULL, NULL, 'devisdossier.numdossier', '=', '$_POST[dossier]');
INSERT INTO yaction (numaction) VALUES (60068);
UPDATE yaction SET type = 'IF' WHERE numaction = '60068';
INSERT INTO yactionif (numexp, numif, numaction, cle, `left`, op, `right`) VALUES (NULL, '1', '60068', '1', '$_FUNC[NbRows,60067]', '>', '1');
INSERT INTO yactionif (numexp, numif, numaction, cle, `left`, op, `right`) VALUES (NULL, '2', '60068', '2', '$_FUNC[NbRows,60067]', '<=', '1');
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('60068', '1', NULL, '302', NULL);
INSERT INTO yaction (numaction) VALUES (60069);
UPDATE yaction SET type = 'MSG' WHERE numaction = '60069';
INSERT INTO yactionuser (bbmindex, numaction, `cle`, `type`, msg) VALUES (NULL, '60069', '1', 'alert', 'déjà 1 devis sur le dossier');
DELETE FROM yactionlink WHERE numaction = '60068' AND cle = '1';
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('60068', '1', '302', '2', NULL);
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('60068', '2', '60069', '1', NULL);
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('60067', '1', '60068', NULL, NULL);


-- 25/6

INSERT INTO yaction (numaction) VALUES (60070);
UPDATE yaction SET commentaire = 'verification de l\'acompte' WHERE numaction = '60070';
DELETE FROM yaction WHERE numaction = '60070';
INSERT INTO yaction (numaction) VALUES (60070);
UPDATE yaction SET type = 'UPDATE' WHERE numaction = '60070';
INSERT INTO yactionlink (numaction, cle, next, nextif, child) VALUES ('60070', '1', '10160', NULL, NULL);
UPDATE yaction SET liste = 'devis' WHERE numaction = '60070';
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '60070', '1', 'devis.acomptettc', '0', NULL, NULL, 0, 'Toujours');
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '60070', '1', NULL, NULL, NULL, 'devis.bbmindex', '=', '$_POST[devis]');
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '60070', '1', 'devis.acomptettc', '0', NULL, NULL, 0, 'Toujours');
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '60070', '1', 'devis.acomptettc', '0', NULL, NULL, 0, 'Toujours');
UPDATE yactionupdate SET `right` = '-2' WHERE numaction = '50092' AND cle = '1';
UPDATE yactionupdate SET `right` = '-1' WHERE numaction = '50092' AND cle = '1';
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50071', '2', NULL, NULL, NULL, 'facture.aexporter', '=', '1');
DELETE FROM ycontrainte WHERE numaction = '50071' AND cle = '1';
UPDATE yaction SET liste = 'clientcontrat' WHERE numaction = '50032';
UPDATE yaction SET liste = 'export' WHERE numaction = '50032';
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50032', '1', 'export.numfacture', 'numreglement', NULL);
DELETE FROM ycontrainte WHERE numaction = '50032' AND cle = '1';
UPDATE yactionexport SET fonctionsql = 'DISTINCT' WHERE numaction = '50032' AND cle = '1';
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50033', '1', NULL, NULL, NULL, 'facturereglement.numreglement', '=', '$_PARAM[50032.numreglement]');
UPDATE yaction SET liste = 'facturereglement' WHERE numaction = '50032';
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50032', '1', NULL, NULL, NULL, 'facturereglement.exportee', '=', '0');
DELETE FROM yactionexport WHERE numaction = '50032' AND cle = '1';
DELETE FROM ycontrainte WHERE numaction = '50033' AND cle = '1';
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50032', '1', 'facturereglement.bbmindex', 'reglement', NULL);
UPDATE ycontrainte SET `left` = 'facturereglement.exporte' WHERE numaction = '50032' AND cle = '1';
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50029', '7', 'facturereglement.codebanque', 'codebanque', NULL);
UPDATE yactionupdate SET `right` = '$_PARAM[50029.codebanque]' WHERE numaction = '50030' AND cle = '1';
UPDATE yactionupdate SET `right` = '$_PARAM[50029.codebanque]' WHERE numaction = '50031' AND cle = '1';
UPDATE yactionexport SET nomchamp = 'reglementglobal.codebanque' WHERE numaction = '50029' AND cle = '7';
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '50029', '2', 'facturereglement', 'numreglement', 'reglementglobal', 'bbmindex', 'INNER');
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50029', '7', 'facturereglement.codebanque', 'codebanque', NULL);
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '50029', '2', 'facturereglement', 'numreglement', 'reglementglobal', 'bbmindex', 'INNER');
UPDATE yactionexport SET nomchamp = 'reglementglobal.codebanque' WHERE numaction = '50029' AND cle = '7';
UPDATE yactionupdate SET `right` = '$_PARAM[50029.codebanque]' WHERE numaction = '50030' AND cle = '1';
UPDATE yactionupdate SET `right` = '$_PARAM[50029.codebanque]' WHERE numaction = '50031' AND cle = '1';
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50029', '8', 'reglementglobal.dateecheance', 'dateecheance', NULL);
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '50029', '3', 'reglementglobal', 'codebanque', 'xbanque', 'codebanque', 'INNER');
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50029', '9', 'xbanque.comptebanque', 'comptebanque', NULL);
UPDATE yactionupdate SET `right` = '411000' WHERE numaction = '50030' AND cle = '2';
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50030', '11', 'export.compteauxiliaire', '$_PARAM[50029.codecomptable]', NULL, NULL, 0, 'Toujours');
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50030', '12', 'export.dateecheance', '$_PARAM[50029.dateecheance]', NULL, NULL, 0, 'Toujours');
UPDATE yactionupdate SET `right` = '$_PARAM[50029.comptebanque]' WHERE numaction = '50031' AND cle = '4';
UPDATE yactionupdate SET `right` = '$_PARAM[50029.codecomptable] $_PARAM[50029.typereglement]' WHERE numaction = '50031' AND cle = '6';
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50031', '11', 'export.dateecheance', '$_PARAM[50029.dateecheance]', NULL, NULL, 0, 'Toujours');
UPDATE yactionupdate SET `right` = '$_PARAM[50029.nomclientfacturation]' WHERE numaction = '50030' AND cle = '5';
INSERT INTO ylientable (bbmindex, numaction, cle, nomtable1, nomchamp1, nomtable2, nomchamp2, typelien) VALUES (NULL, '50029', '3', 'reglementglobal', 'codebanque', 'xbanque', 'codebanque', 'INNER');
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50029', '8', 'reglementglobal.dateecheance', 'dateecheance', NULL);
INSERT INTO yactionexport (bbmindex, numaction, cle, nomchamp, alias, fonctionsql) VALUES (NULL, '50029', '9', 'xbanque.comptebanque', 'comptebanque', NULL);
UPDATE yactionupdate SET `right` = '$_PARAM[50029.nomclientfacturation]' WHERE numaction = '50030' AND cle = '5';
UPDATE yactionupdate SET `right` = '411000' WHERE numaction = '50030' AND cle = '2';
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50030', '11', 'export.compteauxiliaire', '$_PARAM[50029.codecomptable]', NULL, NULL, 0, 'Toujours');
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50030', '12', 'export.dateecheance', '$_PARAM[50029.dateecheance]', NULL, NULL, 0, 'Toujours');
UPDATE yactionupdate SET `right` = '$_PARAM[50029.comptebanque]' WHERE numaction = '50031' AND cle = '4';
UPDATE yactionupdate SET `right` = '$_PARAM[50029.codecomptable] $_PARAM[50029.typereglement]' WHERE numaction = '50031' AND cle = '6';
INSERT INTO yactionupdate (bbmindex, numaction, cle, `left`, `right`, `fonctionphp`, `paramphp`, `isvar`, `actif`) VALUES (NULL, '50031', '11', 'export.dateecheance', '$_PARAM[50029.dateechenace]', NULL, NULL, 0, 'Toujours');
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50029', '2', NULL, NULL, NULL, 'facturereglement.datereglement', '>=', '$_POST[datereglement]');
UPDATE ycontrainte SET `actif` = 'SiNonVide' WHERE numaction = '50029' AND cle = '2';
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50029', '3', NULL, NULL, NULL, 'facturereglement.datereglement', '<=', '$_POST[datereglementfin]');
UPDATE ycontrainte SET `actif` = 'SiNonVide' WHERE numaction = '50029' AND cle = '3';
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50029', '2', NULL, NULL, NULL, 'facturereglement.datereglement', '>=', '$_POST[datereglement]');
UPDATE ycontrainte SET `actif` = 'SiNonVide' WHERE numaction = '50029' AND cle = '2';
INSERT INTO ycontrainte (`numcontrainte`, `numaction`, `cle`, `champwhere`, `champcomp`, `champvalue`, `left`, `op`, `right`) VALUES (NULL, '50029', '3', NULL, NULL, NULL, 'facturereglement.datereglement', '<=', '$_POST[datereglementfin]');
UPDATE ycontrainte SET `actif` = 'SiNonVide' WHERE numaction = '50029' AND cle = '3';
UPDATE yactionupdate SET `right` = 'X$_PARAM[50029.codecomptable]' WHERE numaction = '50030' AND cle = '11';
UPDATE yactionupdate SET `right` = 'X$_PARAM[50029.codecomptable]' WHERE numaction = '50030' AND cle = '11';

-- 17/09 BGI
