Jump to content

Recommended Posts

Posted

Viva,

Precisa de criar um script para converter multiplos dossier para compras no PHC?

Pode ser em tecla de atalho ou criar um script para criar os registos directamente no sql server.

Alguem já fez esta funcionalidade?

  • 3 months later...
Posted

exemplo

fornecedor 25

msel="select bo.nmdos, bo.obrano, bo.no, bo.nome, bi.ref, bi.design, bi.qtt, bi.qtt2, bi.edebito from bo (nolock)
inner join bi on bi.bostamp=bo.bostamp
where bo.ndos=1 and bo.fechada=0 and bo.no='25' "

u_sqlexec(msel.  [bo2fo])
select bo2fo

sfo.newndoc(2)
sfo.dointroduzir
select fo
replace fo.nome with bo2fo.nome
replace fo.no with bo2fo.no

*apagar a primeira linha para não ficar vazia
select fn
delete

*copiar as linhas
select bo2fo
scan
*adicionar uma nova linha em branco
do foine2in 

*copiar os dados das linhas
select fn
replace fn.ref with bo2fo.ref
Do Foactref with "NORMAL",.T.,"OKPRECOS"
replace fn.qtt with bo2fo.qtt

do foiliq

do fotots
endscan

sfo.refresh 

César Faria

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.