Big Chunk of updates on way to making the sales portion working

This commit is contained in:
Amritanshu
2019-07-06 13:46:18 +05:30
parent 87076d9c00
commit d69ab0063a
83 changed files with 1621 additions and 415 deletions

View File

@ -14,7 +14,7 @@ call:copyQuery k-Vouchers "SELECT 'INSERT INTO vouchers(id, date, pax, user_id,
call:copyQuery l-Voucher-Food-Table "SELECT 'INSERT INTO voucher_food_table(id, voucher_id, food_table_id, status) VALUES (''' + CAST(newid() AS Nvarchar(36)) + ''', ' + '''' + CAST(VoucherID AS Nvarchar(36)) + ''', ' + '''' + CAST(FoodTableID AS Nvarchar(36)) + ''', ' + '''' + Status + ''');' FROM Test.dbo.FoodTables WHERE VoucherID IS NOT NULL;"
call:copyQuery m-Kots "SELECT 'INSERT INTO kots(id, voucher_id, code, food_table_id, date, user_id) VALUES (''' + CAST(KotID AS Nvarchar(36)) + ''', ' + '''' + CAST(VoucherID AS Nvarchar(36)) + '''' + ', ' + CAST(Code AS Nvarchar(36)) + ', ' + '''' + CAST(TableID AS Nvarchar(36)) + '''' + ', ' + '''' + CONVERT(Nvarchar(36), Date, 126) + ''', ' + '''' + CAST(UserID AS Nvarchar(36)) + '''' + ');' FROM Test.dbo.Kots;"
call:copyQuery n-Inventories "SELECT 'INSERT INTO inventories(id, kot_id, product_id, sort_order, quantity, price, is_happy_hour, service_charge, is_sc_taxable, service_tax_rate, vat_rate, service_tax_id, vat_id, discount) VALUES (''' + CAST(InventoryID AS Nvarchar(36)) + ''', ' + '''' + CAST(KotID AS Nvarchar(36)) + '''' + ', ' + '''' + CAST(ProductID AS Nvarchar(36)) + '''' + ', ' + CAST(SortOrder AS Nvarchar(36)) + ', ' + CAST(Quantity AS Nvarchar(36)) + ', ' + CAST(Price AS Nvarchar(36)) + ', ' + CASE WHEN IsHappyHour = 1 THEN 'true' ELSE 'false' END + ', ' + CAST(ServiceCharge AS Nvarchar(36)) + ', ' + CASE WHEN IsScTaxable = 1 THEN 'true' ELSE 'false' END + ', ' + CAST(ServiceTaxRate AS Nvarchar(36)) + ', ' + CAST(VatRate AS Nvarchar(36)) + ', ' + '''' + CAST(ServiceTaxID AS Nvarchar(36)) + '''' + ', ' + '''' + CAST(VatID AS Nvarchar(36)) + '''' + ', ' + CAST(Discount AS Nvarchar(36)) + ');' FROM Test.dbo.Inventories;"
call:copyQuery o-Modifiers "SELECT 'INSERT INTO modifiers(id, name, show_in_bill, price) VALUES (''' + CAST(ModifierID AS Nvarchar(36)) + ''', ' + '''' + REPLACE(Name, '''', '''''') + '''' + ', ' + CASE WHEN ShowInBill = 1 THEN 'true' ELSE 'false' END + ', ' + CAST(Price AS Nvarchar(36)) + ');' FROM Test.dbo.Modifiers;"
call:copyQuery o-Modifiers "SELECT 'INSERT INTO modifiers(id, name, show_in_bill, is_active, modifier_category_id, price) VALUES (''' + CAST(ModifierID AS Nvarchar(36)) + ''', ' + '''' + REPLACE(Name, '''', '''''') + '''' + ', ' + CASE WHEN ShowInBill = 1 THEN 'true' ELSE 'false' END + ', true, {ID}, ' + CAST(Price AS Nvarchar(36)) + ');' FROM Test.dbo.Modifiers;"
call:copyQuery p-InventoryModifiers "SELECT 'INSERT INTO inventory_modifiers(id, inventory_id, modifier_id, price) VALUES (''' + CAST(InventoryModifierID AS Nvarchar(36)) + ''', ' + '''' + CAST(InventoryID AS Nvarchar(36)) + '''' + ', ' + '''' + CAST(ModifierID AS Nvarchar(36)) + '''' + ', 0);' FROM Test.dbo.InventoryModifiers;"
call:copyQuery q-Sections "SELECT 'INSERT INTO sections(id, name) VALUES (''' + CAST(NewID() AS Nvarchar(36)) + ''', ''' + Location + ''');' FROM Test.dbo.PrintLocations GROUP BY Location;"
call:copyQuery r-MachineLocations "SELECT 'INSERT INTO machine_locations(id, machine_name, location_id) SELECT ''' + CAST(MachineLocationID AS Nvarchar(36)) + ''', ' + '''' + REPLACE(Machine, '''', '''''') + '''' + ', id from locations where name = ' + '''' + REPLACE(Location, '''', '''''') + '''' + ';' FROM Test.dbo.MachineLocations;"