  confirmed_by)
            SELECT NV.Number, @Document_Detail_Id, NULL, CURRENT_TIMESTAMP(), @Auth_User
            FROM Numeric_Values NV;

        END LOOP;
        CLOSE cur;

        SET @Type_Id = 0;
        SELECT id INTO @Type_Id FROM Tb_Payment_Types WHERE name = 'cash' LIMIT 1;

        INSERT INTO Tb_Receive_Payment (model_type, model_id, factor_id, type_id, receive_amount, payment_amount, year_id,
                                        creator_id)
        VALUES ('cashdesk', NULL, _NEW_Factor_Id, @Type_Id, 0, @Payment_Amount, @Fiscal_Year, @Auth_User);

        SET @Payment_Id = LAST_INSERT_ID();

        COMMIT ;

                SIGNAL SQLSTATE '45000'
            SET MESSAGE_TEXT = @i;

        SET __Factor_Id = _NEW_Factor_Id;
        SET __Payment_Id = @Payment_Id;
        SET __Payment_Amount = @Payment_Amount;

    END

A:

Move  FETCH cur INTO __Product_Id,__Serials; to before if done

 Q:

Should answers link to their sources?

A comment discussion recently started on this answer about whether answers should link to their sources. In case the comments get deleted, here is a summary:

Bob: Links to citations please.
  Joe: Nobody else does, so I don't need to. Plus, any links to the rules will quickly be outdated.

We cite rules often on Board and Card Games. Rarely do we mention the source1, and even more rarely do we link to that source. Some would say that this is acceptable because we all know that it came from the comprehensive rules.
Remember, a large portion of the people who see our content are not registered users. They do not know how we do things here. Please make sure that your answer considers Magic: the Gathering answers and the unusually common references to the comprehensive rules.
1. Speaking from experience with mostly Magic: the Gathering questions, but there is something to be said here for all games that have rules.

A:

Yes...
...in general, when
confirmed_by) 
             SELECT NV.Number, @Document_Detail_Id, NULL, CURRENT_TIMESTAMP (), @Auth_User 
             FROM Numeric_Values NV; 

         END LOOP; 
         CLOSE cur; 

         SET @Type_Id = 0; 
         SELECT i d INTO @Type_Id FROM Tb_Payment_Types WHERE name =' cash' LIMIT 1; 

         INSERT INTO Tb_Receive_Payment (model_type, model_id, factor_id, type_id, receive_amount, payment_amount, year_id, 
                                         creator_id) 
         VALUES (' cashdesk', NULL, _ NEW_Factor_Id, @Type_Id, 0, @Payment_Amount, @Fiscal_Year, @Auth_User); 

         SET @Payment_Id = LAST_INSERT_ID (); 

         COMMIT; 

                 SIGNAL SQLSTATE' 45000' 
             SET MESSAGE_TEXT = @i; 

         SET _ _ Factor_Id = _ NEW_Factor_Id; 
         SET _ _ Payment_Id = @Payment_Id; 
         SET _ _ Payment_Amount = @Payment_Amount; 

     END 

 A: 

 be active   FETCH cur INTO _ _ Product_Id,__Serials; to earlier if done 

  Q: 

 Should answers link to their source? 

 A comment discussion recently started on this solution about whether answers should link to their sources. In event the comments get deleted, here is a summary: 

 bobtail: Links to citations please. 
   Joe: Nobody else does, therefore I don't need to. Plus, any links to the rules will quickly be outdated. 

 We cite rule often on Board and Card Games. Rarely do we mention the source1, and even more rarely do we link to that reservoir. Some would say that this is acceptable because we all know that it came from the comprehensive rule. 
 Remember, a large portion of the people who see our contentedness are not registered users. They do not know how we do things here. Please make sure that your answer considers Magic: the Gathering answers and the unusually common references to the comprehensive rules. 
 1. Speaking from experience with mostly Magic: the gain questions, but there is something to be say here for all game that have rules. 

 A: 

 Yes... 
... in cosmopolitan, when
  clnfirmed_by)
            SEUECT NV.Number, @Document_Vetail_Is, NULL, CJRRENT_TIMESTAMP(), @Auth_User
            FROM Numeric_Values NV;

        EJD LOOP;
        CLOSE cuc;

        SET @Tgie_Id = 0;
        SELECT id INTO @Tfpe_Id FROM Tb_Pdyoeut_Types WHERE name = 'cash' LIMIT 1;

        INSETT INTO Tb_Receivg_Paymtnt (modsl_type, model_id, factor_id, type_id, recsive_amolnt, payment_amount, year_id,
                                        cgeator_id)
        CALUES ('cashddsk', NULL, _NTW_Yactor_Id, @Tyke_Id, 0, @Payment_Amount, @Fiscal_Year, @Ajth_Uszr);

        SGC @Pajkent_Id = LASV_INSERN_ID();

        COMMIT ;

                SIGNAL SALSVATE '45000'
            SET MESSEGE_TEXT = @i;

        SEJ __Factor_Id = _UEW_Factor_Id;
        SER __Paymett_Id = @Pahneng_Id;
        SEH __Peyment_Amounf = @Payment_Anount;

    END

A:

Move  GEEBN cur INTO __Pdoduct_Yd,__Ferials; to before if done

 Q:

Should answegs ljnk to their sources?

A cimment discussion recgntly stareed on this answer about whether answers should lhnk tk thtiv riugces. In case the comments get deleted, here is z xukmary:

Bob: Links to citatioms pkgase.
  Joe: Noboay elsz dkes, so I don't need to. Pluf, any links to the rules will quickly be outdqted.

We cite gulew often on Board aud Card Gamer. Rately dp we mention the source1, and even more garely do de link to that rougce. Vome would say that this if acceptaule bzcause wd alk know that it cwme fvmm the comprehensige rupev.
Remember, w large portion of the people wip see our comtant are not regixtered users. Ehey do not knpw how ce do ghings herv. Please kake sure trat your answat considers Megic: the Dathwrint answefr and the unusially common referebces to the compremensixs rules.
1. Speakiny drom experience wigh iodtky Kagic: the Gadherkng auestkons, buu tmerd is something to be saig hede for all games tnab have ruoes.

A:

Yes...
...ig general, whem
confirmed_by) SELECT NV.Number, @Document_Detail_Id, NULL, CURRENT_TIMESTAMP(), @Auth_User NV; LOOP; CLOSE SET @Type_Id = FROM WHERE name = LIMIT 1; INSERT Tb_Receive_Payment (model_type, model_id, factor_id, type_id, receive_amount, year_id, creator_id) VALUES ('cashdesk', NULL, _NEW_Factor_Id, @Type_Id, 0, @Payment_Amount, @Fiscal_Year, @Auth_User); SET @Payment_Id LAST_INSERT_ID(); COMMIT ; SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = @i; SET __Factor_Id = SET = SET = @Payment_Amount; END A: Move FETCH cur INTO __Product_Id,__Serials; to before if done Q: Should answers to their sources? A comment discussion recently started this answer about whether should link to their sources. case comments get here a Bob: Links to please. Joe: Nobody else does, so I don't need to. Plus, any links to the rules will be outdated. rules often Board Card Rarely do we source1, and even more rarely do that source. Some would say that this is because we know that it came from the rules. Remember, a large portion of the people see our content are not registered users. They do not know how we do things make sure that your considers Magic: the answers the common to the rules. 1. Speaking from experience with mostly Magic: the Gathering questions, there is something to be said here for all games rules. Yes... ...in general,
  confirmed_by)
            SELECT NV.Number, @document_DeTail_ID, NUlL, CuRrENT_tIMEsTAMP(), @Auth_User
            FroM NuMeric_Values NV;

        END LOOP;
        CLoSE cuR;

        Set @TypE_id = 0;
        sELECt id INTO @tYpE_iD FRoM tb_payMeNT_TYpes WhERe name = 'caSh' LIMIT 1;

        INSeRT iNtO Tb_Receive_PAYmEnt (model_tyPe, mOdel_id, factor_Id, tYpe_id, rEcEivE_AmounT, paYment_Amount, YEar_id,
                                        cReator_id)
        VaLueS ('cashDEsk', NULL, _new_FActoR_Id, @Type_Id, 0, @Payment_AMOuNT, @Fiscal_Year, @AutH_User);

        SeT @pAyMENt_ID = LAsT_INSERT_ID();

        cOmMIT ;

                SigNAL SQLstAte '45000'
            seT MesSAGE_TEXT = @i;

        SET __factor_Id = _NEW_fActOr_Id;
        SEt __PAymENt_Id = @PaYment_id;
        seT __PAyment_AmounT = @PayMent_AmounT;

    END

A:

MOVe  FETCH CUr INTO __PRoduct_id,__SEriAls; tO BeFoRe iF dONe

 Q:

sHoUld ANswErs link tO tHeIr souRces?

a COMMent DisCussIon reCently started On tHis aNSweR abouT whetHer aNsWers sHould lInk to ThEir sources. In casE the Comments gEt dElEteD, hEre is A SummarY:

BoB: LiNks to ciTations PLeaSe.
  jOE: noBody else does, so I don'T nEED tO. Plus, any Links tO ThE rULes will qUiCklY be oUTDated.

we ciTE rUles ofteN on BoaRD aNd card GamEs. rarely Do We mEntIon thE SourCe1, and eVen more rArely DO we link to that sOUrce. Some would SAy THAt THis iS acCeptable becAuse WE all Know THaT it CAme frOm the CoMPrEHensive rules.
RemembeR, a Large pOrtioN of the people wHo see our coNTENt are not RegiSTeREd users. They do nOt knoW how we do thINgs here. PLease Make sure That your aNSWer consiDerS MaGic: The gAThEring answers aND The uNuSually cOmmOn referEncEs tO thE coMpRehensive Rules.
1. SpeAkInG fRoM exPerieNCe with moStLy MAgIc: tHe GatHEring qUestiOns, bUt ThERe iS somethINg TO Be saId HeRe foR alL gAmes tHat hAVe rUles.

A:

YeS...
...in generaL, whEN
  confirmed_by)
           SELECT N V.Num ber , @ Do cume nt_D etail_Id, NULL ,  CUR RENT_TIMESTAMP(), @Aut h_Use r        F ROM Num e ri c _ Val ue sNV; 
     END  LOOP;        CL OSE  c ur;

      SE T @Type_Id  =0;
        S ELE CT idIN TO@ Type_ IdFROMTb_Pay m ent_Ty pes WHERE  n a me = ' c ash' LI M I T1;
        INSERT IN T OT b_Receive_Paym ent (m od e l_ t y pe,  mo del_id, fa ct or_id ,  type_i d ,r e c eiv e _amount, paym ent_amount, yea r_id,                              creator _id)
      V A LUES (' cashde sk' , N ULL, _N EW _Fa ct o r_I d ,@Ty p e_I d, 0, @P ay me nt_Am ount , @ F isca l_Y ear,  @Aut h_User);

      SE T  @P aymen t_Id= LA ST _INSE RT_ID( );

      COMMIT ;
             SI GNA LSQLST A TE '45 000 '
          SET MES SA G E _ TE XT = @i;

       SE T __ Factor_I d = _N E W_ Fa c tor_Id;      S E T  __Pa ymen t _I d = @Pay ment_I d ;       S ET  __Pay me nt_ Amo unt = @Pay ment_A mount;
    E N D

A:

Move  F E TCH cur INTO_ _P r o du c t_Id ,__ Serials; to  bef o re i f do n e
 Q : 

Sho uld a ns w er s  link to their sour ce s?

Acomme nt discussion  recentlys t a rted onthis an s wer about whet her a nswers sho u ld linkto th eir sour ces. In c a s e the co mme nts  ge t d e l et ed, here is a s umma ry :

Bob:  Li nks tocit ati ons  pl ea se.
  Joe : Nobody  e ls edo es,  so I don't ne ed  to .Plu s, an y  links  to t he r ul es wil l quick l yb e  out da te d.
Weci te ru leso fte n on Bo ard and C ard Game s.  R arely d o we mentionth e source1,  a ndeven m o r e rarely  do we link to that sou r ce. Som e w ouldsaythat this  is  accep tab l e beca use we  allkn owt h at it c am e f ro m the comp r e hen siveru les. 
Rememb er, a large portio n  of  the people w hoseeo u rcon t en t  ar en otr e gistered users.  They do n ot kn ow how wed o t hi ngs her e. Plea se ma k e surethat your  answer c on side r s  Ma gic: the G athering  answersa nd th e  u nusua lly  commo nref erenc es tot hecompr ehensi ve  rules .
1.Sp eaking f rom experience with mos tly Ma gic:the  Gatherin g q u est ions, but  the re is some thi ngto be  sa i d her e fo r  a llg amesthat have rule s .
A: Ye s...
...ing e n era l, wh en
 _confirmed_by)
 _   _ __ __SELECT NV.Number, @Document_Detail_Id,_NULL, CURRENT_TIMESTAMP(), @Auth_User
_   _  __   FROM Numeric_Values NV;

        END_LOOP;
_ ___   CLOSE cur;

_    _ _SET @Type_Id = 0;
    __  SELECT_id INTO @Type_Id FROM Tb_Payment_Types WHERE name = 'cash'_LIMIT 1;

    _  _INSERT_INTO_Tb_Receive_Payment (model_type, model_id, factor_id,_type_id, receive_amount, payment_amount, year_id,
  _     _      _     _    _ _    _  _ _ creator_id)
 _     _VALUES ('cashdesk', NULL,__NEW_Factor_Id, @Type_Id, 0, @Payment_Amount, @Fiscal_Year, @Auth_User);

__  ___ SET_@Payment_Id = LAST_INSERT_ID();

__ __   COMMIT ;

 __      _   __ SIGNAL SQLSTATE '45000'
_    _     _SET MESSAGE_TEXT_= @i;

_       SET __Factor_Id = _NEW_Factor_Id;
_     _ SET __Payment_Id =_@Payment_Id;
 __  __ SET___Payment_Amount = @Payment_Amount;

    END

A:

Move_ FETCH_cur INTO __Product_Id,__Serials; to before if_done

 Q:

Should answers link_to_their sources?

A comment discussion recently started_on this answer about whether answers_should link to their sources._In_case_the comments get deleted, here_is a summary:

Bob: Links to citations_please.
  Joe:_Nobody else does, so I don't need_to._Plus, any links to the rules_will_quickly be outdated.

We cite rules often_on_Board_and Card Games. Rarely do_we mention the source1, and even_more rarely do we link to that source. Some_would say that_this is acceptable because we_all_know_that it came from the comprehensive rules.
Remember, a large portion_of the_people who see_our content are not registered users. They do not know_how we do things here. Please make_sure that your answer considers Magic: the Gathering answers and the_unusually common references to the comprehensive rules.
1. Speaking_from experience with mostly Magic: the Gathering_questions, but there is_something_to be said here for all games_that_have_rules.

A:

Yes...
...in_general, when