Any work during your physical presence in Portugal and income derived from that is Portugese sourced income (broadly speaking). If you do remote work does not matter, if you sell stuff online does not matter, if you consult over telephone, remote log etc does not matter - your physical presence...