{"id":17176,"date":"2020-06-19T22:56:57","date_gmt":"2020-06-20T02:56:57","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/our_profit_loss-2\/"},"modified":"2020-06-20T13:25:05","modified_gmt":"2020-06-20T17:25:05","slug":"our_profit_loss-2","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=17176","title":{"rendered":"our_profit_loss"},"content":{"rendered":"<p>USE [AmazonProfitLossOrderManagement]<br \/>\nGO<br \/>\n\/****** Object: StoredProcedure [dbo].[our_profit_loss] Script Date: 2020-06-19 10:17:11 PM ******\/<br \/>\nSET ANSI_NULLS ON<br \/>\nGO<br \/>\nSET QUOTED_IDENTIFIER ON<br \/>\nGO<br \/>\nremove-this-phrase&#8211; Alter Procedure our_profit_loss<br \/>\nremove-this-phrase&#8211; =============================================<br \/>\nremove-this-phrase&#8211; Author: &lt;Author,,Name&gt;<br \/>\nremove-this-phrase&#8211; Create date: &lt;Create Date,,&gt;<br \/>\nremove-this-phrase&#8211; Description:\t&lt;Description,,&gt;<br \/>\nremove-this-phrase&#8211; =============================================<br \/>\nCREATE PROCEDURE [dbo].[our_profit_loss]<br \/>\nAS<br \/>\nBEGIN<br \/>\nremove-this-phrase&#8211; SET NOCOUNT ON added to prevent extra result sets from<br \/>\nremove-this-phrase&#8211; interfering with SELECT statements.<br \/>\nSET NOCOUNT ON;<\/p>\n<p>\/****** Script for SelectTopNRows command from SSMS ******\/<br \/>\ndeclare @customer_paid float;<br \/>\ndeclare @ur_total_cost float;<\/p>\n<p>SELECT @customer_paid=([item-price-cad] + [item-tax-cad] + [shipping-price-cad] + [shipping-tax-cad] ), @ur_total_cost = ([our_purchase_price] + [our_shipping_price] + our_shipping_insurance)<br \/>\nFROM [AmazonProfitLossOrderManagement].[dbo].[order_and_profit_loss_mgmt_july_15th_2018]<\/p>\n<p>select @customer_paid, @ur_total_cost<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset total_customer_pay=([item-price-cad] + [item-tax-cad] + [shipping-price-cad] + [shipping-tax-cad] )<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset our_total_cost=([our_purchase_price] + [our_shipping_price] + our_shipping_insurance)<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset our_profit_loss=round(total_customer_pay-our_total_cost-amazon_fees_cad,2)<\/p>\n<p>select * from [order_and_profit_loss_mgmt_july_15th_2018]<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset our_purchase_price=0 where our_purchase_price is null<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset our_shipping_price=0 where our_shipping_price is null<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset our_shipping_insurance=0 where our_shipping_insurance is null<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset refund_to_customer=0 where refund_to_customer is null<\/p>\n<p>select * from [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\norder by [purchase-date] desc<\/p>\n<p>update [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nset order_cancelled=0<br \/>\nwhere order_cancelled is null<\/p>\n<p>select sum(our_profit_loss) as proft, sum(our_profit_loss)*0.15 as possible_tax, sum(our_profit_loss)*0.15 as possible_vat,<br \/>\n(sum(our_profit_loss) &#8211; sum(our_profit_loss)*0.15) as actual_profit<br \/>\nfrom [order_and_profit_loss_mgmt_july_15th_2018]<br \/>\nwhere order_cancelled=0<\/p>\n<p>END<br \/>\nGO<br \/>\n*** . *** *** . *** . *** . ***<\/p>\n<p><em><strong><em><strong>Training Courses: <\/strong><a href=\"http:\/\/training.sitestree.com\/\">http:\/\/Training.SitesTree.com<\/a> <\/em><br \/>\nBlog<\/strong>: <a href=\"http:\/\/bangla.salearningschool.com\/\">http:\/\/Bangla.SaLearningSchool.com<\/a>, <a href=\"http:\/\/sitestree.com\">http:\/\/SitesTree.com<\/a><\/em><br \/>\n<em><strong>8112223 Canada Inc\/Justetc<\/strong>: <a href=\"http:\/\/JustEtc.net\">http:\/\/JustEtc.net<\/a><\/em><br \/>\n<em>Youtube: <\/em><a href=\"https:\/\/www.youtube.com\/channel\/UCHrtq0pV8mEuTLGd2-Lp9ig\/playlists\">https:\/\/www.youtube.com\/channel\/UCHrtq0pV8mEuTLGd2-Lp9ig\/playlists<\/a><br \/>\n<em><strong>Medium: <\/strong><\/em><a href=\"https:\/\/medium.com\/@SayedAhmedCanada\">https:\/\/medium.com\/@SayedAhmedCanada<\/a><\/p>\n<p><em><\/em><br \/>\n<em><strong>Sayed Ahmed<\/strong><br \/>\n<\/em><br \/>\n<em><strong>BSc. Eng. in Comp. Sc. &amp; Eng. (BUET)<\/strong><\/em><br \/>\n<em><strong>MSc. in Comp. Sc. (U of Manitoba, Canada)<\/strong><\/em><br \/>\n<em><strong>MSc. in Data Science and Analytics (Ryerson University, Canada)<\/strong><\/em><br \/>\n<em><strong>Linkedin<\/strong>: <a href=\"https:\/\/ca.linkedin.com\/in\/sayedjustetc\">https:\/\/ca.linkedin.com\/in\/sayedjustetc<\/a><br \/>\n<\/em><\/p>\n<p><em><strong>Facebook Groups\/Forums to discuss (Q &amp; A): <\/strong><\/em><br \/>\n<a href=\"https:\/\/www.facebook.com\/salearningschool\/?ref=your_pages\">https:\/\/www.facebook.com\/salearningschool<\/a><\/p>\n<p><a href=\"https:\/\/www.facebook.com\/banglasalearningschool\">https:\/\/www.facebook.com\/banglasalearningschool<\/a><br \/>\n<a href=\"https:\/\/www.facebook.com\/justetcsocial\">https:\/\/www.facebook.com\/justetcsocial<\/a><\/p>\n<p><em>Get access to courses on Big Data, Data Science, AI, Cloud, Linux, System Admin, Web Development and Misc. related. Also, create your own course to sell to others. <\/em><a href=\"http:\/\/sitestree.com\/training\/\">http:\/\/sitestree.com\/training\/<\/a><\/p>\n<p><strong>Join, Discuss, and Thrive:<\/strong><br \/>\nFinance: <a href=\"https:\/\/www.facebook.com\/groups\/1792339521056034\">https:\/\/www.facebook.com\/groups\/1792339521056034<\/a><\/p>\n<p>Bangladesh and Canada: <a href=\"https:\/\/www.facebook.com\/groups\/398414183875009\">https:\/\/www.facebook.com\/groups\/398414183875009<\/a><\/p>\n<p>Bangladesh: IT &amp; Eng: Canada: <a href=\"https:\/\/www.facebook.com\/groups\/480297675634630\">https:\/\/www.facebook.com\/groups\/480297675634630<\/a><\/p>\n<p>BUETians in Ontario: <a href=\"https:\/\/www.facebook.com\/groups\/371982239854027\">https:\/\/www.facebook.com\/groups\/371982239854027<\/a><\/p>\n<p>Worldwide IT: <a href=\"https:\/\/www.facebook.com\/groups\/28362061867\">https:\/\/www.facebook.com\/groups\/28362061867<\/a><\/p>\n<p>JustEtc: <a href=\"https:\/\/www.facebook.com\/JustETC-Technologies-Inc-289864738261\">https:\/\/www.facebook.com\/JustETC-Technologies-Inc-289864738261<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>USE [AmazonProfitLossOrderManagement] GO \/****** Object: StoredProcedure [dbo].[our_profit_loss] Script Date: 2020-06-19 10:17:11 PM ******\/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO remove-this-phrase&#8211; Alter Procedure our_profit_loss remove-this-phrase&#8211; ============================================= remove-this-phrase&#8211; Author: &lt;Author,,Name&gt; remove-this-phrase&#8211; Create date: &lt;Create Date,,&gt; remove-this-phrase&#8211; Description: &lt;Description,,&gt; remove-this-phrase&#8211; ============================================= CREATE PROCEDURE [dbo].[our_profit_loss] AS BEGIN remove-this-phrase&#8211; SET NOCOUNT ON added to prevent extra result sets &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=17176\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1915,182],"tags":[],"class_list":["post-17176","post","type-post","status-publish","format-standard","hentry","category-selling-on-amazon","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":17180,"url":"http:\/\/bangla.sitestree.com\/?p=17180","url_meta":{"origin":17176,"position":0},"title":"update_exchange_rate_and_price","author":"Sayed","date":"June 19, 2020","format":false,"excerpt":"USE [AmazonProfitLossOrderManagement] GO \/****** Object: StoredProcedure [dbo].[update_exchange_rate_and_price] Script Date: 2020-06-19 10:17:11 PM ******\/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO remove-this-phrase-- Alter Procedure update_exchange_rate_and_price remove-this-phrase-- ============================================= remove-this-phrase-- Author: <Author,,Name> remove-this-phrase-- Create date: <Create Date,,> remove-this-phrase-- Description: <Description,,> remove-this-phrase-- ============================================= CREATE PROCEDURE [dbo].[update_exchange_rate_and_price] @exchange_rate_from_eu float, @exchange_rate_from_gbp float AS BEGIN remove-this-phrase--\u2026","rel":"","context":"In &quot;manage-selling-on-amazon-using-sql&quot;","block_context":{"text":"manage-selling-on-amazon-using-sql","link":"http:\/\/bangla.sitestree.com\/?cat=1915"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17175,"url":"http:\/\/bangla.sitestree.com\/?p=17175","url_meta":{"origin":17176,"position":1},"title":"minimum_price_for_amazon","author":"Sayed","date":"June 19, 2020","format":false,"excerpt":"USE [AmazonMinimumPriceAdjustment] GO \/****** Object: StoredProcedure [dbo].[minimum_price_for_amazon] Script Date: 2020-06-19 10:17:46 PM ******\/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO remove-this-phrase-- ============================================= remove-this-phrase-- Author: <Author,,Name> remove-this-phrase-- Create date: <Create Date,,> remove-this-phrase-- Description: <Description,,> remove-this-phrase-- ============================================= CREATE PROCEDURE [dbo].[minimum_price_for_amazon] AS BEGIN remove-this-phrase-- SET NOCOUNT ON added to prevent extra result\u2026","rel":"","context":"In &quot;manage-selling-on-amazon-using-sql&quot;","block_context":{"text":"manage-selling-on-amazon-using-sql","link":"http:\/\/bangla.sitestree.com\/?cat=1915"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17190,"url":"http:\/\/bangla.sitestree.com\/?p=17190","url_meta":{"origin":17176,"position":2},"title":"minimum_price_for_amazon","author":"Sayed","date":"June 19, 2020","format":false,"excerpt":"USE ProductAndPriceManagement GO \/****** Object: StoredProcedure [dbo].[minimum_price_for_amazon] Script Date: 2020-06-19 9:57:08 PM ******\/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO remove-this-phrase-- ============================================= remove-this-phrase-- Author: <Author,,Name> remove-this-phrase-- Create date: <Create Date,,> remove-this-phrase-- Description: <Description,,> remove-this-phrase-- ============================================= CREATE PROCEDURE [dbo].[minimum_price_for_amazon] AS BEGIN remove-this-phrase-- SET NOCOUNT ON added to prevent extra result\u2026","rel":"","context":"In &quot;manage-selling-on-amazon-using-sql&quot;","block_context":{"text":"manage-selling-on-amazon-using-sql","link":"http:\/\/bangla.sitestree.com\/?cat=1915"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17163,"url":"http:\/\/bangla.sitestree.com\/?p=17163","url_meta":{"origin":17176,"position":3},"title":"remove this word product_name_mismatch","author":"Sayed","date":"June 19, 2020","format":false,"excerpt":"USE ProductAndPriceManagement GO \/****** Object: StoredProcedure [dbo].[product_name_mismatch] Script Date: 2020-06-19 9:56:07 PM ******\/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO remove-this-phrase-- ============================================= remove-this-phrase-- Author: <Author,,Name> remove-this-phrase-- Create date: <Create Date,,> remove-this-phrase-- Description: <Description,,> remove-this-phrase-- ============================================= CREATE PROCEDURE [dbo].[product_name_mismatch] AS BEGIN remove-this-phrase-- SET NOCOUNT ON added to prevent extra result\u2026","rel":"","context":"In &quot;manage-selling-on-amazon-using-sql&quot;","block_context":{"text":"manage-selling-on-amazon-using-sql","link":"http:\/\/bangla.sitestree.com\/?cat=1915"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17177,"url":"http:\/\/bangla.sitestree.com\/?p=17177","url_meta":{"origin":17176,"position":4},"title":"product_name_mismatch","author":"Sayed","date":"June 19, 2020","format":false,"excerpt":"USE [AmazonInventory-2018-06-14] GO \/****** Object: StoredProcedure [dbo].[product_name_mismatch] Script Date: 2020-06-19 10:18:12 PM ******\/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO remove-this-phrase-- ============================================= remove-this-phrase-- Author: <Author,,Name> remove-this-phrase-- Create date: <Create Date,,> remove-this-phrase-- Description: <Description,,> remove-this-phrase-- ============================================= CREATE PROCEDURE [dbo].[product_name_mismatch] AS BEGIN remove-this-phrase-- SET NOCOUNT ON added to prevent extra result\u2026","rel":"","context":"In &quot;manage-selling-on-amazon-using-sql&quot;","block_context":{"text":"manage-selling-on-amazon-using-sql","link":"http:\/\/bangla.sitestree.com\/?cat=1915"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17191,"url":"http:\/\/bangla.sitestree.com\/?p=17191","url_meta":{"origin":17176,"position":5},"title":"product_name_mismatch","author":"Sayed","date":"June 19, 2020","format":false,"excerpt":"USE ProductAndPriceManagement GO \/****** Object: StoredProcedure [dbo].[product_name_mismatch] Script Date: 2020-06-19 9:56:07 PM ******\/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO remove-this-phrase-- ============================================= remove-this-phrase-- Author: <Author,,Name> remove-this-phrase-- Create date: <Create Date,,> remove-this-phrase-- Description: <Description,,> remove-this-phrase-- ============================================= CREATE PROCEDURE [dbo].[product_name_mismatch] AS BEGIN remove-this-phrase-- SET NOCOUNT ON added to prevent extra result\u2026","rel":"","context":"In &quot;manage-selling-on-amazon-using-sql&quot;","block_context":{"text":"manage-selling-on-amazon-using-sql","link":"http:\/\/bangla.sitestree.com\/?cat=1915"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17176"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17176\/revisions"}],"predecessor-version":[{"id":17241,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17176\/revisions\/17241"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17176"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}