Snippets Collections
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class Character : MonoBehaviour
{
    public int CurHp;
    public int MaxHp;

    public bool IsPlayer;

    public List<CombatAction> CombatActions = new List<CombatAction>();

    [SerializeField] private Character opponent;

    private Vector3 startPos;

    public event UnityAction OnHealthChange;
    public static event UnityAction<Character> OnDie;

    void Start ()
    {
        startPos = transform.position;
    }

    public void TakeDamage (int damageToTake)
    {
        CurHp -= damageToTake;

        OnHealthChange?.Invoke();

        if(CurHp <= 0)
            Die();
    }

    void Die ()
    {
        OnDie?.Invoke(this);
        Destroy(gameObject);
    }

    public void Heal (int healAmount)
    {
        CurHp += healAmount;

        OnHealthChange?.Invoke();

        if(CurHp > MaxHp)
            CurHp = MaxHp;
    }

    
    
}
#T2b Gmail
uid -> anmol.tyagi@thoughts2binary.com
pass -> Anmol.thoughts@123
<------------------------------------------------------------->
#User Name
anmol.tyagi
Password
|Kzkd#OB;|5jjp?
Notes
account id- satmodo 
username -> 
anmol.tyagi-at-877029150039
password -> 
fYJeCK78H9C5XDaAX92B8+lEv0h0X1+GgC5dt7cYCVU= 
<------------------------------------------------------------>
#Procon
id -> admin
pass -> b10Watch-+
<------------------------------------------------------------>
#worksanan
id -> anmol.tyagi@thoughts2binary.com
pass -> xjvkwV^3A$1OURN&zf(^6QYf
AND
id -> amit.kumar@thoughts2binary.com
pass -> S#rqUX673uebPe&xlmlY@Jzl
<------------------------------------------------------------>
#satmodo
id -> anmol.tyagi@thoughts2binary.com
pass -> Anmol.tyagi@34t2b
<------------------------------------------------------------>
SELECT 
  u.id AS parent_id,
  u.firstname AS parent_firstname,
  u.lastname AS parent_lastname,
  u.phone AS parent_phone,
  u.status AS relationship_status,
  u.created_at AS student_signup_unix,
  up.country AS parent_country
FROM user u
LEFT JOIN user_profile up ON u.id = up.user_id
WHERE 
     u.type = 'parent'
  AND u.created_at BETWEEN 1748818800 AND 1750460400
    AND (
    (
      NOT (
        u.phone LIKE '234%' OR 
        u.phone LIKE '080%' OR 
        u.phone LIKE '081%' OR 
        u.phone LIKE '070%' OR 
        u.phone LIKE '090%' OR 
        u.phone LIKE '091%'
      )
    )
    AND (
      LOWER(up.country) NOT IN ('nigeria') OR up.country IS NULL
    )
  );
-- Set your date range
SET @start_date = '2025-04-01';
SET @end_date = '2025-05-01';

-- Get all active students first
WITH active_students AS (
    SELECT DISTINCT student_id
    FROM (
        SELECT qs.student_id
        FROM quiz_summary qs
        JOIN user u ON u.id = qs.student_id
        WHERE u.type = 'student'
          AND qs.submit = 1
          AND qs.submit_at BETWEEN @start_date AND @end_date

        UNION

        SELECT ts.student_id
        FROM tutor_session ts
        JOIN user u ON u.id = ts.student_id
        WHERE u.type = 'student'
          AND ts.status = 'completed'
          AND ts.created_at BETWEEN @start_date AND @end_date

        UNION

        SELECT tsp.participant_id AS student_id
        FROM tutor_session_participant tsp
        JOIN tutor_session ts ON ts.id = tsp.session_id
        JOIN user u ON u.id = tsp.participant_id
        WHERE u.type = 'student'
          AND ts.status = 'completed'
          AND ts.created_at BETWEEN @start_date AND @end_date

        UNION

        SELECT fl.user_id AS student_id
        FROM file_log fl
        JOIN user u ON u.id = fl.user_id
        WHERE u.type = 'student'
          AND fl.type = 'video'
          AND fl.created_at BETWEEN @start_date AND @end_date

        UNION

        SELECT ful.user_id AS student_id
        FROM feature_user_logger ful
        JOIN user u ON u.id = ful.user_id
        WHERE u.type = 'student'
          AND ful.created_at BETWEEN @start_date AND @end_date
    ) AS all_activities
),

-- Main students = active students with no parent record
main_students AS (
    SELECT u.id AS user_id
    FROM user u
    JOIN active_students a ON a.student_id = u.id
    LEFT JOIN parents p ON p.student_id = u.id
    WHERE p.id IS NULL
),

-- Main parents = parents whose child is in the active_students set
main_parents AS (
    SELECT DISTINCT u.id AS user_id
    FROM user u
    JOIN parents p ON p.parent_id = u.id
    JOIN active_students a ON a.student_id = p.student_id
)

-- Final result: count + optional list
SELECT 
    (SELECT COUNT(*) FROM main_students) AS total_main_students,
    (SELECT COUNT(*) FROM main_parents) AS total_main_parents;
// Function to display custom star ratings
function display_custom_star_rating($rating) {
$html = '<div class="star-rating">';

for ($i = 1; $i <= 5; $i++) {
if ($i <= $rating) {
$html .= '<span class="star filled"></span>';
} else {
$html .= '<span class="star"></span>';
}
}

$html .= '</div>';
return $html;
}

// Replace WooCommerce's default star ratings with our custom ones
function custom_woocommerce_review_display_rating() {
global $comment;
$rating = get_comment_meta($comment->comment_ID, 'rating', true);

if ($rating && wc_review_ratings_enabled()) {
echo display_custom_star_rating($rating);
}
}

// Remove WooCommerce's default star display
remove_action('woocommerce_review_before_comment_meta', 'woocommerce_review_display_rating', 10);

// Add our custom star display
add_action('woocommerce_review_before_comment_meta', 'custom_woocommerce_review_display_rating', 10);
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":sunshine: Boost Days - What's On This Week :sunshine:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n Good morning Melbourne,\n\n Hope you all had a wonderful weekend! Please see what's on for the week below."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering some delicious sweet treats from Via Porta Bakehouse:* \n\n :vegemite:Vegemite and Cheese Twist :cookie:Choc Chip Cookies \n\n :strawberry: *Weekly Café Special:* _ Iced Strawberry Nesquik_"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 7th May :calendar-date-12:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": " \n\n :lunch: *Light Lunch*: Provided by *Kartel Catering* from *12pm* in the L3 Kitchen & Wominjeka Breakout Space."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 8th May :calendar-date-13:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am-10:30am* in the Wominjeka Breakout Space. \n\n :sandwich: *Eat Up Sandwich Makin' Sesh * from 2.30pm-3.30pm in the L-3 Kitchen.   "
			}
		},
		{
			"type": "divider"
		}
	]
}
Entrepreneurs choose crypto exchange scripts because they offer a fast, cost-effective, and customizable way to launch a cryptocurrency trading platform. These ready-made solutions come with essential features like trading engines, wallet integration, security modules, and admin dashboards—helping startups avoid the complexity of building from scratch. With reduced development time, lower investment costs, and scalable architecture, crypto exchange scripts are the ideal choice for entrepreneurs looking to enter the crypto market quickly and efficiently.

{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":xeros-connect: Boost Days - What's on this week! :xeros-connect:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Morning Ahuriri :wave: Happy Monday, let's get ready to dive into another week with our Xeros Connect Boost Day programme! See below for what's in store :eyes:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-7: Wednesday, 7th May :camel:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*.\n:wrap: *Lunch*: Provided by *Design Cuisine* from *12:30PM-1:30PM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-8: Thursday, 8th May",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*.\n:breakfast: *Breakfast*: Provided by *Roam* from *9:30AM-10:30AM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-9: Friday, 9th May",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:beers: *Social Happy Hour*: Enjoy some drinks and nibbles from *4:00PM-5:30PM* in Clearview."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*What else?* Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=eGVyby5jb21fbXRhc2ZucThjaTl1b3BpY284dXN0OWlhdDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ|*Hawkes Bay Social Calendar*>, and get ready to Boost your workdays!\n\nWX Team :party-wx:"
			}
		}
	]
}
/*========================================================
  Rise 360 compulsory CSS
  For use in all Digital Learning and Development Rise 360 courses.
  Version 1.0
  Last updated 04/11/2024
==========================================================*/

/*Global variables – edit these variables to suit your course design.
==========================================================*/

:root {
  --custom-theme-colour-button-hover-opacity: .9; /*This sets the opacity of buttons and checkboxes that use the theme colour, such as continue buttons.Lower value equals ligher hover colour.*/
  --custom-carousel-prev-next-hover-colour: #000; /*This sets the hover state colour of the previous and next buttons on the quote carousel and image carousel blocks.*/
}

/*Global CSS edits
==========================================================*/

/*Links > Hover state: Add a background colour and border.*/
.brand--linkColor a:hover {
  outline: solid 3px rgba(0, 0, 0, .1); /*Using transparancy prevents surrounding text, such as full stops, from vanishing.*/
  background-color: rgba(0, 0, 0, .1) !important;
}

/*Cover page
==========================================================*/

/*Cover page > Start module button: Remove all caps, increase font size, decrease font weight, adjust padding.*/
.cover__header-content-action-link-text{
  text-transform: none;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .1rem;
}
.cover__header-content-action-link {
  padding: 0.8rem 2.9rem !important;
}

/*Cover page > body text: Increase font size and change colour.*/ 
.cover__details-content-description.brand--linkColor {
  color: #000;
  font-size: 1.7rem;
}

/*Cover page > Section titles: Increase font size, remove all caps, darken border line.*/
.overview-list__section-title {
  border-bottom: .1rem solid #717376; /*Colour of the lesson icons.*/
  font-size: 1.4rem;
  text-transform: none;
}

/*Cover page > lesson list: Increase font size.*/
.overview-list-item__title {
  font-size: 1.4rem;
}

/*Navigation menu
==========================================================*/

/*Navigation menu > % progress indicator: Remove all caps, increase font size.*/
.nav-sidebar-header__progress-text {
  text-transform: none !important;
  font-size: 1.4rem !important;
}

/*Navigation menu > Section titles: Remove all caps, increase font size.*/
.nav-sidebar__outline-section-toggle-text {
  text-transform: none;
  font-size: 1.4rem;
}
.nav-sidebar__outline-section-toggle:after {
  border-bottom: 1px solid #717376 !important;
}

/*Navigation menu > Lesson titles: Increase font size.*/
.nav-sidebar__outline-section-item__link {
  font-size: 1.4rem !important;
}

/*Lesson header
==========================================================*/

/*Lesson header > Lesson counter: Increase font size, remove italics.*/
.lesson-header__counter {
  font-size: 1.4rem;
  font-style: normal;
  margin-bottom: 1.3rem !important;
}

/*Text blocks
==========================================================*/

/*Paragraph
----------------------------------------------------------*/

/*Paragraph with heading
----------------------------------------------------------*/

/*Paragraph with subheading
----------------------------------------------------------*/

/*Heading
----------------------------------------------------------*/

/*Subheading
----------------------------------------------------------*/

/*Columns
----------------------------------------------------------*/

/*Table
----------------------------------------------------------*/


/*Statement blocks
==========================================================*/

/*Statement A
----------------------------------------------------------*/

/*Statement B
----------------------------------------------------------*/

/*Statement C
----------------------------------------------------------*/

/*Statement D
----------------------------------------------------------*/

/*Note
----------------------------------------------------------*/


/*Quote blocks
==========================================================*/

/*Quote A
----------------------------------------------------------*/

/*Quote B
----------------------------------------------------------*/

/*Quote C
----------------------------------------------------------*/

/*Quote D
----------------------------------------------------------*/

/*Quote on image
----------------------------------------------------------*/

/*Quote carousel
----------------------------------------------------------*/

/*Quote carousel > Progression circles and arrows: Change arrow hover colour, change progression cirle hover opacity and scale.*/
.block-quote--carousel .carousel-controls-next,
.block-quote--carousel .carousel-controls-prev {
  transition: color 0.3s;
}
.block-quote--carousel .carousel-controls-next:hover,
.block-quote--carousel .carousel-controls-prev:hover {
  color: var(--custom-carousel-prev-next-hover-colour); 
}
.carousel-controls-item-btn {
  transition: all 0.15s ease-in-out;
}
.carousel-controls-item-btn:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
  color: var(--custom-theme-hover-bg, #202d60);
}


/*List blocks
==========================================================*/

/*Numbered list
----------------------------------------------------------*/

/*Checkbox list
----------------------------------------------------------*/

/*Checkbox list > Checkboxes: Move the checkboxes to the front and change the hover colour.*/
.block-list__checkbox {
  z-index: 2;
  transition: all .15s ease-in-out;
}
.block-list__checkbox:hover {
  background-color: var(--color-theme-decorative);
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Bulleted list
----------------------------------------------------------*/


/*Image blocks
==========================================================*/

/*Image blocks > Caption: Increase font size. This can be changed by manually adjusting the font size in Rise.*/
.block-image__caption, .block-gallery__caption {
  font-size: 1.4rem !important;
}

/*Image centered
----------------------------------------------------------*/

/*Image full width
----------------------------------------------------------*/

/*Image & text
----------------------------------------------------------*/

/*Text on image
----------------------------------------------------------*/


/*Gallery blocks
==========================================================*/

/*Carousel
----------------------------------------------------------*/

/*Carousel > Progression circles and arrows: Change arrow hover colour, change progression cirle hover opacity and scale.*/
.block-gallery-carousel__container .carousel-controls-next,
.block-gallery-carousel__container .carousel-controls-prev {
  transition: color 0.3s;
}
.block-gallery-carousel__container .carousel-controls-next:hover,
.block-gallery-carousel__container .carousel-controls-prev:hover {
  color: var(--custom-carousel-prev-next-hover-colour);
}
/*Note that the hover state of the progression circles is modified in the Quote carousel section.*/

/*Two column grid
----------------------------------------------------------*/

/*Three column grid
----------------------------------------------------------*/

/*Four column grid
----------------------------------------------------------*/


/*Multimedia blocks
==========================================================*/

/*Audio
----------------------------------------------------------*/

/*Audio > Play/puase button and scrub slider: Increase size and gap between. Change hover scale.*/
.audio-player__play {
  margin-right: 1.6rem;
}
.audio-player__play .svg-inline--fa {
  height: 1.7rem;
  transition: all 0.15s ease-in-out;
}
.audio-player__play .svg-inline--fa:hover {
  transform: scale(1.2);
}
.audio-player__tracker-handle{
  height: 100%;
}
.audio-player__tracker-handle-icon>svg {
  height: 1.5rem;
  width: 1.5rem;
}
.audio-player__tracker-handle-icon{
  transition: all 0.15s ease-in-out;
}
.audio-player__tracker-handle-icon:hover {
  transform: scale(1.2);
}
.audio-player__tracker-handle-icon:active {
  transform: scale(1.2);
}

/*Audio > track line: Make line thicker.*/
.audio-player__tracker-bar {
  border-top: .16rem solid var(--color-track);
}
.audio-player__tracker:after {
  border-top: .16rem solid var(--color-runner);
}

/*Audio > Timer: Increase font size.*/
.audio-player__timer {
  font-size: 1.2rem;
}

/*Audio > Caption: Increase font size. This can be changed by manually adjusting the font size in Rise.*/
.block-audio__caption {
  font-size: 1.4rem;
}

/*Video
----------------------------------------------------------*/

/*Video > Caption: Change font size to 14px.*/
.block-video__caption {
  font-size: 1.4rem;
}

/*Embed
----------------------------------------------------------*/

/*Attachement
----------------------------------------------------------*/

/*Attachement: Add hover colour.*/
.block-attachment:hover {
  background: #ebebeb;
}

/*Code snippet
----------------------------------------------------------*/

/*Code snippet > Caption: Increase font size.*/
.block-text__code-caption p {
  font-size: 1.4rem;
}

/*Interactive blocks
==========================================================*/

/*Accordion
----------------------------------------------------------*/

/*Tabs
----------------------------------------------------------*/

/*Tabs > Titles: Remove all caps, increase font size and reduce letter spacing.*/
.blocks-tabs__header-item{
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .04rem;
}

/*Labeled graphic
----------------------------------------------------------*/

/*Labeled graphic > pop-up text: Set font size. This can be changed by manually adjusting the font size in Rise.*/
.bubble__content {
  font-size: 1.6rem;
}

/*Process
----------------------------------------------------------*/

/*Process > Navigation arrows: Change hover state opacity.*/
.process-arrow {
  transition: opacity .3s !important;
}
.process-arrow:hover {
  opacity: .8;
}

/*Process > Start button: Change focus state outline.*/
.process-card__start:focus, .process-card-mobile__start:focus {
  outline-offset: 0.4rem;
}

/*Process > Start button: Change hover state opacity.*/
.process-card__start:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Process > Start button: Remove all caps, increase font size and letter spacing.*/
.process-card__start-text, .process-card-mobile__start-text  {
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .1rem;
}

.block-process-card__start-btn {
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .1rem;}


.process-card__start-icon {
  height: 1.3rem !important;
  width: 1.3rem !important;
}

/*Process > Start again: Remove all caps, increase font size and letter spacing.*/
.process-card__restart, .process-card-mobile__restart {
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .1rem;
  font-weight: 700;
}
  
/*Process > Start again: Add hover state.*/
.process-card__restart {
  transition: background-color 0.3s;
  border-radius: 5px;
}
.process-card__restart:hover {
  background-color: #ebebeb;
}

/*Scenario
----------------------------------------------------------*/

/*Scenario block > Continue buttons, Start over buttons: Remove all caps, increase font size and letter spacing.*/
.scenario-block__text__continue {
  line-height: 2rem;
}
.scenario-block__text__continue, .scenario-block__dialogue__button, .scenario-block__text__end span {
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .1rem;
}

/*Scenario block > Response: Increase font size.*/
.scenario-block__response .fr-view {
    font-size: 1.6rem;
}

/*Scenario block > Response: Change hover colour.*/
.scenario-block__response__inner:hover {
  background-color: #ebebeb;
}
  
/*Scenario > Continue buttons: Change hover opacity.*/
.scenario-block__text__continue:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}
  
/*Scenario > Continue buttons: Change focus state outline.*/
.scenario-block__text__continue:focus {
  outline-offset: 0.4rem;
}
  
/*Scenario > Response buttons: Change hover state.*/
.scenario-block__dialogue__button {
  transition: all .3s;
}
.scenario-block__dialogue__button:hover {
  background-color: #ebebeb;
  transform: translateX(1rem);
}
  
/*Scenario > Start over: Change hover state.*/
.scenario-block__text__end {
  transition: all .3s;
  color: var(--color-theme-decorative);
  padding: 1rem;
  margin-top: 1rem;
}
.scenario-block__text__end:hover {
  background-color: #ebebeb;
  border-radius: 5px;
}


/*Sorting activity
----------------------------------------------------------*/

/*Sorting activity > Restart button: Remove all caps, change font size, colour and letter spacing.*/
.block-sorting-activity .restart-button__content {
  color: var(--color-theme-decorative);
  border-radius: 5px;
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .1rem;
  font-weight: 700;
}

/*Sorting activity > Restart button: Add a hover state.*/
.block-sorting-activity .deck__title {
  margin-bottom: 1rem;  
  padding-bottom: .6rem;
  border-bottom: .1rem solid rgba(0, 0, 0, .2);
}
.block-sorting-activity .restart-button {
  margin-top: 0rem;
  border: none;
  padding: 1rem;
  border-radius: 5px;
  min-height: 7.45rem;
}
.block-sorting-activity .restart-button {
  transition: background-color 0.3s;
}
.block-sorting-activity .restart-button:hover {
  background-color: #ebebeb;
}


/*Timeline
----------------------------------------------------------*/

/*Flashcard grid
----------------------------------------------------------*/

/*Flashbard stack
----------------------------------------------------------*/

/*Flashcard stack > Previous and Next button: Change hover state.*/
.block-flashcards-slider__arrow--next, .block-flashcards-slider__arrow--prev {
  transition: opacity .3s;
}
.block-flashcards-slider__arrow--next:hover, .block-flashcards-slider__arrow--prev:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Flashcard stack > Slide counter: Remove italics.*/
.block-flashcards-slider__progress-text {
  font-style: normal;
}

/*Flashcard stack > Progress line: Increase thickness.*/
.block-flashcards-slider__progress-line {
  border-bottom: max(.2rem, 2px) solid var(--color-progress-track);
  position: relative;
}
.block-flashcards-slider__progress-runner {
  border-bottom: max(.2rem, 2px) solid var(--color-theme-decorative);
}

/*Button
----------------------------------------------------------*/

/*Button and Button stack > Button: Remove all caps, increase font size and line height.*/
.blocks-button__button {
  transition: all .3s;
  text-transform: none;
  font-size: 1.5rem;
  line-height: 3.9rem;
}

/*Button and Button stack > Button: Change hover state.*/
.blocks-button__button:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Button and Button stack > Button: Offset the focus state outline.*/
.blocks-button__button:focus {
  outline-offset: .4rem;
}

/*Button stack
----------------------------------------------------------*/

/*Storyline
----------------------------------------------------------*/


/*Knowledge check blocks AND Quiz lesson
==========================================================*/

/*Knowledge check/Quiz > Options: remove extra space between question options and submit button/feedback box.*/
.block-knowledge .quiz-card__interactive {
  margin-bottom: 0rem;
}

/*Knowledge check/Quiz > Submit/Next buttons: Remove all caps and increase font size.*/
.quiz-card__button{
  transition: opacity .3s;
  text-transform: none;
  font-size: 1.5rem;
}
  
/*Knowledge check/Quiz > Submit/Next buttons: Change hover state.*/
.quiz-card__button:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}
  
/*Knowledge check/Quiz > Submit/Next buttons: Offset the focus state outline.*/
.quiz-card__button:focus {
  outline-offset: 0.4rem;
}

/*Knowledge check/Quiz > 'Correct/Incorrect' label: Increase font size.*/
.quiz-card__feedback-label {
  font-size: 1.4rem;
}

/*Knowledge check/Quiz > Feedback body text: Increase font size, align left and ensure color is black. */
.quiz-card__feedback-text {
  font-size: 1.6rem;
  text-align: left;
  color: #000;
}

/*Knowledge check > Try again button: Remove all caps, increase font size and change to theme colour. Note that the Rise 360 label text must also be lowercase.*/
.block-knowledge__retake-text {
  text-transform: none;
  font-size: 1.4rem;
}
.block-knowledge__retake {
  color: var(--color-theme-decorative)
}

/*Knowledge check > Try again button: Change hover state.*/
.block-knowledge__retake-content {
  transition: background-color 0.3s;
  border-radius: 5px;
  padding: 1rem;
  margin: -1rem /*Negative margin pushes the margin out into the padding area to create a larger hover state without having to change the padding for the normal state.*/
}
.block-knowledge__retake-content:hover {
  background-color: #ebebeb;
}

/*Multiple choice
----------------------------------------------------------*/

/*Multiple response
----------------------------------------------------------*/

/*Fill in the blank
----------------------------------------------------------*/

/*Fill in the blank > 'Acceptable responses' label: Increase font size and remove italics.*/
.quiz-fill__options {
  font-size: 1.4rem;
  font-style:normal;
}

/*Matching
----------------------------------------------------------*/

/*Matching: Increase font size to 16px.*/
.quiz-match__item-content {
  font-size: 1.5rem;
}

/*Quiz
----------------------------------------------------------*/

/*Quiz > 'Lesson X of Y' label: Increase font size, letter spacing and remove italics.*/
.quiz-header__counter {
  font-size: 1.4rem;
  font-style: normal;
  letter-spacing: .05rem;
}

/*Quiz > 'Start assessment' label: Remove all caps, increase font size, move icon to the left.*/
.quiz-header__start-quiz {
  transition: all .3s;
  text-transform: none;
  font-size: 1.5rem;
  border-radius: 5px;
  padding: 1rem;
  margin: -1rem;
}
.quiz-header__start-quiz [class*=icon-] {
  margin-left: .6rem;
}

/*Quiz > 'Start assessment' label: Add hover state.*/
.quiz-header__start-quiz:hover {
  background-color: #ebebeb;
}

/*Quiz > 'Question' label: Remove italics and increase font size.*/
.quiz-card__step-label {
  font-size: 1.4rem;
  font-style: normal;
  letter-spacing: .05rem;
  font-weight: 400;
}
@media (max-width: 47.9375em) {
  .quiz-card__counter {
    font-size: 2.2rem;
  }
}

/*Quiz > Quiz results odemeter: Increase font size on all elements.*/
.odometer__score-label, .odometer__passlabel, .odometer__passpercent  {
  font-size: 1.4rem;
  text-transform: none;
}

/*Quiz > Quiz results 'Try again' button: Remove all caps, change font colour, size, weight and letter spacing, adjust padding.*/
.quiz-results__footer .restart-button__content {
  transition: background-color 0.3s;
  color: var(--color-theme);
  text-transform: none;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .1rem;
  padding: 1rem;
  margin: -1rem;
  border-radius: 5px;
}

/*Quiz > Quiz results 'Try again' button: Add hover state.*/
.quiz-results__footer .restart-button__content:hover {
  background-color: #ebebeb;
}


/*Draw from question bank
----------------------------------------------------------*/


/*Chart blocks
==========================================================*/

/*Bar chart
----------------------------------------------------------*/

/*Line chart
----------------------------------------------------------*/

/*Pie chart
----------------------------------------------------------*/


/*Divider blocks
==========================================================*/

/*Continue
----------------------------------------------------------*/
  
/*Continue: Change hover state.*/
.continue-btn {
  transition: opacity 0.3s;
}
.continue-btn:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Continue: Offset the focus state outline.*/
.continue-btn:focus {
  outline-offset: 0.4rem;
}

/*Divider
----------------------------------------------------------*/

/*Numbered divider
----------------------------------------------------------*/

/*Spacer
----------------------------------------------------------*/


/*CSS edits by Firstname Lastname on XX/XX/202X.*/

/*========================================================
  Optional CSS edits – Paste all optional CSS edits below this comment.
==========================================================*/
emailSendTo = List();
emailSendTo.add(customer_email);
sendInvoiceParam = Map();
sendInvoiceParam.put("to_mail_ids",emailSendTo);

response = invokeurl
[
  url :"https://www.zohoapis.com/books/v3/estimates/" + quote_id + "/email?organization_id=" + org
  type :POST
  parameters:sendInvoiceParam.toString()
  connection:"zoho_apps_connection"
INSTALL CHAT APP

cd frappe-bench
bench get-app chat
bench --site site1.local install-app chat
INSTALL LOAN / LENDING

cd frappe-bench
bench get-app lending
bench --site site1.local install-app lending
bench switch-to-branch develop --upgrade
bench switch-to-branch develop frappe erpnext --upgrade

  Bench start
 	bench migrate
	bench build
	bench restart  # if you're in production or want to reload the server
  
 
	bench setup requirements
   	bench update --reset

Raven Installation

cd frappe-bench
bench get-app https://github.com/The-Commit-Company/raven
bench --site raven.test install-app raven

https://github.com/The-Commit-Company/raven


================================
  
cd frappe-bench
bench get-app https://github.com/The-Commit-Company/Raven.git
bench --site site1.local install-app raven


https://github.com/yrestom/Frappe-Raven/
cd frappe-bench
bench get-app https://github.com/clefincode/clefincode_chat.git
bench --site site1.local install-app clefincode_chat
bench --site site1.local migrate
bench build



https://github.com/clefincode/clefincode_chat
//Chat Installation

cd frappe-bench
bench get-app chat
bench --site site1.local install-app chat
//HRM Installation

cd frappe-bench
bench get-app hrms --branch version-15
bench --site site1.local install-app hrms
//Builder Installation

cd frappe-bench
bench get-app builder
bench --site site1.local install-app builder
//Webshop Installation

cd frappe-bench
bench get-app webshop
bench --site site1.local install-app webshop
//Studio Installation

cd frappe-bench
bench get-app studio
bench --site site1.local install-app studio

bench browse studio.localhost --user Administrator
// Stay Connected
.stay-connected-section{
    @include section-padding;
}
.stay-connected{
    background: $support-color;
    border-radius: 0 0 _res-m(14) _res-m(14);
    padding: _res-m(100) _res-m(70);
    @include screen-sm-min{
        padding: _res(40) _res(56);
        border-radius: 0 0 _res(14) _res(14);
        .ari-column{
            @include _flex($halign: space-between);
        }
    }
    &-title{
        color: #fff;
        font-size: _res-m(65);
        font-weight: bold;
        text-align: center;
        text-transform: uppercase;
        margin-bottom: _res-m(69);
        @include screen-sm-min{
            font-size: _res(36);
            letter-spacing: .111em;
            margin-bottom: 0;
        }
    }
    &-form{
        .ari-form-container{
            margin-bottom: 0;
            form{
                @include _flex($valign: flex-start);
                .alpaca-field{
                    padding: 0;
                    .alpaca-container{
                        @include _flex($valign: flex-start);
                        gap: 1px;
                        &-item{
                            margin-top: 0;
                            &-first{
                                .form-group input{ 
                                    border-radius: _res-m(14) 0 0 _res-m(14);
                                    @include screen-sm-min{
                                        border-radius: _res(14) 0 0 _res(14);
                                    }
                                }
                            }
                            .form-group{
                                margin-bottom: 0;
                                input{
                                    height: _res-m(144);
                                    background: #323232;
                                    border: none;
                                    font-size: _res-m(25);
                                    @include screen-sm-min{
                                        font-size: _res(10,20);
                                        height: _res(30,72);
                                        width: _res(400);
                                    }
                                }
                            }
                        }
                    }
                }
                .alpaca-form-buttons-container{
                    margin-top: 0;
                    button{
                        @include btn-style;
                        border-radius: 0 _res-m(14) _res-m(14) 0;
                        height: _res-m(144);
                        width: _res-m(257);
                        font-weight: 500;
                        font-size: _res-m(47);
                        opacity: 1;
                        @include screen-sm-min{
                            border-radius: 0 _res(14) _res(14) 0;
                            width: _res(100,178);
                            height: _res(30,72);
                        }
                    }
                }
            }
        }
    }
}
I was talking to someone the other day who casually mentioned they set up their own crypto exchange in just six days. I figured they must be a coding genius or had an army of tech innovators, but nope - they used a white label coinbase clone script. Everything was ready to go out of the box: KYC compliance, wallet implementations, even liquidity management.

It's kind of wild when you think about it. Not too long ago, launching a crypto exchange meant months of development and a hefty budget. Now? You pick the right tech partner and you are practically flipping the switch on your own trading platform in a week.

If you are someone who's been toying with the idea of launching your own crypto exchange, this space is more accessible than ever. The tech has caught up with the vision. And let's be real - speed to market matters.

Curious where all these turnkey solutions are coming from? Let's just say some teams are quietly powering the next wave of exchanges. Maticz is one name that keeps popping up.

- https://maticz.com/coinbase-clone-script
/* Daily ER append for EFRM fraud users */
SELECT
  DISTINCT SUBSTR(CAST(txn_date_switch AS VARCHAR(30)), 1, 7) AS txn_year_month,
  payer_vpa_switch,
  'NA' AS reporting_date,
  ingestion_date,
  'EFRM' AS source
FROM
  (
    SELECT
      txn_id AS upi_txn_id,
      DATE(MIN(dl_last_updated)) AS ingestion_date,
      CAST(REGEXP_REPLACE(txn_amount, ',', '') AS DOUBLE) AS txn_amount
    FROM
      frauds.efrm_data_snapshot_v3
    WHERE
     DATE(dl_last_updated) >= DATE_TRUNC('MONTH', CURRENT_DATE - INTERVAL '1 MONTH')
      AND DATE(dl_last_updated) < DATE_TRUNC('MONTH', CURRENT_DATE)
    GROUP BY
      1,
      3
  ) AS a
  INNER JOIN (
    SELECT
      DISTINCT DATE(b.created_on) AS txn_date_switch,
      a.txn_id AS upi_txn_id_switch,
      a.vpa AS payer_vpa_switch,
      b.vpa AS payee_vpa_switch,
      CAST(a.amount AS DOUBLE) AS txn_amount_switch,
      a.mcc AS payer_mcc_switch,
      b.mcc AS payee_mcc_switch,
      a.handle AS payer_handle,
      b.handle AS payee_handle,
      a.scope_cust_id,
      a.mobile_no AS payer_mobile_no,
      (
        CASE
          WHEN (
            LOWER(b.vpa) LIKE '%@paytm%'
            OR LOWER(b.vpa) LIKE '%@pt%'
          ) THEN 'paytm merchant/bene'
          ELSE 'others'
        END
      ) AS merchant_bene_type
    FROM
      switch.txn_participants_snapshot_v3 AS a
      INNER JOIN switch.txn_participants_snapshot_v3 AS b ON a.txn_id = b.txn_id
    WHERE
      DATE(a.dl_last_updated) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
      AND DATE(b.dl_last_updated) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
      AND DATE(a.created_on) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
      AND a.participant_type IN ('PAYER')
      AND b.participant_type IN ('PAYEE')
      AND (
        LOWER(a.vpa) LIKE '%@paytm%'
        OR LOWER(a.vpa) LIKE '%@pt%'
      )
  ) AS c ON a.upi_txn_id = c.upi_txn_id_switch
  AND a.txn_amount = c.txn_amount_switch
  AND C.txn_date_switch < a.ingestion_date
  INNER JOIN (
    SELECT
      DISTINCT txn_id,
      category,
      CAST(amount AS DOUBLE) AS amount,
      DATE(created_on) AS created_on
    FROM
      switch.txn_info_snapshot_v3
    WHERE
      dl_last_updated >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
      AND created_on >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
      AND UPPER(status) IN ('SUCCESS')
  ) AS e ON a.upi_txn_id = e.txn_id
  AND a.txn_amount = e.amount
  AND e.created_on < a.ingestion_date
SELECT DISTINCT substr(cast(txn_date_switch as varchar(30)), 1, 7) as txn_year_month
, payer_vpa_switch
, reporting_date
, ingestion_date
, 'Cybercell' AS source
FROM
  (
    SELECT
      *
    FROM
      (
        SELECT
          DISTINCT transaction_id AS txnid,
          CAST(txn_amount AS DOUBLE) AS txn_amount,
          DATE(reporting_date) AS reporting_date,
          DATE(dl_last_updated) AS ingestion_date,
          ROW_NUMBER() OVER (PARTITION BY transaction_id) AS txn_id_duplicate
        FROM
          frauds.ppsl_cybercell_snapshot_v3
        WHERE
          DATE(dl_last_updated) >= DATE(CURRENT_DATE - INTERVAL '1' DAY)
          AND NOT transaction_id IN ('', ' ', 'NA', 'N.A', '0')
          AND NOT transaction_id IS NULL
      )
    WHERE
      txn_id_duplicate = 1
  ) AS b
  INNER JOIN (
    SELECT
      DISTINCT GET_JSON_OBJECT(
        payresultcontext,
        '$.payMethodResultList[0].extendInfo.payeeVpa'
      ) AS payee_vpa,
      transactionid,
      IF(NOT rrncode IS NULL, rrncode, banktxnid) AS rrn_pg,
      DATE(dl_last_updated) AS dl_last_updated
    FROM
      risk_maquette_data_async.pplus_payment_result_prod_async_snapshot_v3
    WHERE
      DATE(dl_last_updated) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
      AND DATE(gmt_occur_derived) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
      AND payresult IN ('payment_success')
      AND UPPER(paymethod) IN ('UPI')
  ) AS c ON b.txnid = c.transactionid
  AND c.dl_last_updated < b.reporting_date
  INNER JOIN (
    SELECT
      *
    FROM
      (
        SELECT
          DISTINCT b.created_on AS txn_date_switch,
          a.txn_id AS upi_txn_id_switch,
          a.vpa AS payer_vpa_switch,
          b.vpa AS payee_vpa_switch,
          a.amount AS txn_amount_switch,
          a.mcc AS payer_mcc_switch,
          b.mcc AS payee_mcc_switch,
          a.handle AS payer_handle,
          b.handle AS payee_handle,
          a.scope_cust_id,
          a.mobile_no AS payer_mobile_no,
          (
            CASE
              WHEN (
                LOWER(b.vpa) LIKE '%@paytm%'
                OR LOWER(b.vpa) LIKE '%@pt%'
              ) THEN 'paytm merchant/bene'
              ELSE 'others'
            END
          ) AS merchant_bene_type
        FROM
          switch.txn_participants_snapshot_v3 AS a
          INNER JOIN switch.txn_participants_snapshot_v3 AS b ON a.txn_id = b.txn_id
        WHERE
          DATE(a.dl_last_updated) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
          AND b.dl_last_updated >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
          AND a.created_on >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
          AND a.participant_type IN ('PAYER')
          AND b.participant_type IN ('PAYEE')
          AND (
            LOWER(a.vpa) LIKE '%@paytm%'
            OR LOWER(a.vpa) LIKE '%@pt%'
          )
      ) AS x
      INNER JOIN (
        SELECT
          DISTINCT txn_id,
          category,
          rrn
        FROM
          switch.txn_info_snapshot_v3
        WHERE
          DATE(dl_last_updated) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
          AND DATE(created_on) >= DATE(CURRENT_DATE - INTERVAL '90' DAY)
          AND UPPER(status) IN ('SUCCESS')
      ) AS f ON x.upi_txn_id_switch = f.txn_id
  ) AS y ON y.rrn = c.rrn_pg
  AND y.payee_vpa_switch = c.payee_vpa
  AND y.txn_date_switch < b.reporting_date
style="box-shadow:none !important; left: -9.1em !important; transform: rotate(270deg) translateX(50%) !important;
// add tag support to pages
function tags_support_all() {
	register_taxonomy_for_object_type('post_tag', 'page');
}

// ensure all tags are included in queries
function tags_support_query($wp_query) {
	if ($wp_query->get('tag')) $wp_query->set('post_type', 'any');
}

// tag hooks
add_action('init', 'tags_support_all');
add_action('pre_get_posts', 'tags_support_query');
Launch your safe crypto wallet platform with our Trust Wallet Clone Script, which is a dynamic solution that replicates the Trust Wallet mobile app's features and functions.  This Trust Wallet Clone Script, developed for entrepreneurs and investors, allows for smooth cryptocurrency storage, trading, and staking.  Explore this unique chance to simply lead the DeFi wallet revolution!
HTML Code - Enter in HTML Code
=====================


 <link rel="stylesheet" href="/files/ledger-style.css">
 
{% set gl_entries = frappe.db.sql("""
    SELECT posting_date, voucher_no, debit, credit, remarks
    FROM `tabGL Entry`
    WHERE party_type = 'Customer'
    AND party = %s
    AND is_cancelled = 0
    AND posting_date <= %s
    ORDER BY posting_date DESC, creation DESC
    LIMIT 5
""", (doc.customer, doc.posting_date), as_dict=1) %}
 
{% set gl_totals = frappe.db.sql("""
    SELECT 
        COALESCE(SUM(debit), 0) AS total_debit,
        COALESCE(SUM(credit), 0) AS total_credit
    FROM `tabGL Entry`
    WHERE party_type = 'Customer'
    AND party = %s
    AND is_cancelled = 0
    AND posting_date BETWEEN '2024-01-01' AND %s
""", (doc.customer, doc.posting_date), as_dict=1)[0] %}
 
<div class="invoice-title">Sales Invoice</div>
 
<div class="details-box">
    <div>
        <b>Customer:</b> {{ doc.customer_name }}<br>
        <b>Customer Code:</b> {{ doc.customer }}<br>
        <b>DC No:</b> {{ doc.custom_dc_no or "-" }}
    </div>
    <div>
        <b>Invoice No:</b> {{ doc.name }}<br>
        <b>Posting Date:</b> {{ frappe.utils.formatdate(doc.posting_date, "dd-MM-yyyy") }}<br>
        <b>Bilty No:</b> {{ doc.custom_bilty_no or "-" }}<br>
        <b>Transporter:</b> {{ doc.custom_transport or "-" }}
    </div>
</div>

<div class="section-divider"></div>
<div class="section-title">Current Sales Invoice</div> 
 
<table>
    <thead>
        <tr>
            <th>No</th>
            <th>Item</th>
            <th>Quantity</th>
            <th>Rate</th>
            <th>Amount (PKR)</th>
        </tr>
    </thead>
    <tbody>
        {% for item in doc.items %}
        <tr>
            <td>{{ loop.index }}</td>
            <td>{{ item.item_name }}</td>
            <td>{{ (item.qty or 0) | int }}</td>
            <td>{{ "{:,}".format((item.rate or 0) | int) }}</td>
            <td>{{ "{:,}".format((item.amount or 0) | int) }}</td>
        </tr>
        {% endfor %}
        <tr>
            <td colspan="4" style="text-align: right;"><b>Total Current Invoice Amount</b></td>
            <td><b>{{ "{:,}".format(doc.total | int) }}</b></td>
        </tr>
    </tbody>
</table>

<div class="section-title">Ledger Report - Last 5-Transaction Till ( {{ frappe.utils.formatdate(doc.posting_date, "dd-MM-yyyy") }})</div>
 
<table class="ledger-table">
    <thead>
        <tr>
            <th>Date</th>
            <th>Voucher No</th>
            <th>Debit</th>
            <th>Credit</th>
            <th>Remarks</th>
        </tr>
    </thead>
    <tbody>
        {% for entry in gl_entries %}
        <tr>
            <td>{{ frappe.utils.formatdate(entry.posting_date, "dd-MM-yyyy") }}</td>
            <td>{{ entry.voucher_no }}</td>
            <td>{{ "{:,}".format((entry.debit or 0) | int) }}</td>
            <td>{{ "{:,}".format((entry.credit or 0) | int) }}</td>
            <td class="remarks-column">{{ entry.remarks or 'No Remarks' }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
 
<div class="balance-box">
    Closing Balance:__ {{ "{:,}".format(((gl_totals.total_debit or 0) - (gl_totals.total_credit or 0)) | int) }} /-
</div>
 
<!-- ✅ Footer Section -->
<div class="footer" style="text-align: left; font-size: 14px; margin-top: 20px; line-height: 1.6;">
    <strong>Created By:</strong> {{ doc.owner }}<br>
    <strong>Print_Date:</strong> {{ frappe.utils.nowdate() }}
    <strong>Print_Time:</strong> {{ frappe.utils.nowtime() }}<br>
    <strong>Printed By:</strong> {{ frappe.session.user }}<br>
    <strong>Verified By: __________________________</strong>
</div>
 

         
         
====================================================================================
****************************************************************************
====================================================================================
     
 Add the Following Code in CCS
         ----------------
      
      
      
body {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #000;
}

.invoice-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #000; /* Blue Color */ /*Sales Invoice*/
}

.section-title {
    font-size: 18px;
    margin-top: 30px;
    font-weight: bold;
    color: #1e3799;   /* Blue Color */
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
}

.details-box {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #000;
}

.details-box div {
    width: 48%;
    line-height: 1.6;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    font-size: 12px;
    color: #000;
}

th, td {
    padding: 8px;
    border: 1px solid #000;
}

th {
    background-color: #dff9fb; /* light blue */
    color: #1e3799; /* blue text */
    font-weight: bold;
}

.ledger-table {
    font-size: 10.5px;
}

.ledger-table th, .ledger-table td {
    border: 1px solid #000;
}

.balance-box {
    text-align: right;
    font-size: 16px;
    font-weight: bold;
    color: #1e3799; /* Blue color for balance */
    margin-top: 20px;
}

.remarks-column {
    font-size: 9px;
}

/* ✅ Line before Current Sales Invoice */
.section-divider {
    border-top: 2px solid #000;
    margin: 0px 0 10px 0;  /* top, right/left, bottom */
}

/* Meta section for Created By, Printed Time, etc. */
.print-meta {
    text-align: left;
    font-size: 12px;
    margin-top: 60px;
    line-height: 1.6;
    border-top: 2px solid #000;
    padding-top: 10px;
    color: #000;
}

/* Optional footer styling */
.footer {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px dashed #999;
    font-size: 11px;
    color: #555;
}
add_filter( 'pre_wp_mail', '__return_false' );
setwd("C:\\Users\\d.a.odhiambo\\Desktop\\UBR5 vs Mets Analysis")
# Load TPM data
tpm <- read.csv("GemTPM_Primary.csv")
# Remove duplicate rows from Counts
tpm <- tpm[!duplicated(tpm[, 1]), ]
rownames(tpm) <- tpm[, 1]
tpm <- tpm[, -1]

ubr5_expr <- as.numeric(tpm["UBR5", ])
library(msigdbr)
library(GSVA)
library(dplyr)

# Get Hallmark Interferon Gamma Response gene set
m_df <- msigdbr(species = "Homo sapiens", category = "H")
hallmark_ifng_genes <- m_df %>%
  filter(gs_name == "HALLMARK_INTERFERON_GAMMA_RESPONSE") %>%
  pull(gene_symbol)

# Subset to only genes in your dataset
gene_set_list <- list(HALLMARK_INTERFERON_GAMMA_RESPONSE = intersect(hallmark_ifng_genes, rownames(tpm)))

# Prepare expression matrix (ensure it's numeric)
tpm_matrix <- as.matrix(tpm)
mode(tpm_matrix) <- "numeric"

library(GSVA)

# Step 1: Create ssGSEA parameter object (no additional args here!)
ssgsea_params <- ssgseaParam(exprData = tpm_matrix, geneSets = gene_set_list)

# Step 2: Run ssGSEA
ssgsea_scores <- gsva(param = ssgsea_params)

# Get the Hallmark Interferon Gamma Response score
ifng_score <- as.numeric(ssgsea_scores["HALLMARK_INTERFERON_GAMMA_RESPONSE", ])
cor.test(ubr5_expr, ifng_score)

# Run correlation test
correlation_result <- cor.test(ubr5_expr, ifng_score)

# Get correlation coefficient and p-value
cor_coefficient <- round(correlation_result$estimate, 3)  # Extract correlation coefficient and round
p_value <- round(correlation_result$p.value, 3)  # Extract p-value and round

# Plotting
library(ggplot2)

# Create a data frame for plotting
data_for_plot <- data.frame(
  UBR5_Expression = ubr5_expr,
  IFNG_Score = ifng_score
)

# Generate the plot
ggplot(data_for_plot, aes(x = UBR5_Expression, y = IFNG_Score)) +
  geom_point(color = "blue") +
  labs(title = "Correlation between UBR5 Expression and IFN-gamma Response",
       x = "UBR5 Expression",
       y = "Hallmark IFN-gamma Response Score") +
  theme_minimal() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +  # Adding a linear regression line for visualization
  annotate("text", x = max(ubr5_expr), y = min(ifng_score), 
           label = paste("r = ", cor_coefficient, "\np = ", format(p_value, scientific = TRUE)),  # Use scientific format for very small p-values
           hjust = 1, vjust = 0, color = "black", size = 5, fontface = "italic")
p_value <- formatC(correlation_result$p.value, format = "f", digits = 7)
label = paste("r = ", cor_coefficient, "\np = ", p_value)
# Get correlation coefficient and exact p-value
cor_coefficient <- round(correlation_result$estimate, 3)
p_value <- formatC(correlation_result$p.value, format = "f", digits = 7)

# Create plot
ggplot(data_for_plot, aes(x = UBR5_Expression, y = IFNG_Score)) +
  geom_point(color = "blue") +
  labs(title = "Correlation between UBR5 Expression and IFN-gamma Response",
       x = "UBR5 Expression",
       y = "Hallmark IFN-gamma Response Score") +
  theme_minimal() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  annotate("text", x = max(ubr5_expr), y = min(ifng_score),
           label = paste("r = ", cor_coefficient, "\np = ", p_value),
           hjust = 1, vjust = 0, color = "black", size = 5, fontface = "italic")
{% set gl_entries = frappe.db.sql("""
    SELECT posting_date, voucher_no, debit, credit, remarks
    FROM `tabGL Entry`
    WHERE party_type = 'Customer'
    AND party = %s
    AND is_cancelled = 0
    AND posting_date <= %s
    ORDER BY posting_date DESC, creation DESC
    LIMIT 5
""", (doc.customer, doc.posting_date), as_dict=1) %}

{% set gl_totals = frappe.db.sql("""
    SELECT 
        COALESCE(SUM(debit), 0) AS total_debit,
        COALESCE(SUM(credit), 0) AS total_credit
    FROM `tabGL Entry`
    WHERE party_type = 'Customer'
    AND party = %s
    AND is_cancelled = 0
    AND posting_date BETWEEN '2024-01-01' AND %s
""", (doc.customer, doc.posting_date), as_dict=1)[0] %}

<style>
    @media print {
        body {
            margin: 0;
            padding-bottom: 100px; /* Enough room for footer */
        }
    }

    body {
        font-family: Arial, sans-serif;
        font-size: 12px;
        position: relative;
    }

    .invoice-title {
        text-align: center;
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 20px;
        color: #2c3e50;
    }

    .section-title {
        font-size: 16px;
        margin-top: 30px;
        font-weight: bold;
        color: #34495e;
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
    }

    .details-box {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
    }

    .details-box div {
        width: 48%;
        line-height: 1.6;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 25px;
    }

    th {
        background-color: #f5f5f5;
        text-align: left;
        padding: 8px;
        border: 1px solid #ddd;
    }

    td {
        padding: 8px;
        border: 1px solid #ddd;
    }

    .balance-box {
        text-align: right;
        font-size: 16px;
        font-weight: bold;
        color: #2d3436;
        margin-top: 20px;
    }

    .small-text {
        font-size: 10px;
        color: #555;
    }

    /* Fixed footer */
    .footer-section {
        position: fixed;
        bottom: 20px;
        left: 0;
        width: 100%;
        font-size: 11px;
        font-family: Arial, sans-serif;
        text-align: center;
        padding: 0 30px;
        color: #000;
    }

    .footer-line {
        border-top: 1px solid #000;
        margin-bottom: 5px;
        width: 100%;
    }

    .footer-labels {
        display: flex;
        justify-content: space-around;
    }

    .created-by {
        text-align: left;
        margin-top: 5px;
    }
</style>

<div class="invoice-title">Sales Invoice</div>

<div class="details-box">
    <div>
        <b>Customer:</b> {{ doc.customer_name }}<br>
        <b>Customer Code:</b> {{ doc.customer }}<br>
        <b>DC No:</b> {{ doc.custom_dc_no or '' }}
    </div>
    <div>
        <b>Invoice No:</b> {{ doc.name }}<br>
        <b>Posting Date:</b> {{ frappe.utils.formatdate(doc.posting_date) }}<br>
        <b>Bilty No:</b> {{ doc.custom_bilty_no or '' }}<br>
        <b>Transporter:</b> {{ doc.custom_transport or '' }}
    </div>
</div>

<div class="section-title">Current Sales Invoice</div>

<table>
    <thead>
        <tr>
            <th>#</th>
            <th>Item</th>
            <th>Qty</th>
            <th>Rate (PKR)</th>
            <th>Amount (PKR)</th>
        </tr>
    </thead>
    <tbody>
        {% set total_amount = 0 %}
        {% for item in doc.items %}
        {% set total_amount = total_amount + (item.amount or 0) %}
        <tr>
            <td>{{ loop.index }}</td>
            <td>{{ item.item_name }}</td>
            <td>{{ item.qty }}</td>
            <td>{{ "{:,.0f}".format(item.rate or 0) }}</td>
            <td>{{ "{:,.0f}".format(item.amount or 0) }}</td>
        </tr>
        {% endfor %}
        <tr>
            <td colspan="4" style="text-align: right;"><b>Total</b></td>
            <td><b>{{ "{:,.0f}".format(doc.total or total_amount) }}</b></td>
        </tr>
    </tbody>
</table>

<div class="section-title">Ledger Entries Last 5 (till {{ frappe.utils.formatdate(doc.posting_date) }})</div>

<table>
    <thead>
        <tr>
            <th>Date</th>
            <th>Voucher No</th>
            <th>Debit (PKR)</th>
            <th>Credit (PKR)</th>
            <th>Remarks</th>
        </tr>
    </thead>
    <tbody>
        {% for entry in gl_entries %}
        <tr>
            <td>{{ frappe.utils.formatdate(entry.posting_date) }}</td>
            <td>{{ entry.voucher_no }}</td>
            <td>{{ "{:,.0f}".format(entry.debit or 0) }}</td>
            <td>{{ "{:,.0f}".format(entry.credit or 0) }}</td>
            <td class="small-text">{{ entry.remarks or 'No Remarks' }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

<div class="balance-box">
    Closing Balance: PKR {{ "{:,.0f}".format((gl_totals.total_debit or 0) - (gl_totals.total_credit or 0)) }}
</div>

<!-- FOOTER AT BOTTOM OF PDF PAGE -->
<style>
    html, body {
        height: 100%;
        margin: 0;
        padding: 0;
    }

    .footer-section {
        position: fixed;
        bottom: 0px;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 11px;
        font-family: Arial, sans-serif;
        color: #000;
    }

    .footer-line {
        border-top: 1px solid #000;
        width: 95%;
        margin: 0 auto 4px auto;
    }

    .footer-labels {
        display: flex;
        justify-content: space-around;
        margin: 0 50px;
    }

    .footer-labels div {
        flex: 1;
    }

    .created-by {
        text-align: left;
        margin-left: 50px;
        margin-top: 4px;
        font-size: 10px;
    }
</style>

<div class="footer-section">
    <div class="footer-line"></div>
    <div class="footer-labels">
        <div>Posted By</div>
        <div>Submitted By</div>
        <div>Verified By</div>
    </div>
    <div class="created-by">
        Created by: {{ frappe.db.get_value('User', doc.owner, 'first_name') or "Unknown" }}
    </div>
</div>
setwd("C:\\Users\\d.a.odhiambo\\Desktop\\UBR5 vs Mets Analysis")
# Load TPM data
tpm <- read.csv("GemTPM_Primary.csv")
# Remove duplicate rows from Counts
tpm <- tpm[!duplicated(tpm[, 1]), ]
rownames(tpm) <-tpm[, 1]
tpm<- tpm [, -1]

ubr5_expr <- as.numeric(tpm["UBR5", ])


# Define genes
# Define target gene(s)
target_gene <- "IFNGR1"

# Filter and extract expression
target_expr <- as.numeric(tpm[rownames(tpm) == target_gene, , drop = FALSE])


# Plotting
library(ggplot2)

library(ggrepel)

# Assuming column names of tpm are sample names:
sample_names <- colnames(tpm)

# Create the correlation data frame with sample names
correlation_data <- data.frame(
  Sample = sample_names,
  UBR5 = ubr5_expr,
  IFNGR1 = target_expr
)

# Identify samples with "high" CD274 (you can define your own threshold)
high_IFNGR1_thresh <- quantile(correlation_data$IFNGR1, 0.9, na.rm = TRUE)  # top 10% by default
correlation_data$Label <- ifelse(correlation_data$IFNGR1 > high_IFNGR1_thresh, correlation_data$Sample, "")

# Pearson correlation
cor_test <- cor.test(correlation_data$UBR5, correlation_data$IFNGR1, method = "pearson")
cor_value <- round(cor_test$estimate, 3)
p_value <- signif(cor_test$p.value, 3)


ggplot(correlation_data, aes(x = UBR5, y = IFNGR1)) +
  geom_point(color = "blue", size = 3, alpha = 0.7) +
  geom_smooth(method = "lm", color = "red", se = TRUE) +
  geom_text_repel(aes(label = Label), size = 3, max.overlaps = Inf) +
  labs(
    title = "Correlation between UBR5 and IFNGR1_PT",
    x = "UBR5 Expression",
    y = "IFNGR1 Expression"
  ) +
  theme_minimal() +
  annotate(
    "text",
    x = max(correlation_data$UBR5, na.rm = TRUE) * 0.8,
    y = max(correlation_data$IFNGR1, na.rm = TRUE),
    label = paste("Pearson r =", cor_value, "\nP-value =", p_value),
    size = 5,
    color = "black",
    hjust = 0
  )

       
       




















{% set gl_entries = frappe.db.sql("""
    SELECT posting_date, voucher_no, debit, credit, remarks
    FROM `tabGL Entry`
    WHERE party_type = 'Customer'
    AND party = %s
    AND is_cancelled = 0
    AND posting_date <= %s
    ORDER BY posting_date DESC, creation DESC
    LIMIT 5
""", (doc.customer, doc.posting_date), as_dict=1) %}

{% set gl_totals = frappe.db.sql("""
    SELECT 
        COALESCE(SUM(debit), 0) AS total_debit,
        COALESCE(SUM(credit), 0) AS total_credit
    FROM `tabGL Entry`
    WHERE party_type = 'Customer'
    AND party = %s
    AND is_cancelled = 0
    AND posting_date BETWEEN '2024-01-01' AND %s
""", (doc.customer, doc.posting_date), as_dict=1)[0] %}

<style>
    body {
        font-family: Arial, sans-serif;
        font-size: 12px;
        color: #2c3e50;
    }
    .invoice-title {
        text-align: center;
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 20px;
        color: #2c3e50;
    }
    .section-title {
        font-size: 16px;
        margin-top: 30px;
        font-weight: bold;
        color: #1e3799;
        border-bottom: 2px solid #1e3799;
        padding-bottom: 5px;
    }
    .details-box {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
    }
    .details-box div {
        width: 48%;
        line-height: 1.6;
    }
    table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 25px;
    }
    th {
        background-color: #dff9fb;
        text-align: left;
        padding: 8px;
        border: 1px solid #dcdde1;
    }
    td {
        padding: 8px;
        border: 1px solid #dcdde1;
    }
    .balance-box {
        text-align: right;
        font-size: 16px;
        font-weight: bold;
        color: #2d3436;
        margin-top: 20px;
    }
    .remarks-column {
        font-size: 10px; /* Smaller font size for Remarks column */
    }
</style>

<div class="invoice-title">Sales Invoice</div>

<div class="details-box">
    <div>
        <b>Customer:</b> {{ doc.customer_name }}<br>
        <b>Customer Code:</b> {{ doc.customer }}<br>
        <b>DC No:</b> {{ doc.custom_dc_no or "-" }}
    </div>
    <div>
        <b>Invoice No:</b> {{ doc.name }}<br>
        <b>Posting Date:</b> {{ frappe.utils.formatdate(doc.posting_date, "dd-MM-yyyy") }}<br>
        <b>Bilty No:</b> {{ doc.custom_bilty_no or "-" }}<br>
        <b>Transporter:</b> {{ doc.custom_transport or "-" }}
    </div>
</div>

<div class="section-title">Current Sales Invoice</div>

<table>
    <thead>
        <tr>
            <th>#</th>
            <th>Item</th>
            <th>Qty</th>
            <th>Rate (PKR)</th>
            <th>Amount (PKR)</th>
        </tr>
    </thead>
    <tbody>
        {% for item in doc.items %}
        <tr>
            <td>{{ loop.index }}</td>
            <td>{{ item.item_name }}</td>
            <td>{{ (item.qty or 0) | int }}</td>
            <td>{{ "{:,}".format((item.rate or 0) | int) }}</td>
            <td>{{ "{:,}".format((item.amount or 0) | int) }}</td>
        </tr>
        {% endfor %}
        <tr>
            <td colspan="4" style="text-align: right;"><b>Total</b></td>
            <td><b>{{ "{:,}".format(doc.total | int) }}</b></td>
        </tr>
    </tbody>
</table>

<div class="section-title">Ledger Entries Last 5 (till {{ frappe.utils.formatdate(doc.posting_date, "dd-MM-yyyy") }})</div>

<table>
    <thead>
        <tr>
            <th>Date</th>
            <th>Voucher No</th>
            <th>Debit (PKR)</th>
            <th>Credit (PKR)</th>
            <th>Remarks</th>
        </tr>
    </thead>
    <tbody>
        {% for entry in gl_entries %}
        <tr>
            <td>{{ frappe.utils.formatdate(entry.posting_date, "dd-MM-yyyy") }}</td>
            <td>{{ entry.voucher_no }}</td>
            <td>{{ "{:,}".format((entry.debit or 0) | int) }}</td>
            <td>{{ "{:,}".format((entry.credit or 0) | int) }}</td>
            <td class="remarks-column">{{ entry.remarks or 'No Remarks' }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

<div class="balance-box">
    Closing Balance: PKR {{ "{:,}".format(((gl_totals.total_debit or 0) - (gl_totals.total_credit or 0)) | int) }}
</div>
// export const getWorkstation = (workstationId, currentLocale) => {
//   return instance.get(
//     "/api/" + currentLocale + "/workstations/" + workstationId
//   );
// };

// export const createWorkstation = (resource, currentLocale) => {
//   return instance.post("/api/" + currentLocale + "/workstations/", {
//     ...resource
//   });
// };

// export const updateWorkstation = (workstationId, resource, currentLocale) => {
//   return instance.patch(
//     "/api/" + currentLocale + "/workstations/" + workstationId,
//     {
//       ...resource
//     }
//   );
// };
import axios, { AxiosRequestConfig } from "axios";
import Axios from "axios";

const instance = axios.create({
  baseURL: 'http://localhost:5555/',
  timeout: 60000,
});

// const logOut = () => {
//   // Clear user-related data from localStorage/sessionStorage
//   localStorage.removeItem('authToken');
//   localStorage.removeItem('refreshToken');
//   persisterStore.purge(); // Purge persisted Redux store if needed

//   // Optionally dispatch a Redux action to clear user state
//   store.dispatch({ type: 'LOGOUT' });

//   // Redirect to login page or any other route
//   window.location.href = '/login';
// };

export const apiServices = {
  postData: async (requestUrl, payload) => {
    const token = localStorage.getItem("yestoken");
    try {
      const response = await instance.post(`${requestUrl}`, payload, {
        headers: { Authorization: `Bearer ${token}` },
      });
      // if (response.data.message === 'TOKEN IS EXPIRED') {
      //   logOut();
      // }
      return response;
    } catch (error) {
      console.error("Error during POST request:", error);
      return error.response;
    }
  },
  fetchData: async (requestUrl, params) => {
    const token = localStorage.getItem("yestoken");
    try {
      // Perform the GET request
      const response = await instance.get(`${requestUrl}`, {
        params,
        headers: { Authorization: `Bearer ${token}` },
      });
      return response;
    } catch (error) {
      console.error("Error during GET request:", error);
      throw error;
    }
  },
  changeData: async (requestUrl, payload) => {
    const token = localStorage.getItem("yestoken");
    console.warn("()()change-put", token);
    try {
      // Perform the PUT request
      const response = await instance.put(`${requestUrl}`, payload, {
        headers: { Authorization: `Bearer ${token}` },
      });
      return response;
    } catch (error) {
      console.error("Error during PUT request:", error);
      throw error;
    }
  },
  deleteData: async (requestUrl, params) => {
    const token = localStorage.getItem("yestoken");
    console.warn("()()delete-delete", token);
    try {
      const response = await instance.delete(`${requestUrl}`, {
        params,
        headers: { Authorization: `Bearer ${token}` },
      });
      return response;
    } catch (error) {
      console.error("Error during DELETE request:", error);
      throw error;
    }
  },
  deleteDataPayload: async (requestUrl, payload) => {
    const token = localStorage.getItem("yestoken");
    try {
      const response = await Axios.delete(requestUrl, {
        headers: {
          Authorization: `Bearer ${token}`,
        },
        data: payload,
      });
      return response;
    } catch (error) {
      console.error("Error during DELETE request:", error);
      throw error;
    }
  },
  updateData: async (requestUrl, payload) => {
    const token = localStorage.getItem("yestoken");
    console.warn("()()update-patch", token);
    try {
      const response = await instance.patch(`${requestUrl}`, payload, {
        headers: { Authorization: `Bearer ${token}` },
      });
      return response;
    } catch (error) {
      console.error("Error during PATCH request:", error);
      throw error;
    }
  },
};
info "Ticket ID: " + tktid;

// Step 1: Get the Desk ticket
getTicket = zoho.desk.getRecordById("807258170","tickets",tktid);
ticketData = getTicket.get("statusType");

// Step 2: Fetch matching record from Zoho Creator using TKT_Desk_ID
tktresp = invokeurl
[
	url :"https://creatorapp.zoho.com/api/v2/support729/safe-guard/report/All_Service_Requests?criteria=(TKT_Desk_ID==" + tktid + ")"
	type :GET
	connection:"creator"
];
info tktresp;

// Step 3: Extract Creator record ID from the response
if (tktresp.containsKey("data") && tktresp.get("data").size() > 0)
{
    record = tktresp.get("data").get(0);
    recordID = record.get("ID").toLong(); // Ensure it's BIGINT
    info "Record ID to update: " + recordID;

    // Step 4: Prepare and send update
    updateMap = Map();
    optionalMap = Map();
    updateMap.put("Ticket_Status", ticketData);

    updateResp = zoho.creator.updateRecord("support729", "safe-guard", "All_Service_Requests", recordID, updateMap, optionalMap, "creator");
    info "Update response: " + updateResp.toString();
}
else
{
    info "No matching record found in Creator for Desk Ticket ID: " + tktid;
}
void Send_Maill_Update.Desk_Ticket_Post(int Rec_id, string sub, string cont, string to)
{
	Employ_data = Employment_Check[ID == input.Rec_id];
	info to;
	orgId = 60008472224;
	// 	contactId = "39794000001546129";
	contactId = "39794000007712322";
	dataMap = Map();
	dataMap.put("subject",sub);
	dataMap.put("description",cont);
	dataMap.put("departmentId","39794000006446468");
	dataMap.put("contactId",contactId);
	cfMap = Map();
	cfMap.put("cf_creator_id",Employ_data.ID);
	cfMap.put("cf_to_email",to);
	dataMap.put("cf",cfMap);
	response = zoho.desk.create(orgId,"tickets",dataMap,"desk_integration");
	// 	info response;
	ticketId = response.get("id");
	ticketno = response.get("ticketNumber");
	Employ_data.Desk_Mail_Status="Submitted";
	if(Employ_data.cf_zoho_desk_id != null && Employ_data.cf_zoho_desk_id != "")
	{
		Employ_data.cf_zoho_desk_id=Employ_data.cf_zoho_desk_id + "," + ticketId;
		Employ_data.Zoho_Ticket_No=Employ_data.Zoho_Ticket_No + "," + ticketno;
	}
	else
	{
		Employ_data.cf_zoho_desk_id=ticketId;
		Employ_data.Zoho_Ticket_No=ticketno;
	}
}


Post Record in Desk

tickets = invokeurl
	[
		url :"https://desk.zoho.in/api/v1/tickets"
		type :GET
		headers:{"OrgId":"60008472224"}
		connection:"desk"
	];
	ticketId = null;
	for each  potentialTicket in tickets.get("data")
	{
		ticketSubject = potentialTicket.get("subject").trim().toLowerCase();
		ticketLastIndex = ticketSubject.lastIndexOf(" -  - ");
		ticketIdExtracted = if(ticketLastIndex != -1,ticketSubject.subString(ticketLastIndex + 6),"");
		if(ticketIdExtracted == searchId && potentialTicket.get("cf_creator_id") == null)
		{
			ticketId = potentialTicket.get("id");
		}
	}


GET Record from Desk
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
filebrowser -r /path/to/your/files
script_directory=$(dirname "$BASH_SOURCE")
echo "Script directory: $script_directory"
// Product - View More Button
const $products = $('.item-group-slider .slick-slide');

$products.each(function(index){
    let href = $(this).find('.itemTitle a').attr('href');
    $(this).find('.itemDetail').append($(`<a href="${href}" class="cta-btn">View More</a>`));
});
<%{
	get_comp = Company_Details[ID != null];
	imgqr = get_comp.QR_Code;
	qrurl = "https://creator.zohopublic.in/carrierwheels/erp/Company_Details_Report/" + get_comp.ID + "/QR_Code/image-download/j6hYk3Aydznp76py4dSap5JAORMuJxeEjMAb2Vdsteh0Cg35dYySwyzXFY2Fz1KFhjwJttt5ka7nn5jbvnnxGJD1Hh8BeJMJ6qZN/" + imgqr;
	CompanyLogo = "https://carrierwheels.com/images/CW_Logo.png";
	company_stamp = "https://carrierwheels.com/images/Approved_Stamp-CWPL.jpg";
	calstamp = "https://workdrive.zoho.com/file/muo5y868dd7d53ec64985bbf148dd9c50e7df";
	fetcal = Calibration_History[ID == input.ID.tolong()];
	calmast = Calibration_Master[Gauge_No == fetcal.Gauge_No.Gauge_No];
	img_name = ifnull(fetcal.Attachment.getSuffix("image/").getPrefix("border").replaceAll("\"","").trim(),"");
	customrurl = "https://creator.zohopublic.in/carrierwheels/erp/Calibration_History_Report/" + fetcal.ID + "/Attachment/image-download/AzPNXH4sPQ1RzdsMsbg3tu9gabdAw2h9GBK1TPRxd3xPXCEwF1gYjZSSyEzxVVkhPzBWnGj2jwZr5aKKNgm6AFbb4RdJxdmAjJWM/" + img_name;
	%>
<br>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>


.table2
   {
   width : 100%;
   border :1px solid black;
   text-align : center;
   border-collapse : collapse;
   font-family: Times New Roman;
   margin-left:auto;
   margin-right:auto;
   }
   html{
    height: 100%;
}
.headtab
{
border : 0;
  margin : 0;
}
@page {
margin: 0;
margin-top : 0;
margin-bottom : 0;
margin-left : 0;
margin-right : 0;
}
@media print {
     body {margin: 0mm}
}
</style>
<table class="table2"  >
 <tr>

  <td rowspan="5" width="10%"><img src=<%=CompanyLogo%>  width="86px" height ="20px"></td>
        
		 <td rowspan="5" style= "font-size : 18px ; font-family : Times New Roman; text-align:center;padding-top : 0px; padding-bottom:0px;border-right: 1px solid black;border-left: 1px solid black;padding-left: 100px;"><h7 style="color:lightblue"><b>CARRIER WHEELS PVT LTD</h7></b><br><b>Calibration Report</b></td>
</tr>
       <tr style="border-collapse:collapse; border :0px solid black;"><td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:11px;"><b> Doc No :</b> </td> </td><td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:11px;"><b> CWPL/QA/F/05</b> </td></tr>
	  
		 <tr><td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:10px;"><b>Rev.no : </b> </td> <td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:10px;"> <b>03</b></td></tr>
		 <tr><td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:10px;"><b>Rev.Date : </b></td> <td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:10px;"><b>01.04.2023 </b></td></tr>
		 <tr><td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:10px;"><b>Origin.Date :</b> </td> <td style = "text-align:left; width:10%; border :0px solid black; border-collapse : collapse; font-size:10px;"> <b>12.06.2012</b></td></tr>
		 </table>
	 <style>
.supplier
   {
			width: 100%;
			margin-left: auto;
			margin-right: auto;
			border: 1px solid black;
			border-collapse: collapse;
			
   }
   		.prod
	{
		text-align: left;
		font-size : 10.5px;
	   	width : 100%;
	   	height : 0.5px;
		border :1px solid black; 
		border-collapse : collapse;	   
	}
	 .tr
   {
   border :1px solid black;
   border-collapse : collapse;
   font-size : 13px;
   height : 2px;
   }
   .td
   {
   border :1px solid black;
   border-collapse : collapse;
   font-size : 12px;
   height : 2px;
   }
	   .th
   {
   border :1px solid black;
   border-collapse : collapse;
   font-size : 12px;
   height : 2px;
   }
</style>
<table class = "supplier">
<tr>
 <td style="text-align:center; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b> SETUP DETAILS</td></tr>
 </table>
 
 <table class = "supplier">
      <tr><td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b> Item Name: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Item_Name.Item_Name,"")%>  </td>
		  <td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b> Calibration Date: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Cal_Done_Date,"")%></td></tr>
		   <tr><td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Gauge No: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Gauge_No.Gauge_No,"")%></td>
		  <td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b> Master Instrument: </td> <td tyle="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Master_Instruments.Item_Name,"")%></td></tr>
			<tr><td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Location: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Location.Location_Name,"")%></td>
		  <td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b> Internal /External: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Calibration_Type,"")%></td></tr>
		  <tr><td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Usable Range: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Usable_Range.Usable_Range,"")%> </td>
		  <td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Least Count: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Least_Count.Least_Count,"")%></td></tr>
		  <tr><td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Frequency: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Frequency.Frequency,"")%> </td>
		  <td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Cal Due Date: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(calmast.Cal_Due_Date,"")%></td></tr>
</table>
		 <table class = "supplier">
<tr>
 <td style="text-align:center; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b> IMAGE</td></tr>
<tr> <td  style="text-align:center;"><img src=<%=customrurl%> height="130px" width="200px"> </td></tr>

 </table>
 <table class="supplier" >
<tr style="border :1px solid black; border-collapse : collapse;" >
	<td colspan = "3" style="text-align:center;font-size:13px; border :1px solid black; border-collapse : collapse;" > <b>RECORDING <b></td>
</tr>
</table>

<table style="width : 100%; border :1px solid black; border-collapse : collapse; font-size : 10.5px;">
<tr class="tr">
<th class="th" ><b>S.No</th>
<th class="th">Item Name</th>
<th class="th">Description</th>
<th class="th">Specification(Range)	</th>
<th class="th">Actual</th>
<th class="th">Difference</th>
<th class="th">Permissible error</th>
<th class="th" width="60px">Status</th>
<th class="th">Remarks</th>
</tr>
<%
	slno = 1;
	for each  sub in fetcal.Item_Details1
	{
		fet_material = Calibration_Master[Item_Name == sub.Item_Name.Item_Name];
		%>
<tr class="tr">
<td class="td" align = "center"><%=sub.S_No%> </td>
<td class="td" align = "center"><%=ifnull(sub.Item_Name.Item_Name,"")%></td>
<td class="td" align = "center"><%=ifnull(sub.Description,"")%></td>
<td class="td" align = "center"><%=ifnull(sub.Spec_Range,"")%></td>
<td class="td" align = "center"><%=ifnull(sub.Actual,"")%></td>
<td class="td" align = "center"><%=ifnull(sub.Difference,"")%></td>
<td class="td" align = "center"><%=ifnull(sub.Permissable_Error,"")%></td>
<td class="td" align = "center"><%=ifnull(sub.Status,"")%></td>
<td class="td" align = "center"><%=ifnull(sub.Remarks,"")%></td>
<%
	}
	%>
</table>
<table class = "supplier">
<tr>
 <td style="text-align:center; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>DECISION/RESULTS</td></tr>
 </table>
 <table class = "supplier">
      <tr><td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Calibration Result: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Result,"")%> </td></tr>
	  <tr><td style="text-align:left; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>Calibration Remarks: </td> <td style="text-align:left; width:20% ;border :1px solid black; border-collapse : collapse;font-size:12px"><%=ifnull(fetcal.Terms_Conditions,"")%></td></tr>
	  </table>
	  
	  <table class = "supplier">
<tr>
 <td style="text-align:center; width:10% ;border :1px solid black; border-collapse : collapse;font-size:13px ;"> <b>VALIDATION TEAM</td></tr>
 </table>
<table style="width : 100%; border :1px solid black; border-collapse : collapse; font-size : 10.5px;">
<tr class="tr">
<th class="th" >&nbsp;&nbsp;&nbsp;</th>
<th class="th">Calibration By:</th>
<th class="th">Verification By:</th>
<th class="th">Approved By:</th>
</tr>
<%
	for each  rec in fetcal
	{
		%>
<tr class="tr">
<td class="td"><b><%="Name"%></td></b>
<td class="td" align = "center"><%=rec.Calibration_By.Employee_Name%></td>
<td class="td" align = "center"><%=rec.Checked_By.Employee_Name%></td>
<td class="td" align = "center"><%=rec.Approved_By.Employee_Name%></td>
</tr>
<tr class="tr">
<td class="td"><b><%="Date"%></td></b>
<td class="td" align = "center"><%=ifnull(fetcal.Cal_Done_Date,"")%></td>
<td class="td" align = "center"><%=ifnull(fetcal.Cal_Done_Date,"")%></td>
<td class="td" align = "center"><%=ifnull(fetcal.Cal_Done_Date,"")%></td>
</tr>
<tr class="tr">
<td class="td"><b><%="Signature"%></td></b>
<td class="td" align = "center"><%=""%></td>
<td class="td" align = "center"><%=""%></td>
<td class="td" align = "center"><%=""%></td>
</tr>
<%
	}
	%>
</table>
<style>
	.table3
	{
		 width : 100%;
	   margin-left: auto;
	   margin-right: auto;
	   font-size : 12px;
	   border :1px solid black;
	   border-collapse :collapse;
	   text-align: center;
	}
</style>
<table class="table3" style="margin-bottom: 50px;">
<tr>
<td><b><img src=<%=company_stamp%> width="100px" height ="50px"  align = "center"><br> QA Department</b></td>
<!--<td><b><img src=<%=qrurl%> height ="70px" align = "center"><br> QR Code</b></td>-->
</tr> 
<tr>
<td style="font-size:11px;text-align:center;height:1px; border-collapse : collapse ; border-top : 1px solid black; border-bottom : 1px solid black; margin-botton: auto;"colspan=4> <p style="font-size : 10px;text-align:center"><b>This is system generated report</b></td></tr>	   
   
</table>
<%

}%>
INSERT INTO team_kingkong.tpap_cybercell_fraud_base3
select upi_txn_id_switch,
    txn_date_switch,
    txn_amount_switch,
    payer_vpa_switch,
    payee_vpa_switch,
    payer_mcc_switch,
    payee_mcc_switch,
    payer_handle,
    payee_handle,
    scope_cust_id,
    merchant_bene_type,
    category,
    payer_mobile_no,
    upi_subtype,
    reporting_date,
    ingestion_date,
    'Cybercell' as source
    from
        (select * from
            (select DISTINCT transaction_id as txnid,
            cast(txn_amount as double) as txn_amount,
            DATE(reporting_date) as reporting_date,
            DATE(dl_last_updated) AS ingestion_date,
            row_number() over(partition by transaction_id) as txn_id_duplicate
            FROM frauds.ppsl_cybercell_snapshot_v3
            where DATE(dl_last_updated) BETWEEN DATE'2025-02-01' AND DATE'2025-02-28'
            and transaction_id NOT IN ('', ' ', 'NA', 'N.A', '0') and transaction_id is not null) 
        where txn_id_duplicate = 1) b
    inner join
        (select distinct json_extract_scalar(payresultcontext, '$.payMethodResultList[0].extendInfo.payeeVpa') AS payee_vpa,
        transactionid,
        IF(rrncode IS NOT NULL, rrncode, banktxnid) as rrn_pg,
        DATE(dl_last_updated) as dl_last_updated
        FROM risk_maquette_data_async.pplus_payment_result_prod_async_snapshot_v3
        Where DATE(dl_last_updated) BETWEEN DATE'2024-12-01' AND DATE'2025-02-28' -- DATE_ADD(CURRENT_DATE, -90)
        and date(gmt_occur_derived) BETWEEN DATE'2024-12-01' AND DATE'2025-02-28' -- DATE_ADD(CURRENT_DATE, -90)
        and payresult in ('payment_success') and upper(paymethod) in ('UPI')) c
    on b.txnid = c.transactionid AND c.dl_last_updated < b.reporting_date
    INNER join
        (SELECT * FROM
            (select DISTINCT b.created_on as txn_date_switch
            ,a.txn_id as upi_txn_id_switch
            , a.vpa as payer_vpa_switch
            , b.vpa as  payee_vpa_switch
            , a.amount as txn_amount_switch
            ,a.mcc as payer_mcc_switch
            , b.mcc as payee_mcc_switch
            ,a.handle as payer_handle
            , b.handle as payee_handle
            ,a.scope_cust_id
            ,a.mobile_no as payer_mobile_no
            ,(case when (lower(b.vpa) like '%@paytm%' or lower(b.vpa) like '%@pt%') then 'paytm merchant/bene' else 'others' end) merchant_bene_type
            from switch.txn_participants_snapshot_v3 a
            inner join switch.txn_participants_snapshot_v3 b on a.txn_id = b.txn_id
            where DATE(a.dl_last_updated) BETWEEN DATE'2024-12-01' AND DATE'2025-02-28' -- DATE_ADD(CURRENT_DATE, -90)
            and b.dl_last_updated BETWEEN DATE'2024-12-01' AND DATE'2025-02-28' -- DATE_ADD(CURRENT_DATE, -90)
            and a.created_on BETWEEN DATE'2024-12-01' AND DATE'2025-02-28' -- DATE_ADD(CURRENT_DATE, -90)
            and a.participant_type in ('PAYER') and b.participant_type in ('PAYEE')
            and (lower(a.vpa) like'%@paytm%' or lower(a.vpa) like '%@pt%')) x
        inner join
            (select DISTINCT txn_id, category, rrn
            from switch.txn_info_snapshot_v3
            where DATE(dl_last_updated) BETWEEN DATE'2024-12-01' AND DATE'2025-02-28' -- DATE_ADD(CURRENT_DATE, -90)
            and DATE(created_on) BETWEEN DATE'2024-12-01' AND DATE'2025-02-28' -- DATE_ADD(CURRENT_DATE, -90)
            and upper(status) in ('SUCCESS')) f
    on x.upi_txn_id_switch = f.txn_id)y
on y.rrn = c.rrn_pg and y.payee_vpa_switch = c.payee_vpa AND y.txn_date_switch < b.reporting_date
LEFT JOIN
    (SELECT DISTINCT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    , CAST(json_extract_scalar(request, '$.requestPayload.amount') AS DOUBLE) as amount
    , json_extract_scalar(request, '$.requestPayload.payeeVpa') as payeeVpa
    , DATE(dl_last_updated) as dl_last_updated
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE'2024-12-01' AND DATE'2025-02-28'
    AND json_extract_scalar(response, '$.action_recommended') = 'PASS'
    AND json_extract_scalar(request, '$.source') = 'UPI'
    AND (lower(json_extract_scalar(request, '$.requestPayload.payerVpa')) LIKE '%@paytm%'
    or lower(json_extract_scalar(request, '$.requestPayload.payerVpa')) like '%@pt%'))d
on y.upi_txn_id_switch = d.txnid AND y.txn_amount_switch = d.amount AND c.payee_vpa = d.payeeVpa AND d.dl_last_updated < b.reporting_date
;
star

Mon May 05 2025 09:05:02 GMT+0000 (Coordinated Universal Time)

@iliavial #c#

star

Mon May 05 2025 06:47:30 GMT+0000 (Coordinated Universal Time)

@anmoltyagi

star

Mon May 05 2025 06:34:43 GMT+0000 (Coordinated Universal Time)

@IfedayoAwe

star

Mon May 05 2025 06:18:45 GMT+0000 (Coordinated Universal Time)

@IfedayoAwe

star

Mon May 05 2025 02:39:00 GMT+0000 (Coordinated Universal Time)

@kevinalanks

star

Sun May 04 2025 04:08:33 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Sat May 03 2025 12:41:27 GMT+0000 (Coordinated Universal Time) https://appticz.com/cryptocurrency-exchange-software

@davidscott

star

Sat May 03 2025 11:38:23 GMT+0000 (Coordinated Universal Time) https://dissertationhelpservices.uk/dissertation-introduction-writing-service/

@MillerAlex

star

Fri May 02 2025 03:51:01 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu May 01 2025 23:10:09 GMT+0000 (Coordinated Universal Time)

@tara.hamedani

star

Thu May 01 2025 16:23:08 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024

star

Thu May 01 2025 15:53:25 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 15:42:44 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 13:04:26 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 12:21:50 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 11:57:38 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 11:27:50 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 11:26:58 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 11:25:32 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 11:24:19 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 11:21:42 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu May 01 2025 10:32:55 GMT+0000 (Coordinated Universal Time)

@vishalsingh21

star

Wed Apr 30 2025 12:22:46 GMT+0000 (Coordinated Universal Time) https://maticz.com/coinbase-clone-script

@jamielucas

star

Wed Apr 30 2025 10:38:06 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed Apr 30 2025 10:37:11 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed Apr 30 2025 09:58:22 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/crypto-wallet-security/

@CharleenStewar #cryptowallet security #crypto security

star

Wed Apr 30 2025 09:39:15 GMT+0000 (Coordinated Universal Time)

@Shira

star

Wed Apr 30 2025 09:22:30 GMT+0000 (Coordinated Universal Time) https://www.sitepoint.com/wordpress-pages-use-tags/

@Sebhart #php #wordpress #tags #functions

star

Wed Apr 30 2025 09:11:02 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/blog/trust-wallet-clone-script

@Seraphina

star

Wed Apr 30 2025 08:28:00 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Tue Apr 29 2025 23:48:09 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Tue Apr 29 2025 21:46:32 GMT+0000 (Coordinated Universal Time)

@1234_5

star

Tue Apr 29 2025 21:05:22 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Tue Apr 29 2025 20:20:04 GMT+0000 (Coordinated Universal Time)

@1234_5

star

Tue Apr 29 2025 19:03:46 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Tue Apr 29 2025 12:58:11 GMT+0000 (Coordinated Universal Time)

@codejck

star

Tue Apr 29 2025 12:35:15 GMT+0000 (Coordinated Universal Time) https://appticz.com/cryptocurrency-exchange-development-company

@davidscott

star

Tue Apr 29 2025 10:14:17 GMT+0000 (Coordinated Universal Time)

@codejck

star

Tue Apr 29 2025 09:34:47 GMT+0000 (Coordinated Universal Time) https://www.eversheds-sutherland.com/en/global/capabilities/services/litigation

@fareya

star

Tue Apr 29 2025 08:22:48 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Tue Apr 29 2025 06:55:09 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/solana-token-development/

@LilianAnderson #solanatokendevelopment #solanablockchaintokens #highroitokens #cryptotokencreation #solanadevelopmentguide

star

Tue Apr 29 2025 06:18:56 GMT+0000 (Coordinated Universal Time) https://medicaregt.com/products/laboratory-equipmentsuppliers-in-dubai-uae/

@Medicare

star

Tue Apr 29 2025 04:38:14 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Mon Apr 28 2025 21:48:59 GMT+0000 (Coordinated Universal Time)

@v1ral_ITS

star

Mon Apr 28 2025 11:45:02 GMT+0000 (Coordinated Universal Time)

@vishalsingh21

star

Mon Apr 28 2025 11:38:24 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Mon Apr 28 2025 10:50:06 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/cryptocurrency-market-making-software/

@CharleenStewar #cryptomarketmakingsoftware #cryptotrading #marketmaking #liquidity

star

Mon Apr 28 2025 10:16:37 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension