forked from ochoarobert1/ccontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ochoarobert1#5 from ochoarobert1/feature/invoice
Feature/invoice
- Loading branch information
Showing
6 changed files
with
373 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
name: 🚀 Deploy website on push | ||
jobs: | ||
web-deploy: | ||
name: 🎉 Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🚚 Get latest code | ||
uses: actions/checkout@v3 | ||
|
||
- name: 📂 Sync files | ||
uses: SamKirkland/[email protected] | ||
with: | ||
server: ${{ secrets.ftp_server }} | ||
username: ${{ secrets.ftp_username }} | ||
password: ${{ secrets.ftp_password }} | ||
log-level: minimal | ||
exclude: | | ||
**/.git* | ||
**/.git*/** | ||
**/node_modules/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,93 @@ | ||
(function ($) { | ||
'use strict'; | ||
"use strict"; | ||
|
||
$(document).on('ready', function () { | ||
console.log('loaded'); | ||
$(document).on("ready", function () { | ||
console.log("loaded"); | ||
|
||
$('#printQuote').on('click', function (e) { | ||
e.preventDefault(); | ||
console.log('clicked'); | ||
window.open(ajaxurl + '?action=ccontrol_create_pdf&postid=' + jQuery('#printQuote').data('id'), '_blank'); | ||
}); | ||
|
||
$('#sendQuote').on('click', function (e) { | ||
e.preventDefault(); | ||
console.log('clicked'); | ||
$.ajax({ | ||
type: 'POST', | ||
url: ajaxurl, | ||
data: { | ||
action: 'ccontrol_create_pdf_send', | ||
postid: jQuery('#sendQuote').data('id') | ||
}, | ||
success: function (response) { | ||
console.log(response); | ||
|
||
} | ||
}); | ||
}); | ||
$("#printQuote").on("click", function (e) { | ||
e.preventDefault(); | ||
console.log("clicked"); | ||
window.open( | ||
ajaxurl + | ||
"?action=ccontrol_create_pdf&postid=" + | ||
jQuery("#printQuote").data("id"), | ||
"_blank" | ||
); | ||
}); | ||
|
||
$('#printInvoice').on('click', function (e) { | ||
e.preventDefault(); | ||
console.log('clicked'); | ||
window.open(ajaxurl + '?action=ccontrol_create_invoice_pdf&postid=' + jQuery('#printInvoice').data('id'), '_blank'); | ||
}); | ||
$("#sendQuote").on("click", function (e) { | ||
e.preventDefault(); | ||
console.log("clicked"); | ||
$.ajax({ | ||
type: "POST", | ||
url: ajaxurl, | ||
data: { | ||
action: "ccontrol_create_pdf_send", | ||
postid: jQuery("#sendQuote").data("id"), | ||
}, | ||
success: function (response) { | ||
console.log(response); | ||
}, | ||
}); | ||
}); | ||
|
||
$('#sendInvoice').on('click', function (e) { | ||
e.preventDefault(); | ||
console.log('clicked'); | ||
$.ajax({ | ||
type: 'POST', | ||
url: ajaxurl, | ||
data: { | ||
action: 'ccontrol_create_invoice_pdf_send', | ||
postid: jQuery('#sendInvoice').data('id') | ||
}, | ||
success: function (response) { | ||
console.log(response); | ||
$("#printInvoice").on("click", function (e) { | ||
e.preventDefault(); | ||
console.log("clicked"); | ||
window.open( | ||
ajaxurl + | ||
"?action=ccontrol_create_invoice_pdf&postid=" + | ||
jQuery("#printInvoice").data("id"), | ||
"_blank" | ||
); | ||
}); | ||
|
||
} | ||
}); | ||
}); | ||
$("#sendInvoice").on("click", function (e) { | ||
e.preventDefault(); | ||
console.log("clicked"); | ||
$.ajax({ | ||
type: "POST", | ||
url: ajaxurl, | ||
data: { | ||
action: "ccontrol_create_invoice_pdf_send", | ||
postid: jQuery("#sendInvoice").data("id"), | ||
}, | ||
success: function (response) { | ||
console.log(response); | ||
}, | ||
}); | ||
}); | ||
|
||
$('#upload-btn').click(function (e) { | ||
e.preventDefault(); | ||
var image = wp.media({ | ||
title: 'Upload Image', | ||
multiple: false | ||
}).open() | ||
.on('select', function (e) { | ||
var uploaded_image = image.state().get('selection').first(); | ||
var image_url = uploaded_image.toJSON().url; | ||
$('#image_url').val(image_url); | ||
$('#ccontrol_logo').attr('src', image_url); | ||
}); | ||
$("#upload-btn").click(function (e) { | ||
e.preventDefault(); | ||
var image = wp | ||
.media({ | ||
title: "Upload Image", | ||
multiple: false, | ||
}) | ||
.open() | ||
.on("select", function (e) { | ||
var uploaded_image = image.state().get("selection").first(); | ||
var image_url = uploaded_image.toJSON().url; | ||
$("#image_url").val(image_url); | ||
$("#ccontrol_logo").attr("src", image_url); | ||
}); | ||
}); | ||
|
||
})(jQuery); | ||
$(document).on("click", ".item-factura-add", function (e) { | ||
e.preventDefault(); | ||
console.log("clicked"); | ||
var item = $(this).parent().parent(); | ||
var clone = item.clone(); | ||
clone.find("input").val(""); | ||
clone.find(".item-factura-remove").show(); | ||
item.after(clone); | ||
}); | ||
$(document).on("click", ".item-factura-remove", function (e) { | ||
e.preventDefault(); | ||
console.log("clicked"); | ||
var item = $(this).parent().parent(); | ||
item.remove(); | ||
}); | ||
}); | ||
})(jQuery); |
Oops, something went wrong.