Gutschriften Anpassungen
This commit is contained in:
parent
3754f1c571
commit
e670b92f5d
28 changed files with 303 additions and 99 deletions
|
|
@ -16,23 +16,23 @@ class Credit
|
|||
|
||||
|
||||
public static function makeNextCreditNumber(){
|
||||
$invoice_number = self::getCreditNumber();
|
||||
$invoice_number = $invoice_number+1;
|
||||
Setting::setContentBySlug('credit-number', $invoice_number, 'int');
|
||||
return $invoice_number;
|
||||
$credit_number = self::getCreditNumber();
|
||||
$credit_number = $credit_number+1;
|
||||
Setting::setContentBySlug('credit-number', $credit_number, 'int');
|
||||
return $credit_number;
|
||||
}
|
||||
|
||||
public static function createCreditNumber($invoice_number, $invoice_date){
|
||||
$prefix = "GS".\Carbon::parse($invoice_date)->format('Ym');
|
||||
return $prefix.$invoice_number;
|
||||
public static function createCreditNumber($credit_number, $credit_date){
|
||||
$prefix = "GS".\Carbon::parse($credit_date)->format('Ym');
|
||||
return $prefix.$credit_number;
|
||||
}
|
||||
|
||||
public static function getCreditStorageDir($invoice_date){
|
||||
return "/credit/".\Carbon::parse($invoice_date)->format('Y/m/');
|
||||
public static function getCreditStorageDir($credit_date){
|
||||
return "/credit/".\Carbon::parse($credit_date)->format('Y/m/');
|
||||
}
|
||||
|
||||
public static function makeCreditFilename($invoice_number){
|
||||
return "Gutschrift-".$invoice_number.".pdf";
|
||||
public static function makeCreditFilename($credit_number){
|
||||
return "Gutschrift-".$credit_number.".pdf";
|
||||
}
|
||||
|
||||
public static function isCredit(UserCredit $user_credit){
|
||||
|
|
@ -64,7 +64,6 @@ class Credit
|
|||
public static function sendCreditMail(UserCredit $user_credit){
|
||||
$bcc = [];
|
||||
$email = $user_credit->user->email;
|
||||
$email = "kevin.adametz@me.com";
|
||||
if(!$email){
|
||||
if($user_credit->user->mode === 'test'){
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -394,6 +394,18 @@ class HTMLHelper
|
|||
return $ret;
|
||||
}
|
||||
|
||||
public static function getAnyOptions($id, $options = [], $all=true){#
|
||||
$ret = "";
|
||||
if($all){
|
||||
$ret .= '<option value="">'.__('please select').'</option>\n';
|
||||
}
|
||||
foreach ($options as $key=>$value){
|
||||
$attr = ($key == $id) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$key.'" '.$attr.'>'.$value.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function getOptionRange($select, $from=1, $to=50){
|
||||
$values = range($from, $to);
|
||||
$ret = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue