INSERT INTO sd_payments (paycod, paytyp, title ) VALUES (26400, 1, 'МП Монополия');
UPDATE sd_payments SET title='МП Монополия'  WHERE paycod=26400;
UPDATE sd_azspayms set time_end=now() where id_shop=sf_get_cur_id_shop() AND paycod=26400 and time_end IS NULL;
INSERT INTO sd_azspayms ( id_shop, time_beg, time_end, paycod, npp, flg, bnalnum, set, color, cardtyp, posadr, round ) VALUES (sf_get_cur_id_shop() , now(), NULL, 26400, (SELECT max(npp) + 1 FROM sd_azspayms WHERE time_end IS NULL), 0, 12, 1, 0, 0, 0, null); 
