This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Create multiple DBs from same backup | |
| Script created by Nikolas Demiridis (nikolas@demiridis.gr) | |
| Date: 25/10/2017 | |
| Version: 20171025.01 | |
| Change every line after a CHANGE comment | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @heid uniqueidentifier | |
| DECLARE @heitemid uniqueidentifier | |
| DECLARE @hepropcmpsid uniqueidentifier | |
| DECLARE @hecmpsid uniqueidentifier | |
| DECLARE db_cursor CURSOR FOR | |
| SELECT | |
| heid, | |
| heitemid, | |
| hecmpsid | |
| FROM heretailentrylines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Μας επιστρέφει όλα τα hotel transactions και τον δημοτικό φόρο. | |
| Ελέγχει αν έχει υπολογιστεί δημοτικός φόρος όπου θα έπρεπε να περιλαμβάνεται, | |
| με βάση την υπηρεσία και τις πρόσθετες χρεώσεις της. | |
| Ελέγχει αν το πεδίο του δημοτικού φόρου στη γραμμή του transaction είναι | |
| διαφορετικό από την πρόσθετη χρέωση της υπηρεσίας που αντιστοιχεί στο | |
| business unit και επιπλέον, ελέγχει μόνο τα transactions που ΔΕΝ είναι | |
| αυτοπαράδοση. | |
| */ | |
| SELECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| heRetDocEntries.HEDOCCODE AS DocCode, | |
| heRetDocEntries.HEREFNUMBER AS RefNumber, | |
| heRetDocEntries.HEENTRYDATE AS EntryDate, | |
| heRetDocEntries.HETTOTALVAL AS Total, | |
| heRetDocEntries.HERETAILSTATION AS RetailStation, | |
| heResOrders.HEORDERNO AS OrderNo, | |
| heResServSections.HECODE AS ServingSectionCode, | |
| heResServSections.HENAME AS ServingSection, | |
| hePDARoles.HECODE AS PDACode, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @hotelID uniqueidentifier, | |
| @fromDate datetime, | |
| @toDate datetime, | |
| @RmtpID uniqueidentifier, | |
| @rmCnt int, | |
| @hotelPax int, | |
| @existsRows int | |
| SET @fromDate = '01 jan 2017' | |
| SET @toDate = '31 dec 2017' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Ενημέρωση γραμμών με τιμές (τελευταία υπολογιζομένη τιμή κόστους) | |
| UPDATE HEWENTLINES | |
| SET HEPRICE = ROUND((SELECT | |
| CASE | |
| WHEN ISNULL(purprc.HEITEMCOST, 0) = 0 THEN lines.HEPRICE | |
| ELSE purprc.HEITEMCOST | |
| END AS newprice | |
| FROM HEDOCENTRIES doc, | |
| HEWENTLINES lines, | |
| HEITEMS ite, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| heReservPlan.HEID, | |
| heReservations.HERESNUM, | |
| heReservPlan.HEDISCOUNT, | |
| heReservPlan.HEDISCOUNTTYPE, | |
| heReservPlan.HEMANUALROOMPRICE, | |
| heReservPlan.HEROOMPRICE, | |
| heRatePlans.HEDISCOUNTABLE | |
| FROM heReservPlan | |
| INNER JOIN heRatePlans |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Ενημερώνει τον τύπο του κατόχου και το ID του συναλλασόμενου | |
| και το όνομα του. | |
| Θα πρέπει μετά να εκτελεστεί ανακατασκευή κινήσεων. | |
| Με μικρές μεταβολές μπορεί να χρησιμοποιηθεί για να μεταβάλλει | |
| και άλλα δεδομένα σε αξιόγραφα που έχουν κινηθεί. | |
| Οι αλλαγές γίνονται στον πίνακα BankNoteTrans και BankNotes, | |
| αλλά στον πρώτο, βρίσκονται τα δεδομένα για την κατάσταση του | |
| αξιογράφου. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Ενημερώνει όλα τα hotel transactions με το δημοτικό φόρο, | |
| αν η υπηρεσία που αντιστοιχεί στο business unit, έχει δημοτικό φόρο και | |
| εφόσον το transaction δεν αφορά σε αυτοπαράδοση. | |
| */ | |
| UPDATE heHotelTransactions | |
| SET heHotelTransactions.heMunTax = heChargeGroupCharges.heValue | |
| FROM heHotelTransactions | |
| INNER JOIN heItems | |
| ON heHotelTransactions.heBuItemID = heItems.heID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| BANKNOTES.HEID, | |
| BANKNOTES.HECODE, | |
| BANKNOTES.HENAME, | |
| 'HEBANKNOTETRANSTYPES' AS TBL | |
| FROM | |
| HEBANKNOTETRANSTYPES BANKNOTES | |
| LEFT JOIN HECOMPANIES COMPANY ON BANKNOTES.HECOMPID = COMPANY.HEID | |
| UNION ALL | |
| SELECT |
OlderNewer