-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
NEW Default customer, category and product when enable TakePOS #25031
Conversation
Easy setup for TakePOS. Create a category and product when TakePOS is enabled. It checks if TakePOS has already been configured to avoid recreating the category and productif it has already been created.
Default category and product when enable TakePOS
//Default customer for Point of sale | ||
if (empty(getDolGlobalInt('CASHDESK_ID_THIRDPARTY1'))) { | ||
$societe = new Societe($db); | ||
$societe->nom = $langs->trans("DefaultPOSThirdLabel"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you disable and reenable the module. You must check the object does not exist yet by doing a fetch to avoid to try to create it a second time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When reactivated the second time, as the variable CASHDESK_ID_THIRDPARTY1 is already assigned, it will not be created again. It is only created the first time when the CASHDESK_ID_THIRDPARTY1 variable has never been initialized.
$category->label = $langs->trans("DefaultPOSCatLabel"); | ||
$category->type = Categorie::TYPE_PRODUCT; | ||
$result = $category->create($user); | ||
if ($result > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand addition of a Default Category and Thirdparty, but what is the goald of this product ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For TakePOS to work you must have created at least one product. If there are no products created, TakePOS says it needs at least one product to work. A generic product may be interesting to be able to use TakePOS without configuration. Then if the user wants to change the name or create more products, they are welcome.
htdocs/langs/en_US/cashdesk.lang
Outdated
@@ -145,3 +145,6 @@ ShowProductReference=Show reference of products | |||
UsePriceHT=Use price excl. taxes and not price incl. taxes | |||
TerminalName=Terminal %s | |||
TerminalNameDesc=Terminal name | |||
DefaultPOSThirdLabel=TakePOS sales |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to name it "Default customer for POS"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for me
if (empty(getDolGlobalInt('CASHDESK_ID_THIRDPARTY1'))) { | ||
$societe = new Societe($db); | ||
$societe->nom = $langs->trans("DefaultPOSThirdLabel"); | ||
$societe->client = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also set property note_private = 'Default customer automaticaly created by Point Of Sale module activation. Can be used as the default customer in the Point Of Sale setup. Can also be edited or removed.'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for me
htdocs/langs/en_US/cashdesk.lang
Outdated
@@ -145,3 +145,6 @@ ShowProductReference=Show reference of products | |||
UsePriceHT=Use price excl. taxes and not price incl. taxes | |||
TerminalName=Terminal %s | |||
TerminalNameDesc=Terminal name | |||
DefaultPOSThirdLabel=TakePOS sales | |||
DefaultPOSCatLabel=Point of sale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to name this category like this
"Category for all Point Of Sale products"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for me
Easy setup for TakePOS. Create a customer when TakePOS is enabled. It checks if TakePOS has already been configured to avoid recreating the customer if it has already been created.