Apply Payment Type to Existing Customers

From ISoft Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

ITrack Enterprise currently has a setting for payment types where you can apply them to new customers, but you may also want to assign the new payment type to existing customers. These queries can help you with that:

#Get the list of payment types, starting with the most recently created
SELECT * FROM paymentmethod ORDER BY paymentmethodid DESC;

#Apply a paymentmethodid to all customers, if a customer already has the payment type
#this query will handle that fine
INSERT IGNORE INTO `customerpaymentmethod` (customerid, paymentmethodid)
SELECT customer.`customerid`, <paymentmethodid> FROM customer;