--Order 20010966.50
--INSERT VALUES IN TABLES

--WEBMENUGROUP and WEBMENUGROUP_DESC table

insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       1,
       'Linen',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       2,
       'Linen Reports',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       3,
       'Garments',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       4,
       'Garment Reports',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       5,
       'Cost Information',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       6,
       'Cost Reports',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       7,
       'Financial Information',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       8,
       'Delivery Documents',
	'Y',
       1,
       sysdate
);
insert into webmenugroup(webmenugroup_id,sequencenumber,factorydescription,active,systemuser_id,timestamp) values
(
       seq_webmenugroup.nextval,
       9,
       'Main',
	'Y',
       1,
       sysdate
);
insert into WEBMENUGROUP_DESC
select wmg.webmenugroup_id, l.language_id, wmg.factorydescription, 1, sysdate
   from webmenugroup wmg, 
           languages l
  where l.translatedescription='Y';


--insert into Dialogs table

----dialogs of type 3

begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Ingave Patiëntendagen'',
         ''WebAdjPatientDaysEntry'',
         ''Adjusted Patient Days Entry'',
         ''Eintrag Patiententage'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Entrée jours d`hospitalisation'',
         ''Indtastning af Patientdage'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Toewijzen Leveringen'',
         ''WebAllocateDeliveries'',
         ''Allocate Deliveries'',
         ''Stationsverteilung'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Attribuer livraisons'',
         ''Tildel leveringer'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/

begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Budget Ingave'',
         ''WebBudgetEntry'',
         ''Budget Entry'',
         ''Budget Eingabe'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Entrée budget'',
         ''Budgetindtastning'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Wijzigen Relatie'',
         ''WebChangeCustomer'',
         ''Change Customer'',
         ''Ändern Kunde'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Changer client'',
         ''Ændre kunde'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Wijzigen E-Mail'',
         ''WebChangeEmail'',
         ''Change Email'',
         ''E-Mail ändern'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Changer émail'',
         ''Ændre Email'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Wijzigen Wachtwoord'',
         ''WebChangePassword'',
         ''Change Password'',
         ''Passwort ändern'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Modifier mot de passe'',
         ''Ændre adgangskode'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Voorraad telling/bestelling bevestigen'',
         ''WebConfirmStockOrder'',
         ''Confirm Stock Counts / Orders'',
         ''Bestätigen Lagerzählungen/ Bestellungen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Confirmer comptages stock/commandes'',
         ''Bekræft optællinger / bestillinger'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Toon Uitleveroverzicht'',
         ''WebConsignmentNotes'',
         ''View Consignment Notes'',
         ''Zeige Frachtbriefe'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Afficher liste livraisons'',
         ''Vis samlefølgesedler'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Gebruiker gedefinieerde informatie'',
         ''WebCustomInformation'',
         ''Custom Information'',
         ''Benutzerdefinierten Daten'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Information personnalisée'',
         ''Brugerdefineret data'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/

begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Toon Afleverbonnen'',
         ''WebDeliveryNotes'',
         ''View Delivery Notes'',
         ''Zeige Lieferscheine'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Afficher bulletins de livraison'',
         ''Vis følgesedler'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Financiële details'',
         ''WebFinancialDetails'',
         ''Financial Details'',
         ''Finanzielle Details'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Détails financiers'',
         ''Finansdetaljer'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Kleding'',
         ''WebGarment'',
         ''Garments'',
         ''Kleidung'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Vêtements'',
         ''Beklædning'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Kleding-bestellingen'',
         ''WebGarmentOrder'',
         ''Garment Orders'',
         ''Kleidungs- Bestellung'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Commandes vêtements'',
         ''Tøjbestilling'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Standaarddocumenten'',
         ''WebGenericDocuments'',
         ''Generic Documents'',
         ''Allgemeine Dokumente'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Documents génériques'',
         ''Standarddokumenter'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Toon Facturen'',
         ''WebInvoices'',
         ''View Invoices'',
         ''Ansehen Rechnungen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Afficher factures'',
         ''Vis fakturaer'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Vakken'',
         ''WebLocker'',
         ''Lockers'',
         ''Fächer'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Casiers'',
         ''Skabe'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Afmelden'',
         ''WebLogOff'',
         ''Log Off'',
         ''Abmelden'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Déconnexion'',
         ''Log af'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Onderhoud Levernormen'',
         ''WebMaintainDelStandards'',
         ''Maintain Delivery Standards'',
         ''Wartung Lieferung Standards'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Gestion normes livraison '',
         ''Vedligehold af faste leveringer'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Onderhoud Voorraadnormen'',
         ''WebMaintainNormStockLevels'',
         ''Maintain Norm Stock Levels'',
         ''Wartung Liefernormen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Gestion normes de niveaux stock'',
         ''Vedligehold af lagerstandarder'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Maand Definities'',
         ''WebMonthDefinition'',
         ''Month Definition'',
         ''Monats- Definitionen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Définition mois'',
         ''Månedsdefinition'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Ingave Patiëntendagen'',
         ''WebPatientDaysEntry'',
         ''Patient Days Entry'',
         ''Eingabe Patiententage'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Entrée jours d`hospitalisation'',
         ''Indtastning af patientdage'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Ingave patiënten'',
         ''WebPatientsEntry'',
         ''Patients Entry'',
         ''Eingabe Patienten'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Entrée résidents'',
         ''Indtastning af patienter'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Toon betalingen'',
         ''WebPayments'',
         ''View Payments'',
         ''Zeige Zahlungen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Afficher paiements'',
         ''Vis betalinger'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/

begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Toon Verzamelfacturen'',
         ''WebStatements'',
         ''View Statements'',
         ''Zeige Anweisungen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Afficher factures regroupées'',
         ''Vis kontoudtog'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Voorraad Telling / Bestellingen'',
         ''WebStockCountOrder'',
         ''Stock Count / Order'',
         ''Bestandszählungen / Bestellungen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Comptages stock / commandes'',
         ''Lageroptælling / Bestilling'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Dragers'',
         ''WebWearer'',
         ''Wearers'',
         ''Träger'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Porteurs'',
         ''Medarbejdere'',
         3,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/

----dialogs of type 4

begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Toewijzingsformulier'',
         ''WebRptAllocationSheet'',
         ''AllocationSheet'',
         ''Zuteilungsblatt'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Feuille d`allocation'',
         ''Fordelingsskema'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Blanco bestel-formulier'',
         ''WebRptBlankOrderForm'',
         ''Blank Order Form'',
         ''leerer Bestellauftrag'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Feuille commande vide'',
         ''Tom bestillingsblanket'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Budgetkosten'',
         ''WebRptBudgetCosts'',
         ''Budget Costs'',
         ''Budgetkosten'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Coûts budget'',
         ''Budgetomkostninger'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Budget Bepaling'',
         ''WebRptBudgetDetermination'',
         ''Budget Determination'',
         ''Budget Bestimmung'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Définition budget'',
         ''Budgetbestemmelse'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Budget Afstemming'',
         ''WebRptBudgetReconcile'',
         ''Budget Reconciliation'',
         ''Budget Abstimmung'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Rapprochement budget'',
         ''Budgetafstemning'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Geleverde producten'',
         ''WebRptDeliveredProducts'',
         ''Delivered Products'',
         ''Gelieferte Produkte'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Produits livrés'',
         ''Leverede produkter'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Kleding bestellingen'',
         ''WebRptGarmentOrders'',
         ''Garment Orders'',
         ''Kleidungs- Auftrag'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Commandes vêtements'',
         ''Tøjbestillinger'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Kleding per drager'',
         ''WebRptGarmperWearer'',
         ''Garments per Wearer'',
         ''Kleidung pro Träger'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Vêtements par porteur'',
         ''Beklædning per medarbejder'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
--section break for pack_Script    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Inventaris Verbruik'',
         ''WebRptInventoryUtilisation'',
         ''Inventory Utilisation'',
         ''Inventar Nutzung'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Utilisation inventaire'',
         ''Beholdningsforbrug'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Maandelijks Verbruik'',
         ''WebRptMontlyUsage'',
         ''Monthly Usage'',
         ''Monatliche Nutzung'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Utilisation mensuelle'',
         ''Månedlig forbrug'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Tellingen / Bestellingen'',
         ''WebRptOrder'',
         ''Counts / Orders'',
         ''Zählungen / Bestellungen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Comptages / commandes'',
         ''Optællinger / Bestillinger'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Ontvangen aantallen'',
         ''WebRptReceivedQuantities'',
         ''Received Quantities'',
         ''empfangene Mengen'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Quantités reçues'',
         ''Modtagede mængder'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Scans per drager'',
         ''WebRptScansperWearer'',
         ''Scans per Wearer'',
         ''Scannungen pro Träger'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Scans par porteur'',
         ''Scans per medarbejder'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Dragers'',
         ''WebRptWearer'',
         ''Wearers'',
         ''Träger'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Porteurs'',
         ''Medarbejder'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/
    
begin
execute immediate ('insert into dialogs
  select seq_dialogs.nextval,
         ''Drager Inventaris'',
         ''WebRptWearerInventory'',
         ''Wearer Inventory'',
         ''Trägerbestand'',
         getminsystemuser(),
         ''Y'',
         sysdate,
         ''Y'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''N'',
         ''Inventaire porteur'',
         ''Medarbejderbeholdning'',
         4,
         0,
         trim('' '')
    from dual');
	commit;
exception when others then null;
end;
/

--WEBMENUDIALOG table

--Linen
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Linen') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebStockCountOrder')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Linen') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebConfirmStockOrder')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Linen') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebMaintainDelStandards')  dialog_id,
       3,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Linen') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebMaintainNormStockLevels')  dialog_id,
       4,
       1,
       sysdate
from dual;

--Linen Reports
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Linen Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptBlankOrderForm')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Linen Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptOrder')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Linen Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptDeliveredProducts')  dialog_id,
       3,
       1,
       sysdate
from dual;

--Garments
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garments') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebWearer')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garments') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebGarmentOrder')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garments') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebGarment')  dialog_id,
       3,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garments') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebLocker')  dialog_id,
       4,
       1,
       sysdate
from dual;

--Garment Reports
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garment Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptWearer')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garment Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptWearerInventory')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garment Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptGarmperWearer')  dialog_id,
       3,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garment Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptGarmentOrders')  dialog_id,
       4,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Garment Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptScansperWearer')  dialog_id,
       5,
       1,
       sysdate
from dual;

--Cost information
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebAllocateDeliveries')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptAllocationSheet')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebPatientDaysEntry')  dialog_id,
       3,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebAdjPatientDaysEntry')  dialog_id,
       4,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebPatientsEntry')  dialog_id,
       5,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebBudgetEntry')  dialog_id,
       6,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebMonthDefinition')  dialog_id,
       7,
       1,
       sysdate
from dual;

--Cost Reports
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptMontlyUsage')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptReceivedQuantities')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptInventoryUtilisation')  dialog_id,
       3,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptBudgetCosts')  dialog_id,
       4,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptBudgetDetermination')  dialog_id,
       5,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Cost Reports') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebRptBudgetReconcile')  dialog_id,
       6,
       1,
       sysdate
from dual;

--Financial Information
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Financial Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebFinancialDetails')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Financial Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebInvoices')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Financial Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebPayments')  dialog_id,
       3,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Financial Information') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebStatements')  dialog_id,
       4,
       1,
       sysdate
from dual;

--Delivery Documents
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Delivery Documents') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebDeliveryNotes')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Delivery Documents') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebConsignmentNotes')  dialog_id,
       2,
       1,
       sysdate
from dual;

--Main
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Main') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebGenericDocuments')  dialog_id,
       1,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Main') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebCustomInformation')  dialog_id,
       2,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Main') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebChangeEmail')  dialog_id,
       3,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Main') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebChangePassword')  dialog_id,
       4,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Main') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebChangeCustomer')  dialog_id,
       5,
       1,
       sysdate
from dual;
insert into webmenudialog(webmenudialog_id,webmenugroup_id,dialog_id,sequencenumber,systemuser_id,timestamp)
select
       seq_webmenudialog.nextval,
       (select wmg.webmenugroup_id from webmenugroup wmg where wmg.factorydescription = 'Main') webmenugroup_id,
       (select d.dialog_id from dialogs d where d.code = 'WebLogOff')  dialog_id,
       6,
       1,
       sysdate
from dual;

--WEBMENUDIALOG_DESC table
insert into WEBMENUDIALOG_DESC
select wmd.webmenudialog_id, l.language_id,
       (select 
          (case (substr(l.code,1,2))
            when 'DK' then nvl(d.dkdescription, d.endescription)
            when 'FR' then nvl(d.frdescription, d.endescription)
            when 'DE' then nvl(d.gedescription, d.endescription)
            when 'NL' then nvl(d.nldescription, d.endescription)
            else d.endescription end) 
          from dialogs d
         where d.dialog_id = wmd.dialog_id), 1, sysdate
  from webmenudialog wmd, languages l
 where l.translatedescription = 'Y';

--WEBUSERDIALOG table


-- Linen
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          webmenugroup wmg
where wmg.webmenugroup_id=wmd.webmenugroup_id
    and wmg.factorydescription in ('Linen', 'Linen Reports')
    and (w.accessnongarments='Y' or w.accesssalesitems='Y');

-- Garments
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          webmenugroup wmg,
          dialogs d
where wmg.webmenugroup_id=wmd.webmenugroup_id
    and d.dialog_id=wmd.dialog_id
    and wmg.factorydescription in ('Garments', 'Garment Reports')
    and w.accessgarments='Y'
    and (d.code <> 'WebLockers' or w.allowlockerentry='Y');

-- Financial Info
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          webmenugroup wmg
where wmg.webmenugroup_id=wmd.webmenugroup_id
    and wmg.factorydescription = 'Financial Information'
    and w.accessfinancialdetails='Y';

-- Cost Information: Allocate Deliveries
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          dialogs d
where d.dialog_id=wmd.dialog_id
    and d.code = 'WebAllocateDeliveries'
    and w.allowdeliveryrealloc='Y'; 

-- Cost Information: Patient Days Entry
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          dialogs d
where d.dialog_id=wmd.dialog_id
    and d.code = 'WebPatientDaysEntry'
    and w.allowpatientdayentry='Y';

-- Cost Information: Adjusted Patient Days Entry for customer ANG only
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          dialogs d
where d.dialog_id=wmd.dialog_id
    and d.code = 'WebAdjPatientDaysEntry'
    and w.allowpatientdayentry='Y'
    and (select min(code) from databasesettings) = 'ANG';

-- Cost Information: Budget Entry
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          dialogs d
where d.dialog_id=wmd.dialog_id
    and d.code = 'WebBudgetEntry'
    and w.allowbudgetentry='Y';

-- Cost Reports
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval,w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          webmenugroup wmg
where wmg.webmenugroup_id=wmd.webmenugroup_id
    and wmg.factorydescription = 'Cost Reports'
    and w.allowcostreports='Y';

-- Main
insert into WEBUSERDIALOG
select seq_webuserdialog.nextval, w.webuser_id, wmd.webmenudialog_id, null, 1, sysdate
  from webuser w,
          webmenudialog wmd,
          webmenugroup wmg
where wmg.webmenugroup_id=wmd.webmenugroup_id
    and wmg.factorydescription = 'Main';
