Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,167,233 members, 7,867,606 topics. Date: Friday, 21 June 2024 at 07:40 PM

How To Code This Logic With Php... - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How To Code This Logic With Php... (1818 Views)

Help A Beginner Code This Using Javascript / I Need An Expert To Code This For Me / [Tutorial Post] How To Integrate Paystack Payment System With PHP (2) (3) (4)

(1) (Reply) (Go Down)

How To Code This Logic With Php... by Aliks(m): 8:22pm On Apr 25, 2018
I'm trying to code a software for a pharmacy that will allow them to manage their sales, purchases and stock.

For every stock they purchase; they'll be able to add 'item name', indicate quantity by description e.g. 'sachet, packet or carton' of drugs with a dropdown, and indicate quantity in units of '1, 2, 3 etc'. Eg. a purchase of item 'panadol', '3(units)' of 'cartons' and /or item 'paracetamol', '5(units)' of 'packets'.

Now, I'm trying to convert dynamically the relationship between the qualities sachet, packet, carton and possibly other quantities they'll enter in the qualities table...

So that in the end, when they make sales of 5 packets of panadol a day, the system will automatically calculate the balance stock from 3 cartons based on the quantity relationship between sachets, packets and cartons...
Re: How To Code This Logic With Php... by elninosft(m): 9:14pm On Apr 25, 2018
Aliks:
I'm trying to code a software for a pharmacy that will allow them to manage their sales, purchases and stock.

For every stock they purchase; they'll be able to add 'item name', indicate quantity by description e.g. 'sachet, packet or carton' of drugs with a dropdown, and indicate quantity in units of '1, 2, 3 etc'. Eg. a purchase of item 'panadol', '3(units)' of 'cartons' and /or item 'paracetamol', '5(units)' of 'packets'.

Now, I'm trying to convert dynamically the relationship between the qualities sachet, packet, carton and possibly other quantities they'll enter in the qualities table...

So that in the end, when they make sales of 5 packets of panadol a day, the system will automatically calculate the balance stock from 3 cartons based on the quantity relationship between sachets, packets and cartons...

Do you want it done for you or you need the script?
Re: How To Code This Logic With Php... by vankaid: 10:36pm On Apr 25, 2018
elninosft:


Do you want it done for you or you need the script?
Do it for him here with sample codes!
Re: How To Code This Logic With Php... by Aliks(m): 7:47am On Apr 26, 2018
elninosft:


Do you want it done for you or you need the script?
I'll appreciate the script sir.
Re: How To Code This Logic With Php... by CAENO: 9:02am On Apr 26, 2018
I can build this in php,Ajax,MySQL.Buzz me on 07012585759.
Re: How To Code This Logic With Php... by Duchman67: 9:03am On Apr 26, 2018
My design will convert both stock purchases and sales to the common unit. So the pharm buying a carton of panadol will be listed in stock database as 300 packets of panadol.

Sales input into the database will be an insert statement where the quantity is multiplied by -1 to get a negative quantity value. Stock purchases input into the database will be an insert statement with no quanttity multiplication by -1

So a sum column statement shows no stock if result less than 1.
You can have a cron job run the sum column statement on each drug and email/sms you when the result of that mysql query hits a certain threshold/number.


Aliks:
I'm trying to code a software for a pharmacy that will allow them to manage their sales, purchases and stock.

For every stock they purchase; they'll be able to add 'item name', indicate quantity by description e.g. 'sachet, packet or carton' of drugs with a dropdown, and indicate quantity in units of '1, 2, 3 etc'. Eg. a purchase of item 'panadol', '3(units)' of 'cartons' and /or item 'paracetamol', '5(units)' of 'packets'.

Now, I'm trying to convert dynamically the relationship between the qualities sachet, packet, carton and possibly other quantities they'll enter in the qualities table...

So that in the end, when they make sales of 5 packets of panadol a day, the system will automatically calculate the balance stock from 3 cartons based on the quantity relationship between sachets, packets and cartons...

2 Likes

Re: How To Code This Logic With Php... by Aliks(m): 9:31am On Apr 26, 2018
Duchman67:
My design will convert both stock purchases and sales to the common unit. So the pharm buying a carton of panadol will be listed in stock database as 300 packets of panadol.

Sales input into the database will be an insert statement where the quantity is multiplied by -1 to get a negative quantity value. Stock purchases input into the database will be an insert statement with no quanttity multiplication by -1

So a sum column statement shows no stock if result less than 1.
You can have a cron job run the sum column statement on each drug and email/sms you when the result of that mysql query hits a certain threshold/number.


The sales may not only be packets, maybe in sachets as well (there may be more than one sachet in a packet depending on the drug package structure). Numbers of packets per carton will certainly differ with drugs, and sachets per packets - we are not only dealing with panadol in which its unit structure we can just assign as static variables. So, we have to keep things dynamic and allow them use the software flexibly...

I need insight on going about the dynamic conversions, and probably the database structure...
Re: How To Code This Logic With Php... by Duchman67: 10:59am On Apr 26, 2018
You will need to sit down with the pharm and get the least saleable unit per drug and use that to build the database structure. Stock page and sales should mirror each other in the aspect of unit per drug.

The stock update on the database is an insert statement and the sales update is an insert statement but with negative quantity column insert. So both stock statement and sales must be of the same unit type for maximum accuracy. Any thing outside this will introduce extensive inaccuracy on column sum statement. On the database structure it can not be dynamic as far as i can see(though a more informed mind can prove otherwise)

Aliks:

The sales may not only be packets, maybe in sachets as well (there may be more than one sachet in a packet depending on the drug package structure). Numbers of packets per carton will certainly differ with drugs, and sachets per packets - we are not only dealing with panadol in which its unit structure we can just assign as static variables. So, we have to keep things dynamic and allow them use the software flexibly...

I need insight on going about the dynamic conversions, and probably the database structure...

1 Like

Re: How To Code This Logic With Php... by elninosft(m): 2:10pm On Apr 26, 2018
Aliks:

I'll appreciate the script sir.
Chat me up on whatsapp 09060488908
Re: How To Code This Logic With Php... by urchrlex: 8:31pm On Apr 26, 2018
s as simple as ABCD . It's just like a maths problem that has many solutions but all gives you the same answer. X = a, X =b,X=c,X=d; You want to substitute the value of X =a . To all the functions. Solve it then call me I will tell you how to solve it .You can use simple IF condition to solve it or declare them in you database. Call me :08156903069

1 Like

Re: How To Code This Logic With Php... by Aliks(m): 3:44pm On Apr 27, 2018
Duchman67:
You will need to sit down with the pharm and get the least saleable unit per drug and use that to build the database structure. Stock page and sales should mirror each other in the aspect of unit per drug.

The stock update on the database is an insert statement and the sales update is an insert statement but with negative quantity column insert. So both stock statement and sales must be of the same unit type for maximum accuracy. Any thing outside this will introduce extensive inaccuracy on column sum statement. On the database structure it can not be dynamic as far as i can see(though a more informed mind can prove otherwise)

Good point about having same unit of measurement accross... Any conversions I'll make will probably be on a pre and post basis i.e. before and after insertion/update.

I'm already doing something; inserting sales and purchases with units and quantity descriptions, and immediately updating stock table with + for purchase and - for sales... Once I sort out the dynamic conversions of the units of measurements just for user flexibility - it's done!

Thanks for the insights...
Re: How To Code This Logic With Php... by romme2u: 11:07am On Apr 28, 2018
sad

have you done date manipulation before?

converting from seconds to minutes to hour to day to week.

explore the date extension and use the same analogy to build your data structure and conversion sequence.

............like how many sachets make a packet and how many packets make a carton.

if 100 packets are in a carton and 10 sachets are in a packet, how many sachets are in a carton.

2 Likes

Re: How To Code This Logic With Php... by airsaylongcon: 3:50am On Apr 29, 2018
I CANNOT believe that coders are expending energy rebuilding the wheel! This is a basic point of sale solution that has been built times without number in PHP. Op, there's a plethora of readily available solution. In Java try Unicenta opos, PHP try OSPOS (open source POS). If it's purely for inventory management, hit me up for solutions

PS: Those things you referred to as 'qualities' are properly called Unit of Measure (UOM)
Re: How To Code This Logic With Php... by Aliks(m): 9:43am On Jul 24, 2018
airsaylongcon:
I CANNOT believe that coders are expending energy rebuilding the wheel! This is a basic point of sale solution that has been built times without number in PHP. Op, there's a plethora of readily available solution. In Java try Unicenta opos, PHP try OSPOS (open source POS). If it's purely for inventory management, hit me up for solutions

PS: Those things you referred to as 'qualities' are properly called Unit of Measure (UOM)
You just need to exercise yourself and create some things from scratch by yourself - you get to learn more and have the advantage.

I've completed the Hospital Management Software successfully... just a little playing with if/else!
Re: How To Code This Logic With Php... by airsaylongcon: 9:54am On Jul 24, 2018
Aliks:

You just need to exercise yourself and create some things from scratch by yourself - you get to learn more and have the advantage.

I've completed the Hospital Management Software successfully... just a little playing with if/else!

Is your HMS for ambulatory care?
Re: How To Code This Logic With Php... by sparkle6(m): 10:10am On Jul 24, 2018
i can do that in java
Re: How To Code This Logic With Php... by Aliks(m): 7:12am On Jul 26, 2018
airsaylongcon:


Is your HMS for ambulatory care?
Didn't include it, but I always can if you want it...
Re: How To Code This Logic With Php... by airsaylongcon: 7:20am On Jul 26, 2018
Aliks:

Didn't include it, but I always can if you want it...

Lol! Never mind.
Re: How To Code This Logic With Php... by Projectova: 11:42am On Jul 26, 2018
Aliks:
I'm trying to code a software for a pharmacy that will allow them to manage their sales, purchases and stock.

For every stock they purchase; they'll be able to add 'item name', indicate quantity by description e.g. 'sachet, packet or carton' of drugs with a dropdown, and indicate quantity in units of '1, 2, 3 etc'. Eg. a purchase of item 'panadol', '3(units)' of 'cartons' and /or item 'paracetamol', '5(units)' of 'packets'.

Now, I'm trying to convert dynamically the relationship between the qualities sachet, packet, carton and possibly other quantities they'll enter in the qualities table...

So that in the end, when they make sales of 5 packets of panadol a day, the system will automatically calculate the balance stock from 3 cartons based on the quantity relationship between sachets, packets and cartons...
The best SOLUTION to this problem is to convert all units of measurements to the smallest unit of measurement.

Let me tell you WHY first, then HOW thereafter.

WHY?
1. Customers buy in varying units: Someone may buy in retail, while another may buy in bulk. Customer A wants a dose (2 caplets) while customer B needs a sachet (10 caplets). And there could even be Customer C who needs A packet (5 sachets), and Customer D might even need a whole carton (many packets).

2. Keep It Simple: Your client wants to easily look through his reports (sales/purchases) and easily understand what transpired without the need for needless conversions. Also, the software will thank you for this. But most importantly, all the job of how many is done once, during entry, and not anytime reports are polled from the database.

SUGGESTION: Batching your entries (sales/purchase) is necessary should you want to integrate in-built automatic unit converter (sachet-to-tablet, carton-tablets, etc) in the app. This is so because from my knowledge, packaging quantities are likely going to change. In fact trying to build your converter for this will be tantamount to creating a KBS, an expert sub-system in your app.

HOW?
Advise your client to enter all drugs quantities in the smallest measurement units (capsule/caplet/tablet/bottle/jar) and not in bulk units. In Computer Science, things are preferrably stored in elementary rather than as grouped items. And especially for Database Normalization.

So, you design should be such that:

Purchases input include:
Purchase Quantity: (in bulk: sachets/cartons/rolls etc)
Purchase Price:
Units Per Purchase Quantity: (How many tablets/bottle in a sachet/carton/roll)
Unit Quantity (in units: capsule/caplet/tablet/bottle/jar)
Unit Price: (price of 1 capsule/caplet/tablet/bottle/jar)
Batch No.: this is ONLY necessary should there be a change in packaging composition.

Sales input include:
Sales Quantity: (in units: capsule/caplet/tablet/bottle/jar)
Other nominal inputs are either fetched from the DB or derived from a function of computation thereof.

I hope this is as helpful as you anticipated.

1 Like

(1) (Reply)

Is It Possible To Gain An Internship With A Tech Company? / Wap Site / How does The Gocredit Feature Of The 2go App Work?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 131
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.