Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize Kontostand and Geldtransaktionen #5

Open
2 tasks
abruckmeier opened this issue Dec 27, 2019 · 0 comments
Open
2 tasks

Synchronize Kontostand and Geldtransaktionen #5

abruckmeier opened this issue Dec 27, 2019 · 0 comments

Comments

@abruckmeier
Copy link
Owner

Synchronisation of both entities from time to time (regularly, weekly?) -> Slack-Message to the administrator.

  • Count the Bargeld and set the correct status.
  • Create job to synchronise/compare the entities.

Code for comparison

select
	k.id,
	k.username,
	ks.stand,
	coalesce(z.zu,0) - coalesce(v.von,0) as std_transaktionen,
	ks.stand - (coalesce(z.zu,0) - coalesce(v.von,0)) as diff,
	-ks.stand - (coalesce(z.zu,0) - coalesce(v.von,0)) as diff2,
	v.von,
	z.zu
from profil_kioskuser as k
left join kiosk_kontostand ks
	on k.id = ks.nutzer_id
left join (
	select 
		vonnutzer_id as id,
		sum(betrag) as von
	from kiosk_geldtransaktionen
	group by vonnutzer_id
) as v
	using(id)
left join (
	select 
		zunutzer_id as id,
		sum(betrag) as zu
	from kiosk_geldtransaktionen
	group by zunutzer_id
) as z
	using(id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant